diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9e2d86607e9..753ea7865a9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -354,9 +354,8 @@ In addition, you will need to update the registries: // apps/sim/blocks/blocks/pinecone.ts import { PineconeIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' - import type { PineconeResponse } from '@/tools/pinecone/types' - export const PineconeBlock: BlockConfig = { + export const PineconeBlock: BlockConfig = { type: 'pinecone', name: 'Pinecone', description: 'Use Pinecone vector database', diff --git a/CLAUDE.md b/CLAUDE.md index 70309e5dfce..9637595dce6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,6 +88,7 @@ The `'use client'` server boundary, the app/worker runtime env split, and featur - **Naming**: components PascalCase (`WorkflowList`); hooks `use*`; files kebab-case (`workflow-list.tsx`); constants SCREAMING_SNAKE_CASE; interfaces PascalCase with a suffix (`WorkflowListProps`); stores `stores//store.ts`. - **Imports**: absolute (`@/...`) only, never relative. A folder with 3+ exports gets an `index.ts` barrel; never re-export from a non-barrel file. `import type` for type-only imports. Order and lazy-loading through barrels: `.claude/rules/sim-imports.md`. - **TypeScript**: no `any` (use precise types or `unknown` with guards); a props interface for every component; `as const` for constant objects/arrays; explicit ref types (`useRef(null)`). +- **Unused bindings** fail lint (biome `noUnusedVariables`, `noUnusedFunctionParameters`): delete the dead variable, import, or parameter and update callers; write `catch {}` when the error is unused. Prefix `_` only for a parameter that must hold its position because a later one is used. `const { a, ...rest } = obj` to omit keys is allowed. The rules carry no autofix, so `bun run lint` will not rename anything for you. - **Components**: `'use client'` only for hooks or browser APIs. Structure order, extraction thresholds, and list-render rules: `.claude/rules/sim-components.md`. Render-performance idioms (lazy-init refs, hoisting, `Map` pre-indexing, `[...arr].sort()` never `toSorted()` on client paths): `.claude/rules/sim-react-performance.md`. For effect/state/memo/callback anti-patterns use the `/you-might-not-need-*` skills and verify against the running UI. - **State ownership**: React Query owns server data — never `useState` + `fetch`; shareable client view-state (tabs, filters, search, pagination, selected id) lives in the URL via `nuqs`; Zustand owns global client state; `useState` owns UI-only state. Hooks: `.claude/rules/sim-hooks.md`. Stores (`devtools`, `persist` only with an explicit `partialize` whitelist, workflow value invariants): `.claude/rules/sim-stores.md`. URL state: `.claude/rules/sim-url-state.md`. - **Utils**: inline a helper with one consumer; create `utils.ts` when 2+ files share it — in `lib/` (app-wide) or `feature/utils/` (feature-scoped). Check `lib/` before writing a new one. diff --git a/apps/desktop/src/main/browser-agent/driver.ts b/apps/desktop/src/main/browser-agent/driver.ts index ba968d28051..c624a00beca 100644 --- a/apps/desktop/src/main/browser-agent/driver.ts +++ b/apps/desktop/src/main/browser-agent/driver.ts @@ -1738,7 +1738,7 @@ function requireSnapshotForElementAction(): void { ) } -function pageTargetForElement(contents: WebContents, elementId: number): PageExecutionTarget { +function pageTargetForElement(elementId: number): PageExecutionTarget { requireSnapshotForElementAction() const target = driverScopeState().snapshotTargets.get(elementId) if (!target || ('isDestroyed' in target && target.isDestroyed())) { @@ -2351,7 +2351,7 @@ async function captureSnapshot( if (tab.view.webContents !== contents) { throw new ToolError('The active tab changed before the snapshot started. Try again.') } - if (elementId !== undefined && pageTargetForElement(contents, elementId) !== contents) { + if (elementId !== undefined && pageTargetForElement(elementId) !== contents) { throw new ToolError( 'Scoped snapshots require a top-page element. Omit elementId to capture framed content.' ) @@ -2745,7 +2745,7 @@ async function executeToolInner( const contents = session.requireAutomationTab().view.webContents const elementId = requireNum(params, 'elementId') const paths = uploadPaths(params) - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) assertCurrentExecution() const frame = 'getURL' in target ? target.mainFrame : target const expression = `(${String(resolveFileInputTarget)})(${elementId})` @@ -2816,8 +2816,7 @@ async function executeToolInner( } const waitedTab = session.requireAutomationTab() const contents = waitedTab.view.webContents - const elementTarget = - elementId === undefined ? undefined : pageTargetForElement(contents, elementId) + const elementTarget = elementId === undefined ? undefined : pageTargetForElement(elementId) if (elementTarget && elementTarget !== contents) { throw new ToolError( 'Element-state waits are limited to the top page. Use a text or URL condition for framed content.' @@ -2946,7 +2945,7 @@ async function executeToolInner( const contents = session.requireAutomationTab().view.webContents const elementId = num(params, 'elementId') if (elementId === undefined) return await readWholePageText(contents, executionDeadline) - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) return unwrapPageResult( await execInPage(target, readPageText, [elementId], false, executionDeadline) ) @@ -2961,7 +2960,7 @@ async function executeToolInner( const elementId = num(params, 'elementId') let elementClip: Record | undefined if (elementId !== undefined) { - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) if (target !== contents) { throw new ToolError( 'Element screenshots are limited to the top page. Use browser_screenshot without elementId for framed content.' @@ -3119,7 +3118,7 @@ async function executeToolInner( const contents = clickedTab.view.webContents const elementId = requireNum(params, 'elementId') const click = pointerClick(params) - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) const targetFrame = frameExecutionTarget(target, contents) let trusted = false let activation = 'synthetic-pointer' @@ -3596,7 +3595,7 @@ async function executeToolInner( let stoppedIndex = 0 let dispatchStarted = false const readField = async (field: FormField) => { - const target = pageTargetForElement(contents, field.elementId) + const target = pageTargetForElement(field.elementId) if (target !== contents) throw new ToolError( 'Form batches require top-page fields; use individual tools for framed fields.' @@ -3757,7 +3756,7 @@ async function executeToolInner( if (typeof text !== 'string') throw new ToolError('Missing required parameter "text"') const submit = params.submit === true const contents = session.requireAutomationTab().view.webContents - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) const targetFrame = frameExecutionTarget(target, contents) // Native path: focus + select current content, then insert through the @@ -4307,9 +4306,7 @@ async function executeToolInner( const contents = session.requireAutomationTab().view.webContents const elementId = num(params, 'elementId') const target = - elementId !== undefined - ? pageTargetForElement(contents, elementId) - : focusedPageTarget(contents) + elementId !== undefined ? pageTargetForElement(elementId) : focusedPageTarget(contents) const targetFrame = frameExecutionTarget(target, contents) assertCurrentExecution() if (elementId !== undefined) assertElementActionCurrent(contents, elementId, target) @@ -4355,7 +4352,7 @@ async function executeToolInner( const selection = values === undefined ? requireStr(params, 'value') : (values as string[]) const contents = session.requireAutomationTab().view.webContents const elementId = requireNum(params, 'elementId') - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) const targetFrame = frameExecutionTarget(target, contents) assertCurrentExecution() assertElementActionCurrent(contents, elementId, target) @@ -4434,8 +4431,7 @@ async function executeToolInner( throw new ToolError('Missing required boolean parameter "checked"') } const checked = params.checked - const contents = session.requireAutomationTab().view.webContents - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) const before = toRecord( unwrapPageResult( await execInPage(target, readCheckableElementState, [elementId], false, executionDeadline) @@ -4562,7 +4558,7 @@ async function executeToolInner( ) } const elementId = requireNum(params, 'elementId') - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) const targetFrame = frameExecutionTarget(target, contents) let beforePage = await pageActionState(target, true, elementId) let beforeElement = await activeElementState(target) @@ -4939,7 +4935,7 @@ async function executeToolInner( ): Promise<{ x: number; y: number; element?: string }> => { const elementId = num(params, `${which}ElementId`) if (elementId !== undefined) { - const target = pageTargetForElement(contents, elementId) + const target = pageTargetForElement(elementId) if (frameExecutionTarget(target, contents)) { throw new ToolError( `Dragging elements inside embedded frames is not supported. Use ${which}X/${which}Y viewport coordinates instead.` diff --git a/apps/desktop/src/main/browser-credentials/os-auth.ts b/apps/desktop/src/main/browser-credentials/os-auth.ts index 23d9cf6c530..2aea35c5c0b 100644 --- a/apps/desktop/src/main/browser-credentials/os-auth.ts +++ b/apps/desktop/src/main/browser-credentials/os-auth.ts @@ -147,7 +147,7 @@ async function promptForSecret(reason: string, action: string): Promise ? await showShellDialog(parent, options) : await showShellDialog(options) return response === 1 - } catch (error) { + } catch { // Fail closed: if the confirmation cannot be shown, nothing is revealed. logger.warn('Could not present the credential confirmation') return false diff --git a/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx b/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx index bb09919dc63..5a88444c95a 100644 --- a/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx +++ b/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx @@ -208,9 +208,7 @@ export default function ResumeExecutionPage({ const queuePosition = selectedDetail?.pausePoint.queuePosition const resumeInputsRef = useRef>({}) const [resumeInput, setResumeInput] = useState('') - const [formValuesByContext, setFormValuesByContext] = useState< - Record> - >({}) + const formValuesByContextRef = useRef>>({}) const [formValues, setFormValues] = useState>({}) const [formErrors, setFormErrors] = useState>({}) const [loadingAction, setLoadingAction] = useState(false) @@ -308,17 +306,6 @@ export default function ResumeExecutionPage({ [formatValueForInputField] ) - const formatStructureValue = useCallback((value: any): string => { - if (value === null || value === undefined) return '—' - if (typeof value === 'string') return value - if (typeof value === 'number' || typeof value === 'boolean') return String(value) - try { - return JSON.stringify(value, null, 2) - } catch { - return String(value) - } - }, []) - const parseFormValue = useCallback( (field: NormalizedInputField, rawValue: string): { value: any; error?: string } => { const value = rawValue ?? '' @@ -358,11 +345,12 @@ export default function ResumeExecutionPage({ const handleFormFieldChange = useCallback( (fieldName: string, newValue: string) => { if (!selectedContextId) return - setFormValues((prev) => { - const updated = { ...prev, [fieldName]: newValue } - setFormValuesByContext((map) => ({ ...map, [selectedContextId]: updated })) - return updated - }) + const updated = { + ...formValuesByContextRef.current[selectedContextId], + [fieldName]: newValue, + } + formValuesByContextRef.current[selectedContextId] = updated + setFormValues(updated) setFormErrors((prev) => { if (!prev[fieldName]) return prev const { [fieldName]: _, ...rest } = prev @@ -516,12 +504,9 @@ export default function ResumeExecutionPage({ : undefined if (operation === 'human' && fetchedInputFields.length > 0) { const baseValues = buildInitialFormValues(fetchedInputFields, submission) - let mergedValues = baseValues - setFormValuesByContext((prev) => { - const existingValues = prev[detail.pausePoint.contextId] - if (existingValues) mergedValues = { ...baseValues, ...existingValues } - return { ...prev, [detail.pausePoint.contextId]: mergedValues } - }) + const existingValues = formValuesByContextRef.current[detail.pausePoint.contextId] + const mergedValues = existingValues ? { ...baseValues, ...existingValues } : baseValues + formValuesByContextRef.current[detail.pausePoint.contextId] = mergedValues setFormValues(mergedValues) setFormErrors({}) if (resumeInputsRef.current[detail.pausePoint.contextId] !== undefined) { diff --git a/apps/sim/app/api/auth/sso/register/route.test.ts b/apps/sim/app/api/auth/sso/register/route.test.ts index 668fbd217a7..7dc11402814 100644 --- a/apps/sim/app/api/auth/sso/register/route.test.ts +++ b/apps/sim/app/api/auth/sso/register/route.test.ts @@ -374,7 +374,7 @@ describe('POST /api/auth/sso/register', () => { it('does not SSRF-validate userInfoEndpoint when skipUserInfoEndpoint is requested', async () => { queueMembers([{ organizationId: 'org1', role: 'owner' }]) - mockValidateUrlWithDNS.mockImplementation(async (url: string, label: string) => { + mockValidateUrlWithDNS.mockImplementation(async (_url: string, label: string) => { if (label === 'OIDC userInfoEndpoint') { return { isValid: false, error: 'resolves to a private IP address' } } diff --git a/apps/sim/app/api/chat/[identifier]/otp/route.ts b/apps/sim/app/api/chat/[identifier]/otp/route.ts index 91c283e7e8a..6f3afae5d70 100644 --- a/apps/sim/app/api/chat/[identifier]/otp/route.ts +++ b/apps/sim/app/api/chat/[identifier]/otp/route.ts @@ -60,7 +60,7 @@ async function deliverOtp(requestId: string, deploymentId: string, title: string const otp = generateOTP() await storeOTP('chat', deploymentId, email, otp) - const emailHtml = await renderOTPEmail(otp, email, 'email-verification', title) + const emailHtml = await renderOTPEmail(otp, 'email-verification', title) const emailResult = await sendEmail({ to: email, subject: getOtpSubject(title), diff --git a/apps/sim/app/api/copilot/feedback/route.ts b/apps/sim/app/api/copilot/feedback/route.ts index 78e2edd0b2f..e973145c4f0 100644 --- a/apps/sim/app/api/copilot/feedback/route.ts +++ b/apps/sim/app/api/copilot/feedback/route.ts @@ -117,7 +117,7 @@ export const POST = withRouteHandler(async (req: NextRequest) => { * GET /api/copilot/feedback * Get feedback records for the authenticated user */ -export const GET = withRouteHandler(async (req: NextRequest) => { +export const GET = withRouteHandler(async () => { const tracker = createRequestTracker() try { diff --git a/apps/sim/app/api/environment/route.ts b/apps/sim/app/api/environment/route.ts index 10034a9e495..dbef90ae0e7 100644 --- a/apps/sim/app/api/environment/route.ts +++ b/apps/sim/app/api/environment/route.ts @@ -115,7 +115,7 @@ export const POST = withRouteHandler(async (req: NextRequest) => { } }) -export const GET = withRouteHandler(async (request: Request) => { +export const GET = withRouteHandler(async () => { const requestId = generateRequestId() try { diff --git a/apps/sim/app/api/files/authorization.test.ts b/apps/sim/app/api/files/authorization.test.ts index 26b588f6d90..9d601a564f3 100644 --- a/apps/sim/app/api/files/authorization.test.ts +++ b/apps/sim/app/api/files/authorization.test.ts @@ -142,7 +142,7 @@ describe('verifyKBFileWriteAccess (binding-only delete authorization)', () => { describe('public-context access (profile-pictures / og-images / workspace-logos)', () => { function write(cloudKey: string, context: 'profile-pictures' | 'og-images' | 'workspace-logos') { - return verifyFileAccess(cloudKey, USER_ID, undefined, context, false, { requireWrite: true }) + return verifyFileAccess(cloudKey, USER_ID, undefined, context, { requireWrite: true }) } it('allows organization logo reads and denies generic deletes even for the uploader', async () => { @@ -152,10 +152,10 @@ describe('public-context access (profile-pictures / og-images / workspace-logos) true ) await expect( - verifyFileAccess(key, USER_ID, undefined, 'organization-logos', false, { requireWrite: true }) + verifyFileAccess(key, USER_ID, undefined, 'organization-logos', { requireWrite: true }) ).resolves.toBe(false) await expect( - verifyFileAccess(key, USER_ID, undefined, 'general', false, { requireWrite: true }) + verifyFileAccess(key, USER_ID, undefined, 'general', { requireWrite: true }) ).resolves.toBe(false) expect(mockGetFileMetadata).not.toHaveBeenCalled() expect(mockGetUserEntityPermissions).not.toHaveBeenCalled() @@ -203,7 +203,7 @@ describe('workspace-scoped access (workspace files and mothership attachments)', }) function read(cloudKey: string, context: 'workspace' | 'mothership') { - return verifyFileAccess(cloudKey, USER_ID, undefined, context, false) + return verifyFileAccess(cloudKey, USER_ID, undefined, context) } interface BoundRow { @@ -315,7 +315,7 @@ describe('organization connector cache access', () => { 'denies the uploader a raw download even with a forged %s context', async (context) => { await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, context, false, { knowledgeAccess: 'user' }) + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, context, { knowledgeAccess: 'user' }) ).resolves.toBe(false) expect(mockGetFileMetadata).not.toHaveBeenCalled() expect(mockGetUserEntityPermissions).not.toHaveBeenCalled() @@ -325,7 +325,7 @@ describe('organization connector cache access', () => { it('denies system reads after the cache loses its active document reference', async () => { dbChainMockFns.limit.mockResolvedValue([]) await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', false, { + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', { knowledgeAccess: SYSTEM_ACCESS_SCOPE, }) ).resolves.toBe(false) @@ -338,7 +338,7 @@ describe('organization connector cache access', () => { deletedAt: null, }) await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', false, { + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', { knowledgeAccess: SYSTEM_ACCESS_SCOPE, }) ).resolves.toBe(false) @@ -347,7 +347,7 @@ describe('organization connector cache access', () => { it('does not let a raw download endpoint delete organization caches', async () => { await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'general', false, { + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'general', { requireWrite: true, knowledgeAccess: SYSTEM_ACCESS_SCOPE, }) @@ -378,7 +378,7 @@ describe('KB file live source authorization', () => { queueTableRows(schemaMock.knowledgeConnector, [{ connectorId: 'confluence-source' }]) queueTableRows(schemaMock.document, allowed ? [{ id: 'doc-1' }] : []) await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', false, { + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', { knowledgeAccess: access, }) ).resolves.toBe(allowed) @@ -415,7 +415,7 @@ describe('KB file live source authorization', () => { mockGetUserEntityPermissions.mockResolvedValue(null) const get = vi.fn() await expect( - verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', false, { + verifyFileAccess(CLOUD_KEY, USER_ID, undefined, 'knowledge-base', { knowledgeAccess: { get, getForConnectors: vi.fn(), getForDocuments: vi.fn() }, }) ).resolves.toBe(false) diff --git a/apps/sim/app/api/files/authorization.ts b/apps/sim/app/api/files/authorization.ts index f96381bbddd..ab28084e50c 100644 --- a/apps/sim/app/api/files/authorization.ts +++ b/apps/sim/app/api/files/authorization.ts @@ -19,7 +19,6 @@ import { getFileMetadataByKey } from '@/lib/uploads/server/metadata' import { isWorkspaceScopedContext } from '@/lib/uploads/shared/types' import { inferContextFromKey } from '@/lib/uploads/utils/file-utils' import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils' -import { isUuid } from '@/executor/constants' const logger = createLogger('FileAuthorization') @@ -31,12 +30,6 @@ export class FileAccessDeniedError extends Error { } } -interface AuthorizationResult { - granted: boolean - reason: string - workspaceId?: string -} - type WorkspacePermission = 'read' | 'write' | 'admin' /** @@ -113,34 +106,12 @@ async function lookupWorkspaceFileByKey( } } -/** - * Extract workspace ID from workspace file key pattern - * Pattern: {workspaceId}/{timestamp}-{random}-{filename} - */ -function extractWorkspaceIdFromKey(key: string): string | null { - const inferredContext = inferContextFromKey(key) - if (inferredContext !== 'workspace') { - return null - } - - // Use the proper parsing utility from workspace context module - const parts = key.split('/') - const workspaceId = parts[0] - - if (workspaceId && isUuid(workspaceId)) { - return workspaceId - } - - return null -} - /** * Verify file access based on file path patterns and metadata * @param cloudKey The file key/path (e.g., "workspace_id/workflow_id/execution_id/filename" or "kb/filename") * @param userId The authenticated user ID * @param customConfig Optional custom storage configuration * @param context Optional explicit storage context - * @param isLocal Optional flag indicating if this is local storage * @returns Promise True if user has access, false otherwise */ export async function verifyFileAccess( @@ -148,7 +119,6 @@ export async function verifyFileAccess( userId: string, customConfig?: StorageConfig, context?: StorageContext | 'general', - isLocal?: boolean, options?: { requireWrite?: boolean; knowledgeAccess?: KnowledgeFileAccess } ): Promise { /** Organization images require the Principal-aware Assistant application resolver. */ @@ -161,10 +131,10 @@ export async function verifyFileAccess( if (keyContext === 'knowledge-base') { return requireWrite ? verifyKBFileWriteAccess(cloudKey, userId) - : verifyKBFileAccess(cloudKey, userId, customConfig, options?.knowledgeAccess) + : verifyKBFileAccess(cloudKey, userId, options?.knowledgeAccess) } if (context === 'general') { - return await verifyRegularFileAccess(cloudKey, userId, customConfig, isLocal, requireWrite) + return await verifyRegularFileAccess(cloudKey, userId, customConfig, requireWrite) } // Infer context from key if not explicitly provided @@ -185,12 +155,12 @@ export async function verifyFileAccess( // 1. Workspace / mothership files: Check database first (most reliable for both local and cloud) if (isWorkspaceScopedContext(inferredContext)) { - return await verifyWorkspaceFileAccess(cloudKey, userId, customConfig, isLocal, requireWrite) + return await verifyWorkspaceFileAccess(cloudKey, userId, customConfig, requireWrite) } // 2. Execution files: workspace_id/workflow_id/execution_id/filename if (inferredContext === 'execution') { - return await verifyExecutionFileAccess(cloudKey, userId, customConfig, requireWrite) + return await verifyExecutionFileAccess(cloudKey, userId, requireWrite) } // 3. Copilot files: Check database first, then metadata, then path pattern (legacy) @@ -202,7 +172,7 @@ export async function verifyFileAccess( if (inferredContext === 'knowledge-base') { return requireWrite ? verifyKBFileWriteAccess(cloudKey, userId) - : verifyKBFileAccess(cloudKey, userId, customConfig, options?.knowledgeAccess) + : verifyKBFileAccess(cloudKey, userId, options?.knowledgeAccess) } // 5. Chat files: chat/filename @@ -212,7 +182,7 @@ export async function verifyFileAccess( // 6. Regular uploads: UUID-filename or timestamp-filename // Check metadata for userId/workspaceId, or database for workspace files - return await verifyRegularFileAccess(cloudKey, userId, customConfig, isLocal, requireWrite) + return await verifyRegularFileAccess(cloudKey, userId, customConfig, requireWrite) } catch (error) { logger.error('Error verifying file access:', { cloudKey, userId, error }) // Deny access on error to be safe @@ -240,7 +210,6 @@ async function verifyWorkspaceFileAccess( cloudKey: string, userId: string, customConfig?: StorageConfig, - isLocal?: boolean, requireWrite = false ): Promise { try { @@ -397,7 +366,6 @@ async function verifyPublicAssetWriteAccess( async function verifyExecutionFileAccess( cloudKey: string, userId: string, - customConfig?: StorageConfig, requireWrite = false ): Promise { const parts = cloudKey.split('/') @@ -580,7 +548,6 @@ async function resolveKnowledgeFileAccess( async function verifyKBFileAccess( cloudKey: string, userId: string, - customConfig?: StorageConfig, knowledgeAccess?: KnowledgeFileAccess ): Promise { try { @@ -731,7 +698,6 @@ async function verifyRegularFileAccess( cloudKey: string, userId: string, customConfig?: StorageConfig, - isLocal?: boolean, requireWrite = false ): Promise { try { diff --git a/apps/sim/app/api/files/delete/route.ts b/apps/sim/app/api/files/delete/route.ts index 34903aa22e1..f50db010c50 100644 --- a/apps/sim/app/api/files/delete/route.ts +++ b/apps/sim/app/api/files/delete/route.ts @@ -6,7 +6,7 @@ import { getValidationErrorMessage, parseRequest } from '@/lib/api/server' import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' import type { StorageContext } from '@/lib/uploads/config' -import { deleteFile, hasCloudStorage } from '@/lib/uploads/core/storage-service' +import { deleteFile } from '@/lib/uploads/core/storage-service' import { deleteFileMetadata } from '@/lib/uploads/server/metadata' import { extractStorageKey, inferContextFromKey } from '@/lib/uploads/utils/file-utils' import { verifyFileAccess, verifyKBFileWriteAccess } from '@/app/api/files/authorization' @@ -73,7 +73,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => { const hasAccess = storageContext === 'knowledge-base' ? await verifyKBFileWriteAccess(key, userId) - : await verifyFileAccess(key, userId, undefined, storageContext, !hasCloudStorage(), { + : await verifyFileAccess(key, userId, undefined, storageContext, { requireWrite: true, }) diff --git a/apps/sim/app/api/files/export/[id]/route.ts b/apps/sim/app/api/files/export/[id]/route.ts index 37737a8ba84..9ec91812e13 100644 --- a/apps/sim/app/api/files/export/[id]/route.ts +++ b/apps/sim/app/api/files/export/[id]/route.ts @@ -60,7 +60,7 @@ export const GET = withRouteHandler( } const knowledgeAccess = authResult.authType === AuthType.SESSION ? 'user' : undefined - const hasAccess = await verifyFileAccess(record.key, userId, undefined, undefined, undefined, { + const hasAccess = await verifyFileAccess(record.key, userId, undefined, undefined, { knowledgeAccess, }) if (!hasAccess) { @@ -147,7 +147,7 @@ export const GET = withRouteHandler( const imgRecord = await getFileMetadataById(storedFileId(imageId)) if (!imgRecord) return null if ( - !(await verifyFileAccess(imgRecord.key, userId, undefined, undefined, undefined, { + !(await verifyFileAccess(imgRecord.key, userId, undefined, undefined, { knowledgeAccess, })) ) { diff --git a/apps/sim/app/api/files/public/[token]/otp/route.ts b/apps/sim/app/api/files/public/[token]/otp/route.ts index 26fa53f8f8b..57a707c189b 100644 --- a/apps/sim/app/api/files/public/[token]/otp/route.ts +++ b/apps/sim/app/api/files/public/[token]/otp/route.ts @@ -73,7 +73,7 @@ async function deliverOtp(requestId: string, shareId: string, email: string): Pr const otp = generateOTP() await storeOTP('file', shareId, email, otp) - const emailHtml = await renderOTPEmail(otp, email, 'email-verification', SHARE_EMAIL_LABEL) + const emailHtml = await renderOTPEmail(otp, 'email-verification', SHARE_EMAIL_LABEL) const emailResult = await sendEmail({ to: email, subject: getOtpSubject(SHARE_EMAIL_LABEL), diff --git a/apps/sim/app/api/files/serve/[...path]/route.ts b/apps/sim/app/api/files/serve/[...path]/route.ts index 666135163fc..eeff30cd6d7 100644 --- a/apps/sim/app/api/files/serve/[...path]/route.ts +++ b/apps/sim/app/api/files/serve/[...path]/route.ts @@ -473,7 +473,6 @@ async function handleLocalFile( userId, undefined, // customConfig context, - true, // isLocal { knowledgeAccess } ) @@ -547,8 +546,7 @@ async function handleCloudProxy( cloudKey, userId, undefined, // customConfig - context, // context - false, // isLocal + context, { knowledgeAccess } ) diff --git a/apps/sim/app/api/files/utils.ts b/apps/sim/app/api/files/utils.ts index 7805849ed5c..bbd20fe6b52 100644 --- a/apps/sim/app/api/files/utils.ts +++ b/apps/sim/app/api/files/utils.ts @@ -14,11 +14,6 @@ export interface ApiSuccessResponse { [key: string]: any } -interface ApiErrorResponse { - error: string - message?: string -} - export interface FileResponse { buffer: Buffer contentType: string diff --git a/apps/sim/app/api/files/view/[id]/route.ts b/apps/sim/app/api/files/view/[id]/route.ts index 47ab06d164f..26a38f073d9 100644 --- a/apps/sim/app/api/files/view/[id]/route.ts +++ b/apps/sim/app/api/files/view/[id]/route.ts @@ -38,7 +38,6 @@ export const GET = withRouteHandler( authResult.userId, undefined, record.context as StorageContext | 'general', - undefined, { knowledgeAccess: authResult.authType === AuthType.SESSION ? 'user' : undefined } ) if (!hasAccess) { diff --git a/apps/sim/app/api/folders/reorder/route.test.ts b/apps/sim/app/api/folders/reorder/route.test.ts index b9a1a759e76..18acecc4de6 100644 --- a/apps/sim/app/api/folders/reorder/route.test.ts +++ b/apps/sim/app/api/folders/reorder/route.test.ts @@ -4,18 +4,6 @@ import { authMockFns, createMockRequest, permissionsMock, permissionsMockFns } from '@sim/testing' import { beforeEach, describe, expect, it, vi } from 'vitest' -const { mockLogger } = vi.hoisted(() => ({ - mockLogger: { - info: vi.fn(), - warn: vi.fn(), - error: vi.fn(), - debug: vi.fn(), - trace: vi.fn(), - fatal: vi.fn(), - child: vi.fn(), - }, -})) - const mockGetUserEntityPermissions = permissionsMockFns.mockGetUserEntityPermissions vi.mock('@/lib/workspaces/permissions/utils', () => permissionsMock) diff --git a/apps/sim/app/api/mcp/servers/[id]/refresh/route.ts b/apps/sim/app/api/mcp/servers/[id]/refresh/route.ts index c4131eec801..f7ec2c4ff23 100644 --- a/apps/sim/app/api/mcp/servers/[id]/refresh/route.ts +++ b/apps/sim/app/api/mcp/servers/[id]/refresh/route.ts @@ -161,7 +161,7 @@ export const POST = withRouteHandler( withMcpAuth<{ id: string }>( 'write', 'mcp_tools.use' - )(async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => { + )(async (_request: NextRequest, { userId, workspaceId, requestId }, { params }) => { try { const paramsValidation = mcpServerIdParamsSchema.safeParse(await params) if (!paramsValidation.success) return validationErrorResponse(paramsValidation.error) diff --git a/apps/sim/app/api/mcp/servers/route.ts b/apps/sim/app/api/mcp/servers/route.ts index daccfa311b0..dde2f6c082c 100644 --- a/apps/sim/app/api/mcp/servers/route.ts +++ b/apps/sim/app/api/mcp/servers/route.ts @@ -32,7 +32,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'mcp_tools.use' - )(async (request: NextRequest, { userId, workspaceId, requestId, permission }) => { + )(async (_request: NextRequest, { workspaceId, requestId, permission }) => { try { logger.info(`[${requestId}] Listing MCP servers for workspace ${workspaceId}`) diff --git a/apps/sim/app/api/mcp/tools/stored/route.ts b/apps/sim/app/api/mcp/tools/stored/route.ts index 5329f578a5b..a06bdfc1229 100644 --- a/apps/sim/app/api/mcp/tools/stored/route.ts +++ b/apps/sim/app/api/mcp/tools/stored/route.ts @@ -17,7 +17,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'mcp_tools.use' - )(async (request: NextRequest, { userId, workspaceId, requestId }) => { + )(async (_request: NextRequest, { workspaceId, requestId }) => { try { logger.info(`[${requestId}] Fetching stored MCP tools for workspace ${workspaceId}`) diff --git a/apps/sim/app/api/mcp/workflow-servers/[id]/route.ts b/apps/sim/app/api/mcp/workflow-servers/[id]/route.ts index 56eda6a9c5a..89e2d46051b 100644 --- a/apps/sim/app/api/mcp/workflow-servers/[id]/route.ts +++ b/apps/sim/app/api/mcp/workflow-servers/[id]/route.ts @@ -39,7 +39,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'deploy.mcp' - )(async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => { + )(async (_request: NextRequest, { workspaceId, requestId }, { params }) => { try { const { id: serverId } = workflowMcpServerParamsSchema.parse(await params) @@ -156,7 +156,7 @@ export const DELETE = withRouteHandler( 'deploy.mcp' )( async ( - request: NextRequest, + _request: NextRequest, { userId, userName, userEmail, workspaceId, requestId }, { params } ) => { @@ -179,8 +179,6 @@ export const DELETE = withRouteHandler( mcpOrchestrationStatus(result.errorCode) ) } - const deletedServer = result.server - logger.info(`[${requestId}] Successfully deleted workflow MCP server: ${serverId}`) return createMcpSuccessResponse({ message: `Server ${serverId} deleted successfully` }) diff --git a/apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts b/apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts index 0105df0a387..41965115308 100644 --- a/apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts +++ b/apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts @@ -37,7 +37,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'deploy.mcp' - )(async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => { + )(async (_request: NextRequest, { workspaceId, requestId }, { params }) => { try { const { id: serverId, toolId } = workflowMcpToolParamsSchema.parse(await params) @@ -153,7 +153,7 @@ export const DELETE = withRouteHandler( 'deploy.mcp' )( async ( - request: NextRequest, + _request: NextRequest, { userId, userName, userEmail, workspaceId, requestId }, { params } ) => { @@ -177,8 +177,6 @@ export const DELETE = withRouteHandler( mcpOrchestrationStatus(result.errorCode) ) } - const deletedTool = result.tool - logger.info(`[${requestId}] Successfully deleted tool ${toolId}`) return createMcpSuccessResponse({ message: `Tool ${toolId} deleted successfully` }) diff --git a/apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts b/apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts index b97d5bb3233..49613fc08f6 100644 --- a/apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts +++ b/apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts @@ -36,7 +36,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'deploy.mcp' - )(async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => { + )(async (_request: NextRequest, { workspaceId, requestId }, { params }) => { try { const { id: serverId } = workflowMcpServerParamsSchema.parse(await params) diff --git a/apps/sim/app/api/mcp/workflow-servers/route.ts b/apps/sim/app/api/mcp/workflow-servers/route.ts index 16722ea657e..127384261ba 100644 --- a/apps/sim/app/api/mcp/workflow-servers/route.ts +++ b/apps/sim/app/api/mcp/workflow-servers/route.ts @@ -29,7 +29,7 @@ export const GET = withRouteHandler( withMcpAuth( 'read', 'deploy.mcp' - )(async (request: NextRequest, { userId, workspaceId, requestId }) => { + )(async (_request: NextRequest, { workspaceId, requestId }) => { try { logger.info(`[${requestId}] Listing workflow MCP servers for workspace ${workspaceId}`) diff --git a/apps/sim/app/api/mothership/execute/route.ts b/apps/sim/app/api/mothership/execute/route.ts index 3b460d1e910..6e908371cb4 100644 --- a/apps/sim/app/api/mothership/execute/route.ts +++ b/apps/sim/app/api/mothership/execute/route.ts @@ -158,12 +158,10 @@ export const POST = withRouteHandler(async (req: NextRequest) => { chatId, messageId: providedMessageId, requestId: providedRequestId, - fileAttachments, contexts, mcpTools, workflowId, executionId, - userMetadata, secretScope, mountedSecrets, } = validation.data.body diff --git a/apps/sim/app/api/organizations/[id]/domains/route.test.ts b/apps/sim/app/api/organizations/[id]/domains/route.test.ts index fceedb35272..aff38e39075 100644 --- a/apps/sim/app/api/organizations/[id]/domains/route.test.ts +++ b/apps/sim/app/api/organizations/[id]/domains/route.test.ts @@ -1,7 +1,7 @@ import { member, ssoDomain } from '@sim/db/schema' import { createMockRequest, dbChainMockFns, queueTableRows, resetDbChainMock } from '@sim/testing' import { createRouteContext } from '@sim/testing/helpers/http' -import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' +import { auditMock } from '@sim/testing/mocks/audit.mock' import { authMockFns } from '@sim/testing/mocks/auth.mock' import { billingSubscriptionMock, @@ -21,7 +21,6 @@ import { GET, POST } from '@/app/api/organizations/[id]/domains/route' const mockGetSession = authMockFns.mockGetSession const mockIsEnterprise = billingSubscriptionMockFns.mockIsOrganizationOnEnterprisePlan -const mockRecordAudit = auditMockFns.mockRecordAudit const ORG_ID = 'org-1' const routeContext = createRouteContext({ id: ORG_ID }) diff --git a/apps/sim/app/api/providers/base/models/route.ts b/apps/sim/app/api/providers/base/models/route.ts index e0ccec24a27..ac14e63f3f6 100644 --- a/apps/sim/app/api/providers/base/models/route.ts +++ b/apps/sim/app/api/providers/base/models/route.ts @@ -7,7 +7,7 @@ export const GET = withRouteHandler(async () => { try { const allModels = Object.keys(getBaseModelProviders()) return NextResponse.json(providerModelsResponseSchema.parse({ models: allModels })) - } catch (error) { + } catch { return NextResponse.json({ models: [], error: 'Failed to fetch models' }, { status: 500 }) } }) diff --git a/apps/sim/app/api/table/[tableId]/rows/[rowId]/enrichment/[groupId]/route.test.ts b/apps/sim/app/api/table/[tableId]/rows/[rowId]/enrichment/[groupId]/route.test.ts index 276b27de421..859a179e7b1 100644 --- a/apps/sim/app/api/table/[tableId]/rows/[rowId]/enrichment/[groupId]/route.test.ts +++ b/apps/sim/app/api/table/[tableId]/rows/[rowId]/enrichment/[groupId]/route.test.ts @@ -12,10 +12,6 @@ import { import { NextRequest } from 'next/server' import { beforeEach, describe, expect, it, vi } from 'vitest' -const { mocks } = vi.hoisted(() => ({ - mocks: { readDetail: vi.fn(), authenticate: vi.fn() }, -})) - vi.mock('@/lib/table/application/rows', () => tableApplicationRowsMock) vi.mock('@/lib/table/api', () => tableApiMock) diff --git a/apps/sim/app/api/v1/workflows/[id]/deploy/route.test.ts b/apps/sim/app/api/v1/workflows/[id]/deploy/route.test.ts index 744751634d0..e7f0897f7c0 100644 --- a/apps/sim/app/api/v1/workflows/[id]/deploy/route.test.ts +++ b/apps/sim/app/api/v1/workflows/[id]/deploy/route.test.ts @@ -6,7 +6,7 @@ import { WorkflowLockedError } from '@sim/platform-authz/workflow' import { createRouteContext } from '@sim/testing/helpers/http' -import { posthogServerMock, posthogServerMockFns } from '@sim/testing/mocks/posthog-server.mock' +import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { createMockRequest } from '@sim/testing/mocks/request.mock' import { v1LogsMetaMock } from '@sim/testing/mocks/v1-logs-meta.mock' import { v1MiddlewareMock, v1MiddlewareMockFns } from '@sim/testing/mocks/v1-middleware.mock' @@ -30,7 +30,6 @@ import { DELETE, POST } from '@/app/api/v1/workflows/[id]/deploy/route' const { mockPerformFullDeploy, mockPerformFullUndeploy } = workflowsOrchestrationMockFns -const mockCaptureServerEvent = posthogServerMockFns.mockCaptureServerEvent const { mockCheckRateLimit, mockValidateWorkspaceAccess } = v1MiddlewareMockFns const WORKFLOW_ID = 'wf-1' diff --git a/apps/sim/app/api/v1/workflows/[id]/deploy/route.ts b/apps/sim/app/api/v1/workflows/[id]/deploy/route.ts index 7e0a550aee5..a5c1a798391 100644 --- a/apps/sim/app/api/v1/workflows/[id]/deploy/route.ts +++ b/apps/sim/app/api/v1/workflows/[id]/deploy/route.ts @@ -55,7 +55,6 @@ export const POST = withRouteHandler( const target = await resolveV1DeploymentWorkflow(rateLimit, userId, id, 'deploy.api') if (!target.ok) return target.response - const { workflow, workspaceId } = target await assertWorkflowMutable(id) diff --git a/apps/sim/app/api/v1/workflows/[id]/rollback/route.test.ts b/apps/sim/app/api/v1/workflows/[id]/rollback/route.test.ts index 54c867b2dcf..67fabcda7a0 100644 --- a/apps/sim/app/api/v1/workflows/[id]/rollback/route.test.ts +++ b/apps/sim/app/api/v1/workflows/[id]/rollback/route.test.ts @@ -15,10 +15,7 @@ import { workflowsOrchestrationMock, workflowsOrchestrationMockFns, } from '@sim/testing/mocks/workflows-orchestration.mock' -import { - workflowsPersistenceUtilsMock, - workflowsPersistenceUtilsMockFns, -} from '@sim/testing/mocks/workflows-persistence-utils.mock' +import { workflowsPersistenceUtilsMock } from '@sim/testing/mocks/workflows-persistence-utils.mock' import { NextResponse } from 'next/server' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -45,9 +42,6 @@ v1LogsMetaMockFns.mockCreateApiResponse.mockImplementation((body: unknown) => ({ headers: {}, })) -const mockFindPreviousDeploymentVersion = - workflowsPersistenceUtilsMockFns.mockFindPreviousDeploymentVersion - const WORKFLOW_ID = 'wf-1' const WORKFLOW_RECORD = { id: WORKFLOW_ID, diff --git a/apps/sim/app/api/v1/workflows/[id]/rollback/route.ts b/apps/sim/app/api/v1/workflows/[id]/rollback/route.ts index ce88815b2cb..e1a2317dafe 100644 --- a/apps/sim/app/api/v1/workflows/[id]/rollback/route.ts +++ b/apps/sim/app/api/v1/workflows/[id]/rollback/route.ts @@ -54,7 +54,7 @@ export const POST = withRouteHandler( const target = await resolveV1DeploymentWorkflow(rateLimit, userId, id, 'deploy.api') if (!target.ok) return target.response - const { workflow, workspaceId } = target + const { workflow } = target if (!workflow.isDeployed) { return NextResponse.json({ error: 'Workflow is not deployed' }, { status: 400 }) diff --git a/apps/sim/app/api/v1/workflows/import/route.test.ts b/apps/sim/app/api/v1/workflows/import/route.test.ts index 485f0faa918..80be033846c 100644 --- a/apps/sim/app/api/v1/workflows/import/route.test.ts +++ b/apps/sim/app/api/v1/workflows/import/route.test.ts @@ -7,7 +7,7 @@ import { workspace } from '@sim/db/schema' import { dbChainMockFns, queueTableRows, resetDbChainMock } from '@sim/testing/mocks/database.mock' -import { realtimeNotifyMock, realtimeNotifyMockFns } from '@sim/testing/mocks/realtime-notify.mock' +import { realtimeNotifyMock } from '@sim/testing/mocks/realtime-notify.mock' import { createMockRequest } from '@sim/testing/mocks/request.mock' import { v1LogsMetaMock, v1LogsMetaMockFns } from '@sim/testing/mocks/v1-logs-meta.mock' import { v1MiddlewareMock, v1MiddlewareMockFns } from '@sim/testing/mocks/v1-middleware.mock' @@ -77,8 +77,6 @@ v1LogsMetaMockFns.mockCreateApiResponse.mockImplementation((body: unknown) => ({ const mockSaveWorkflowToNormalizedTables = workflowsPersistenceUtilsMockFns.mockSaveWorkflowToNormalizedTables -const mockNotifyWorkspaceWorkflowsChanged = - realtimeNotifyMockFns.mockNotifyWorkspaceWorkflowsChanged const mockAssertFolderMutable = workflowAuthzMockFns.mockAssertFolderMutable const mockAssertFolderInWorkspace = workflowAuthzMockFns.mockAssertFolderInWorkspace const mockDbDelete = dbChainMockFns.delete diff --git a/apps/sim/app/api/wand/route.ts b/apps/sim/app/api/wand/route.ts index bf926e6a871..6d4c44f32a6 100644 --- a/apps/sim/app/api/wand/route.ts +++ b/apps/sim/app/api/wand/route.ts @@ -464,7 +464,7 @@ export const POST = withRouteHandler(async (req: NextRequest) => { let parsed: any try { parsed = JSON.parse(data) - } catch (parseError) { + } catch { continue } diff --git a/apps/sim/app/api/workflows/[id]/execute/route.ts b/apps/sim/app/api/workflows/[id]/execute/route.ts index 7df4e6842b9..f81c4c43ade 100644 --- a/apps/sim/app/api/workflows/[id]/execute/route.ts +++ b/apps/sim/app/api/workflows/[id]/execute/route.ts @@ -290,7 +290,7 @@ function clientCancelledResponse(): NextResponse { function executionTimedOutResponse(timeoutMs?: number): NextResponse { return NextResponse.json( - { success: false, error: getTimeoutErrorMessage(null, timeoutMs) }, + { success: false, error: getTimeoutErrorMessage(timeoutMs) }, { status: 408 } ) } @@ -1498,7 +1498,7 @@ async function handleExecutePost( } if (result.status === 'cancelled' && didExecutionTimeOut() && timeoutController.timeoutMs) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) reqLogger.info('Non-SSE execution timed out', { timeoutMs: timeoutController.timeoutMs, }) @@ -1600,7 +1600,7 @@ async function handleExecutePost( } catch (error: unknown) { const executionTimedOut = didExecutionTimeOut(error) const errorMessage = executionTimedOut - ? getTimeoutErrorMessage(error, timeoutController.timeoutMs) + ? getTimeoutErrorMessage(timeoutController.timeoutMs) : getErrorMessage(error, 'Unknown error') if (requestAbort.isRequestAborted() && !executionTimedOut) { @@ -2296,7 +2296,7 @@ async function handleExecutePost( if (result.status === 'cancelled') { if (didExecutionTimeOut() && timeoutController.timeoutMs) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) reqLogger.info('Workflow execution timed out', { timeoutMs: timeoutController.timeoutMs, }) @@ -2417,7 +2417,7 @@ async function handleExecutePost( await awaitBoundCopilotPostExecution() const isTimeout = didExecutionTimeOut(error) const errorMessage = isTimeout - ? getTimeoutErrorMessage(error, timeoutController.timeoutMs) + ? getTimeoutErrorMessage(timeoutController.timeoutMs) : getErrorMessage(error, 'Unknown error') reqLogger.error( diff --git a/apps/sim/app/api/workflows/[id]/log/route.test.ts b/apps/sim/app/api/workflows/[id]/log/route.test.ts index c783d5cb585..b78a0bb9b1d 100644 --- a/apps/sim/app/api/workflows/[id]/log/route.test.ts +++ b/apps/sim/app/api/workflows/[id]/log/route.test.ts @@ -34,12 +34,7 @@ import { POST } from '@/app/api/workflows/[id]/log/route' const { mockGetWorkspaceBilledAccountUserId } = workspacesUtilsMockFns const { mockResolveBillingAttribution } = billingAttributionMockFns -const { - mockStart, - mockSetResolvedSecretTraceRegistry, - mockSafeComplete, - mockSafeCompleteWithError, -} = loggingSessionMockFns +const { mockStart, mockSetResolvedSecretTraceRegistry, mockSafeComplete } = loggingSessionMockFns const makeRequest = (workflowId: string, body: unknown) => createMockRequest({ diff --git a/apps/sim/app/api/workflows/route.test.ts b/apps/sim/app/api/workflows/route.test.ts index 06fe49a8021..8e3e44b65b5 100644 --- a/apps/sim/app/api/workflows/route.test.ts +++ b/apps/sim/app/api/workflows/route.test.ts @@ -13,11 +13,10 @@ import { workflowsPersistenceUtilsMock, workflowsPersistenceUtilsMockFns, } from '@sim/testing' -import { getMockPlatformEvent, telemetryMock } from '@sim/testing/mocks/telemetry.mock' +import { telemetryMock } from '@sim/testing/mocks/telemetry.mock' import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest' const mockGetUserEntityPermissions = permissionsMockFns.mockGetUserEntityPermissions -const mockWorkflowCreated = getMockPlatformEvent('workflowCreated') vi.mock('@sim/audit', () => auditMock) diff --git a/apps/sim/app/api/workspaces/[id]/environment/route.ts b/apps/sim/app/api/workspaces/[id]/environment/route.ts index eadffd8ec92..1ed68d7adb2 100644 --- a/apps/sim/app/api/workspaces/[id]/environment/route.ts +++ b/apps/sim/app/api/workspaces/[id]/environment/route.ts @@ -124,7 +124,7 @@ async function maskPersonalEnvForViewer({ } export const GET = withRouteHandler( - async (request: NextRequest, { params }: { params: Promise<{ id: string }> }) => { + async (_request: NextRequest, { params }: { params: Promise<{ id: string }> }) => { const requestId = generateRequestId() const workspaceId = (await params).id diff --git a/apps/sim/app/api/workspaces/[id]/route.ts b/apps/sim/app/api/workspaces/[id]/route.ts index 7fce432cca5..c58003d5fd2 100644 --- a/apps/sim/app/api/workspaces/[id]/route.ts +++ b/apps/sim/app/api/workspaces/[id]/route.ts @@ -21,7 +21,7 @@ import { } from '@/lib/workspaces/permissions/utils' export const GET = withRouteHandler( - async (request: NextRequest, { params }: { params: Promise<{ id: string }> }) => { + async (_request: NextRequest, { params }: { params: Promise<{ id: string }> }) => { const { id } = await params const session = await getSession() diff --git a/apps/sim/app/api/workspaces/invitations/route.ts b/apps/sim/app/api/workspaces/invitations/route.ts index 8eac267368d..d7cf5cd8e82 100644 --- a/apps/sim/app/api/workspaces/invitations/route.ts +++ b/apps/sim/app/api/workspaces/invitations/route.ts @@ -1,6 +1,6 @@ import { createLogger } from '@sim/logger' import { omit } from '@sim/utils/object' -import { type NextRequest, NextResponse } from 'next/server' +import { NextResponse } from 'next/server' import { getSession } from '@/lib/auth' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' import { listInvitationsForWorkspaces } from '@/lib/invitations/core' @@ -10,7 +10,7 @@ export const dynamic = 'force-dynamic' const logger = createLogger('WorkspaceInvitationsAPI') -export const GET = withRouteHandler(async (req: NextRequest) => { +export const GET = withRouteHandler(async () => { const session = await getSession() if (!session?.user?.id) { return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) diff --git a/apps/sim/app/workspace/[workspaceId]/components/custom-tool-editor/custom-tool-code-field.tsx b/apps/sim/app/workspace/[workspaceId]/components/custom-tool-editor/custom-tool-code-field.tsx index a7a4bd9bd39..982231b7834 100644 --- a/apps/sim/app/workspace/[workspaceId]/components/custom-tool-editor/custom-tool-code-field.tsx +++ b/apps/sim/app/workspace/[workspaceId]/components/custom-tool-editor/custom-tool-code-field.tsx @@ -11,7 +11,6 @@ import { PopoverScrollArea, PopoverSection, } from '@sim/emcn' -import { createLogger } from '@sim/logger' import { CODE_PLACEHOLDER, type SchemaParameter, @@ -27,8 +26,6 @@ import { } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown' import { CodeEditor } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/components/code-editor/code-editor' -const logger = createLogger('CustomToolCodeField') - interface CustomToolCodeFieldProps { value: string onChange: (value: string) => void diff --git a/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/image-input-rule.test.ts b/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/image-input-rule.test.ts index 80166aa755a..0c458c877fd 100644 --- a/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/image-input-rule.test.ts +++ b/apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/image-input-rule.test.ts @@ -131,9 +131,9 @@ describe.each([false, true])('image input rules (collaborative=%s)', (collaborat }) describe.each([ - { name: 'image', extension: 'image', source: '![Audit image](https://example.com/logo.png)' }, - { name: 'link', extension: 'markdownLinkInputRule', source: '[Audit link](https://example.com)' }, -])('$name input-rule event boundaries', ({ name, extension, source }) => { + { name: 'image', source: '![Audit image](https://example.com/logo.png)' }, + { name: 'link', source: '[Audit link](https://example.com)' }, +])('$name input-rule event boundaries', ({ name, source }) => { function assertConverted(editor: Editor) { expect(editor.getHTML()).toContain( name === 'image' ? 'src="https://example.com/logo.png"' : 'href="https://example.com"' diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/knowledge-search-results/search-transitions.test.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/knowledge-search-results/search-transitions.test.tsx index c4f14aee6b1..d96bbdea681 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/knowledge-search-results/search-transitions.test.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/knowledge-search-results/search-transitions.test.tsx @@ -173,23 +173,6 @@ async function render({ }) } -async function click(label: string) { - await act(async () => { - const trigger = container.querySelector( - 'button[aria-label^="Filter by source:"]' - )! - trigger.focus() - trigger.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown', bubbles: true })) - await vi.advanceTimersByTimeAsync(1) - const item = [...document.querySelectorAll('[role="menuitem"]')].find( - (element) => element.textContent === label - ) - if (!item) throw new Error(`Missing source filter: ${label}`) - item.click() - await vi.advanceTimersByTimeAsync(1) - }) -} - async function complete( index: number, { title = 'Release plan', partial = false, empty = false, count = 1 } = {} diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx index 3ce52bacb91..e37b6bf091c 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session.tsx @@ -207,7 +207,6 @@ function zoomActionForTerminalCommand(command: TerminalShortcutCommand): Desktop const TerminalView = memo(function TerminalView({ terminalId, - running, active, visible, scopeId, @@ -219,7 +218,6 @@ const TerminalView = memo(function TerminalView({ focusRequest, }: { terminalId: string - running: string | null active: boolean visible: boolean scopeId: string @@ -742,7 +740,6 @@ export function TerminalSession({ visible, scopeId }: TerminalSessionProps) { (function UserI const files = useFileAttachments({ userId, workspaceId, - isLoading: isSending, }) const hasFiles = files.attachedFiles.some((f) => !f.uploading && f.key) const hasUploadingFiles = files.attachedFiles.some((f) => f.uploading) diff --git a/apps/sim/app/workspace/[workspaceId]/home/hooks/stream/stream-helpers.ts b/apps/sim/app/workspace/[workspaceId]/home/hooks/stream/stream-helpers.ts index 100cbda798a..7ea9d6bd159 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/hooks/stream/stream-helpers.ts +++ b/apps/sim/app/workspace/[workspaceId]/home/hooks/stream/stream-helpers.ts @@ -1,4 +1,3 @@ -import { createLogger } from '@sim/logger' import { isRecordLike } from '@sim/utils/object' import { isUnsettledToolState } from '@/lib/mothership/chat/persisted-message' import { @@ -40,8 +39,6 @@ import { ToolCallStatus } from '@/app/workspace/[workspaceId]/home/types' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useWorkflowStore } from '@/stores/workflows/workflow/store' -const logger = createLogger('StreamHelpers') - export const FILE_SUBAGENT_ID = 'file' export const DEPLOY_TOOL_NAMES: Set = new Set([ diff --git a/apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts b/apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts index 7c6db2b8c06..565375b8ff8 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts +++ b/apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts @@ -692,7 +692,6 @@ export function useChat( */ const [activeResourceId, setActiveResourceId] = options?.activeResourceState ?? internalActiveResourceState - const [genericResourceData, setGenericResourceData] = useState(null) const onResourceEventRef = useRef(options?.onResourceEvent) const revealedSimKeysRef = useRef(new Map()) onResourceEventRef.current = options?.onResourceEvent @@ -4971,7 +4970,7 @@ export function useChat( editingQueuedId, dispatchingHeadId, previewSession, - genericResourceData, + genericResourceData: null, getCurrentRequestId, } } diff --git a/apps/sim/app/workspace/[workspaceId]/home/hooks/use-resource-panel.ts b/apps/sim/app/workspace/[workspaceId]/home/hooks/use-resource-panel.ts index 046da128f3f..45d678d0ff5 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/hooks/use-resource-panel.ts +++ b/apps/sim/app/workspace/[workspaceId]/home/hooks/use-resource-panel.ts @@ -169,13 +169,9 @@ export function useChatResourcePanel( const { activeResourceParam, activeResourceParamRef, - activeResourceState, - setActiveResourceUrl, isResourceCollapsed, setResourceCollapsed, - skipResourceTransition, setSkipResourceTransition, - resourceActivityIds, setResourceActivityIds, isResourceCollapsedRef, resourceCollapseOwnedByUserRef, diff --git a/apps/sim/app/workspace/[workspaceId]/home/types.ts b/apps/sim/app/workspace/[workspaceId]/home/types.ts index 9a5613ecf93..9aaaa4a83b2 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/types.ts +++ b/apps/sim/app/workspace/[workspaceId]/home/types.ts @@ -5,9 +5,6 @@ import type { AssistantSearchLevel } from '@/lib/mothership/generated/assistant' import type { ChatContext } from '@/stores/panel' import type { BrowserTextSelection, TerminalTextSelection } from '@/stores/panel/types' -const EDIT_CONTENT_TOOL_ID = 'apply_file_edit' -const RUN_SUBAGENT_ID = 'run' - export type { MothershipResource, MothershipResourceType, diff --git a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx index 2fd999b0dd0..d9121eeb437 100644 --- a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx +++ b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/base.tsx @@ -438,7 +438,6 @@ export function KnowledgeBase({ const { isOpen: isContextMenuOpen, position: contextMenuPosition, - menuRef, handleContextMenu: baseHandleContextMenu, closeMenu: closeContextMenu, } = useContextMenu() @@ -1465,7 +1464,6 @@ export function KnowledgeBase({ open={showAddDocumentsModal} onOpenChange={setShowAddDocumentsModal} knowledgeBaseId={id} - chunkingConfig={knowledgeBase?.chunkingConfig} /> {showAddConnectorModal && knowledgeBase && ( diff --git a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx index d119f9d2a3c..5dbdf5a9de1 100644 --- a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-connector-modal/add-connector-modal.tsx @@ -83,8 +83,6 @@ import { useConnectorSetupStore } from '@/stores/connector-setup/store' const CONNECTOR_ENTRIES = Object.entries(CONNECTOR_META_REGISTRY) -const WORKSPACE_ACCESS: ConnectorAccessSelection = { accessMode: 'workspace' } - interface AddConnectorModalProps { scope?: ResourceScope open: boolean diff --git a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx index f70b4f8c7ba..37e25673d42 100644 --- a/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/add-documents-modal/add-documents-modal.tsx @@ -28,19 +28,9 @@ interface AddDocumentsModalProps { open: boolean onOpenChange: (open: boolean) => void knowledgeBaseId: string - chunkingConfig?: { - maxSize: number - minSize: number - overlap: number - } } -export function AddDocumentsModal({ - open, - onOpenChange, - knowledgeBaseId, - chunkingConfig, -}: AddDocumentsModalProps) { +export function AddDocumentsModal({ open, onOpenChange, knowledgeBaseId }: AddDocumentsModalProps) { const params = useParams() const workspaceId = params.workspaceId as string const [files, setFiles] = useState([]) diff --git a/apps/sim/app/workspace/[workspaceId]/logs/logs.tsx b/apps/sim/app/workspace/[workspaceId]/logs/logs.tsx index b93297fe27a..ff435d7d94b 100644 --- a/apps/sim/app/workspace/[workspaceId]/logs/logs.tsx +++ b/apps/sim/app/workspace/[workspaceId]/logs/logs.tsx @@ -261,7 +261,6 @@ export default function Logs() { setFolderIds, setTriggers, setTimeRange, - setDateRange, clearDateRange, } = useLogFilters() diff --git a/apps/sim/app/workspace/[workspaceId]/prefetch-access.test.tsx b/apps/sim/app/workspace/[workspaceId]/prefetch-access.test.tsx index 71bd308e490..5b79191fb31 100644 --- a/apps/sim/app/workspace/[workspaceId]/prefetch-access.test.tsx +++ b/apps/sim/app/workspace/[workspaceId]/prefetch-access.test.tsx @@ -1,6 +1,6 @@ /** @vitest-environment jsdom */ -import { act, type ReactNode } from 'react' +import type { ReactNode } from 'react' import { createSessionPrincipal } from '@sim/testing/factories/principal.factory' import { apiClientRequestMock, @@ -9,7 +9,6 @@ import { import { emcnIconsMock } from '@sim/testing/mocks/emcn-icons.mock' import { nextNavigationMock, nextNavigationMockFns } from '@sim/testing/mocks/next-navigation.mock' import { dehydrate, hydrate, QueryClient, QueryClientProvider } from '@tanstack/react-query' -import { createRoot, type Root } from 'react-dom/client' import { renderToString } from 'react-dom/server' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -79,26 +78,18 @@ const discovery = { describe('workspace access hydration', () => { let server: QueryClient let client: QueryClient - let root: Root | undefined - let container: HTMLDivElement beforeEach(() => { - ;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true nextNavigationMockFns.mockUseParams.mockReturnValue({ workspaceId: 'workspace' }) mocks.policy.mockResolvedValue(policy) mocks.discovery.mockResolvedValue(discovery) mockRequestJson.mockImplementation(() => new Promise(() => {})) server = new QueryClient({ defaultOptions: { queries: { retry: false } } }) client = new QueryClient({ defaultOptions: { queries: { retry: false } } }) - container = document.createElement('div') - document.body.appendChild(container) }) afterEach(() => { - if (root) act(() => root?.unmount()) - root = undefined server.clear() client.clear() - container.remove() }) async function prefetch() { await prefetchWorkspaceAccess(server, 'workspace', principal) @@ -113,10 +104,6 @@ describe('workspace access hydration', () => { ) } - function render() { - root = createRoot(container) - act(() => root?.render(tree())) - } function restrict() { mocks.policy.mockResolvedValue({ ...policy, config: { ...policy.config, hideCopilot: true } }) } diff --git a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx index 67ebe645dee..0cabf2f1666 100644 --- a/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx +++ b/apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx @@ -600,7 +600,6 @@ export function TableGrid({ workflows, columns, tableWorkflowGroups, - workflowStates, columnSourceInfo, ensureAllRowsLoaded, ensureRowsLoadedUpTo, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx index 8dbf0230432..dd71ec38deb 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx @@ -63,7 +63,6 @@ import { useChatStore } from '@/stores/chat/store' import { getChatPosition } from '@/stores/chat/utils' import { useIsCurrentWorkflowExecuting } from '@/stores/execution' import { useOperationQueue } from '@/stores/operation-queue/store' -import { useTerminalConsoleStore, useWorkflowConsoleEntries } from '@/stores/terminal' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useSubBlockStore } from '@/stores/workflows/subblock/store' import { useWorkflowStore } from '@/stores/workflows/workflow/store' @@ -278,10 +277,6 @@ export function Chat() { ) ) - const hasConsoleHydrated = useTerminalConsoleStore((state) => state._hasHydrated) - const entries = useWorkflowConsoleEntries( - hasConsoleHydrated && typeof activeWorkflowId === 'string' ? activeWorkflowId : undefined - ) const isExecuting = useIsCurrentWorkflowExecuting() const { handleRunWorkflow, handleCancelExecution } = useWorkflowExecution() const { data: session } = useSession() @@ -409,10 +404,6 @@ export function Chat() { onDimensionsChange: setChatDimensions, }) - const outputEntries = useMemo(() => { - return entries.filter((entry) => entry.output) - }, [entries]) - const workflowMessages = useMemo(() => { if (!activeWorkflowId) return [] return messages.filter((msg) => msg.workflowId === activeWorkflowId) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts index 0d14547d936..6ace75ab6e4 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts @@ -94,7 +94,6 @@ interface UseFileAttachmentsProps { organizationId?: string requestMode?: ChatRequestMode disabled?: boolean - isLoading?: boolean initialAttachments?: FileAttachmentForApi[] } @@ -106,7 +105,7 @@ interface UseFileAttachmentsProps { * @returns File attachment state and operations */ export function useFileAttachments(props: UseFileAttachmentsProps) { - const { userId, workspaceId, organizationId, requestMode, disabled, isLoading } = props + const { userId, workspaceId, organizationId, requestMode, disabled } = props const imagesOnly = Boolean(organizationId) && requestMode !== 'agent' && requestMode !== 'plan' const [attachedFiles, setAttachedFiles] = useState(() => diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/api/api.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/api/api.tsx index fc2973f9531..e4b63ed76e0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/api/api.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/api/api.tsx @@ -416,19 +416,6 @@ console.log(limits);` } } - const getAsyncExampleTitle = () => { - switch (asyncExampleType) { - case 'execute': - return 'Start Execution' - case 'status': - return 'Check Status' - case 'rate-limits': - return 'Usage Limits' - default: - return 'Start Execution' - } - } - const handleCopy = (key: keyof CopiedState, value: string) => { navigator.clipboard.writeText(value) setCopied((prev) => ({ ...prev, [key]: true })) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx index 7eb3a45fecd..8ce604f967b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/chat/chat.tsx @@ -51,9 +51,6 @@ const IDENTIFIER_PATTERN = /^[a-z0-9-]+$/ interface ChatDeployProps { workflowId: string - deploymentInfo: { - apiKey: string - } | null existingChat: ExistingChat | null isLoadingChat: boolean onRefetchChat: () => Promise @@ -94,7 +91,6 @@ const initialFormData: ChatFormData = { export function ChatDeploy({ workflowId, - deploymentInfo, existingChat, isLoadingChat, onRefetchChat, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx index a40a9d7d0fd..a88ac9fe855 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx @@ -159,11 +159,10 @@ export function DeployModal({ const createButtonDisabled = isApiKeysLoading || (!allowPersonalApiKeys && !canManageWorkspaceKeys) - const { - data: deploymentInfoData, - isLoading: isLoadingDeploymentInfo, - refetch: refetchDeploymentInfo, - } = useDeploymentInfo(workflowId, { enabled: open }) + const { data: deploymentInfoData, isLoading: isLoadingDeploymentInfo } = useDeploymentInfo( + workflowId, + { enabled: open } + ) const { data: versionsData, isLoading: versionsLoading } = useDeploymentVersions(workflowId, { enabled: open, @@ -604,7 +603,6 @@ export function DeployModal({ {activeTab === 'chat' && ( >(() => new Set()) const [expandedFieldPaths, setExpandedFieldPaths] = useState>(() => new Set()) const scrollContainerRef = useRef(null) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx index 5169f4697fd..211dde13b57 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/condition-input/condition-input.tsx @@ -593,42 +593,6 @@ export function ConditionInput({ } } - // Handle tag selection - updated for individual blocks - const handleTagSelect = (blockId: string, newValue: string) => { - if (isPreview || disabled) return - shouldPersistRef.current = true - setConditionalBlocks((blocks) => - blocks.map((block) => - block.id === blockId - ? { - ...block, - value: newValue, - showTags: false, - activeSourceBlockId: null, - } - : block - ) - ) - } - - // Handle environment variable selection - updated for individual blocks - const handleEnvVarSelect = (blockId: string, newValue: string) => { - if (isPreview || disabled) return - shouldPersistRef.current = true - setConditionalBlocks((blocks) => - blocks.map((block) => - block.id === blockId - ? { - ...block, - value: newValue, - showEnvVars: false, - searchTerm: '', - } - : block - ) - ) - } - const handleTagSelectImmediate = ( blockId: string, newValue: string, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx index bf2b4bdb42d..1fc1b8bb4e0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/document-tag-entry/document-tag-entry.tsx @@ -308,7 +308,6 @@ export function DocumentTagEntry({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( cellKey, - fieldValue, (newValue) => handleTagDropdownSelection(tag.id, newValue) ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx index 198bfe9480a..bd16ea80e9e 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx @@ -397,7 +397,7 @@ export const Dropdown = memo(function Dropdown({ } return [] - } catch (error) { + } catch { return [] } } diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/eval-input/eval-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/eval-input/eval-input.tsx index 6c659aff3dc..bb09af0b74f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/eval-input/eval-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/eval-input/eval-input.tsx @@ -225,7 +225,6 @@ export function EvalInput({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( metric.id, - metric.description || '', (newValue) => updateMetricField(metric.id, newValue) ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx index 330a73b990b..44065aa2c4f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/file-upload/file-upload.tsx @@ -128,13 +128,11 @@ interface SingleFileSelectorProps { file: UploadedFile options: Array<{ label: string; value: string; disabled?: boolean }> selectedValue: string - inputValue: string onInputChange: (value: string) => void onClear: (e: React.MouseEvent) => void onOpenChange: (open: boolean) => void disabled: boolean isLoading: boolean - formatFileSize: (bytes: number) => string truncateMiddle: (text: string, start?: number, end?: number) => string isDeleting: boolean workflowSearchHighlight?: ReturnType @@ -149,13 +147,11 @@ function SingleFileSelector({ file, options, selectedValue, - inputValue, onInputChange, onClear, onOpenChange, disabled, isLoading, - formatFileSize, truncateMiddle, isDeleting, workflowSearchHighlight, @@ -964,7 +960,6 @@ export function FileUpload({ file={filesArray[0]} options={singleFileOptions} selectedValue={selectedFileId} - inputValue={inputValue} onInputChange={handleComboboxChange} onClear={(e) => handleRemoveFile(filesArray[0], e)} onOpenChange={(open) => { @@ -972,7 +967,6 @@ export function FileUpload({ }} disabled={disabled} isLoading={loadingWorkspaceFiles} - formatFileSize={formatFileSize} truncateMiddle={truncateMiddle} isDeleting={deletingFiles[filesArray[0]?.path || '']} workflowSearchHighlight={getWorkflowSearchLabelHighlight({ diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx index 7a4545c0426..1417f773d43 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/components/filter-rule-row.tsx @@ -73,7 +73,6 @@ export function FilterRuleRow({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( cellKey, - rule.value, (newValue) => onUpdate(rule.id, 'value', newValue) ) const workflowSearchHighlight = getActiveWorkflowSearchHighlight({ diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/input-mapping/input-mapping.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/input-mapping/input-mapping.tsx index b0b8583cce4..1106b85d079 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/input-mapping/input-mapping.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/input-mapping/input-mapping.tsx @@ -220,11 +220,7 @@ function InputMappingField({ const fieldId = fieldName const fieldState = inputController.fieldHelpers.getFieldState(fieldId) const handlers = inputController.fieldHelpers.createFieldHandlers(fieldId, value, onChange) - const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( - fieldId, - value, - onChange - ) + const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler(fieldId, onChange) /** * Synchronizes scroll position between input and overlay diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-tag-filters/knowledge-tag-filters.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-tag-filters/knowledge-tag-filters.tsx index 9ddea5c5fce..8ec5ae157a3 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-tag-filters/knowledge-tag-filters.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/knowledge-tag-filters/knowledge-tag-filters.tsx @@ -303,7 +303,6 @@ export function KnowledgeTagFilters({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( cellKey, - fieldValue, (newValue) => handleTagDropdownSelection(filter.id, field, newValue) ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx index a3da0f3fa49..4e5284575a6 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx @@ -565,7 +565,6 @@ export function MessagesInput({ const handleEnvSelect = subBlockInput.fieldHelpers.createEnvVarSelectHandler( fieldId, - message.content, (newValue: string) => { updateMessageContent(index, newValue) } @@ -573,7 +572,6 @@ export function MessagesInput({ const handleTagSelect = subBlockInput.fieldHelpers.createTagSelectHandler( fieldId, - message.content, (newValue: string) => { updateMessageContent(index, newValue) } diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx index f74ffd665ae..c5ac7b4c69f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/short-input/short-input.tsx @@ -219,13 +219,6 @@ export const ShortInput = memo(function ShortInput({ const baseValue = isPreview ? previewValue : propValue !== undefined ? propValue : undefined - const effectiveValue = - (useWebhookUrl || config.providerWebhookUrl) && webhookManagement.webhookUrl - ? webhookManagement.webhookUrl - : baseValue - - const value = wandHook?.isStreaming ? localContent : effectiveValue - useEffect(() => { if (!wandHook.isStreaming) { setLocalContent((prev) => { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slider-input/slider-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slider-input/slider-input.tsx index 7a5cb41d9cb..22f41eb6348 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slider-input/slider-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/slider-input/slider-input.tsx @@ -40,8 +40,6 @@ export function SliderInput({ ? Math.max(min, Math.min(max, value)) : computedDefaultValue - const displayValue = normalizedValue ?? computedDefaultValue - // Ensure the normalized value is set if it differs from the current value useEffect(() => { if (!isPreview && value !== null && value !== undefined && value !== normalizedValue) { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx index 8528a704670..c3c3abf3270 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/starter/input-format.tsx @@ -314,7 +314,6 @@ export function FieldFormat({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( nameFieldKey, - fieldValue, (newValue) => updateField(field.id, 'name', newValue) ) @@ -461,7 +460,6 @@ export function FieldFormat({ ) const tagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( field.id, - fieldValue, (newValue) => updateField(field.id, 'value', newValue) ) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table/table.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table/table.tsx index 4b8823d4ee7..282f67ba7f0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table/table.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table/table.tsx @@ -161,7 +161,6 @@ function TableCell({ const baseTagSelectHandler = inputController.fieldHelpers.createTagSelectHandler( cellKey, - cellValue, (newValue) => updateCellValue(rowIndex, column, newValue) ) const tagSelectHandler = (tag: string) => { @@ -171,7 +170,6 @@ function TableCell({ const baseEnvVarSelectHandler = inputController.fieldHelpers.createEnvVarSelectHandler( cellKey, - cellValue, (newValue) => updateCellValue(rowIndex, column, newValue) ) const envVarSelectHandler = (envVar: string) => { diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-input.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-input.ts index 8723ae4922c..af86a28197b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-input.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-input.ts @@ -5,7 +5,6 @@ import { checkEnvVarTrigger } from '@/app/workspace/[workspaceId]/w/[workflowId] import { checkTagTrigger } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown' import { useSubBlockValue } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-sub-block-value' import type { SubBlockConfig } from '@/blocks/types' -import { useTagSelection } from '@/hooks/kb/use-tag-selection' const logger = createLogger('useSubBlockInput') @@ -134,13 +133,11 @@ export interface UseSubBlockInputResult { /** Create tag select handler for a field */ createTagSelectHandler: ( fieldId: string, - fieldValue: string, onFieldChange: (newValue: string) => void ) => (newValue: string) => void /** Create env var select handler for a field */ createEnvVarSelectHandler: ( fieldId: string, - fieldValue: string, onFieldChange: (newValue: string) => void ) => (newValue: string) => void } @@ -178,8 +175,6 @@ export function useSubBlockInput(options: UseSubBlockInputOptions): UseSubBlockI onStreamingEnd, }) - const emitTagSelection = useTagSelection(blockId, subBlockId) - // Local content enables immediate UI updates and streaming text display const [localContent, setLocalContent] = useState('') @@ -394,22 +389,6 @@ export function useSubBlockInput(options: UseSubBlockInputOptions): UseSubBlockI // Intentionally empty; consumers may mirror scroll to overlays if needed }, []) - // Helper to apply selected value coming from popovers - const applySelectedValue = useCallback( - (newValue: string, isTagSelection: boolean) => { - if (onChange) { - onChange(newValue) - } else if (!isPreview) { - if (isTagSelection) { - emitTagSelection(newValue) - } else { - setStoreValue(newValue) - } - } - }, - [onChange, isPreview, emitTagSelection, setStoreValue] - ) - // Field-level state tracking for array-based inputs const [fieldStates, setFieldStates] = useState>({}) @@ -535,7 +514,7 @@ export function useSubBlockInput(options: UseSubBlockInputOptions): UseSubBlockI // Create tag select handler for a field const createTagSelectHandler = useCallback( - (fieldId: string, fieldValue: string, onFieldChange: (newValue: string) => void) => { + (fieldId: string, onFieldChange: (newValue: string) => void) => { return (newValue: string) => { if (!isPreview && !disabled) { onFieldChange(newValue) @@ -548,7 +527,7 @@ export function useSubBlockInput(options: UseSubBlockInputOptions): UseSubBlockI // Create env var select handler for a field const createEnvVarSelectHandler = useCallback( - (fieldId: string, fieldValue: string, onFieldChange: (newValue: string) => void) => { + (fieldId: string, onFieldChange: (newValue: string) => void) => { return (newValue: string) => { if (!isPreview && !disabled) { onFieldChange(newValue) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/subflow-editor/subflow-editor.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/subflow-editor/subflow-editor.tsx index 744db65a8ba..13e10f5e356 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/subflow-editor/subflow-editor.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/subflow-editor/subflow-editor.tsx @@ -285,7 +285,7 @@ export function SubflowEditor({
- +
)} diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx index ca5a2c44052..32900f4cb01 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx @@ -862,10 +862,7 @@ export function Editor() { {/* Connections Content - Always visible */}
- +
)} diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx index 5b6c2b61125..5d98b5eda06 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx @@ -66,7 +66,7 @@ import { useAutoLayout } from '@/app/workspace/[workspaceId]/w/[workflowId]/hook import { useCurrentWorkflow } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-current-workflow' import { useWorkflowExecution } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution' import { getWorkflowLockToggleIds } from '@/app/workspace/[workspaceId]/w/[workflowId]/utils' -import { useDeleteWorkflow, useImportWorkflow } from '@/app/workspace/[workspaceId]/w/hooks' +import { useDeleteWorkflow } from '@/app/workspace/[workspaceId]/w/hooks' import { RequestAccessModal } from '@/ee/access-requests/components/request-access-action' import { getMyAccessRequestHref } from '@/ee/access-requests/lib/navigation' import { useDiscoverAccessRequests } from '@/hooks/queries/access-requests' @@ -141,7 +141,6 @@ export const Panel = memo(function Panel() { const posthogRef = useRef(posthog) const panelRef = useRef(null) - const fileInputRef = useRef(null) const { activeTab: storedActiveTab, setActiveTab, @@ -181,7 +180,6 @@ export const Panel = memo(function Panel() { const isCopilotTabAvailable = chatEnabled && !permissionConfig.hideCopilot const activeTab: PanelTab = storedActiveTab === 'copilot' && !isCopilotTabAvailable ? 'toolbar' : storedActiveTab - const { isImporting, handleFileChange } = useImportWorkflow({ workspaceId }) const duplicateWorkflowMutation = useDuplicateWorkflowMutation() const { data: workflows = {} } = useWorkflowMap(workspaceId) const { data: folders = {} } = useFolderMap(workspaceId) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx index 0baf5e457a5..3ac1be74166 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/variables/variables.tsx @@ -52,8 +52,6 @@ const TYPE_OPTIONS: ComboboxOption[] = [ /** * UI constants for consistent styling and sizing */ -const BADGE_HEIGHT = 20 -const BADGE_TEXT_SIZE = 13 const ICON_SIZE = 13 const HEADER_ICON_SIZE = 16 const LINE_HEIGHT = 21 diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts index 295234abd86..e2cd89e19e3 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts @@ -423,12 +423,7 @@ export function useWorkflowExecution() { })) ) const hasHydrated = useTerminalConsoleStore((s) => s._hasHydrated) - const { getVariablesByWorkflowId, variables } = useVariablesStore( - useShallow((s) => ({ - getVariablesByWorkflowId: s.getVariablesByWorkflowId, - variables: s.variables, - })) - ) + const getVariablesByWorkflowId = useVariablesStore((s) => s.getVariablesByWorkflowId) const { isExecuting, isDebugging, pendingBlocks, executor, debugContext } = useExecutionStore( useShallow((state) => { const exec = activeWorkflowId @@ -1722,18 +1717,6 @@ export function useWorkflowExecution() { setActiveBlocks(activeWorkflowId, new Set()) } - let notificationMessage = WORKFLOW_EXECUTION_FAILURE_MESSAGE - const requestError = - isRecordLike(error) && isRecordLike(error.request) ? error.request : undefined - if (requestError && sanitizeMessage(requestError.url)) { - notificationMessage += `: Request to ${(requestError.url as string).trim()} failed` - if (isRecordLike(error) && typeof error.status === 'number') { - notificationMessage += ` (Status: ${error.status})` - } - } else if (sanitizeMessage(errorResult.error)) { - notificationMessage += `: ${errorResult.error}` - } - return errorResult } diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index 96593cb5d44..a61ae585cdf 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -432,8 +432,7 @@ const WorkflowContent = React.memo( })) ) - const { handleRunFromBlock, handleRunUntilBlock, handleRunWorkflow, handleCancelExecution } = - useWorkflowExecution() + const { handleRunFromBlock, handleRunUntilBlock } = useWorkflowExecution() const snapToGridSize = useSnapToGridSize() const snapToGrid = snapToGridSize > 0 diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx index 5cbefeed900..1364b35d187 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx @@ -320,8 +320,6 @@ const SidebarNavItem = memo(function SidebarNavItem({ /** Event name for sidebar scroll operations - centralized for consistency */ export const SIDEBAR_SCROLL_EVENT = 'sidebar-scroll-to-item' -const HIDDEN_STYLE = { display: 'none' } as const - /** * Opts a control out of the desktop shell's window-drag region. The header row is * draggable chrome, so anything clickable inside it has to say so or the click is @@ -401,7 +399,6 @@ export const Sidebar = memo(function Sidebar({ organizationHref }: SidebarProps) ]) const toggleCollapsed = useSidebarStore((state) => state.toggleCollapsed) - const isOnWorkflowPage = !!workflowId const isMac = isMacPlatform() const showCollapsedTooltips = isCollapsed diff --git a/apps/sim/background/cleanup-stale-executions.ts b/apps/sim/background/cleanup-stale-executions.ts index 3c0d9010475..073de0da5c6 100644 --- a/apps/sim/background/cleanup-stale-executions.ts +++ b/apps/sim/background/cleanup-stale-executions.ts @@ -45,7 +45,7 @@ const logger = createLogger('CleanupStaleExecutions') const STALE_THRESHOLD_MS = getExecutionReservationTtlMs() const STALE_THRESHOLD_MINUTES = Math.ceil(STALE_THRESHOLD_MS / 60000) const GENERIC_STALE_PROCESSING_ERROR = `Job terminated: stuck in processing for more than ${STALE_THRESHOLD_MINUTES} minutes` -const EXECUTION_DEADLINE_ERROR = getTimeoutErrorMessage(undefined) +const EXECUTION_DEADLINE_ERROR = getTimeoutErrorMessage() /** * Table jobs run as detached workers with progress heartbeats, independently of workflow timeout * policy. Preserve their historical 90-minute task window plus five-minute cleanup grace. diff --git a/apps/sim/background/dispatch-cancel-guard.test.ts b/apps/sim/background/dispatch-cancel-guard.test.ts index 25825c92dd6..a7ffae490ff 100644 --- a/apps/sim/background/dispatch-cancel-guard.test.ts +++ b/apps/sim/background/dispatch-cancel-guard.test.ts @@ -57,8 +57,7 @@ import { runRowCascadeLoop } from '@/background/workflow-column-execution' const { mockGetRowById } = tableRowsServiceMockFns const { mockExecuteWorkflow } = executeWorkflowMockFns -const { mockPickNextEligibleGroupForRow, mockStashCellContextForResume } = - tableWorkflowColumnsMockFns +const { mockPickNextEligibleGroupForRow } = tableWorkflowColumnsMockFns const mockGetTableById = tableServiceMockFns.mockGetTableById const mockLoadDeployedWorkflowState = workflowsPersistenceUtilsMockFns.mockLoadDeployedWorkflowState diff --git a/apps/sim/background/resume-execution.ts b/apps/sim/background/resume-execution.ts index f6a8fa9b7cd..ee440c093a7 100644 --- a/apps/sim/background/resume-execution.ts +++ b/apps/sim/background/resume-execution.ts @@ -269,7 +269,7 @@ function throwIfResumeAttemptTimedOut( return } - throw new ExecutionTimeoutError(getTimeoutErrorMessage(null, timeoutController.timeoutMs)) + throw new ExecutionTimeoutError(getTimeoutErrorMessage(timeoutController.timeoutMs)) } type CellWriters = { diff --git a/apps/sim/background/schedule-execution.ts b/apps/sim/background/schedule-execution.ts index 0a34f19d5fd..ace6772721b 100644 --- a/apps/sim/background/schedule-execution.ts +++ b/apps/sim/background/schedule-execution.ts @@ -674,7 +674,7 @@ async function runWorkflowExecution({ timeoutController.isTimedOut() && timeoutMs !== undefined if (timedOut) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutMs) logger.info(`[${requestId}] Scheduled workflow execution timed out`, { timeoutMs, }) diff --git a/apps/sim/background/webhook-execution.ts b/apps/sim/background/webhook-execution.ts index 827cd55e684..5a1080b5a89 100644 --- a/apps/sim/background/webhook-execution.ts +++ b/apps/sim/background/webhook-execution.ts @@ -238,7 +238,7 @@ async function processTriggerFileOutputs( normalizeWebhookAttachments(value), context ) - } catch (error) { + } catch { processed[key] = [] } } else if (outputDef?.type === 'file' && value) { @@ -735,7 +735,7 @@ async function handleExecutionResult( ctx.timeoutController.isTimedOut() && ctx.timeoutController.timeoutMs ) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, ctx.timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(ctx.timeoutController.timeoutMs) logger.info(`[${ctx.requestId}] Webhook execution timed out`, { timeoutMs: ctx.timeoutController.timeoutMs, }) diff --git a/apps/sim/background/workflow-column-execution.ts b/apps/sim/background/workflow-column-execution.ts index cbd43a3b95f..7cd569ce424 100644 --- a/apps/sim/background/workflow-column-execution.ts +++ b/apps/sim/background/workflow-column-execution.ts @@ -149,7 +149,7 @@ export function buildTableAbortState(args: { executionId, jobId: null, workflowId, - error: timedOut ? getTimeoutErrorMessage(null, timeoutMs) : 'Cancelled', + error: timedOut ? getTimeoutErrorMessage(timeoutMs) : 'Cancelled', runningBlockIds: [], } } diff --git a/apps/sim/background/workflow-execution.ts b/apps/sim/background/workflow-execution.ts index b04e5a0610c..33acc5ed146 100644 --- a/apps/sim/background/workflow-execution.ts +++ b/apps/sim/background/workflow-execution.ts @@ -277,7 +277,7 @@ export async function executeWorkflowJob( timeoutController.isTimedOut() && timeoutController.timeoutMs ) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) logger.info(`[${requestId}] Workflow execution timed out`, { timeoutMs: timeoutController.timeoutMs, }) diff --git a/apps/sim/blocks/blocks.test.ts b/apps/sim/blocks/blocks.test.ts index 8889f038cc6..1cb51e664d2 100644 --- a/apps/sim/blocks/blocks.test.ts +++ b/apps/sim/blocks/blocks.test.ts @@ -464,10 +464,10 @@ describe.concurrent('Blocks Module', () => { if (hasRequired && hasOptional) { const requiredSubBlocks = subBlocks - .filter((sb, i) => requiredStatuses[i] === 'required') + .filter((_sb, i) => requiredStatuses[i] === 'required') .map((sb) => `${sb.id} (${sb.mode || 'both'})`) const optionalSubBlocks = subBlocks - .filter((sb, i) => requiredStatuses[i] === 'optional') + .filter((_sb, i) => requiredStatuses[i] === 'optional') .map((sb) => `${sb.id} (${sb.mode || 'both'})`) errors.push( diff --git a/apps/sim/blocks/blocks/affinity.ts b/apps/sim/blocks/blocks/affinity.ts index dfa98b484b1..258f8704aa5 100644 --- a/apps/sim/blocks/blocks/affinity.ts +++ b/apps/sim/blocks/blocks/affinity.ts @@ -2,7 +2,6 @@ import { AffinityIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { parseOptionalBooleanInput, parseOptionalNumberInput } from '@/blocks/utils' -import type { AffinityCollectionResponse } from '@/tools/affinity/types' /** Operations scoped to a company or person through the shared field endpoints. */ const FIELD_ENTITY_OPERATIONS = [ @@ -304,7 +303,7 @@ function affinityToolIds(): ReadonlySet { return affinityToolIdCache } -export const AffinityBlock: BlockConfig> = { +export const AffinityBlock: BlockConfig = { type: 'affinity', name: 'Affinity', description: 'Read and write companies, people, lists, notes, and relationships in Affinity', diff --git a/apps/sim/blocks/blocks/agent.ts b/apps/sim/blocks/blocks/agent.ts index 9eb4e2732af..b81fc0a4c74 100644 --- a/apps/sim/blocks/blocks/agent.ts +++ b/apps/sim/blocks/blocks/agent.ts @@ -29,7 +29,6 @@ import { isAutoModel, supportsTemperature, } from '@/providers/models' -import type { ToolResponse } from '@/tools/types' const logger = createLogger('AgentBlock') @@ -45,25 +44,6 @@ const MODELS_WITHOUT_MEMORY = getModelsWithoutMemory() const EVALUATION_MODELS = getEvaluationModels() const MODELS_WITHOUT_CHAT_CONTROLS = [...MODELS_WITH_DEEP_RESEARCH, ...EVALUATION_MODELS] -interface AgentResponse extends ToolResponse { - output: { - content: string - model: string - tokens?: { - prompt?: number - completion?: number - total?: number - } - toolCalls?: { - list: Array<{ - name: string - arguments: Record - }> - count: number - } - } -} - // Helper function to get the tool ID from a block type const getToolIdFromBlock = (blockType: string): string | undefined => { try { @@ -79,7 +59,7 @@ const getToolIdFromBlock = (blockType: string): string | undefined => { } } -export const AgentBlock: BlockConfig = { +export const AgentBlock: BlockConfig = { type: 'agent', name: 'Agent', description: 'Build an agent', diff --git a/apps/sim/blocks/blocks/ahrefs.ts b/apps/sim/blocks/blocks/ahrefs.ts index 0586a8801e9..cb79b534d32 100644 --- a/apps/sim/blocks/blocks/ahrefs.ts +++ b/apps/sim/blocks/blocks/ahrefs.ts @@ -1,7 +1,6 @@ import { AhrefsIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AhrefsResponse } from '@/tools/ahrefs/types' const COUNTRY_OPTIONS = [ { label: 'United States', id: 'us' }, @@ -88,7 +87,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n generationType: 'timestamp' as const, } -export const AhrefsBlock: BlockConfig = { +export const AhrefsBlock: BlockConfig = { type: 'ahrefs', name: 'Ahrefs', description: 'SEO analysis with Ahrefs', diff --git a/apps/sim/blocks/blocks/airtable.ts b/apps/sim/blocks/blocks/airtable.ts index f142c12ee7b..bbf0ed9c8e6 100644 --- a/apps/sim/blocks/blocks/airtable.ts +++ b/apps/sim/blocks/blocks/airtable.ts @@ -2,7 +2,6 @@ import { AirtableIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AirtableResponse } from '@/tools/airtable/types' import { getTrigger } from '@/triggers' /** Canonical account pair — an advanced-mode card only fills `manualCredential`. */ @@ -12,7 +11,7 @@ const BASE_FIELD = ['baseSelector', 'baseId'] as const /** Canonical table pair — the picker in basic mode, the raw table id in advanced. */ const TABLE_FIELD = ['tableSelector', 'tableId'] as const -export const AirtableBlock: BlockConfig = { +export const AirtableBlock: BlockConfig = { type: 'airtable', name: 'Airtable', description: 'Read, create, and update Airtable', diff --git a/apps/sim/blocks/blocks/airweave.ts b/apps/sim/blocks/blocks/airweave.ts index dcbd167758e..bd68d4d8cdc 100644 --- a/apps/sim/blocks/blocks/airweave.ts +++ b/apps/sim/blocks/blocks/airweave.ts @@ -1,9 +1,8 @@ import { AirweaveIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AirweaveSearchResponse } from '@/tools/airweave/types' -export const AirweaveBlock: BlockConfig = { +export const AirweaveBlock: BlockConfig = { type: 'airweave', name: 'Airweave', description: 'Search your synced data collections', diff --git a/apps/sim/blocks/blocks/api.ts b/apps/sim/blocks/blocks/api.ts index eab5b60c67d..ccbcf4e4289 100644 --- a/apps/sim/blocks/blocks/api.ts +++ b/apps/sim/blocks/blocks/api.ts @@ -1,9 +1,8 @@ import { ApiIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { RequestResponse } from '@/tools/http/types' -export const ApiBlock: BlockConfig = { +export const ApiBlock: BlockConfig = { type: 'api', name: 'API', description: 'Use any API', diff --git a/apps/sim/blocks/blocks/apify.ts b/apps/sim/blocks/blocks/apify.ts index 7196c0a9b8f..2f3109293ca 100644 --- a/apps/sim/blocks/blocks/apify.ts +++ b/apps/sim/blocks/blocks/apify.ts @@ -1,12 +1,11 @@ import { ApifyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RunActorResult } from '@/tools/apify/types' const RUN_OPERATIONS = ['apify_run_actor_sync', 'apify_run_actor_async'] const RUN_OR_TASK_OPERATIONS = [...RUN_OPERATIONS, 'apify_run_task'] -export const ApifyBlock: BlockConfig = { +export const ApifyBlock: BlockConfig = { type: 'apify', name: 'Apify', description: 'Run Apify actors and retrieve results', diff --git a/apps/sim/blocks/blocks/apollo.ts b/apps/sim/blocks/blocks/apollo.ts index 71ccb028a9d..9c44deb3cb2 100644 --- a/apps/sim/blocks/blocks/apollo.ts +++ b/apps/sim/blocks/blocks/apollo.ts @@ -3,12 +3,11 @@ import { getErrorMessage } from '@sim/utils/errors' import { ApolloIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ApolloResponse } from '@/tools/apollo/types' /** Identifies a person by email when available, otherwise by given name. */ const PERSON_IDENTITY_FIELD = ['email', 'first_name'] as const -export const ApolloBlock: BlockConfig = { +export const ApolloBlock: BlockConfig = { type: 'apollo', name: 'Apollo', description: 'Search, enrich, and manage contacts with Apollo.io', diff --git a/apps/sim/blocks/blocks/appconfig.ts b/apps/sim/blocks/blocks/appconfig.ts index 460280baa8d..3de1afd90c1 100644 --- a/apps/sim/blocks/blocks/appconfig.ts +++ b/apps/sim/blocks/blocks/appconfig.ts @@ -1,14 +1,8 @@ import { AppConfigIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - AppConfigGetConfigurationResponse, - AppConfigListApplicationsResponse, -} from '@/tools/appconfig/types' -export const AppConfigBlock: BlockConfig< - AppConfigListApplicationsResponse | AppConfigGetConfigurationResponse -> = { +export const AppConfigBlock: BlockConfig = { type: 'appconfig', name: 'AWS AppConfig', description: 'Manage and retrieve configuration with AWS AppConfig', diff --git a/apps/sim/blocks/blocks/arxiv.ts b/apps/sim/blocks/blocks/arxiv.ts index 5ce8057be8b..d71c2352e8c 100644 --- a/apps/sim/blocks/blocks/arxiv.ts +++ b/apps/sim/blocks/blocks/arxiv.ts @@ -1,9 +1,8 @@ import { ArxivIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { ArxivResponse } from '@/tools/arxiv/types' -export const ArxivBlock: BlockConfig = { +export const ArxivBlock: BlockConfig = { type: 'arxiv', name: 'ArXiv', description: 'Search and retrieve academic papers from ArXiv', diff --git a/apps/sim/blocks/blocks/asana.ts b/apps/sim/blocks/blocks/asana.ts index 0242fa16c3a..03de29b358a 100644 --- a/apps/sim/blocks/blocks/asana.ts +++ b/apps/sim/blocks/blocks/asana.ts @@ -2,7 +2,6 @@ import { AsanaIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AsanaResponse } from '@/tools/asana/types' const WORKSPACE_FIELD = ['workspaceSelector', 'workspace'] as const const GET_TASKS_WORKSPACE_FIELD = ['getTasksWorkspaceSelector', 'getTasks_workspace'] as const @@ -11,7 +10,7 @@ const CREATE_PROJECT_WORKSPACE_FIELD = [ 'createProject_workspace', ] as const -export const AsanaBlock: BlockConfig = { +export const AsanaBlock: BlockConfig = { type: 'asana', name: 'Asana', description: 'Interact with Asana', diff --git a/apps/sim/blocks/blocks/athena.ts b/apps/sim/blocks/blocks/athena.ts index 70a048f6a68..3d3415e4f70 100644 --- a/apps/sim/blocks/blocks/athena.ts +++ b/apps/sim/blocks/blocks/athena.ts @@ -1,35 +1,6 @@ import { AthenaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { - AthenaBatchGetNamedQueryResponse, - AthenaBatchGetPreparedStatementResponse, - AthenaBatchGetQueryExecutionResponse, - AthenaCreateNamedQueryResponse, - AthenaCreatePreparedStatementResponse, - AthenaDeleteNamedQueryResponse, - AthenaDeletePreparedStatementResponse, - AthenaGetDatabaseResponse, - AthenaGetDataCatalogResponse, - AthenaGetNamedQueryResponse, - AthenaGetPreparedStatementResponse, - AthenaGetQueryExecutionResponse, - AthenaGetQueryResultsResponse, - AthenaGetQueryRuntimeStatisticsResponse, - AthenaGetTableMetadataResponse, - AthenaGetWorkGroupResponse, - AthenaListDatabasesResponse, - AthenaListDataCatalogsResponse, - AthenaListNamedQueriesResponse, - AthenaListPreparedStatementsResponse, - AthenaListQueryExecutionsResponse, - AthenaListTableMetadataResponse, - AthenaListWorkGroupsResponse, - AthenaStartQueryResponse, - AthenaStopQueryResponse, - AthenaUpdateNamedQueryResponse, - AthenaUpdatePreparedStatementResponse, -} from '@/tools/athena/types' /** * Normalizes a switch value that may arrive as a boolean or as the strings 'true' / 'false'. @@ -41,35 +12,7 @@ function parseBoolean(value: unknown): boolean | undefined { return undefined } -export const AthenaBlock: BlockConfig< - | AthenaStartQueryResponse - | AthenaGetQueryExecutionResponse - | AthenaGetQueryResultsResponse - | AthenaGetQueryRuntimeStatisticsResponse - | AthenaStopQueryResponse - | AthenaListQueryExecutionsResponse - | AthenaBatchGetQueryExecutionResponse - | AthenaCreateNamedQueryResponse - | AthenaGetNamedQueryResponse - | AthenaBatchGetNamedQueryResponse - | AthenaUpdateNamedQueryResponse - | AthenaListNamedQueriesResponse - | AthenaDeleteNamedQueryResponse - | AthenaCreatePreparedStatementResponse - | AthenaGetPreparedStatementResponse - | AthenaBatchGetPreparedStatementResponse - | AthenaUpdatePreparedStatementResponse - | AthenaListPreparedStatementsResponse - | AthenaDeletePreparedStatementResponse - | AthenaListDataCatalogsResponse - | AthenaGetDataCatalogResponse - | AthenaListDatabasesResponse - | AthenaGetDatabaseResponse - | AthenaListTableMetadataResponse - | AthenaGetTableMetadataResponse - | AthenaListWorkGroupsResponse - | AthenaGetWorkGroupResponse -> = { +export const AthenaBlock: BlockConfig = { type: 'athena', name: 'Athena', description: 'Run SQL queries on data in Amazon S3 using AWS Athena', diff --git a/apps/sim/blocks/blocks/attio.ts b/apps/sim/blocks/blocks/attio.ts index fb747044658..0fcea1b3306 100644 --- a/apps/sim/blocks/blocks/attio.ts +++ b/apps/sim/blocks/blocks/attio.ts @@ -1,7 +1,6 @@ import { AttioIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AttioResponse } from '@/tools/attio/types' import { getTrigger } from '@/triggers' /* @@ -18,7 +17,7 @@ const LIST_FIELD = ['listSelector', 'listIdOrSlug'] as const */ const COMMENT_TARGET_FIELD = ['commentEntryId', 'commentRecordId', 'commentThreadId'] as const -export const AttioBlock: BlockConfig = { +export const AttioBlock: BlockConfig = { type: 'attio', name: 'Attio', description: 'Manage records, notes, tasks, lists, comments, and more in Attio CRM', diff --git a/apps/sim/blocks/blocks/azure_data_explorer.ts b/apps/sim/blocks/blocks/azure_data_explorer.ts index 1375103927b..cf7afe9e2a4 100644 --- a/apps/sim/blocks/blocks/azure_data_explorer.ts +++ b/apps/sim/blocks/blocks/azure_data_explorer.ts @@ -1,7 +1,6 @@ import { AzureDataExplorerIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AzureDataExplorerTableResponse } from '@/tools/azure_data_explorer/types' /** Every operation except the cluster-level database listing runs in a database. */ const DATABASE_SCOPED_OPERATIONS = [ @@ -108,7 +107,7 @@ function toBoolean(value: unknown): true | undefined { return value === true || value === 'true' ? true : undefined } -export const AzureDataExplorerBlock: BlockConfig = { +export const AzureDataExplorerBlock: BlockConfig = { type: 'azure_data_explorer', name: 'Azure Data Explorer', description: 'Query and manage Azure Data Explorer (Kusto) clusters with KQL', diff --git a/apps/sim/blocks/blocks/azure_devops.ts b/apps/sim/blocks/blocks/azure_devops.ts index 2b610173115..4d958becd26 100644 --- a/apps/sim/blocks/blocks/azure_devops.ts +++ b/apps/sim/blocks/blocks/azure_devops.ts @@ -1,7 +1,7 @@ import { AzureIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { AzureDevOpsBasicWorkItemType, AzureDevOpsResponse } from '@/tools/azure_devops/types' +import type { AzureDevOpsBasicWorkItemType } from '@/tools/azure_devops/types' import { AZURE_DEVOPS_BASIC_WORK_ITEM_STATES } from '@/tools/azure_devops/utils' import { getTrigger } from '@/triggers' @@ -12,7 +12,7 @@ function normalizeDate(input: unknown): string | undefined { return /^\d{4}-\d{2}-\d{2}$/.test(value) ? `${value}T00:00:00Z` : value } -export const AzureDevOpsBlock: BlockConfig = { +export const AzureDevOpsBlock: BlockConfig = { type: 'azure_devops', name: 'Azure DevOps', description: 'Interact with Azure DevOps pipelines, builds, and work items', diff --git a/apps/sim/blocks/blocks/brandfetch.ts b/apps/sim/blocks/blocks/brandfetch.ts index fff2f409a47..e5c3fdc2476 100644 --- a/apps/sim/blocks/blocks/brandfetch.ts +++ b/apps/sim/blocks/blocks/brandfetch.ts @@ -1,9 +1,8 @@ import { BrandfetchIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { BrandfetchGetBrandResponse, BrandfetchSearchResponse } from '@/tools/brandfetch/types' -export const BrandfetchBlock: BlockConfig = { +export const BrandfetchBlock: BlockConfig = { type: 'brandfetch', name: 'Brandfetch', description: 'Look up brand assets, logos, colors, and company info', diff --git a/apps/sim/blocks/blocks/brex.ts b/apps/sim/blocks/blocks/brex.ts index 1e2d98405ae..6bdcb1ca25d 100644 --- a/apps/sim/blocks/blocks/brex.ts +++ b/apps/sim/blocks/blocks/brex.ts @@ -2,7 +2,6 @@ import { BrexIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { BrexResponse } from '@/tools/brex/types' /** Coerces a required money-amount field to a finite number, throwing on blank/non-numeric input rather than silently sending 0 or NaN to Brex. */ function toRequiredAmount(value: unknown, fieldLabel: string): number { @@ -58,7 +57,7 @@ const PAGINATED_OPERATIONS = new Set([ */ const RECEIPT_FILE_FIELD = ['uploadReceiptFile', 'receiptFileReference'] as const -export const BrexBlock: BlockConfig = { +export const BrexBlock: BlockConfig = { type: 'brex', name: 'Brex', description: 'Manage expenses, receipts, transactions, and team data in Brex', diff --git a/apps/sim/blocks/blocks/brightdata.ts b/apps/sim/blocks/blocks/brightdata.ts index c31563f2401..32d65fa2fc0 100644 --- a/apps/sim/blocks/blocks/brightdata.ts +++ b/apps/sim/blocks/blocks/brightdata.ts @@ -1,9 +1,8 @@ import { BrightDataIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { BrightDataResponse } from '@/tools/brightdata/types' -export const BrightDataBlock: BlockConfig = { +export const BrightDataBlock: BlockConfig = { type: 'brightdata', name: 'Bright Data', description: 'Scrape websites, search engines, and extract structured data', diff --git a/apps/sim/blocks/blocks/browser_use.ts b/apps/sim/blocks/blocks/browser_use.ts index 6d0671d1867..711ba972aa0 100644 --- a/apps/sim/blocks/blocks/browser_use.ts +++ b/apps/sim/blocks/blocks/browser_use.ts @@ -1,8 +1,7 @@ import { BrowserUseIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { BrowserUseResponse } from '@/tools/browser_use/types' -export const BrowserUseBlock: BlockConfig = { +export const BrowserUseBlock: BlockConfig = { type: 'browser_use', name: 'Browser Use', description: 'Run browser automation tasks', diff --git a/apps/sim/blocks/blocks/buffer.ts b/apps/sim/blocks/blocks/buffer.ts index 1b7ef9fe7f7..2e361605c40 100644 --- a/apps/sim/blocks/blocks/buffer.ts +++ b/apps/sim/blocks/blocks/buffer.ts @@ -2,11 +2,10 @@ import { BufferIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { BufferPostResponse } from '@/tools/buffer/types' const POST_EDIT_OPS = ['create_post', 'edit_post'] -export const BufferBlock: BlockConfig = { +export const BufferBlock: BlockConfig = { type: 'buffer', name: 'Buffer', description: 'Schedule and publish social media posts across connected channels', diff --git a/apps/sim/blocks/blocks/calcom.ts b/apps/sim/blocks/blocks/calcom.ts index b0d2658479d..6d3d0068d76 100644 --- a/apps/sim/blocks/blocks/calcom.ts +++ b/apps/sim/blocks/blocks/calcom.ts @@ -1,7 +1,6 @@ import { CalComIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' import { getTrigger } from '@/triggers' const EVENT_TYPE_FIELD = ['eventTypeSelector', 'eventTypeId'] as const @@ -10,7 +9,7 @@ const EVENT_TYPE_PARAM_FIELD = ['eventTypeParamSelector', 'eventTypeIdParam'] as const EVENT_TYPE_SCHEDULE_FIELD = ['eventTypeScheduleSelector', 'eventTypeScheduleId'] as const const SCHEDULE_FIELD = ['scheduleSelector', 'scheduleId'] as const -export const CalComBlock: BlockConfig = { +export const CalComBlock: BlockConfig = { type: 'calcom', name: 'Cal.com', description: 'Manage Cal.com bookings, event types, schedules, and availability', diff --git a/apps/sim/blocks/blocks/calendly.ts b/apps/sim/blocks/blocks/calendly.ts index 8d3d7726145..c1eae502808 100644 --- a/apps/sim/blocks/blocks/calendly.ts +++ b/apps/sim/blocks/blocks/calendly.ts @@ -2,7 +2,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { CalendlyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' import { getTrigger } from '@/triggers' /** @@ -25,7 +24,7 @@ function parseJsonArray(value: unknown, field: string): unknown { } } -export const CalendlyBlock: BlockConfig = { +export const CalendlyBlock: BlockConfig = { type: 'calendly', name: 'Calendly', description: 'Manage Calendly scheduling and events', diff --git a/apps/sim/blocks/blocks/cbinsights.ts b/apps/sim/blocks/blocks/cbinsights.ts index 0e40534230b..5b1d5598ca0 100644 --- a/apps/sim/blocks/blocks/cbinsights.ts +++ b/apps/sim/blocks/blocks/cbinsights.ts @@ -2,7 +2,6 @@ import { Building, ListChecks, Search, Sparkles, Sprout, Users } from '@sim/emcn import { CbInsightsIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { CbInsightsResponse } from '@/tools/cbinsights/types' /** Operations that take a single organization ID on the path. */ const ORG_OPERATIONS = [ @@ -62,7 +61,7 @@ const TITLE_FILTER_OPERATIONS = ['get_org_management_and_board', 'list_managemen /** Operations whose history window is bounded by a start and an end date. */ const DATE_RANGE_OPERATIONS = ['get_commercial_maturity_history', 'get_exit_probability_history'] -export const CbInsightsBlock: BlockConfig = { +export const CbInsightsBlock: BlockConfig = { type: 'cbinsights', name: 'CB Insights', description: 'Research private markets — firmographics, funding, and predictive scores', diff --git a/apps/sim/blocks/blocks/clay.ts b/apps/sim/blocks/blocks/clay.ts index 69e9dcbff6e..291cc3a988b 100644 --- a/apps/sim/blocks/blocks/clay.ts +++ b/apps/sim/blocks/blocks/clay.ts @@ -1,8 +1,7 @@ import { ClayIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ClayPopulateResponse } from '@/tools/clay/types' -export const ClayBlock: BlockConfig = { +export const ClayBlock: BlockConfig = { type: 'clay', name: 'Clay', description: 'Populate Clay workbook', diff --git a/apps/sim/blocks/blocks/clerk.ts b/apps/sim/blocks/blocks/clerk.ts index 4a1a99ab48b..d336a2ffd10 100644 --- a/apps/sim/blocks/blocks/clerk.ts +++ b/apps/sim/blocks/blocks/clerk.ts @@ -1,7 +1,6 @@ import { ClerkIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { ClerkResponse } from '@/tools/clerk/types' import { getTrigger } from '@/triggers' /** @@ -13,7 +12,7 @@ const NEW_USER_IDENTIFIER_FIELD = ['emailAddress', 'phoneNumber', 'username'] as /** Human name, whichever half the builder supplied. */ const FULL_NAME_FIELD = ['firstName', 'lastName'] as const -export const ClerkBlock: BlockConfig = { +export const ClerkBlock: BlockConfig = { type: 'clerk', name: 'Clerk', description: 'Manage users, organizations, and sessions in Clerk', diff --git a/apps/sim/blocks/blocks/clickhouse.ts b/apps/sim/blocks/blocks/clickhouse.ts index 3a49ce88ac0..2b7654ad214 100644 --- a/apps/sim/blocks/blocks/clickhouse.ts +++ b/apps/sim/blocks/blocks/clickhouse.ts @@ -3,7 +3,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { ClickHouseIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { ClickHouseResponse } from '@/tools/clickhouse/types' const CLICKHOUSE_QUERY_PROMPT = `You are an expert ClickHouse database developer. Write ClickHouse SQL queries based on the user's request. @@ -61,7 +60,7 @@ const TABLE_REQUIRED_OPERATIONS = [ 'drop_partition', ] -export const ClickHouseBlock: BlockConfig = { +export const ClickHouseBlock: BlockConfig = { type: 'clickhouse', name: 'ClickHouse', description: 'Connect to a ClickHouse database', diff --git a/apps/sim/blocks/blocks/clickup.ts b/apps/sim/blocks/blocks/clickup.ts index 870d0c86dd1..0ff829d020c 100644 --- a/apps/sim/blocks/blocks/clickup.ts +++ b/apps/sim/blocks/blocks/clickup.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { ClickUpResponse } from '@/tools/clickup/types' import { getTrigger } from '@/triggers' const TIMESTAMP_WAND_PROMPT = `Generate a Unix timestamp in milliseconds based on the user's description. @@ -104,7 +103,7 @@ const LIST_PARENT_FIELD = [ /** Attachment payload, whichever upload mode the user picked. */ const ATTACHMENT_FIELD = ['attachmentFile', 'fileReference'] as const -export const ClickUpBlock: BlockConfig = { +export const ClickUpBlock: BlockConfig = { type: 'clickup', name: 'ClickUp', description: 'Interact with ClickUp', diff --git a/apps/sim/blocks/blocks/cloudflare.ts b/apps/sim/blocks/blocks/cloudflare.ts index 14a5f60e5ce..26a64e15065 100644 --- a/apps/sim/blocks/blocks/cloudflare.ts +++ b/apps/sim/blocks/blocks/cloudflare.ts @@ -1,6 +1,5 @@ import { CloudflareIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { CloudflareResponse } from '@/tools/cloudflare/types' /** * Per-operation aliases from a tool param name to the subBlock id that supplies @@ -75,7 +74,7 @@ const ALIASED_SUBBLOCK_IDS = [ ...new Set(Object.values(SUBBLOCK_ALIASES).flatMap((aliases) => Object.values(aliases))), ] -export const CloudflareBlock: BlockConfig = { +export const CloudflareBlock: BlockConfig = { type: 'cloudflare', name: 'Cloudflare', description: 'Manage DNS, WAF, Zero Trust access, and edge infrastructure', diff --git a/apps/sim/blocks/blocks/cloudformation.ts b/apps/sim/blocks/blocks/cloudformation.ts index 5991e688d9a..088e556ee6c 100644 --- a/apps/sim/blocks/blocks/cloudformation.ts +++ b/apps/sim/blocks/blocks/cloudformation.ts @@ -2,41 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { CloudFormationIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { - CloudFormationCancelUpdateStackResponse, - CloudFormationCreateChangeSetResponse, - CloudFormationCreateStackResponse, - CloudFormationDeleteStackResponse, - CloudFormationDescribeChangeSetResponse, - CloudFormationDescribeStackDriftDetectionStatusResponse, - CloudFormationDescribeStackEventsResponse, - CloudFormationDescribeStacksResponse, - CloudFormationDetectStackDriftResponse, - CloudFormationExecuteChangeSetResponse, - CloudFormationGetTemplateResponse, - CloudFormationGetTemplateSummaryResponse, - CloudFormationListStackResourcesResponse, - CloudFormationUpdateStackResponse, - CloudFormationValidateTemplateResponse, -} from '@/tools/cloudformation/types' -export const CloudFormationBlock: BlockConfig< - | CloudFormationDescribeStacksResponse - | CloudFormationListStackResourcesResponse - | CloudFormationDetectStackDriftResponse - | CloudFormationDescribeStackDriftDetectionStatusResponse - | CloudFormationDescribeStackEventsResponse - | CloudFormationGetTemplateResponse - | CloudFormationValidateTemplateResponse - | CloudFormationCreateStackResponse - | CloudFormationUpdateStackResponse - | CloudFormationDeleteStackResponse - | CloudFormationCancelUpdateStackResponse - | CloudFormationCreateChangeSetResponse - | CloudFormationDescribeChangeSetResponse - | CloudFormationExecuteChangeSetResponse - | CloudFormationGetTemplateSummaryResponse -> = { +export const CloudFormationBlock: BlockConfig = { type: 'cloudformation', name: 'CloudFormation', description: 'Manage and inspect AWS CloudFormation stacks, resources, and drift', diff --git a/apps/sim/blocks/blocks/cloudtrail.ts b/apps/sim/blocks/blocks/cloudtrail.ts index c34c8fcc450..0d4d7c7d878 100644 --- a/apps/sim/blocks/blocks/cloudtrail.ts +++ b/apps/sim/blocks/blocks/cloudtrail.ts @@ -1,22 +1,6 @@ import { CloudTrailIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - CloudTrailCancelQueryResponse, - CloudTrailDescribeQueryResponse, - CloudTrailDescribeTrailsResponse, - CloudTrailGetEventDataStoreResponse, - CloudTrailGetEventSelectorsResponse, - CloudTrailGetInsightSelectorsResponse, - CloudTrailGetQueryResultsResponse, - CloudTrailGetTrailResponse, - CloudTrailGetTrailStatusResponse, - CloudTrailListEventDataStoresResponse, - CloudTrailListTagsResponse, - CloudTrailListTrailsResponse, - CloudTrailLookupEventsResponse, - CloudTrailStartQueryResponse, -} from '@/tools/cloudtrail/types' /** Operations that accept an opaque AWS pagination token. */ const PAGINATED_OPERATIONS = [ @@ -41,22 +25,7 @@ function parseBoundedInt(value: unknown): number | undefined { return Number.isNaN(parsed) ? undefined : parsed } -export const CloudTrailBlock: BlockConfig< - | CloudTrailLookupEventsResponse - | CloudTrailDescribeTrailsResponse - | CloudTrailGetTrailResponse - | CloudTrailGetTrailStatusResponse - | CloudTrailListTrailsResponse - | CloudTrailGetEventSelectorsResponse - | CloudTrailGetInsightSelectorsResponse - | CloudTrailStartQueryResponse - | CloudTrailDescribeQueryResponse - | CloudTrailGetQueryResultsResponse - | CloudTrailCancelQueryResponse - | CloudTrailListEventDataStoresResponse - | CloudTrailGetEventDataStoreResponse - | CloudTrailListTagsResponse -> = { +export const CloudTrailBlock: BlockConfig = { type: 'cloudtrail', name: 'CloudTrail', description: 'Audit who did what in AWS with CloudTrail event history and Lake queries', diff --git a/apps/sim/blocks/blocks/cloudwatch.ts b/apps/sim/blocks/blocks/cloudwatch.ts index b167d96cfab..71f50ab3985 100644 --- a/apps/sim/blocks/blocks/cloudwatch.ts +++ b/apps/sim/blocks/blocks/cloudwatch.ts @@ -1,21 +1,6 @@ import { CloudWatchIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { - CloudWatchDescribeAlarmHistoryResponse, - CloudWatchDescribeAlarmsResponse, - CloudWatchDescribeLogGroupsResponse, - CloudWatchDescribeLogStreamsResponse, - CloudWatchFilterLogEventsResponse, - CloudWatchGetLogEventsResponse, - CloudWatchGetMetricStatisticsResponse, - CloudWatchListMetricsResponse, - CloudWatchMuteAlarmResponse, - CloudWatchPutLogGroupRetentionResponse, - CloudWatchPutMetricDataResponse, - CloudWatchQueryLogsResponse, - CloudWatchUnmuteAlarmResponse, -} from '@/tools/cloudwatch/types' /* * Canonical basic/advanced pairs, shared by the card sentences below. Listing @@ -27,21 +12,7 @@ const LOG_GROUPS_FIELD = ['logGroupSelector', 'logGroupNamesInput'] as const const LOG_GROUP_FIELD = ['logGroupNameSelector', 'logGroupNameInput'] as const const LOG_STREAM_FIELD = ['logStreamNameSelector', 'logStreamNameInput'] as const -export const CloudWatchBlock: BlockConfig< - | CloudWatchQueryLogsResponse - | CloudWatchDescribeLogGroupsResponse - | CloudWatchDescribeLogStreamsResponse - | CloudWatchGetLogEventsResponse - | CloudWatchFilterLogEventsResponse - | CloudWatchDescribeAlarmsResponse - | CloudWatchDescribeAlarmHistoryResponse - | CloudWatchListMetricsResponse - | CloudWatchGetMetricStatisticsResponse - | CloudWatchPutMetricDataResponse - | CloudWatchMuteAlarmResponse - | CloudWatchUnmuteAlarmResponse - | CloudWatchPutLogGroupRetentionResponse -> = { +export const CloudWatchBlock: BlockConfig = { type: 'cloudwatch', name: 'CloudWatch', description: 'Query and monitor AWS CloudWatch logs, metrics, and alarms', diff --git a/apps/sim/blocks/blocks/coda.ts b/apps/sim/blocks/blocks/coda.ts index 2b57ba5fa2c..585c232fdaa 100644 --- a/apps/sim/blocks/blocks/coda.ts +++ b/apps/sim/blocks/blocks/coda.ts @@ -1,9 +1,6 @@ import { CodaIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { CodaResponse } from '@/tools/coda/types' -/** Canonical credential pair: the credential picker in basic mode, a raw credential id in advanced. */ -const CREDENTIAL_FIELD = ['credential', 'manualCredential'] const DOC_FIELD = ['docSelector', 'manualDocId'] const PAGE_FIELD = ['pageSelector', 'manualPageId'] const TABLE_FIELD = ['tableSelector', 'manualTableId'] @@ -160,7 +157,7 @@ const DATE_WAND = { generationType: 'timestamp', } as const -export const CodaBlock: BlockConfig = { +export const CodaBlock: BlockConfig = { type: 'coda', name: 'Coda', description: 'Read and write Coda docs, pages, tables, and rows', diff --git a/apps/sim/blocks/blocks/codepipeline.ts b/apps/sim/blocks/blocks/codepipeline.ts index 7611c690036..900a29222d5 100644 --- a/apps/sim/blocks/blocks/codepipeline.ts +++ b/apps/sim/blocks/blocks/codepipeline.ts @@ -6,35 +6,8 @@ import { parseOptionalJsonInput, parseOptionalNumberInput, } from '@/blocks/utils' -import type { - CodePipelineDisableStageTransitionResponse, - CodePipelineEnableStageTransitionResponse, - CodePipelineGetPipelineExecutionResponse, - CodePipelineGetPipelineResponse, - CodePipelineGetPipelineStateResponse, - CodePipelineListActionExecutionsResponse, - CodePipelineListPipelineExecutionsResponse, - CodePipelineListPipelinesResponse, - CodePipelinePutApprovalResultResponse, - CodePipelineRetryStageExecutionResponse, - CodePipelineStartExecutionResponse, - CodePipelineStopExecutionResponse, -} from '@/tools/codepipeline/types' -export const CodePipelineBlock: BlockConfig< - | CodePipelineListPipelinesResponse - | CodePipelineGetPipelineResponse - | CodePipelineGetPipelineStateResponse - | CodePipelineGetPipelineExecutionResponse - | CodePipelineListPipelineExecutionsResponse - | CodePipelineListActionExecutionsResponse - | CodePipelineStartExecutionResponse - | CodePipelineStopExecutionResponse - | CodePipelineRetryStageExecutionResponse - | CodePipelinePutApprovalResultResponse - | CodePipelineDisableStageTransitionResponse - | CodePipelineEnableStageTransitionResponse -> = { +export const CodePipelineBlock: BlockConfig = { type: 'codepipeline', name: 'CodePipeline', description: 'Run, monitor, and approve AWS CodePipeline pipelines', diff --git a/apps/sim/blocks/blocks/condition.ts b/apps/sim/blocks/blocks/condition.ts index f60134f44da..a9b180ef47f 100644 --- a/apps/sim/blocks/blocks/condition.ts +++ b/apps/sim/blocks/blocks/condition.ts @@ -1,20 +1,7 @@ import { ConditionalIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' -interface ConditionBlockOutput { - success: boolean - output: { - conditionResult: boolean - selectedPath: { - blockId: string - blockType: string - blockTitle: string - } - selectedOption: string - } -} - -export const ConditionBlock: BlockConfig = { +export const ConditionBlock: BlockConfig = { type: 'condition', name: 'Condition', description: 'Add a condition', diff --git a/apps/sim/blocks/blocks/confluence.ts b/apps/sim/blocks/blocks/confluence.ts index 1da1f491976..cd05514074f 100644 --- a/apps/sim/blocks/blocks/confluence.ts +++ b/apps/sim/blocks/blocks/confluence.ts @@ -4,7 +4,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { ConfluenceResponse } from '@/tools/confluence/types' import { getTrigger } from '@/triggers' /** Canonical basic/advanced pair for the page target, shared by both versions. */ @@ -22,7 +21,7 @@ const SPACE_KEY_FIELD = ['spaceKeySelector', 'manualSpaceKey'] as const /** Canonical upload/reference pair for an attachment's file. V2 only. */ const ATTACHMENT_FILE_FIELD = ['attachmentFileUpload', 'attachmentFileReference'] as const -export const ConfluenceBlock: BlockConfig = { +export const ConfluenceBlock: BlockConfig = { type: 'confluence', name: 'Confluence (Legacy)', description: 'Interact with Confluence', @@ -426,7 +425,7 @@ export const ConfluenceBlock: BlockConfig = { }, } -export const ConfluenceV2Block: BlockConfig = { +export const ConfluenceV2Block: BlockConfig = { ...ConfluenceBlock, sunset: undefined, type: 'confluence_v2', diff --git a/apps/sim/blocks/blocks/context_dev.ts b/apps/sim/blocks/blocks/context_dev.ts index 17af9633595..e0b2fa17cc7 100644 --- a/apps/sim/blocks/blocks/context_dev.ts +++ b/apps/sim/blocks/blocks/context_dev.ts @@ -1,7 +1,6 @@ import { ContextDevIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ContextDevScrapeMarkdownResponse } from '@/tools/context_dev/types' /** Operations whose primary input is a full page URL. */ const URL_OPS = [ @@ -73,7 +72,7 @@ function toStringArray(value: unknown): string[] | undefined { return undefined } -export const ContextDevBlock: BlockConfig = { +export const ContextDevBlock: BlockConfig = { type: 'context_dev', name: 'Context.dev', description: 'Scrape, crawl, search, extract, and enrich web and brand data', diff --git a/apps/sim/blocks/blocks/convex.ts b/apps/sim/blocks/blocks/convex.ts index 883f0c41f12..df89eb7b33a 100644 --- a/apps/sim/blocks/blocks/convex.ts +++ b/apps/sim/blocks/blocks/convex.ts @@ -1,6 +1,5 @@ import { ConvexIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ConvexResponse } from '@/tools/convex/types' /** * A List Documents page is resumed with either the page cursor or the snapshot @@ -8,7 +7,7 @@ import type { ConvexResponse } from '@/tools/convex/types' */ const PAGE_RESUME_FIELD = ['pageCursor', 'snapshot'] as const -export const ConvexBlock: BlockConfig = { +export const ConvexBlock: BlockConfig = { type: 'convex', name: 'Convex', description: 'Use Convex database', diff --git a/apps/sim/blocks/blocks/credential-group.ts b/apps/sim/blocks/blocks/credential-group.ts index ad9f45df962..8cc6ccbba70 100644 --- a/apps/sim/blocks/blocks/credential-group.ts +++ b/apps/sim/blocks/blocks/credential-group.ts @@ -3,49 +3,10 @@ import { CREDENTIAL_GROUP_EVENT_TRIGGER_ID } from '@/lib/credential-groups/trigg import type { BlockConfig } from '@/blocks/types' import { getTrigger } from '@/triggers' -interface CredentialGroupBlockOutput { - success: boolean - output: { - credentials: Array<{ - credentialId: string - email: string - displayName: string - providerId: string - providerSubjectId: string - providerTenantId: string | null - }> - mcpConnections: Array<{ - credentialId: string - email: string - displayName: string - mcpServerId: string - mcpServerName: string - toolNames: string[] - }> - people: Array<{ - id: string - email: string - status: string - expired: boolean - invitedAt: string - connections: Array<{ provider: string; status: string; count: number }> - }> - enrollmentId: string - email: string - status: string - invitedAt: string - expiresAt: string - invitationLink: string - count: number - hasMore: boolean - nextCursor: string | null - } -} - const INVITE_OPERATIONS = ['send_invite', 'get_invite_link'] as const const LIST_OPERATIONS = ['list_credentials', 'list_mcp_connections', 'list_people'] as const -export const CredentialGroupBlock: BlockConfig = { +export const CredentialGroupBlock: BlockConfig = { type: 'credential_group', name: 'Connected Accounts (Legacy)', hideFromToolbar: true, diff --git a/apps/sim/blocks/blocks/crowdstrike.ts b/apps/sim/blocks/blocks/crowdstrike.ts index 1f908d29025..95bc9f09a7b 100644 --- a/apps/sim/blocks/blocks/crowdstrike.ts +++ b/apps/sim/blocks/blocks/crowdstrike.ts @@ -6,7 +6,6 @@ import { parseOptionalJsonInput, parseOptionalNumberInput, } from '@/blocks/utils' -import type { CrowdStrikeResponse } from '@/tools/crowdstrike/types' /** * Maximum `limit` for each CrowdStrike query collection. Every entry except IOC @@ -92,7 +91,7 @@ const CLEARED_OPTIONAL_PARAMS: Record = Object.freeze({ vulnerabilityIds: undefined, }) -export const CrowdStrikeBlock: BlockConfig = { +export const CrowdStrikeBlock: BlockConfig = { type: 'crowdstrike', name: 'CrowdStrike', description: diff --git a/apps/sim/blocks/blocks/crunchbase.ts b/apps/sim/blocks/blocks/crunchbase.ts index bfa8143f6cb..eeee6a1eb91 100644 --- a/apps/sim/blocks/blocks/crunchbase.ts +++ b/apps/sim/blocks/blocks/crunchbase.ts @@ -2,7 +2,6 @@ import { Building, ListChecks, Search, Sprout, Trash, Users } from '@sim/emcn/ic import { CrunchbaseIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { CrunchbaseResponse } from '@/tools/crunchbase/types' import { CRUNCHBASE_CARD_COLLECTIONS, CRUNCHBASE_COLLECTIONS, @@ -78,7 +77,7 @@ Use field_ids belonging to the collection being searched — organizations suppo Return ONLY the JSON array.` -export const CrunchbaseBlock: BlockConfig = { +export const CrunchbaseBlock: BlockConfig = { type: 'crunchbase', name: 'Crunchbase', description: 'Search and look up companies, people, funding rounds, and acquisitions', diff --git a/apps/sim/blocks/blocks/cursor.ts b/apps/sim/blocks/blocks/cursor.ts index fca94300df6..82a11fb0f46 100644 --- a/apps/sim/blocks/blocks/cursor.ts +++ b/apps/sim/blocks/blocks/cursor.ts @@ -2,9 +2,8 @@ import { CursorIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector } from '@/blocks/utils' -import type { CursorResponse } from '@/tools/cursor/types' -export const CursorBlock: BlockConfig = { +export const CursorBlock: BlockConfig = { type: 'cursor', name: 'Cursor (Legacy)', description: 'Launch and manage Cursor cloud agents to work on GitHub repositories', @@ -258,7 +257,7 @@ export const CursorBlock: BlockConfig = { }, } -export const CursorV2Block: BlockConfig = { +export const CursorV2Block: BlockConfig = { ...CursorBlock, sunset: undefined, type: 'cursor_v2', diff --git a/apps/sim/blocks/blocks/dagster.ts b/apps/sim/blocks/blocks/dagster.ts index 7d1cd12e824..deb79ba2013 100644 --- a/apps/sim/blocks/blocks/dagster.ts +++ b/apps/sim/blocks/blocks/dagster.ts @@ -1,7 +1,6 @@ import { DagsterIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { DagsterResponse } from '@/tools/dagster/types' /** Coerces a subBlock value to a finite number, returning undefined for empty or non-numeric input. */ function toFiniteNumber(value: unknown): number | undefined { @@ -10,7 +9,7 @@ function toFiniteNumber(value: unknown): number | undefined { return Number.isFinite(parsed) ? parsed : undefined } -export const DagsterBlock: BlockConfig = { +export const DagsterBlock: BlockConfig = { type: 'dagster', name: 'Dagster', description: 'Orchestrate data pipelines and manage job runs with Dagster', diff --git a/apps/sim/blocks/blocks/databricks.ts b/apps/sim/blocks/blocks/databricks.ts index 70553226668..96c5c4501aa 100644 --- a/apps/sim/blocks/blocks/databricks.ts +++ b/apps/sim/blocks/blocks/databricks.ts @@ -1,7 +1,6 @@ import { DatabricksIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DatabricksResponse } from '@/tools/databricks/types' /** A run is parameterized either at the job level or per notebook, never both. */ const DATABRICKS_RUN_PARAMS_FIELD = ['jobParameters', 'notebookParams'] as const @@ -47,7 +46,7 @@ const GENIE_PAGED_OPERATIONS = [ 'genie_list_messages', ] -export const DatabricksBlock: BlockConfig = { +export const DatabricksBlock: BlockConfig = { type: 'databricks', name: 'Databricks', description: 'Run SQL, manage jobs, and ask Genie agents on Databricks', diff --git a/apps/sim/blocks/blocks/datadog.ts b/apps/sim/blocks/blocks/datadog.ts index 54500fd9160..d8a67885322 100644 --- a/apps/sim/blocks/blocks/datadog.ts +++ b/apps/sim/blocks/blocks/datadog.ts @@ -1,7 +1,6 @@ import { DatadogIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DatadogResponse } from '@/tools/datadog/types' /** * Normalizes a `switch` sub-block value. Switches serialize their state as the @@ -32,7 +31,7 @@ function datadogNumber(value: unknown): number | undefined { return Number.isFinite(parsed) ? parsed : undefined } -export const DatadogBlock: BlockConfig = { +export const DatadogBlock: BlockConfig = { type: 'datadog', name: 'Datadog', description: 'Monitor infrastructure, applications, and logs with Datadog', diff --git a/apps/sim/blocks/blocks/datagma.ts b/apps/sim/blocks/blocks/datagma.ts index a58afaa8c05..997919a6850 100644 --- a/apps/sim/blocks/blocks/datagma.ts +++ b/apps/sim/blocks/blocks/datagma.ts @@ -1,8 +1,7 @@ import { DatagmaIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { DatagmaResponse } from '@/tools/datagma/types' -export const DatagmaBlock: BlockConfig = { +export const DatagmaBlock: BlockConfig = { type: 'datagma', name: 'Datagma', description: 'Find verified B2B emails, mobile phones, and enrich person or company profiles', diff --git a/apps/sim/blocks/blocks/discord.ts b/apps/sim/blocks/blocks/discord.ts index a9d7d9b93fa..2139e6d0cdd 100644 --- a/apps/sim/blocks/blocks/discord.ts +++ b/apps/sim/blocks/blocks/discord.ts @@ -2,7 +2,6 @@ import { DiscordIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { DiscordResponse } from '@/tools/discord/types' /** * Canonical basic/advanced pair, shared by the card sentences below. Listing @@ -11,7 +10,7 @@ import type { DiscordResponse } from '@/tools/discord/types' */ const ATTACHMENTS_FIELD = ['attachmentFiles', 'files'] as const -export const DiscordBlock: BlockConfig = { +export const DiscordBlock: BlockConfig = { type: 'discord', name: 'Discord', description: 'Interact with Discord', diff --git a/apps/sim/blocks/blocks/docusign.ts b/apps/sim/blocks/blocks/docusign.ts index 0099731e421..1da535cd528 100644 --- a/apps/sim/blocks/blocks/docusign.ts +++ b/apps/sim/blocks/blocks/docusign.ts @@ -3,11 +3,10 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { DocuSignResponse } from '@/tools/docusign/types' const DOCUMENT_FIELD = ['uploadDocument', 'documentRef'] as const -export const DocuSignBlock: BlockConfig = { +export const DocuSignBlock: BlockConfig = { type: 'docusign', name: 'DocuSign', description: 'Send documents for e-signature via DocuSign', diff --git a/apps/sim/blocks/blocks/downdetector.ts b/apps/sim/blocks/blocks/downdetector.ts index 0a826fa4ccd..68a9f570ec1 100644 --- a/apps/sim/blocks/blocks/downdetector.ts +++ b/apps/sim/blocks/blocks/downdetector.ts @@ -1,7 +1,6 @@ import { DowndetectorIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DowndetectorResponse } from '@/tools/downdetector/types' const COMPANY_ID_OPERATIONS = [ 'downdetector_get_company', @@ -46,7 +45,7 @@ const PAGE_NUMBER_OPERATIONS = [ 'downdetector_list_incidents', ] -export const DowndetectorBlock: BlockConfig = { +export const DowndetectorBlock: BlockConfig = { type: 'downdetector', name: 'Downdetector', description: 'Monitor outages and service status with Downdetector', diff --git a/apps/sim/blocks/blocks/dropbox.ts b/apps/sim/blocks/blocks/dropbox.ts index 6f85ed4ea4f..7cb7943cca7 100644 --- a/apps/sim/blocks/blocks/dropbox.ts +++ b/apps/sim/blocks/blocks/dropbox.ts @@ -4,7 +4,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { DropboxResponse } from '@/tools/dropbox/types' /* * Canonical basic/advanced pair for the upload source, shared by the card @@ -516,7 +515,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, links: { type: 'json', description: 'List of shared links (url, name, path_lower, expires)' }, isDeleted: { type: 'boolean', description: 'Whether the latest revision is deleted or moved' }, }, -} satisfies BlockConfig +} satisfies BlockConfig export const DropboxV2Block: BlockConfig = { ...DropboxBlock, diff --git a/apps/sim/blocks/blocks/dropcontact.ts b/apps/sim/blocks/blocks/dropcontact.ts index e1cd61c7821..eea3089d444 100644 --- a/apps/sim/blocks/blocks/dropcontact.ts +++ b/apps/sim/blocks/blocks/dropcontact.ts @@ -1,6 +1,5 @@ import { DropcontactIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { DropcontactResponse } from '@/tools/dropcontact/types' /** Whichever identifier the user supplied for the person being enriched. */ const CONTACT_IDENTITY_FIELD = ['email', 'linkedin', 'full_name', 'first_name'] as const @@ -8,7 +7,7 @@ const CONTACT_IDENTITY_FIELD = ['email', 'linkedin', 'full_name', 'first_name'] /** Whichever identifier the user supplied for the person's employer. */ const CONTACT_COMPANY_FIELD = ['company', 'website'] as const -export const DropcontactBlock: BlockConfig = { +export const DropcontactBlock: BlockConfig = { type: 'dropcontact', name: 'Dropcontact', description: 'Enrich B2B contacts with verified email, phone, and company data', diff --git a/apps/sim/blocks/blocks/dub.ts b/apps/sim/blocks/blocks/dub.ts index 3361f171254..d264139c02c 100644 --- a/apps/sim/blocks/blocks/dub.ts +++ b/apps/sim/blocks/blocks/dub.ts @@ -2,7 +2,6 @@ import { omit } from '@sim/utils/object' import { DubIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DubResponse } from '@/tools/dub/types' const GET_LINK_FIELD = ['linkId', 'getLinkExternalId', 'getLinkKey'] as const const BULK_UPDATE_TARGET_FIELD = ['bulkUpdateLinkIds', 'bulkUpdateExternalIds'] as const @@ -1280,7 +1279,7 @@ export const DubBlock = { condition: { field: 'operation', value: 'create_tag' }, }, }, -} satisfies BlockConfig +} satisfies BlockConfig export const DubV2Block: BlockConfig = { ...DubBlock, diff --git a/apps/sim/blocks/blocks/duckduckgo.ts b/apps/sim/blocks/blocks/duckduckgo.ts index 21c87165fe8..a4ca318f824 100644 --- a/apps/sim/blocks/blocks/duckduckgo.ts +++ b/apps/sim/blocks/blocks/duckduckgo.ts @@ -1,9 +1,8 @@ import { DuckDuckGoIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { DuckDuckGoResponse } from '@/tools/duckduckgo/types' -export const DuckDuckGoBlock: BlockConfig = { +export const DuckDuckGoBlock: BlockConfig = { type: 'duckduckgo', name: 'DuckDuckGo', description: 'Search with DuckDuckGo', diff --git a/apps/sim/blocks/blocks/dynamodb.ts b/apps/sim/blocks/blocks/dynamodb.ts index 8635fbfac79..3c5b67df304 100644 --- a/apps/sim/blocks/blocks/dynamodb.ts +++ b/apps/sim/blocks/blocks/dynamodb.ts @@ -2,9 +2,8 @@ import { toError } from '@sim/utils/errors' import { DynamoDBIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DynamoDBIntrospectResponse, DynamoDBResponse } from '@/tools/dynamodb/types' -export const DynamoDBBlock: BlockConfig = { +export const DynamoDBBlock: BlockConfig = { type: 'dynamodb', name: 'Amazon DynamoDB', description: 'Get, put, query, scan, update, and delete items in Amazon DynamoDB tables', diff --git a/apps/sim/blocks/blocks/dynatrace.ts b/apps/sim/blocks/blocks/dynatrace.ts index e6e14e42809..61b74c9d7ff 100644 --- a/apps/sim/blocks/blocks/dynatrace.ts +++ b/apps/sim/blocks/blocks/dynatrace.ts @@ -1,7 +1,6 @@ import { DynatraceIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { DynatraceResponse } from '@/tools/dynatrace/types' /** Operations that accept the shared `from` timeframe parameter. */ const FROM_OPERATIONS = [ @@ -110,7 +109,7 @@ const SETTINGS_OBJECT_ID_OPERATIONS = [ 'dynatrace_delete_settings_object', ] -export const DynatraceBlock: BlockConfig = { +export const DynatraceBlock: BlockConfig = { type: 'dynatrace', name: 'Dynatrace', description: 'Manage Dynatrace problems, metrics, entities, logs, SLOs, settings, and security', diff --git a/apps/sim/blocks/blocks/elasticsearch.ts b/apps/sim/blocks/blocks/elasticsearch.ts index bee72218d50..944b6c05225 100644 --- a/apps/sim/blocks/blocks/elasticsearch.ts +++ b/apps/sim/blocks/blocks/elasticsearch.ts @@ -1,9 +1,8 @@ import { ElasticsearchIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ElasticsearchResponse } from '@/tools/elasticsearch/types' -export const ElasticsearchBlock: BlockConfig = { +export const ElasticsearchBlock: BlockConfig = { type: 'elasticsearch', name: 'Elasticsearch', description: 'Search, index, and manage data in Elasticsearch', diff --git a/apps/sim/blocks/blocks/elevenlabs.ts b/apps/sim/blocks/blocks/elevenlabs.ts index 282ddf75222..a9b729ae8b4 100644 --- a/apps/sim/blocks/blocks/elevenlabs.ts +++ b/apps/sim/blocks/blocks/elevenlabs.ts @@ -1,7 +1,6 @@ import { ElevenLabsIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { ElevenLabsBlockResponse } from '@/tools/elevenlabs/types' const VOICE_OPERATIONS = [ 'tts', @@ -27,7 +26,7 @@ const toBoolean = (value: unknown): boolean | undefined => { return String(value).toLowerCase() === 'true' } -export const ElevenLabsBlock: BlockConfig = { +export const ElevenLabsBlock: BlockConfig = { type: 'elevenlabs', name: 'ElevenLabs', description: 'Generate and transform audio with ElevenLabs', diff --git a/apps/sim/blocks/blocks/emailbison.ts b/apps/sim/blocks/blocks/emailbison.ts index 7b4e9a6272a..bccb3217512 100644 --- a/apps/sim/blocks/blocks/emailbison.ts +++ b/apps/sim/blocks/blocks/emailbison.ts @@ -1,7 +1,6 @@ import { EmailBisonIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { EmailBisonResponse } from '@/tools/emailbison/types' import { getTrigger } from '@/triggers' const LEAD_MUTATION_OPERATIONS = ['create_lead', 'update_lead'] as const @@ -33,7 +32,7 @@ const EMAILBISON_TRIGGER_IDS = [ 'emailbison_warmup_disabled_causing_bounces', ] as const -export const EmailBisonBlock: BlockConfig = { +export const EmailBisonBlock: BlockConfig = { type: 'emailbison', name: 'Email Bison', description: 'Manage Email Bison leads, campaigns, replies, and tags', diff --git a/apps/sim/blocks/blocks/embeddings.ts b/apps/sim/blocks/blocks/embeddings.ts index c058614e434..a4e1b91e3e3 100644 --- a/apps/sim/blocks/blocks/embeddings.ts +++ b/apps/sim/blocks/blocks/embeddings.ts @@ -18,7 +18,6 @@ import { import type { EmbeddingTaskType } from '@/lib/embeddings/types' import type { BlockConfig, BlockMeta, SubBlockConfig } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { EmbeddingsResponse } from '@/tools/embeddings/types' export const EMBEDDING_BLOCK_PROVIDERS = [ ...EMBEDDING_CATALOG_PROVIDERS, @@ -159,7 +158,7 @@ const CAPABILITY_SUB_BLOCKS: SubBlockConfig[] = Object.entries(EMBEDDING_MODELS) } ) -export const EmbeddingsBlock: BlockConfig = { +export const EmbeddingsBlock: BlockConfig = { type: 'embeddings', name: 'Embeddings', description: 'Generate embeddings', diff --git a/apps/sim/blocks/blocks/enrichment.ts b/apps/sim/blocks/blocks/enrichment.ts index f49929a6102..14e6f4f207d 100644 --- a/apps/sim/blocks/blocks/enrichment.ts +++ b/apps/sim/blocks/blocks/enrichment.ts @@ -4,7 +4,6 @@ import { IntegrationType } from '@/blocks/types' import { ALL_ENRICHMENTS, getEnrichment } from '@/enrichments' import { mapFieldType } from '@/enrichments/providers' import type { EnrichmentOutputField } from '@/enrichments/types' -import type { EnrichmentRunResponse } from '@/tools/enrichment/types' /** Stable subBlock id for an enrichment input (unique across enrichments). */ const inputFieldId = (enrichmentId: string, inputId: string) => `${enrichmentId}__${inputId}` @@ -70,7 +69,7 @@ blockOutputs.provider = { * from the enrichment registry, so new enrichments appear automatically. Runs * on the workspace's hosted / BYOK key (injected server-side); no credential. */ -export const EnrichmentBlock: BlockConfig = { +export const EnrichmentBlock: BlockConfig = { type: 'enrichment', name: 'Data Enrichment', description: 'Enrich data with a Sim enrichment', diff --git a/apps/sim/blocks/blocks/enrow.ts b/apps/sim/blocks/blocks/enrow.ts index 0918c8c6378..089eeffb6c2 100644 --- a/apps/sim/blocks/blocks/enrow.ts +++ b/apps/sim/blocks/blocks/enrow.ts @@ -1,8 +1,7 @@ import { EnrowIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { EnrowResponse } from '@/tools/enrow/types' -export const EnrowBlock: BlockConfig = { +export const EnrowBlock: BlockConfig = { type: 'enrow', name: 'Enrow', description: 'Find and verify B2B emails with triple-verified accuracy', diff --git a/apps/sim/blocks/blocks/evaluator.ts b/apps/sim/blocks/blocks/evaluator.ts index 0d04defb16b..ef6d44737c1 100644 --- a/apps/sim/blocks/blocks/evaluator.ts +++ b/apps/sim/blocks/blocks/evaluator.ts @@ -8,7 +8,6 @@ import { getSerializedModelProviderId, PROVIDER_CREDENTIAL_INPUTS, } from '@/blocks/utils' -import type { ToolResponse } from '@/tools/types' const logger = createLogger('EvaluatorBlock') @@ -21,24 +20,6 @@ interface Metric { } } -interface EvaluatorResponse extends ToolResponse { - output: { - content: string - model: string - tokens?: { - prompt?: number - completion?: number - total?: number - } - cost?: { - input: number - output: number - total: number - } - [metricName: string]: any // Allow dynamic metric fields - } -} - export const generateEvaluatorPrompt = (metrics: Metric[], content: string): string => { // Filter out invalid/incomplete metrics first const validMetrics = metrics.filter((m) => m?.name && m.range) @@ -147,7 +128,7 @@ const generateResponseFormat = (metrics: Metric[]) => { } } -export const EvaluatorBlock: BlockConfig = { +export const EvaluatorBlock: BlockConfig = { type: 'evaluator', name: 'Evaluator', description: 'Evaluate content', diff --git a/apps/sim/blocks/blocks/exa.ts b/apps/sim/blocks/blocks/exa.ts index e7ae7da3498..ff4e06337d8 100644 --- a/apps/sim/blocks/blocks/exa.ts +++ b/apps/sim/blocks/blocks/exa.ts @@ -1,7 +1,6 @@ import { ExaAIIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ExaResponse } from '@/tools/exa/types' /** Categories Exa currently supports. Shared by Search and Find Similar Links. */ const CATEGORY_OPTIONS = [ @@ -35,7 +34,7 @@ const RESEARCH_MODEL_TO_EFFORT: Record = { 'exa-research-pro': 'high', } -export const ExaBlock: BlockConfig = { +export const ExaBlock: BlockConfig = { type: 'exa', name: 'Exa', description: 'Search with Exa AI', diff --git a/apps/sim/blocks/blocks/extend.ts b/apps/sim/blocks/blocks/extend.ts index 699bb843034..54f872a876e 100644 --- a/apps/sim/blocks/blocks/extend.ts +++ b/apps/sim/blocks/blocks/extend.ts @@ -7,12 +7,11 @@ import { type SubBlockType, } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { ExtendParserOutput } from '@/tools/extend/types' const EXTEND_DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const const EXTEND_V2_FILE_FIELD = ['fileUpload', 'fileReference'] as const -export const ExtendBlock: BlockConfig = { +export const ExtendBlock: BlockConfig = { type: 'extend', name: 'Extend', description: 'Parse and extract content from documents', @@ -176,7 +175,7 @@ const extendV2SubBlocks = (ExtendBlock.subBlocks || []).flatMap((subBlock) => { return [subBlock] }) -export const ExtendV2Block: BlockConfig = { +export const ExtendV2Block: BlockConfig = { ...ExtendBlock, sunset: undefined, type: 'extend_v2', diff --git a/apps/sim/blocks/blocks/fathom.ts b/apps/sim/blocks/blocks/fathom.ts index b5e20d85d87..cfc87c8d26b 100644 --- a/apps/sim/blocks/blocks/fathom.ts +++ b/apps/sim/blocks/blocks/fathom.ts @@ -1,10 +1,9 @@ import { FathomIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { FathomResponse } from '@/tools/fathom/types' import { getTrigger } from '@/triggers' import { fathomTriggerOptions } from '@/triggers/fathom/utils' -export const FathomBlock: BlockConfig = { +export const FathomBlock: BlockConfig = { type: 'fathom', name: 'Fathom', description: 'Access meeting recordings, transcripts, and summaries', diff --git a/apps/sim/blocks/blocks/file.ts b/apps/sim/blocks/blocks/file.ts index 1bed85d5b5b..49f40d20e7c 100644 --- a/apps/sim/blocks/blocks/file.ts +++ b/apps/sim/blocks/blocks/file.ts @@ -15,7 +15,6 @@ import { normalizeFileInput, parseOptionalNumberInput, } from '@/blocks/utils' -import type { FileParserOutput, FileParserV3Output } from '@/tools/file/types' const logger = createLogger('FileBlock') @@ -296,7 +295,7 @@ function folderScopePaths(value: unknown): string[] | undefined { return paths.length > 0 ? paths : undefined } -export const FileBlock: BlockConfig = { +export const FileBlock: BlockConfig = { type: 'file', name: 'File (Legacy)', description: 'Read and parse multiple files', @@ -421,7 +420,7 @@ export const FileBlock: BlockConfig = { }, } -export const FileV2Block: BlockConfig = { +export const FileV2Block: BlockConfig = { ...FileBlock, type: 'file_v2', name: 'File (Legacy)', @@ -518,7 +517,7 @@ export const FileV2Block: BlockConfig = { }, } -export const FileV3Block: BlockConfig = { +export const FileV3Block: BlockConfig = { type: 'file_v3', name: 'File', description: 'Read and write workspace files', @@ -830,7 +829,7 @@ const parseReadFileIds = (input: unknown): string | string[] | null => { return null } -export const FileV4Block: BlockConfig = { +export const FileV4Block: BlockConfig = { ...FileV3Block, type: 'file_v4', name: 'File (Legacy)', @@ -1105,7 +1104,7 @@ export const FileV4Block: BlockConfig = { }, } -export const FileV5Block: BlockConfig = { +export const FileV5Block: BlockConfig = { ...FileV4Block, sunset: undefined, type: 'file_v5', diff --git a/apps/sim/blocks/blocks/findymail.ts b/apps/sim/blocks/blocks/findymail.ts index 14da8c4ebf2..20b363aa1f2 100644 --- a/apps/sim/blocks/blocks/findymail.ts +++ b/apps/sim/blocks/blocks/findymail.ts @@ -1,10 +1,9 @@ import { FindymailIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { FindymailResponse } from '@/tools/findymail/types' const COMPANY_LOOKUP_FIELD = ['gc_domain', 'gc_name', 'gc_linkedin_url'] as const -export const FindymailBlock: BlockConfig = { +export const FindymailBlock: BlockConfig = { type: 'findymail', name: 'Findymail', description: 'Find and verify B2B emails, phones, employees, and company data', diff --git a/apps/sim/blocks/blocks/firecrawl.ts b/apps/sim/blocks/blocks/firecrawl.ts index e7a93b22314..261c414c432 100644 --- a/apps/sim/blocks/blocks/firecrawl.ts +++ b/apps/sim/blocks/blocks/firecrawl.ts @@ -2,12 +2,11 @@ import { FirecrawlIcon } from '@/components/icons' import type { BlockConfig, BlockMeta, SubBlockType } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { FirecrawlResponse } from '@/tools/firecrawl/types' /** The document being parsed, whether it was uploaded or passed in by reference. */ const DOCUMENT_FIELD = ['fileUpload', 'fileReference'] as const -export const FirecrawlBlock: BlockConfig = { +export const FirecrawlBlock: BlockConfig = { type: 'firecrawl', name: 'Firecrawl', description: 'Scrape, search, crawl, map, and extract web data', diff --git a/apps/sim/blocks/blocks/fireflies.ts b/apps/sim/blocks/blocks/fireflies.ts index b9bc472650b..d40f3c1520f 100644 --- a/apps/sim/blocks/blocks/fireflies.ts +++ b/apps/sim/blocks/blocks/fireflies.ts @@ -4,12 +4,11 @@ import { resolveHttpsUrlFromFileInput } from '@/lib/uploads/utils/file-utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { FirefliesResponse } from '@/tools/fireflies/types' import { getTrigger } from '@/triggers' const AUDIO_FILE_FIELD = ['audioFile', 'audioFileReference'] as const -export const FirefliesBlock: BlockConfig = { +export const FirefliesBlock: BlockConfig = { type: 'fireflies', name: 'Fireflies (Legacy)', description: 'Interact with Fireflies.ai meeting transcripts and recordings', @@ -701,7 +700,7 @@ const firefliesV2SubBlocks = (FirefliesBlock.subBlocks || []).filter( ) const firefliesV2Inputs = FirefliesBlock.inputs ? omit(FirefliesBlock.inputs, ['audioUrl']) : {} -export const FirefliesV2Block: BlockConfig = { +export const FirefliesV2Block: BlockConfig = { ...FirefliesBlock, sunset: undefined, type: 'fireflies_v2', diff --git a/apps/sim/blocks/blocks/function.ts b/apps/sim/blocks/blocks/function.ts index 36c3e9319ad..d15fe635fae 100644 --- a/apps/sim/blocks/blocks/function.ts +++ b/apps/sim/blocks/blocks/function.ts @@ -3,9 +3,8 @@ import { getDeploymentShape } from '@/lib/core/config/deployment-shape' import { CodeLanguage, getLanguageDisplayName } from '@/lib/execution/languages' import { SANDBOX_OUTPUT_DIR } from '@/lib/execution/remote-sandbox/sandbox-paths' import type { BlockConfig } from '@/blocks/types' -import type { CodeExecutionOutput } from '@/tools/function/types' -export const FunctionBlock: BlockConfig = { +export const FunctionBlock: BlockConfig = { type: 'function', name: 'Function', description: 'Run custom logic', diff --git a/apps/sim/blocks/blocks/gamma.ts b/apps/sim/blocks/blocks/gamma.ts index 479b7abbbe2..c21a8bef834 100644 --- a/apps/sim/blocks/blocks/gamma.ts +++ b/apps/sim/blocks/blocks/gamma.ts @@ -1,8 +1,7 @@ import { GammaIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { GammaResponse } from '@/tools/gamma/types' -export const GammaBlock: BlockConfig = { +export const GammaBlock: BlockConfig = { type: 'gamma', name: 'Gamma', description: 'Generate presentations, documents, and webpages with AI', diff --git a/apps/sim/blocks/blocks/github.ts b/apps/sim/blocks/blocks/github.ts index a3eca3978b2..ea04be4e541 100644 --- a/apps/sim/blocks/blocks/github.ts +++ b/apps/sim/blocks/blocks/github.ts @@ -3,7 +3,6 @@ import { GithubIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector } from '@/blocks/utils' -import type { GitHubResponse } from '@/tools/github/types' import { getTrigger } from '@/triggers' /** Reviewers can be named individually or by team slug; either identifies the request. */ @@ -47,7 +46,7 @@ const GITHUB_PARAM_ALIASES: ReadonlyArray<{ { from: 'gist_public', to: 'public', operations: ['github_create_gist'], toBoolean: true }, ] -export const GitHubBlock: BlockConfig = { +export const GitHubBlock: BlockConfig = { type: 'github', name: 'GitHub (Legacy)', description: 'Interact with GitHub or trigger workflows from GitHub events', @@ -2435,7 +2434,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, } -export const GitHubV2Block: BlockConfig = { +export const GitHubV2Block: BlockConfig = { ...GitHubBlock, sunset: undefined, type: 'github_v2', diff --git a/apps/sim/blocks/blocks/gitlab.ts b/apps/sim/blocks/blocks/gitlab.ts index bcb108281d7..3bb8e066500 100644 --- a/apps/sim/blocks/blocks/gitlab.ts +++ b/apps/sim/blocks/blocks/gitlab.ts @@ -1,7 +1,6 @@ import { GitLabIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { GitLabResponse } from '@/tools/gitlab/types' import { coerceGitLabAccessLevel, GITLAB_ACCESS_LEVEL_OPTIONS, @@ -130,7 +129,7 @@ function parseTriState(raw: unknown): boolean | undefined { return undefined } -export const GitLabBlock: BlockConfig = { +export const GitLabBlock: BlockConfig = { type: 'gitlab', name: 'GitLab', description: 'Interact with GitLab projects, issues, merge requests, and pipelines', diff --git a/apps/sim/blocks/blocks/gmail.ts b/apps/sim/blocks/blocks/gmail.ts index f2cb348a157..992d97fd290 100644 --- a/apps/sim/blocks/blocks/gmail.ts +++ b/apps/sim/blocks/blocks/gmail.ts @@ -8,7 +8,6 @@ import { normalizeFileInput, SERVICE_ACCOUNT_SUBBLOCKS, } from '@/blocks/utils' -import type { GmailToolResponse } from '@/tools/gmail/types' import { getTrigger } from '@/triggers' function selectGmailToolId(params: Record): string { @@ -55,7 +54,7 @@ const DESTINATION_LABEL_FIELD = ['destinationLabel', 'manualDestinationLabel'] a const SOURCE_LABEL_FIELD = ['sourceLabel', 'manualSourceLabel'] as const const MANAGE_LABEL_FIELD = ['labelSelector', 'manualLabelId'] as const -export const GmailBlock: BlockConfig = { +export const GmailBlock: BlockConfig = { type: 'gmail', name: 'Gmail (Legacy)', description: 'Send, read, search, and move Gmail messages or trigger workflows from Gmail events', @@ -656,7 +655,7 @@ Return ONLY the search query - no explanations, no extra text.`, }, } -export const GmailV2Block: BlockConfig = { +export const GmailV2Block: BlockConfig = { ...GmailBlock, sunset: undefined, type: 'gmail_v2', diff --git a/apps/sim/blocks/blocks/gong.ts b/apps/sim/blocks/blocks/gong.ts index f57f91fc592..6b074390015 100644 --- a/apps/sim/blocks/blocks/gong.ts +++ b/apps/sim/blocks/blocks/gong.ts @@ -1,9 +1,8 @@ import { GongIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { GongResponse } from '@/tools/gong/types' import { getTrigger } from '@/triggers' -export const GongBlock: BlockConfig = { +export const GongBlock: BlockConfig = { type: 'gong', name: 'Gong', description: 'Revenue intelligence and conversation analytics', diff --git a/apps/sim/blocks/blocks/google.ts b/apps/sim/blocks/blocks/google.ts index c76260b1b4a..936c7e00eb2 100644 --- a/apps/sim/blocks/blocks/google.ts +++ b/apps/sim/blocks/blocks/google.ts @@ -1,9 +1,8 @@ import { GoogleIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { GoogleSearchResponse } from '@/tools/google/types' -export const GoogleSearchBlock: BlockConfig = { +export const GoogleSearchBlock: BlockConfig = { type: 'google_search', name: 'Google Search', description: 'Search the web', diff --git a/apps/sim/blocks/blocks/google_appsheet.ts b/apps/sim/blocks/blocks/google_appsheet.ts index 85413e37b01..9ae908789d2 100644 --- a/apps/sim/blocks/blocks/google_appsheet.ts +++ b/apps/sim/blocks/blocks/google_appsheet.ts @@ -1,9 +1,8 @@ import { GoogleAppsheetIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { GoogleAppsheetResponse } from '@/tools/google_appsheet/types' -export const GoogleAppsheetBlock: BlockConfig = { +export const GoogleAppsheetBlock: BlockConfig = { type: 'google_appsheet', name: 'Google AppSheet', description: 'Read, add, edit, and delete rows in a Google AppSheet table', diff --git a/apps/sim/blocks/blocks/google_calendar.ts b/apps/sim/blocks/blocks/google_calendar.ts index cda23a0ecd7..320013283c1 100644 --- a/apps/sim/blocks/blocks/google_calendar.ts +++ b/apps/sim/blocks/blocks/google_calendar.ts @@ -3,13 +3,12 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleCalendarResponse } from '@/tools/google_calendar/types' import { getTrigger } from '@/triggers' const CALENDAR_FIELD = ['calendarId', 'manualCalendarId'] as const const DESTINATION_CALENDAR_FIELD = ['destinationCalendar', 'manualDestinationCalendarId'] as const -export const GoogleCalendarBlock: BlockConfig = { +export const GoogleCalendarBlock: BlockConfig = { type: 'google_calendar', name: 'Google Calendar (Legacy)', description: 'Manage Google Calendar events', @@ -1064,7 +1063,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, } -export const GoogleCalendarV2Block: BlockConfig = { +export const GoogleCalendarV2Block: BlockConfig = { ...GoogleCalendarBlock, sunset: undefined, type: 'google_calendar_v2', diff --git a/apps/sim/blocks/blocks/google_contacts.ts b/apps/sim/blocks/blocks/google_contacts.ts index 05f7d897d37..3b1816a5cc5 100644 --- a/apps/sim/blocks/blocks/google_contacts.ts +++ b/apps/sim/blocks/blocks/google_contacts.ts @@ -3,9 +3,8 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleContactsResponse } from '@/tools/google_contacts/types' -export const GoogleContactsBlock: BlockConfig = { +export const GoogleContactsBlock: BlockConfig = { type: 'google_contacts', name: 'Google Contacts', description: 'Manage Google Contacts', diff --git a/apps/sim/blocks/blocks/google_docs.ts b/apps/sim/blocks/blocks/google_docs.ts index 217712b77f8..bf78c1957f5 100644 --- a/apps/sim/blocks/blocks/google_docs.ts +++ b/apps/sim/blocks/blocks/google_docs.ts @@ -3,13 +3,12 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleDocsResponse } from '@/tools/google_docs/types' const DOCUMENT_FIELD = ['documentId', 'manualDocumentId'] as const const FOLDER_FIELD = ['folderSelector', 'folderId'] as const const NAMED_RANGE_FIELD = ['namedRangeId', 'namedRangeName'] as const -export const GoogleDocsBlock: BlockConfig = { +export const GoogleDocsBlock: BlockConfig = { type: 'google_docs', name: 'Google Docs', description: 'Read, write, create, and edit documents', diff --git a/apps/sim/blocks/blocks/google_drive.test.ts b/apps/sim/blocks/blocks/google_drive.test.ts index ce64dd557b6..b3b10a362e7 100644 --- a/apps/sim/blocks/blocks/google_drive.test.ts +++ b/apps/sim/blocks/blocks/google_drive.test.ts @@ -4,24 +4,19 @@ import { describe, expect, it, vi } from 'vitest' vi.mock('@/triggers', () => triggersMock) import { GoogleDriveBlock } from '@/blocks/blocks/google_drive' -import { listTool } from '@/tools/google_drive/list' -import { listCommentsTool } from '@/tools/google_drive/list_comments' -import { listPermissionsTool } from '@/tools/google_drive/list_permissions' -import { listRevisionsTool } from '@/tools/google_drive/list_revisions' -import { searchTool } from '@/tools/google_drive/search' const paginationCases = [ - { operation: 'list', subBlockId: 'pageToken', tool: listTool }, - { operation: 'search', subBlockId: 'searchPageToken', tool: searchTool }, - { operation: 'list_permissions', subBlockId: 'permissionsPageToken', tool: listPermissionsTool }, - { operation: 'list_revisions', subBlockId: 'revisionsPageToken', tool: listRevisionsTool }, - { operation: 'list_comments', subBlockId: 'commentsPageToken', tool: listCommentsTool }, + { operation: 'list', subBlockId: 'pageToken' }, + { operation: 'search', subBlockId: 'searchPageToken' }, + { operation: 'list_permissions', subBlockId: 'permissionsPageToken' }, + { operation: 'list_revisions', subBlockId: 'revisionsPageToken' }, + { operation: 'list_comments', subBlockId: 'commentsPageToken' }, ] as const describe('GoogleDriveBlock pagination', () => { const buildParams = GoogleDriveBlock.tools.config.params! - describe.each(paginationCases)('$operation', ({ operation, subBlockId, tool }) => { + describe.each(paginationCases)('$operation', ({ operation, subBlockId }) => { /** * `pageToken` is the canonical tool param, so the `list` case would forward * through `...rest` even without the mapper. The per-operation ids are the diff --git a/apps/sim/blocks/blocks/google_drive.ts b/apps/sim/blocks/blocks/google_drive.ts index 9d165ef73f9..dac6e27d640 100644 --- a/apps/sim/blocks/blocks/google_drive.ts +++ b/apps/sim/blocks/blocks/google_drive.ts @@ -4,7 +4,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput, SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleDriveResponse } from '@/tools/google_drive/types' import { getTrigger } from '@/triggers' /** @@ -17,7 +16,7 @@ const UPLOAD_FOLDER_FIELD = ['uploadFolderSelector', 'uploadManualFolderId'] as /** The folder the poller watches — the trigger's own canonical pair. */ const TRIGGER_FOLDER_FIELD = ['folderId', 'manualFolderId'] as const -export const GoogleDriveBlock: BlockConfig = { +export const GoogleDriveBlock: BlockConfig = { type: 'google_drive', name: 'Google Drive', description: 'Manage files, folders, and permissions', diff --git a/apps/sim/blocks/blocks/google_meet.ts b/apps/sim/blocks/blocks/google_meet.ts index e8f2063317f..b544caf0759 100644 --- a/apps/sim/blocks/blocks/google_meet.ts +++ b/apps/sim/blocks/blocks/google_meet.ts @@ -3,9 +3,8 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleMeetResponse } from '@/tools/google_meet/types' -export const GoogleMeetBlock: BlockConfig = { +export const GoogleMeetBlock: BlockConfig = { type: 'google_meet', name: 'Google Meet', description: 'Create and manage Google Meet meetings', diff --git a/apps/sim/blocks/blocks/google_pagespeed.ts b/apps/sim/blocks/blocks/google_pagespeed.ts index ee9ecb43d70..990d48d49e6 100644 --- a/apps/sim/blocks/blocks/google_pagespeed.ts +++ b/apps/sim/blocks/blocks/google_pagespeed.ts @@ -1,8 +1,7 @@ import { GooglePagespeedIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { GooglePagespeedAnalyzeResponse } from '@/tools/google_pagespeed/types' -export const GooglePagespeedBlock: BlockConfig = { +export const GooglePagespeedBlock: BlockConfig = { type: 'google_pagespeed', name: 'Google PageSpeed', description: 'Analyze webpage performance with Google PageSpeed Insights', diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index 494828e61d0..0620b6601ad 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleSheetsResponse, GoogleSheetsV2Response } from '@/tools/google_sheets/types' import { getTrigger } from '@/triggers' /** @@ -16,7 +15,7 @@ const SPREADSHEET_FIELD = ['spreadsheetId', 'manualSpreadsheetId'] as const /** Canonical basic/advanced pair for the sheet tab, on the v2 block only. */ const SHEET_FIELD = ['sheetName', 'manualSheetName'] as const -export const GoogleSheetsBlock: BlockConfig = { +export const GoogleSheetsBlock: BlockConfig = { type: 'google_sheets', name: 'Google Sheets (Legacy)', description: 'Read, write, and update data', @@ -320,7 +319,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, }, } -export const GoogleSheetsV2Block: BlockConfig = { +export const GoogleSheetsV2Block: BlockConfig = { type: 'google_sheets_v2', name: 'Google Sheets', description: 'Read, write, and update data with sheet selection', diff --git a/apps/sim/blocks/blocks/google_slides.ts b/apps/sim/blocks/blocks/google_slides.ts index cae504e7f18..273785c09bb 100644 --- a/apps/sim/blocks/blocks/google_slides.ts +++ b/apps/sim/blocks/blocks/google_slides.ts @@ -4,7 +4,6 @@ import { resolveHttpsUrlFromFileInput } from '@/lib/uploads/utils/file-utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput, SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleSlidesResponse } from '@/tools/google_slides/types' const PRESENTATION_FIELD = ['presentationId', 'manualPresentationId'] as const const SOURCE_PRESENTATION_FIELD = [ @@ -14,7 +13,7 @@ const SOURCE_PRESENTATION_FIELD = [ const NEW_PRESENTATION_FOLDER_FIELD = ['folderSelector', 'folderId'] as const const COPY_FOLDER_FIELD = ['copyFolderSelector', 'manualCopyFolderId'] as const -export const GoogleSlidesBlock: BlockConfig = { +export const GoogleSlidesBlock: BlockConfig = { type: 'google_slides', name: 'Google Slides (Legacy)', description: 'Read, write, and create presentations', @@ -3560,7 +3559,7 @@ const googleSlidesV2Inputs = GoogleSlidesBlock.inputs } : {} -export const GoogleSlidesV2Block: BlockConfig = { +export const GoogleSlidesV2Block: BlockConfig = { ...GoogleSlidesBlock, sunset: undefined, type: 'google_slides_v2', diff --git a/apps/sim/blocks/blocks/google_tasks.ts b/apps/sim/blocks/blocks/google_tasks.ts index afda850268e..5f5475bbf65 100644 --- a/apps/sim/blocks/blocks/google_tasks.ts +++ b/apps/sim/blocks/blocks/google_tasks.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { SERVICE_ACCOUNT_SUBBLOCKS } from '@/blocks/utils' -import type { GoogleTasksResponse } from '@/tools/google_tasks/types' /** * Canonical basic/advanced pair for the task list, shared by the card @@ -12,7 +11,7 @@ import type { GoogleTasksResponse } from '@/tools/google_tasks/types' */ const TASK_LIST_FIELD = ['taskListSelector', 'taskListId'] as const -export const GoogleTasksBlock: BlockConfig = { +export const GoogleTasksBlock: BlockConfig = { type: 'google_tasks', name: 'Google Tasks', description: 'Manage Google Tasks', diff --git a/apps/sim/blocks/blocks/grafana.ts b/apps/sim/blocks/blocks/grafana.ts index eb71a701e18..e8731982e8d 100644 --- a/apps/sim/blocks/blocks/grafana.ts +++ b/apps/sim/blocks/blocks/grafana.ts @@ -1,9 +1,8 @@ import { GrafanaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { GrafanaResponse } from '@/tools/grafana/types' -export const GrafanaBlock: BlockConfig = { +export const GrafanaBlock: BlockConfig = { type: 'grafana', name: 'Grafana', description: 'Interact with Grafana dashboards, alerts, and annotations', diff --git a/apps/sim/blocks/blocks/greenhouse.ts b/apps/sim/blocks/blocks/greenhouse.ts index d3f8b610fa5..f122c2b1c2b 100644 --- a/apps/sim/blocks/blocks/greenhouse.ts +++ b/apps/sim/blocks/blocks/greenhouse.ts @@ -1,9 +1,8 @@ import { GreenhouseIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { GreenhouseResponse } from '@/tools/greenhouse/types' import { getTrigger } from '@/triggers' -export const GreenhouseBlock: BlockConfig = { +export const GreenhouseBlock: BlockConfig = { type: 'greenhouse', name: 'Greenhouse', description: 'Manage candidates, jobs, and applications in Greenhouse', diff --git a/apps/sim/blocks/blocks/greptile.ts b/apps/sim/blocks/blocks/greptile.ts index e374023ba6a..a52f9e61660 100644 --- a/apps/sim/blocks/blocks/greptile.ts +++ b/apps/sim/blocks/blocks/greptile.ts @@ -2,12 +2,11 @@ import { ClipboardList } from '@sim/emcn/icons' import { GreptileIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { GreptileResponse } from '@/tools/greptile/types' /** Shared by the two repository operations, which both take a branch. */ const ON_BRANCH = { text: 'on branch', field: 'branch' } as const -export const GreptileBlock: BlockConfig = { +export const GreptileBlock: BlockConfig = { type: 'greptile', name: 'Greptile', description: 'AI-powered codebase search and Q&A', diff --git a/apps/sim/blocks/blocks/guardrails.ts b/apps/sim/blocks/blocks/guardrails.ts index 45eafda193e..7680b2fa109 100644 --- a/apps/sim/blocks/blocks/guardrails.ts +++ b/apps/sim/blocks/blocks/guardrails.ts @@ -19,7 +19,7 @@ export interface GuardrailsResponse extends ToolResponse { } } -export const GuardrailsBlock: BlockConfig = { +export const GuardrailsBlock: BlockConfig = { type: 'guardrails', name: 'Guardrails', description: 'Validate content with guardrails', diff --git a/apps/sim/blocks/blocks/hex.ts b/apps/sim/blocks/blocks/hex.ts index 71901e45352..66edf981c26 100644 --- a/apps/sim/blocks/blocks/hex.ts +++ b/apps/sim/blocks/blocks/hex.ts @@ -1,9 +1,8 @@ import { HexIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { HexResponse } from '@/tools/hex/types' -export const HexBlock: BlockConfig = { +export const HexBlock: BlockConfig = { type: 'hex', name: 'Hex', description: 'Run and manage Hex projects', diff --git a/apps/sim/blocks/blocks/hubspot.ts b/apps/sim/blocks/blocks/hubspot.ts index e3d0e198954..b3b6768bea8 100644 --- a/apps/sim/blocks/blocks/hubspot.ts +++ b/apps/sim/blocks/blocks/hubspot.ts @@ -2,10 +2,9 @@ import { HubspotIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { HubSpotResponse } from '@/tools/hubspot/types' import { getTrigger } from '@/triggers' -export const HubSpotBlock: BlockConfig = { +export const HubSpotBlock: BlockConfig = { type: 'hubspot', name: 'HubSpot', description: 'Interact with HubSpot CRM or trigger workflows from HubSpot events', diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index 928aa64df89..7b6629aa83a 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -1,9 +1,8 @@ import { HuggingFaceIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { HuggingFaceChatResponse } from '@/tools/huggingface/types' -export const HuggingFaceBlock: BlockConfig = { +export const HuggingFaceBlock: BlockConfig = { type: 'huggingface', name: 'Hugging Face', description: 'Use Hugging Face Inference API', diff --git a/apps/sim/blocks/blocks/human_in_the_loop.ts b/apps/sim/blocks/blocks/human_in_the_loop.ts index ade47e74a11..48111cc6171 100644 --- a/apps/sim/blocks/blocks/human_in_the_loop.ts +++ b/apps/sim/blocks/blocks/human_in_the_loop.ts @@ -1,8 +1,7 @@ import { HumanInTheLoopIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' -import type { ResponseBlockOutput } from '@/tools/response/types' -export const HumanInTheLoopBlock: BlockConfig = { +export const HumanInTheLoopBlock: BlockConfig = { type: 'human_in_the_loop', name: 'Human', hideFromToolbar: true, @@ -117,7 +116,7 @@ export const HumanInTheLoopBlock: BlockConfig = { * Everything else — sub-blocks, outputs, pause/resume, the resume page — is identical, * so it is inherited rather than restated. */ -export const HumanInTheLoopV2Block: BlockConfig = { +export const HumanInTheLoopV2Block: BlockConfig = { ...HumanInTheLoopBlock, type: 'human_in_the_loop_v2', hideFromToolbar: false, diff --git a/apps/sim/blocks/blocks/hunter.ts b/apps/sim/blocks/blocks/hunter.ts index c4ab1420f9f..eb0d03d1125 100644 --- a/apps/sim/blocks/blocks/hunter.ts +++ b/apps/sim/blocks/blocks/hunter.ts @@ -1,6 +1,5 @@ import { HunterIOIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { HunterResponse } from '@/tools/hunter/types' /** * The company a lookup targets, for the two operations that accept either a @@ -9,7 +8,7 @@ import type { HunterResponse } from '@/tools/hunter/types' */ const DOMAIN_OR_COMPANY_FIELD = ['domain', 'company'] as const -export const HunterBlock: BlockConfig = { +export const HunterBlock: BlockConfig = { type: 'hunter', name: 'Hunter.io', description: 'Find and verify professional email addresses', diff --git a/apps/sim/blocks/blocks/iam.ts b/apps/sim/blocks/blocks/iam.ts index 2cf3dbfedd7..8636a3e8abe 100644 --- a/apps/sim/blocks/blocks/iam.ts +++ b/apps/sim/blocks/blocks/iam.ts @@ -1,7 +1,6 @@ import { IAMIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { IAMBaseResponse } from '@/tools/iam/types' /** * Raised when `contextEntries` is not a JSON array of context entries. @@ -13,7 +12,7 @@ import type { IAMBaseResponse } from '@/tools/iam/types' const CONTEXT_ENTRIES_SHAPE_ERROR = 'Condition Context Keys must be a JSON array of { contextKeyName, contextKeyValues, contextKeyType }' -export const IAMBlock: BlockConfig = { +export const IAMBlock: BlockConfig = { type: 'iam', name: 'AWS IAM', description: 'Manage AWS IAM users, roles, policies, and groups', diff --git a/apps/sim/blocks/blocks/icypeas.ts b/apps/sim/blocks/blocks/icypeas.ts index 061d02e9a80..cf4d1437165 100644 --- a/apps/sim/blocks/blocks/icypeas.ts +++ b/apps/sim/blocks/blocks/icypeas.ts @@ -1,8 +1,7 @@ import { IcypeasIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { IcypeasResponse } from '@/tools/icypeas/types' -export const IcypeasBlock: BlockConfig = { +export const IcypeasBlock: BlockConfig = { type: 'icypeas', name: 'Icypeas', description: 'Find and verify professional email addresses', diff --git a/apps/sim/blocks/blocks/identity_center.ts b/apps/sim/blocks/blocks/identity_center.ts index 0e02644cfe5..dd982c3793d 100644 --- a/apps/sim/blocks/blocks/identity_center.ts +++ b/apps/sim/blocks/blocks/identity_center.ts @@ -1,9 +1,8 @@ import { IdentityCenterIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { IdentityCenterBaseResponse } from '@/tools/identity_center/types' -export const IdentityCenterBlock: BlockConfig = { +export const IdentityCenterBlock: BlockConfig = { type: 'identity_center', name: 'AWS Identity Center', description: 'Manage temporary elevated access in AWS IAM Identity Center', diff --git a/apps/sim/blocks/blocks/image_generator.ts b/apps/sim/blocks/blocks/image_generator.ts index 1302bfe396d..6b8bbd46a39 100644 --- a/apps/sim/blocks/blocks/image_generator.ts +++ b/apps/sim/blocks/blocks/image_generator.ts @@ -1,8 +1,6 @@ import { ImageIcon } from '@/components/icons' import { AuthMode, type BlockConfig, IntegrationType } from '@/blocks/types' import { parseOptionalBooleanInput } from '@/blocks/utils' -import type { ImageGenerationResponse } from '@/tools/image/types' -import type { DalleResponse } from '@/tools/openai/types' const OPENAI_GPT_IMAGE_MODELS = [ { label: 'GPT Image 1.5', id: 'gpt-image-1.5' }, @@ -52,7 +50,7 @@ const OUTPUT_FORMAT_OPTIONS = [ { label: 'WebP', id: 'webp' }, ] -export const ImageGeneratorBlock: BlockConfig = { +export const ImageGeneratorBlock: BlockConfig = { type: 'image_generator', name: 'Image Generator', description: 'Generate images', @@ -319,7 +317,7 @@ export const ImageGeneratorBlock: BlockConfig = { }, } -export const ImageGeneratorV2Block: BlockConfig = { +export const ImageGeneratorV2Block: BlockConfig = { type: 'image_generator_v2', name: 'Image Generator', description: 'Generate images', diff --git a/apps/sim/blocks/blocks/incidentio.ts b/apps/sim/blocks/blocks/incidentio.ts index bdb8e2baf84..efe9e1a8958 100644 --- a/apps/sim/blocks/blocks/incidentio.ts +++ b/apps/sim/blocks/blocks/incidentio.ts @@ -1,7 +1,6 @@ import { IncidentioIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { IncidentioResponse } from '@/tools/incidentio/types' import { getTrigger } from '@/triggers' /** Identifiers a user can be looked up by, whichever one is filled. */ @@ -26,7 +25,7 @@ function toTriState(value: unknown): boolean | undefined { return undefined } -export const IncidentioBlock: BlockConfig = { +export const IncidentioBlock: BlockConfig = { type: 'incidentio', name: 'incident.io', description: 'Manage incidents with incident.io', diff --git a/apps/sim/blocks/blocks/infisical.ts b/apps/sim/blocks/blocks/infisical.ts index 2e50ba64963..0d9c55aebec 100644 --- a/apps/sim/blocks/blocks/infisical.ts +++ b/apps/sim/blocks/blocks/infisical.ts @@ -1,9 +1,8 @@ import { InfisicalIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { InfisicalResponse } from '@/tools/infisical/types' -export const InfisicalBlock: BlockConfig = { +export const InfisicalBlock: BlockConfig = { type: 'infisical', name: 'Infisical', description: 'Manage secrets with Infisical', diff --git a/apps/sim/blocks/blocks/instagram.ts b/apps/sim/blocks/blocks/instagram.ts index a07c149745f..6862204a45b 100644 --- a/apps/sim/blocks/blocks/instagram.ts +++ b/apps/sim/blocks/blocks/instagram.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { InstagramResponse } from '@/tools/instagram/types' const IG_USER_ID_OPS = [ 'instagram_list_media', @@ -82,7 +81,7 @@ const STORY_MEDIA_FIELD = ['storyMediaUpload', 'storyMediaRef'] as const /** Carousel children, uploaded or referenced by URL. */ const CAROUSEL_MEDIA_FIELD = ['carouselMediaUpload', 'carouselMediaRef'] as const -export const InstagramBlock: BlockConfig = { +export const InstagramBlock: BlockConfig = { type: 'instagram', name: 'Instagram', description: 'Publish and download content, moderate comments, and manage Instagram DMs', diff --git a/apps/sim/blocks/blocks/instantly.ts b/apps/sim/blocks/blocks/instantly.ts index 6510b2945f4..71ade3ff404 100644 --- a/apps/sim/blocks/blocks/instantly.ts +++ b/apps/sim/blocks/blocks/instantly.ts @@ -2,7 +2,6 @@ import { isRecordLike } from '@sim/utils/object' import { InstantlyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { InstantlyResponse } from '@/tools/instantly/types' import { getTrigger } from '@/triggers' const LEAD_LIST_OPERATIONS = ['list_leads'] as const @@ -56,7 +55,7 @@ const INSTANTLY_TRIGGER_IDS = [ 'instantly_supersearch_enrichment_completed', ] as const -export const InstantlyBlock: BlockConfig = { +export const InstantlyBlock: BlockConfig = { type: 'instantly', name: 'Instantly', description: 'Manage Instantly leads, campaigns, emails, and lead lists', diff --git a/apps/sim/blocks/blocks/jina.ts b/apps/sim/blocks/blocks/jina.ts index a76339465f8..5df2df55d86 100644 --- a/apps/sim/blocks/blocks/jina.ts +++ b/apps/sim/blocks/blocks/jina.ts @@ -1,8 +1,7 @@ import { JinaAIIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ReadUrlResponse, SearchResponse } from '@/tools/jina/types' -export const JinaBlock: BlockConfig = { +export const JinaBlock: BlockConfig = { type: 'jina', name: 'Jina', description: 'Search the web or extract content from URLs', diff --git a/apps/sim/blocks/blocks/jira.ts b/apps/sim/blocks/blocks/jira.ts index 96047c4ac28..d85544b7c52 100644 --- a/apps/sim/blocks/blocks/jira.ts +++ b/apps/sim/blocks/blocks/jira.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { JiraResponse } from '@/tools/jira/types' import { getTrigger } from '@/triggers' /** Canonical `issueKey` pair: issue picker (basic) and raw issue key (advanced). */ @@ -13,7 +12,7 @@ const PROJECT_FIELD = ['projectId', 'manualProjectId'] as const /** Canonical `files` pair: upload (basic) and file reference (advanced). */ const ATTACHMENT_FIELD = ['attachmentFiles', 'files'] as const -export const JiraBlock: BlockConfig = { +export const JiraBlock: BlockConfig = { type: 'jira', name: 'Jira', description: 'Interact with Jira', @@ -963,7 +962,7 @@ Return ONLY the comment text - no explanations.`, } }, params: (params) => { - const { oauthCredential, projectId, issueKey, ...rest } = params + const { oauthCredential, projectId, issueKey } = params // Use canonical param IDs (raw subBlock IDs are deleted after serialization) const effectiveProjectId = projectId ? String(projectId).trim() : '' diff --git a/apps/sim/blocks/blocks/jira_service_management.ts b/apps/sim/blocks/blocks/jira_service_management.ts index 06aa7ff225a..d506c42165d 100644 --- a/apps/sim/blocks/blocks/jira_service_management.ts +++ b/apps/sim/blocks/blocks/jira_service_management.ts @@ -2,7 +2,6 @@ import { JiraServiceManagementIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { JsmResponse } from '@/tools/jsm/types' import { getTrigger } from '@/triggers' /** Operations that accept Atlassian's `start`/`limit` pagination query params. */ @@ -57,7 +56,7 @@ const SERVICE_DESK_FIELD = ['serviceDeskSelector', 'serviceDeskId'] as const /** Canonical basic/advanced pair for the request type. */ const REQUEST_TYPE_FIELD = ['requestTypeSelector', 'requestTypeId'] as const -export const JiraServiceManagementBlock: BlockConfig = { +export const JiraServiceManagementBlock: BlockConfig = { type: 'jira_service_management', name: 'Jira Service Management', description: 'Interact with Jira Service Management', diff --git a/apps/sim/blocks/blocks/ketch.ts b/apps/sim/blocks/blocks/ketch.ts index 6f7e0f1afb9..e42fcaa3c76 100644 --- a/apps/sim/blocks/blocks/ketch.ts +++ b/apps/sim/blocks/blocks/ketch.ts @@ -1,9 +1,8 @@ import { KetchIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { KetchResponse } from '@/tools/ketch/types' -export const KetchBlock: BlockConfig = { +export const KetchBlock: BlockConfig = { type: 'ketch', name: 'Ketch', description: 'Manage privacy consent, subscriptions, and data subject rights', diff --git a/apps/sim/blocks/blocks/lambda.ts b/apps/sim/blocks/blocks/lambda.ts index cb34d8b6225..33fadfb6630 100644 --- a/apps/sim/blocks/blocks/lambda.ts +++ b/apps/sim/blocks/blocks/lambda.ts @@ -2,58 +2,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { LambdaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - LambdaAddPermissionResponse, - LambdaCreateAliasResponse, - LambdaCreateEventSourceMappingResponse, - LambdaCreateFunctionResponse, - LambdaCreateFunctionUrlConfigResponse, - LambdaDeleteAliasResponse, - LambdaDeleteEventSourceMappingResponse, - LambdaDeleteFunctionConcurrencyResponse, - LambdaDeleteFunctionEventInvokeConfigResponse, - LambdaDeleteFunctionResponse, - LambdaDeleteFunctionUrlConfigResponse, - LambdaDeleteProvisionedConcurrencyConfigResponse, - LambdaGetAccountSettingsResponse, - LambdaGetAliasResponse, - LambdaGetEventSourceMappingResponse, - LambdaGetFunctionConcurrencyResponse, - LambdaGetFunctionConfigurationResponse, - LambdaGetFunctionEventInvokeConfigResponse, - LambdaGetFunctionRecursionConfigResponse, - LambdaGetFunctionResponse, - LambdaGetFunctionUrlConfigResponse, - LambdaGetLayerVersionResponse, - LambdaGetPolicyResponse, - LambdaGetProvisionedConcurrencyConfigResponse, - LambdaGetRuntimeManagementConfigResponse, - LambdaInvokeResponse, - LambdaListAliasesResponse, - LambdaListEventSourceMappingsResponse, - LambdaListFunctionEventInvokeConfigsResponse, - LambdaListFunctionsResponse, - LambdaListFunctionUrlConfigsResponse, - LambdaListLayersResponse, - LambdaListLayerVersionsResponse, - LambdaListProvisionedConcurrencyConfigsResponse, - LambdaListTagsResponse, - LambdaListVersionsByFunctionResponse, - LambdaPublishVersionResponse, - LambdaPutFunctionConcurrencyResponse, - LambdaPutFunctionEventInvokeConfigResponse, - LambdaPutFunctionRecursionConfigResponse, - LambdaPutProvisionedConcurrencyConfigResponse, - LambdaPutRuntimeManagementConfigResponse, - LambdaRemovePermissionResponse, - LambdaTagResourceResponse, - LambdaUntagResourceResponse, - LambdaUpdateAliasResponse, - LambdaUpdateEventSourceMappingResponse, - LambdaUpdateFunctionCodeResponse, - LambdaUpdateFunctionConfigurationResponse, - LambdaUpdateFunctionUrlConfigResponse, -} from '@/tools/lambda/types' type ParamKind = 'string' | 'number' | 'boolean' | 'json' | 'array' | 'jsonArray' @@ -453,58 +401,7 @@ function parseJson(value: unknown, name: string): unknown { } } -export const LambdaBlock: BlockConfig< - | LambdaInvokeResponse - | LambdaListFunctionsResponse - | LambdaGetFunctionResponse - | LambdaGetFunctionConfigurationResponse - | LambdaCreateFunctionResponse - | LambdaUpdateFunctionCodeResponse - | LambdaUpdateFunctionConfigurationResponse - | LambdaDeleteFunctionResponse - | LambdaPublishVersionResponse - | LambdaListVersionsByFunctionResponse - | LambdaCreateAliasResponse - | LambdaGetAliasResponse - | LambdaUpdateAliasResponse - | LambdaDeleteAliasResponse - | LambdaListAliasesResponse - | LambdaAddPermissionResponse - | LambdaRemovePermissionResponse - | LambdaGetPolicyResponse - | LambdaCreateEventSourceMappingResponse - | LambdaGetEventSourceMappingResponse - | LambdaUpdateEventSourceMappingResponse - | LambdaDeleteEventSourceMappingResponse - | LambdaListEventSourceMappingsResponse - | LambdaGetFunctionConcurrencyResponse - | LambdaPutFunctionConcurrencyResponse - | LambdaDeleteFunctionConcurrencyResponse - | LambdaGetProvisionedConcurrencyConfigResponse - | LambdaPutProvisionedConcurrencyConfigResponse - | LambdaDeleteProvisionedConcurrencyConfigResponse - | LambdaListProvisionedConcurrencyConfigsResponse - | LambdaCreateFunctionUrlConfigResponse - | LambdaGetFunctionUrlConfigResponse - | LambdaUpdateFunctionUrlConfigResponse - | LambdaDeleteFunctionUrlConfigResponse - | LambdaListFunctionUrlConfigsResponse - | LambdaGetFunctionEventInvokeConfigResponse - | LambdaPutFunctionEventInvokeConfigResponse - | LambdaDeleteFunctionEventInvokeConfigResponse - | LambdaListFunctionEventInvokeConfigsResponse - | LambdaListLayersResponse - | LambdaListLayerVersionsResponse - | LambdaGetLayerVersionResponse - | LambdaListTagsResponse - | LambdaTagResourceResponse - | LambdaUntagResourceResponse - | LambdaGetAccountSettingsResponse - | LambdaGetFunctionRecursionConfigResponse - | LambdaPutFunctionRecursionConfigResponse - | LambdaGetRuntimeManagementConfigResponse - | LambdaPutRuntimeManagementConfigResponse -> = { +export const LambdaBlock: BlockConfig = { type: 'lambda', name: 'Lambda', description: 'Invoke, deploy, and manage AWS Lambda functions', diff --git a/apps/sim/blocks/blocks/langsmith.ts b/apps/sim/blocks/blocks/langsmith.ts index d4015c46563..6b350fd769b 100644 --- a/apps/sim/blocks/blocks/langsmith.ts +++ b/apps/sim/blocks/blocks/langsmith.ts @@ -1,9 +1,8 @@ import { toError } from '@sim/utils/errors' import { LangsmithIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { LangsmithResponse } from '@/tools/langsmith/types' -export const LangsmithBlock: BlockConfig = { +export const LangsmithBlock: BlockConfig = { type: 'langsmith', name: 'LangSmith', description: 'Forward workflow runs to LangSmith for observability', diff --git a/apps/sim/blocks/blocks/latex.ts b/apps/sim/blocks/blocks/latex.ts index 5240ca79f0a..05cf889f1db 100644 --- a/apps/sim/blocks/blocks/latex.ts +++ b/apps/sim/blocks/blocks/latex.ts @@ -1,9 +1,8 @@ import { LatexIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { LatexResponse } from '@/tools/latex/types' -export const LatexBlock: BlockConfig = { +export const LatexBlock: BlockConfig = { type: 'latex', name: 'LaTeX', description: 'Compile LaTeX documents into PDFs', diff --git a/apps/sim/blocks/blocks/leadmagic.ts b/apps/sim/blocks/blocks/leadmagic.ts index 7189774d305..263b47102e6 100644 --- a/apps/sim/blocks/blocks/leadmagic.ts +++ b/apps/sim/blocks/blocks/leadmagic.ts @@ -1,6 +1,5 @@ import { LeadMagicIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { LeadMagicResponse } from '@/tools/leadmagic/types' /* * Mutually exclusive company identifiers, and the two email kinds a reverse @@ -11,7 +10,7 @@ const FIND_EMAIL_COMPANY_FIELD = ['fe_domain', 'fe_company_name'] as const const ROLE_COMPANY_FIELD = ['rf_company_domain', 'rf_company_name'] as const const COMPANY_SEARCH_FIELD = ['cs_company_domain', 'cs_profile_url', 'cs_company_name'] as const -export const LeadMagicBlock: BlockConfig = { +export const LeadMagicBlock: BlockConfig = { type: 'leadmagic', name: 'LeadMagic', description: 'Find and enrich B2B contacts, emails, mobile numbers, and company data', diff --git a/apps/sim/blocks/blocks/lemlist.ts b/apps/sim/blocks/blocks/lemlist.ts index 6396ba247c1..f89a77198f5 100644 --- a/apps/sim/blocks/blocks/lemlist.ts +++ b/apps/sim/blocks/blocks/lemlist.ts @@ -1,9 +1,8 @@ import { LemlistIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { LemlistResponse } from '@/tools/lemlist/types' import { getTrigger } from '@/triggers' -export const LemlistBlock: BlockConfig = { +export const LemlistBlock: BlockConfig = { type: 'lemlist', name: 'Lemlist', description: 'Manage outreach activities, leads, and send emails via Lemlist', diff --git a/apps/sim/blocks/blocks/linear.ts b/apps/sim/blocks/blocks/linear.ts index b1d2eb2e8e3..57ba2114e87 100644 --- a/apps/sim/blocks/blocks/linear.ts +++ b/apps/sim/blocks/blocks/linear.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { LinearResponse } from '@/tools/linear/types' import { getTrigger } from '@/triggers' /** @@ -14,7 +13,7 @@ import { getTrigger } from '@/triggers' const TEAM_FIELD = ['teamId', 'manualTeamId'] as const const PROJECT_FIELD = ['projectId', 'manualProjectId'] as const -export const LinearBlock: BlockConfig = { +export const LinearBlock: BlockConfig = { type: 'linear', name: 'Linear (Legacy)', description: 'Interact with Linear issues, projects, and more', @@ -2752,7 +2751,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n * Uses automatic webhook registration via the Linear GraphQL API. * Inherits all tool operations from the legacy block. */ -export const LinearV2Block: BlockConfig = { +export const LinearV2Block: BlockConfig = { ...LinearBlock, sunset: undefined, type: 'linear_v2', diff --git a/apps/sim/blocks/blocks/linkedin.ts b/apps/sim/blocks/blocks/linkedin.ts index 97a47dc9fa3..f703f65e49d 100644 --- a/apps/sim/blocks/blocks/linkedin.ts +++ b/apps/sim/blocks/blocks/linkedin.ts @@ -2,9 +2,8 @@ import { LinkedInIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { LinkedInResponse } from '@/tools/linkedin/types' -export const LinkedInBlock: BlockConfig = { +export const LinkedInBlock: BlockConfig = { type: 'linkedin', name: 'LinkedIn', description: 'Share posts and manage your LinkedIn presence', diff --git a/apps/sim/blocks/blocks/linkup.ts b/apps/sim/blocks/blocks/linkup.ts index 8e7564cddb4..df645fc7f6e 100644 --- a/apps/sim/blocks/blocks/linkup.ts +++ b/apps/sim/blocks/blocks/linkup.ts @@ -1,8 +1,7 @@ import { LinkupIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { LinkupSearchToolResponse } from '@/tools/linkup/types' -export const LinkupBlock: BlockConfig = { +export const LinkupBlock: BlockConfig = { type: 'linkup', name: 'Linkup', description: 'Search the web with Linkup', diff --git a/apps/sim/blocks/blocks/logfire.ts b/apps/sim/blocks/blocks/logfire.ts index 8ade722cc37..717e5522244 100644 --- a/apps/sim/blocks/blocks/logfire.ts +++ b/apps/sim/blocks/blocks/logfire.ts @@ -2,7 +2,6 @@ import { Bug, ClipboardList, Clock, Database, File, Search, Server } from '@sim/ import { LogfireIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { LogfireResponse } from '@/tools/logfire/types' const toBoolean = (value: unknown): boolean | undefined => { if (value === true || value === 'true') return true @@ -74,7 +73,7 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.` const SEARCH_FILTER_FIELD = ['query', 'service', 'spanName'] as const -export const LogfireBlock: BlockConfig = { +export const LogfireBlock: BlockConfig = { type: 'logfire', name: 'Logfire', description: 'Query traces, logs, and metrics in Pydantic Logfire', diff --git a/apps/sim/blocks/blocks/loops.ts b/apps/sim/blocks/blocks/loops.ts index 418f406c249..17aeef36b67 100644 --- a/apps/sim/blocks/blocks/loops.ts +++ b/apps/sim/blocks/blocks/loops.ts @@ -1,13 +1,12 @@ import { LoopsIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { LoopsResponse } from '@/tools/loops/types' import { getTrigger } from '@/triggers' /** How a contact is identified — email or user id, whichever the user filled. */ const CONTACT_FIELD = ['contactEmail', 'userId'] as const -export const LoopsBlock: BlockConfig = { +export const LoopsBlock: BlockConfig = { type: 'loops', name: 'Loops', description: 'Manage contacts and send emails with Loops', diff --git a/apps/sim/blocks/blocks/mailgun.ts b/apps/sim/blocks/blocks/mailgun.ts index f677e28c4b2..a05150e6c77 100644 --- a/apps/sim/blocks/blocks/mailgun.ts +++ b/apps/sim/blocks/blocks/mailgun.ts @@ -1,9 +1,8 @@ import { MailgunIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { SendMessageResult } from '@/tools/mailgun/types' -export const MailgunBlock: BlockConfig = { +export const MailgunBlock: BlockConfig = { type: 'mailgun', name: 'Mailgun', description: 'Send emails and manage mailing lists with Mailgun', diff --git a/apps/sim/blocks/blocks/manageengine-sdp.ts b/apps/sim/blocks/blocks/manageengine-sdp.ts index 4cd09158ac6..d95924575f8 100644 --- a/apps/sim/blocks/blocks/manageengine-sdp.ts +++ b/apps/sim/blocks/blocks/manageengine-sdp.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { SDP_DATA_CENTER_BASES } from '@/tools/manageengine_sdp/data-centers' -import type { SdpResponse } from '@/tools/manageengine_sdp/types' /** * Operations grouped by the entity they address. Every group is used twice — @@ -99,7 +98,7 @@ function toOptionalBoolean(value: unknown): boolean | undefined { return resolved === true || resolved === 'true' } -export const ManageEngineSdpBlock: BlockConfig = { +export const ManageEngineSdpBlock: BlockConfig = { type: 'manageengine_sdp', name: 'ManageEngine ServiceDesk Plus', description: diff --git a/apps/sim/blocks/blocks/mcp.ts b/apps/sim/blocks/blocks/mcp.ts index f38c42fdd8a..f3da42d122c 100644 --- a/apps/sim/blocks/blocks/mcp.ts +++ b/apps/sim/blocks/blocks/mcp.ts @@ -7,7 +7,7 @@ export interface McpResponse extends ToolResponse { output: Record } -export const McpBlock: BlockConfig = { +export const McpBlock: BlockConfig = { type: 'mcp', name: 'MCP', description: 'Discover and run authorized MCP operations', diff --git a/apps/sim/blocks/blocks/mem0.ts b/apps/sim/blocks/blocks/mem0.ts index bab8fc96a93..e6e3539190a 100644 --- a/apps/sim/blocks/blocks/mem0.ts +++ b/apps/sim/blocks/blocks/mem0.ts @@ -1,10 +1,9 @@ import { toError } from '@sim/utils/errors' import { Mem0Icon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { Mem0Response } from '@/tools/mem0/types' import { parseMem0Messages } from '@/tools/mem0/utils' -export const Mem0Block: BlockConfig = { +export const Mem0Block: BlockConfig = { type: 'mem0', name: 'Mem0', description: 'Agent memory management', diff --git a/apps/sim/blocks/blocks/microsoft_ad.ts b/apps/sim/blocks/blocks/microsoft_ad.ts index 7eb521e4ab0..ad4641f5bae 100644 --- a/apps/sim/blocks/blocks/microsoft_ad.ts +++ b/apps/sim/blocks/blocks/microsoft_ad.ts @@ -2,7 +2,6 @@ import { AzureIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { MicrosoftAdResponse } from '@/tools/microsoft_ad/types' /** Operations that act on a single user and therefore require the User ID field. */ const USER_ID_OPERATIONS = [ @@ -124,7 +123,7 @@ const DIRECTORY_ROLE_OPERATIONS = [ 'remove_directory_role_member', ] -export const MicrosoftAdBlock: BlockConfig = { +export const MicrosoftAdBlock: BlockConfig = { type: 'microsoft_ad', name: 'Azure AD', description: 'Manage identities, licenses, roles, and access in Azure AD (Microsoft Entra ID)', diff --git a/apps/sim/blocks/blocks/microsoft_dataverse.ts b/apps/sim/blocks/blocks/microsoft_dataverse.ts index 748859694a0..825fd354c9e 100644 --- a/apps/sim/blocks/blocks/microsoft_dataverse.ts +++ b/apps/sim/blocks/blocks/microsoft_dataverse.ts @@ -4,7 +4,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { DataverseResponse } from '@/tools/microsoft_dataverse/types' /** Canonical upload pair for the file column payload, basic then advanced. */ const FILE_FIELD = ['uploadFile', 'fileReference'] as const @@ -791,7 +790,7 @@ Return ONLY the expand expression - no $expand= prefix, no explanations.`, description: 'Full raw table metadata response (get table metadata)', }, }, -} satisfies BlockConfig +} satisfies BlockConfig export const MicrosoftDataverseV2Block: BlockConfig = { ...MicrosoftDataverseBlock, diff --git a/apps/sim/blocks/blocks/microsoft_dynamics_365.ts b/apps/sim/blocks/blocks/microsoft_dynamics_365.ts index 8372e515086..ded79b02066 100644 --- a/apps/sim/blocks/blocks/microsoft_dynamics_365.ts +++ b/apps/sim/blocks/blocks/microsoft_dynamics_365.ts @@ -7,7 +7,6 @@ import { parseOptionalJsonInput, parseOptionalNumberInput, } from '@/blocks/utils' -import type { DataverseResponse } from '@/tools/microsoft_dynamics_365/types' const DATAVERSE_GUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i @@ -161,7 +160,7 @@ function getCommonParams(params: Record) { } } -export const MicrosoftDynamics365Block: BlockConfig = { +export const MicrosoftDynamics365Block: BlockConfig = { type: 'microsoft_dynamics_365', name: 'Microsoft Dynamics 365 CRM', description: 'Manage customers, sales pipelines, and support cases in Dynamics 365 CRM', diff --git a/apps/sim/blocks/blocks/microsoft_excel.ts b/apps/sim/blocks/blocks/microsoft_excel.ts index 9b38d63a74d..e60a92e3596 100644 --- a/apps/sim/blocks/blocks/microsoft_excel.ts +++ b/apps/sim/blocks/blocks/microsoft_excel.ts @@ -3,10 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector } from '@/blocks/utils' -import type { - MicrosoftExcelResponse, - MicrosoftExcelV2Response, -} from '@/tools/microsoft_excel/types' /** Maps the read/write operation to its `_v2` tool id, falling back to read on unknown ops. */ const versionedReadWriteSelector = createVersionedToolSelector>({ @@ -60,7 +56,7 @@ const SPREADSHEET_FIELD = ['spreadsheetId', 'manualSpreadsheetId'] as const /** Canonical pair for the worksheet tab, on the `_v2` block only. */ const SHEET_FIELD = ['sheetName', 'manualSheetName'] as const -export const MicrosoftExcelBlock: BlockConfig = { +export const MicrosoftExcelBlock: BlockConfig = { type: 'microsoft_excel', name: 'Microsoft Excel (Legacy)', description: 'Read, write, and update data', @@ -683,7 +679,7 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, }, } -export const MicrosoftExcelV2Block: BlockConfig = { +export const MicrosoftExcelV2Block: BlockConfig = { type: 'microsoft_excel_v2', name: 'Microsoft Excel', description: 'Read and write data with sheet selection', diff --git a/apps/sim/blocks/blocks/microsoft_planner.ts b/apps/sim/blocks/blocks/microsoft_planner.ts index bfe0eb5bec4..f3fa542ed24 100644 --- a/apps/sim/blocks/blocks/microsoft_planner.ts +++ b/apps/sim/blocks/blocks/microsoft_planner.ts @@ -2,7 +2,6 @@ import { MicrosoftPlannerIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { MicrosoftPlannerResponse } from '@/tools/microsoft_planner/types' interface MicrosoftPlannerBlockParams { oauthCredential: string @@ -37,7 +36,7 @@ interface MicrosoftPlannerBlockParams { const PLAN_FIELD = ['planSelector', 'planId'] as const const READ_TASK_FIELD = ['taskSelector', 'manualReadTaskId'] as const -export const MicrosoftPlannerBlock: BlockConfig = { +export const MicrosoftPlannerBlock: BlockConfig = { type: 'microsoft_planner', name: 'Microsoft Planner', description: 'Manage tasks, plans, and buckets in Microsoft Planner', diff --git a/apps/sim/blocks/blocks/microsoft_teams.ts b/apps/sim/blocks/blocks/microsoft_teams.ts index 8b647c7310d..8c6532c42dc 100644 --- a/apps/sim/blocks/blocks/microsoft_teams.ts +++ b/apps/sim/blocks/blocks/microsoft_teams.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { MicrosoftTeamsResponse } from '@/tools/microsoft_teams/types' import { getTrigger } from '@/triggers' /** @@ -16,7 +15,7 @@ const CHAT_FIELD = ['chatSelector', 'manualChatId'] as const const CHANNEL_FIELD = ['channelSelector', 'manualChannelId'] as const const ATTACHMENT_FIELD = ['attachmentFiles', 'fileReferences'] as const -export const MicrosoftTeamsBlock: BlockConfig = { +export const MicrosoftTeamsBlock: BlockConfig = { type: 'microsoft_teams', name: 'Microsoft Teams', description: 'Manage messages, reactions, and members in Teams', diff --git a/apps/sim/blocks/blocks/microsoft_word.ts b/apps/sim/blocks/blocks/microsoft_word.ts index 14287601fb8..e44782a84d4 100644 --- a/apps/sim/blocks/blocks/microsoft_word.ts +++ b/apps/sim/blocks/blocks/microsoft_word.ts @@ -2,7 +2,6 @@ import { MicrosoftWordIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { MicrosoftWordResponse } from '@/tools/microsoft_word/types' const DOCUMENT_FIELD = ['documentSelector', 'manualDocumentId'] as const @@ -76,7 +75,7 @@ function requireString(value: unknown, label: string): string { return trimmed } -export const MicrosoftWordBlock: BlockConfig = { +export const MicrosoftWordBlock: BlockConfig = { type: 'microsoft_word', name: 'Microsoft Word', description: 'Create, fill, read, edit, and export Word documents', diff --git a/apps/sim/blocks/blocks/millionverifier.ts b/apps/sim/blocks/blocks/millionverifier.ts index 862e8afa149..78373497f0e 100644 --- a/apps/sim/blocks/blocks/millionverifier.ts +++ b/apps/sim/blocks/blocks/millionverifier.ts @@ -1,8 +1,7 @@ import { MillionVerifierIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { MillionVerifierResponse } from '@/tools/millionverifier/types' -export const MillionVerifierBlock: BlockConfig = { +export const MillionVerifierBlock: BlockConfig = { type: 'millionverifier', name: 'MillionVerifier', description: 'Verify email deliverability and check account credits', diff --git a/apps/sim/blocks/blocks/mistral_parse.ts b/apps/sim/blocks/blocks/mistral_parse.ts index 5d5d027f8e1..84569434abe 100644 --- a/apps/sim/blocks/blocks/mistral_parse.ts +++ b/apps/sim/blocks/blocks/mistral_parse.ts @@ -8,12 +8,8 @@ import { type SubBlockType, } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { MistralParserOutput } from '@/tools/mistral/types' -const DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const -const DOCUMENT_REFERENCE_FIELD = ['fileUpload', 'fileReference'] as const - -export const MistralParseBlock: BlockConfig = { +export const MistralParseBlock: BlockConfig = { type: 'mistral_parse', name: 'Mistral Parser (Legacy)', description: 'Extract text from PDF documents', @@ -172,7 +168,7 @@ export const MistralParseBlock: BlockConfig = { * V2 Block - Restored from main branch for backwards compatibility * Hidden from toolbar, uses filePath subblock ID for advanced mode */ -export const MistralParseV2Block: BlockConfig = { +export const MistralParseV2Block: BlockConfig = { ...MistralParseBlock, type: 'mistral_parse_v2', name: 'Mistral Parser', @@ -303,7 +299,7 @@ export const MistralParseV2Block: BlockConfig = { * V3 Block - New file handling pattern with UserFile normalization * Uses fileReference subblock ID with canonicalParamId for proper file handling */ -export const MistralParseV3Block: BlockConfig = { +export const MistralParseV3Block: BlockConfig = { ...MistralParseBlock, sunset: undefined, type: 'mistral_parse_v3', diff --git a/apps/sim/blocks/blocks/monday.ts b/apps/sim/blocks/blocks/monday.ts index f54779cc433..609a82e1cab 100644 --- a/apps/sim/blocks/blocks/monday.ts +++ b/apps/sim/blocks/blocks/monday.ts @@ -2,48 +2,8 @@ import { MondayIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - MondayArchiveItemResponse, - MondayChangeColumnValueResponse, - MondayCreateBoardResponse, - MondayCreateColumnResponse, - MondayCreateGroupResponse, - MondayCreateItemResponse, - MondayCreateSubitemResponse, - MondayCreateUpdateResponse, - MondayDeleteItemResponse, - MondayDuplicateItemResponse, - MondayGetBoardResponse, - MondayGetGroupsResponse, - MondayGetItemResponse, - MondayGetItemsResponse, - MondayListBoardsResponse, - MondayMoveItemToGroupResponse, - MondaySearchItemsResponse, - MondayUpdateItemResponse, -} from '@/tools/monday/types' import { getTrigger } from '@/triggers' -type MondayResponse = - | MondayListBoardsResponse - | MondayGetBoardResponse - | MondayGetItemResponse - | MondayGetItemsResponse - | MondayCreateItemResponse - | MondayUpdateItemResponse - | MondayDeleteItemResponse - | MondayArchiveItemResponse - | MondayCreateUpdateResponse - | MondayCreateGroupResponse - | MondaySearchItemsResponse - | MondayCreateSubitemResponse - | MondayMoveItemToGroupResponse - | MondayChangeColumnValueResponse - | MondayCreateBoardResponse - | MondayCreateColumnResponse - | MondayGetGroupsResponse - | MondayDuplicateItemResponse - const BOARD_OPS = [ 'get_board', 'get_items', @@ -71,7 +31,7 @@ const ITEM_ID_OPS = [ const BOARD_FIELD = ['boardSelector', 'manualBoardId'] as const const GROUP_FIELD = ['groupSelector', 'manualGroupId'] as const -export const MondayBlock: BlockConfig = { +export const MondayBlock: BlockConfig = { type: 'monday', name: 'Monday', description: 'Manage Monday.com boards, items, and groups', diff --git a/apps/sim/blocks/blocks/mongodb.ts b/apps/sim/blocks/blocks/mongodb.ts index 66d37068c9d..6f969a5465f 100644 --- a/apps/sim/blocks/blocks/mongodb.ts +++ b/apps/sim/blocks/blocks/mongodb.ts @@ -2,9 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { MongoDBIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { MongoDBIntrospectResponse, MongoDBResponse } from '@/tools/mongodb/types' -export const MongoDBBlock: BlockConfig = { +export const MongoDBBlock: BlockConfig = { type: 'mongodb', name: 'MongoDB', description: 'Connect to MongoDB database', diff --git a/apps/sim/blocks/blocks/mothership.ts b/apps/sim/blocks/blocks/mothership.ts index f468837a0e3..7f745e07fe1 100644 --- a/apps/sim/blocks/blocks/mothership.ts +++ b/apps/sim/blocks/blocks/mothership.ts @@ -1,22 +1,8 @@ import { Blimp } from '@sim/emcn/icons' import { MOTHERSHIP_EFFORT_OPTIONS, MOTHERSHIP_MODEL_OPTIONS } from '@/lib/mothership/model-options' import type { BlockConfig } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' -interface MothershipResponse extends ToolResponse { - output: { - content: string - model: string - conversationId?: string - tokens?: { - prompt?: number - completion?: number - total?: number - } - } -} - -export const MothershipBlock: BlockConfig = { +export const MothershipBlock: BlockConfig = { type: 'mothership', name: 'Sim Chat', description: 'Reason, use tools, and stream a conversational response', diff --git a/apps/sim/blocks/blocks/mssql.ts b/apps/sim/blocks/blocks/mssql.ts index 4b760331708..25946d07170 100644 --- a/apps/sim/blocks/blocks/mssql.ts +++ b/apps/sim/blocks/blocks/mssql.ts @@ -2,7 +2,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { MicrosoftSqlIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { MSSQLResponse } from '@/tools/mssql/types' const MSSQL_WAND_PROMPT = `You are an expert Microsoft SQL Server developer. Write T-SQL queries based on the user's request. @@ -66,7 +65,7 @@ Return ONLY the SQL query. Do not include any explanations, markdown formatting, ### REMEMBER Return ONLY the SQL query - no explanations, no markdown, no extra text.` -export const MSSQLBlock: BlockConfig = { +export const MSSQLBlock: BlockConfig = { type: 'mssql', name: 'Microsoft SQL Server', description: 'Connect to Microsoft SQL Server database', diff --git a/apps/sim/blocks/blocks/mysql.ts b/apps/sim/blocks/blocks/mysql.ts index f696a7efe1f..003692a46a8 100644 --- a/apps/sim/blocks/blocks/mysql.ts +++ b/apps/sim/blocks/blocks/mysql.ts @@ -3,9 +3,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { MySQLIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { MySQLResponse } from '@/tools/mysql/types' -export const MySQLBlock: BlockConfig = { +export const MySQLBlock: BlockConfig = { type: 'mysql', name: 'MySQL', description: 'Connect to MySQL database', diff --git a/apps/sim/blocks/blocks/neo4j.ts b/apps/sim/blocks/blocks/neo4j.ts index 81ac22a722b..507ff6b01c5 100644 --- a/apps/sim/blocks/blocks/neo4j.ts +++ b/apps/sim/blocks/blocks/neo4j.ts @@ -2,9 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { Neo4jIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { Neo4jIntrospectResponse, Neo4jResponse } from '@/tools/neo4j/types' -export const Neo4jBlock: BlockConfig = { +export const Neo4jBlock: BlockConfig = { type: 'neo4j', name: 'Neo4j', description: 'Connect to Neo4j graph database', diff --git a/apps/sim/blocks/blocks/netsuite.ts b/apps/sim/blocks/blocks/netsuite.ts index 063baa389e8..7801ad87d9b 100644 --- a/apps/sim/blocks/blocks/netsuite.ts +++ b/apps/sim/blocks/blocks/netsuite.ts @@ -2,7 +2,6 @@ import { NetSuiteIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { parseOptionalNumberInput } from '@/blocks/utils' -import type { NetSuiteResponse } from '@/tools/netsuite/types' const RECORD_TYPE_OPERATIONS = [ 'netsuite_list_records', @@ -116,7 +115,7 @@ function parseJson(value: unknown, label: string): unknown { } } -export const NetSuiteBlock: BlockConfig = { +export const NetSuiteBlock: BlockConfig = { type: 'netsuite', name: 'Oracle NetSuite', description: 'Manage NetSuite records, queries, datasets, batches, and async jobs', diff --git a/apps/sim/blocks/blocks/neverbounce.ts b/apps/sim/blocks/blocks/neverbounce.ts index d6193df0214..939b30ac9d6 100644 --- a/apps/sim/blocks/blocks/neverbounce.ts +++ b/apps/sim/blocks/blocks/neverbounce.ts @@ -1,8 +1,7 @@ import { NeverBounceIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { NeverBounceResponse } from '@/tools/neverbounce/types' -export const NeverBounceBlock: BlockConfig = { +export const NeverBounceBlock: BlockConfig = { type: 'neverbounce', name: 'NeverBounce', description: 'Verify email deliverability and check account credits', diff --git a/apps/sim/blocks/blocks/new_relic.ts b/apps/sim/blocks/blocks/new_relic.ts index 5a4cc80ba91..ea79abb0dc5 100644 --- a/apps/sim/blocks/blocks/new_relic.ts +++ b/apps/sim/blocks/blocks/new_relic.ts @@ -2,7 +2,7 @@ import { getErrorMessage } from '@sim/utils/errors' import { NewRelicIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { NewRelicCustomAttributes, NewRelicResponse } from '@/tools/new_relic/types' +import type { NewRelicCustomAttributes } from '@/tools/new_relic/types' function parseCustomAttributes(value: unknown): NewRelicCustomAttributes | undefined { if (!value) return undefined @@ -18,7 +18,7 @@ function parseCustomAttributes(value: unknown): NewRelicCustomAttributes | undef } } -export const NewRelicBlock: BlockConfig = { +export const NewRelicBlock: BlockConfig = { type: 'new_relic', name: 'New Relic', description: 'Query observability data and record deployments in New Relic', diff --git a/apps/sim/blocks/blocks/notion.ts b/apps/sim/blocks/blocks/notion.ts index 9ac99a181c7..7affe61de9c 100644 --- a/apps/sim/blocks/blocks/notion.ts +++ b/apps/sim/blocks/blocks/notion.ts @@ -4,7 +4,6 @@ import { NotionIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector } from '@/blocks/utils' -import type { NotionResponse } from '@/tools/notion/types' import { getTrigger } from '@/triggers' /** @@ -100,7 +99,7 @@ const NOTION_SENTENCES = { } as const // Legacy block - hidden from toolbar -export const NotionBlock: BlockConfig = { +export const NotionBlock: BlockConfig = { type: 'notion', name: 'Notion (Legacy)', hideFromToolbar: true, @@ -946,7 +945,7 @@ export const NotionBlock: BlockConfig = { // V2 Block with API-aligned outputs -export const NotionV2Block: BlockConfig = { +export const NotionV2Block: BlockConfig = { type: 'notion_v2', name: 'Notion', description: 'Manage Notion pages', diff --git a/apps/sim/blocks/blocks/okta.ts b/apps/sim/blocks/blocks/okta.ts index 7a0db904fec..0bd0c41cefa 100644 --- a/apps/sim/blocks/blocks/okta.ts +++ b/apps/sim/blocks/blocks/okta.ts @@ -1,7 +1,6 @@ import { OktaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { OktaResponse } from '@/tools/okta/types' /** * Coerces a numeric subBlock value, dropping anything that is not a real number. @@ -44,7 +43,7 @@ function blankToUndefined(value: unknown): unknown { return value === null || value === '' ? undefined : value } -export const OktaBlock: BlockConfig = { +export const OktaBlock: BlockConfig = { type: 'okta', name: 'Okta', description: 'Manage users, groups, apps, and MFA in Okta', diff --git a/apps/sim/blocks/blocks/onedrive.ts b/apps/sim/blocks/blocks/onedrive.ts index e52a48f54b6..733ce0cce30 100644 --- a/apps/sim/blocks/blocks/onedrive.ts +++ b/apps/sim/blocks/blocks/onedrive.ts @@ -1,14 +1,10 @@ -import { createLogger } from '@sim/logger' import { MicrosoftOneDriveIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { OneDriveResponse } from '@/tools/onedrive/types' import { normalizeExcelValuesForToolParams } from '@/tools/onedrive/utils' -const logger = createLogger('OneDriveBlock') - const UPLOAD_FILE_FIELD = ['file', 'fileReference'] as const const UPLOAD_FOLDER_FIELD = ['uploadFolderSelector', 'uploadManualFolderId'] as const const CREATE_FOLDER_PARENT_FIELD = [ @@ -31,7 +27,7 @@ const COPY_DESTINATION_FIELD = [ const SHARE_FILE_FIELD = ['shareLinkFileSelector', 'shareLinkManualFileId'] as const const DELETE_FILE_FIELD = ['deleteFileSelector', 'deleteManualFileId'] as const -export const OneDriveBlock: BlockConfig = { +export const OneDriveBlock: BlockConfig = { type: 'onedrive', name: 'OneDrive', description: 'Create, upload, download, search, move, copy, share, and delete files', diff --git a/apps/sim/blocks/blocks/outlook.ts b/apps/sim/blocks/blocks/outlook.ts index 929b51e993f..552bbd9a6c3 100644 --- a/apps/sim/blocks/blocks/outlook.ts +++ b/apps/sim/blocks/blocks/outlook.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { OutlookResponse } from '@/tools/outlook/types' import { getTrigger } from '@/triggers' /** @@ -16,7 +15,7 @@ const MOVE_DESTINATION_FIELD = ['destinationFolder', 'manualDestinationFolder'] const COPY_DESTINATION_FIELD = ['copyDestinationFolder', 'manualCopyDestinationFolder'] as const const CALENDAR_FIELD = ['calendarSelector', 'manualCalendarId'] as const -export const OutlookBlock: BlockConfig = { +export const OutlookBlock: BlockConfig = { type: 'outlook', name: 'Outlook', description: 'Send, read, search, reply, organize, and manage Outlook email and calendar', diff --git a/apps/sim/blocks/blocks/parallel.ts b/apps/sim/blocks/blocks/parallel.ts index 16425eb64bf..a161e58009a 100644 --- a/apps/sim/blocks/blocks/parallel.ts +++ b/apps/sim/blocks/blocks/parallel.ts @@ -1,8 +1,7 @@ import { ParallelIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' -export const ParallelBlock: BlockConfig = { +export const ParallelBlock: BlockConfig = { type: 'parallel_ai', name: 'Parallel AI', description: 'Web research with Parallel AI', diff --git a/apps/sim/blocks/blocks/peopledatalabs.ts b/apps/sim/blocks/blocks/peopledatalabs.ts index b76ca0f3f04..f5f6ec9ba7d 100644 --- a/apps/sim/blocks/blocks/peopledatalabs.ts +++ b/apps/sim/blocks/blocks/peopledatalabs.ts @@ -1,7 +1,6 @@ import { PeopleDataLabsIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { PdlPersonEnrichResponse } from '@/tools/pdl/types' /** Mutually exclusive person identifiers — first one supplied is the match key. */ const PERSON_MATCH_FIELD = ['email', 'profile', 'phone', 'first_name'] as const @@ -12,7 +11,7 @@ const COMPANY_CLEAN_FIELD = ['company_name', 'website', 'company_profile'] as co /** SQL and Elasticsearch DSL are alternate ways to express one search. */ const SEARCH_QUERY_FIELD = ['sql', 'query'] as const -export const PeopleDataLabsBlock: BlockConfig = { +export const PeopleDataLabsBlock: BlockConfig = { type: 'peopledatalabs', name: 'People Data Labs', description: 'Enrich and search people and companies', diff --git a/apps/sim/blocks/blocks/perplexity.ts b/apps/sim/blocks/blocks/perplexity.ts index 56a2d282a3c..8defd89f4b6 100644 --- a/apps/sim/blocks/blocks/perplexity.ts +++ b/apps/sim/blocks/blocks/perplexity.ts @@ -1,10 +1,7 @@ import { PerplexityIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { PerplexityChatResponse, PerplexitySearchResponse } from '@/tools/perplexity/types' -type PerplexityResponse = PerplexityChatResponse | PerplexitySearchResponse - -export const PerplexityBlock: BlockConfig = { +export const PerplexityBlock: BlockConfig = { type: 'perplexity', name: 'Perplexity', description: 'Use Perplexity AI for chat and search', diff --git a/apps/sim/blocks/blocks/persona.ts b/apps/sim/blocks/blocks/persona.ts index 3d17b89e7dd..42b94b1b99b 100644 --- a/apps/sim/blocks/blocks/persona.ts +++ b/apps/sim/blocks/blocks/persona.ts @@ -1,7 +1,6 @@ import { PersonaIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { PersonaResponse } from '@/tools/persona/types' /** Canonical basic/advanced pair for the account importer's CSV. */ const IMPORT_FILE_FIELD = ['importFile', 'importFileRef'] as const @@ -9,7 +8,7 @@ const IMPORT_FILE_FIELD = ['importFile', 'importFileRef'] as const /** A screening report names its subject either as a free-form term or as name parts. */ const REPORT_SUBJECT_FIELD = ['term', 'nameFirst'] as const -export const PersonaBlock: BlockConfig = { +export const PersonaBlock: BlockConfig = { type: 'persona', name: 'Persona', description: 'Verify identities with Persona', diff --git a/apps/sim/blocks/blocks/pi.ts b/apps/sim/blocks/blocks/pi.ts index 1aeaf91c8d5..fed7c3ee8ee 100644 --- a/apps/sim/blocks/blocks/pi.ts +++ b/apps/sim/blocks/blocks/pi.ts @@ -9,41 +9,6 @@ import { PROVIDER_CREDENTIAL_INPUTS, } from '@/blocks/utils' import { isPiByokOnlyMode } from '@/providers/pi-providers' -import type { ToolResponse } from '@/tools/types' - -interface PiResponse extends ToolResponse { - output: { - content: string - model: string - changedFiles?: string[] - diff?: string - prUrl?: string - branch?: string - reviewUrl?: string - commentsPosted?: number - rounds?: number - threadsClean?: boolean - checksGreen?: boolean - threadsResolved?: number - commitsPushed?: number - stopReason?: string - tokens?: { - input?: number - output?: number - total?: number - } - cost?: { - input?: number - output?: number - total?: number - } - providerTiming?: { - startTime?: string - endTime?: string - duration?: number - } - } -} const CLOUD: { field: 'mode'; value: 'cloud' } = { field: 'mode', value: 'cloud' } const CLOUD_REVIEW: { field: 'mode'; value: 'cloud_review' } = { @@ -162,7 +127,7 @@ const hostedModelApiKeyCondition = getApiKeyCondition() const piApiKeyCondition = (values?: Record) => isPiByokOnlyMode(values?.mode) ? CLOUD_SANDBOX : hostedModelApiKeyCondition(values) -export const PiBlock: BlockConfig = { +export const PiBlock: BlockConfig = { type: 'pi', name: 'Pi Coding Agent', description: 'Run an autonomous coding agent on a repo', diff --git a/apps/sim/blocks/blocks/pinecone.ts b/apps/sim/blocks/blocks/pinecone.ts index 429684cc4b2..e3b4671d6f6 100644 --- a/apps/sim/blocks/blocks/pinecone.ts +++ b/apps/sim/blocks/blocks/pinecone.ts @@ -1,9 +1,8 @@ import { PineconeIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { PineconeResponse } from '@/tools/pinecone/types' -export const PineconeBlock: BlockConfig = { +export const PineconeBlock: BlockConfig = { type: 'pinecone', name: 'Pinecone', description: 'Use Pinecone vector database', diff --git a/apps/sim/blocks/blocks/pipedrive.ts b/apps/sim/blocks/blocks/pipedrive.ts index 4ffed13756c..db8efcf0e42 100644 --- a/apps/sim/blocks/blocks/pipedrive.ts +++ b/apps/sim/blocks/blocks/pipedrive.ts @@ -2,11 +2,10 @@ import { PipedriveIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { PipedriveResponse } from '@/tools/pipedrive/types' const PIPELINE_FIELD = ['pipelineSelector', 'pipeline_id'] as const -export const PipedriveBlock: BlockConfig = { +export const PipedriveBlock: BlockConfig = { type: 'pipedrive', name: 'Pipedrive', description: 'Interact with Pipedrive CRM', diff --git a/apps/sim/blocks/blocks/pitchbook.ts b/apps/sim/blocks/blocks/pitchbook.ts index e4fbf813a1f..e63280fcce3 100644 --- a/apps/sim/blocks/blocks/pitchbook.ts +++ b/apps/sim/blocks/blocks/pitchbook.ts @@ -3,7 +3,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { PitchBookIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { PitchbookResponse } from '@/tools/pitchbook/types' /** * Search subblock ids are prefixed per entity family because subblock ids must @@ -184,7 +183,7 @@ function toOptionalNumber(value: unknown): number | undefined { return Number.isFinite(parsed) ? parsed : undefined } -export const PitchBookBlock: BlockConfig = { +export const PitchBookBlock: BlockConfig = { type: 'pitchbook', name: 'PitchBook', description: 'Look up private market data on companies, deals, investors, funds, and people', diff --git a/apps/sim/blocks/blocks/postgresql.ts b/apps/sim/blocks/blocks/postgresql.ts index f739c2788e1..297145fea89 100644 --- a/apps/sim/blocks/blocks/postgresql.ts +++ b/apps/sim/blocks/blocks/postgresql.ts @@ -2,9 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { PostgresIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { PostgresResponse } from '@/tools/postgresql/types' -export const PostgreSQLBlock: BlockConfig = { +export const PostgreSQLBlock: BlockConfig = { type: 'postgresql', name: 'PostgreSQL', description: 'Connect to PostgreSQL database', diff --git a/apps/sim/blocks/blocks/posthog.ts b/apps/sim/blocks/blocks/posthog.ts index 67b4a0cc2a0..bc3908a5946 100644 --- a/apps/sim/blocks/blocks/posthog.ts +++ b/apps/sim/blocks/blocks/posthog.ts @@ -1,12 +1,11 @@ import { PosthogIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { PostHogResponse } from '@/tools/posthog/types' /** Cohort membership definition, whichever of the three forms the user filled. */ const COHORT_DEFINITION_FIELD = ['filters', 'query', 'groups'] as const -export const PostHogBlock: BlockConfig = { +export const PostHogBlock: BlockConfig = { type: 'posthog', name: 'PostHog', description: 'Product analytics and feature management', diff --git a/apps/sim/blocks/blocks/prospeo.ts b/apps/sim/blocks/blocks/prospeo.ts index c05f4578341..ada126f5eb2 100644 --- a/apps/sim/blocks/blocks/prospeo.ts +++ b/apps/sim/blocks/blocks/prospeo.ts @@ -1,6 +1,5 @@ import { ProspeoIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ProspeoResponse } from '@/tools/prospeo/types' const PERSON_IDENTITY_FIELD = [ 'full_name', @@ -25,7 +24,7 @@ const COMPANY_IDENTITY_FIELD = [ const SUGGESTION_QUERY_FIELD = ['location_search', 'job_title_search'] as const -export const ProspeoBlock: BlockConfig = { +export const ProspeoBlock: BlockConfig = { type: 'prospeo', name: 'Prospeo', description: 'Enrich and search B2B contacts and companies', diff --git a/apps/sim/blocks/blocks/pulse.ts b/apps/sim/blocks/blocks/pulse.ts index 30382333e96..bbf799e9de3 100644 --- a/apps/sim/blocks/blocks/pulse.ts +++ b/apps/sim/blocks/blocks/pulse.ts @@ -7,13 +7,12 @@ import { type SubBlockType, } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { PulseParserOutput } from '@/tools/pulse/types' const DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const /* v2 swaps the advanced URL input for a file reference, so the pair differs. */ const DOCUMENT_V2_FIELD = ['fileUpload', 'fileReference'] as const -export const PulseBlock: BlockConfig = { +export const PulseBlock: BlockConfig = { type: 'pulse', name: 'Pulse', description: 'Extract text from documents using Pulse OCR', @@ -179,7 +178,7 @@ const pulseV2SubBlocks = (PulseBlock.subBlocks || []).flatMap((subBlock) => { return [subBlock] }) -export const PulseV2Block: BlockConfig = { +export const PulseV2Block: BlockConfig = { ...PulseBlock, sunset: undefined, type: 'pulse_v2', diff --git a/apps/sim/blocks/blocks/qdrant.ts b/apps/sim/blocks/blocks/qdrant.ts index 45a8a605e0d..0c0531bbefb 100644 --- a/apps/sim/blocks/blocks/qdrant.ts +++ b/apps/sim/blocks/blocks/qdrant.ts @@ -1,9 +1,8 @@ import { QdrantIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { QdrantResponse } from '@/tools/qdrant/types' -export const QdrantBlock: BlockConfig = { +export const QdrantBlock: BlockConfig = { type: 'qdrant', name: 'Qdrant', description: 'Use Qdrant vector database', diff --git a/apps/sim/blocks/blocks/quartr.ts b/apps/sim/blocks/blocks/quartr.ts index ee12110a0ef..b48dbbacfc0 100644 --- a/apps/sim/blocks/blocks/quartr.ts +++ b/apps/sim/blocks/blocks/quartr.ts @@ -1,7 +1,6 @@ import { QuartrIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' const ALL_LIST_OPERATIONS = [ 'list_companies', @@ -47,7 +46,7 @@ const UPDATED_RANGE_LIST_OPERATIONS = ['list_companies', ...DATE_RANGE_LIST_OPER const COMPANY_FILTER_FIELD = ['tickers', 'companyIds'] as const -export const QuartrBlock: BlockConfig = { +export const QuartrBlock: BlockConfig = { type: 'quartr', name: 'Quartr', description: 'Access earnings calls, transcripts, filings, and slides', diff --git a/apps/sim/blocks/blocks/quickbooks.ts b/apps/sim/blocks/blocks/quickbooks.ts index 762b570386a..37c36420f17 100644 --- a/apps/sim/blocks/blocks/quickbooks.ts +++ b/apps/sim/blocks/blocks/quickbooks.ts @@ -7,7 +7,7 @@ import { getQuickBooksReportTypesSupporting, type QuickBooksReportControl, } from '@/tools/quickbooks/report-metadata' -import type { QuickBooksReportType, QuickBooksResponse } from '@/tools/quickbooks/types' +import type { QuickBooksReportType } from '@/tools/quickbooks/types' import { QUICKBOOKS_MAX_RESULTS } from '@/tools/quickbooks/values' import { getTrigger } from '@/triggers' @@ -554,7 +554,7 @@ function attachmentIdCondition(values?: Record) { return { field: 'operation', value: DOWNLOAD_ATTACHMENT_OPERATION } } -export const QuickBooksBlock: BlockConfig = { +export const QuickBooksBlock: BlockConfig = { type: 'quickbooks', name: 'QuickBooks', description: diff --git a/apps/sim/blocks/blocks/quiver.ts b/apps/sim/blocks/blocks/quiver.ts index c87e691642a..1b357b6ce7f 100644 --- a/apps/sim/blocks/blocks/quiver.ts +++ b/apps/sim/blocks/blocks/quiver.ts @@ -3,7 +3,6 @@ import { QuiverIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { QuiverSvgResponse, QuiverSvgV2Response } from '@/tools/quiver/types' const REFERENCE_IMAGES_FIELD = ['referenceFiles', 'referenceInput'] as const const IMAGE_FIELD = ['imageFile', 'imageInput'] as const @@ -258,7 +257,7 @@ export const QuiverBlock = { description: 'List of available models (list_models operation only)', }, }, -} satisfies BlockConfig +} satisfies BlockConfig const selectQuiverV2Tool = createVersionedToolSelector({ baseToolSelector: (params: Record) => @@ -267,7 +266,7 @@ const selectQuiverV2Tool = createVersionedToolSelector({ fallbackToolId: 'quiver_text_to_svg_v2', }) -export const QuiverV2Block: BlockConfig = { +export const QuiverV2Block: BlockConfig = { ...QuiverBlock, type: 'quiver_v2', name: 'Quiver', diff --git a/apps/sim/blocks/blocks/rabbitmq.ts b/apps/sim/blocks/blocks/rabbitmq.ts index bc155c9122c..bb8fc444153 100644 --- a/apps/sim/blocks/blocks/rabbitmq.ts +++ b/apps/sim/blocks/blocks/rabbitmq.ts @@ -1,7 +1,6 @@ import { RabbitmqIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RabbitmqResponse } from '@/tools/rabbitmq/types' /** Operations that act on a single named queue. */ const QUEUE_OPERATIONS = [ @@ -31,7 +30,7 @@ const PAGINATED_OPERATIONS = [ const POLICY_OPERATIONS = ['rabbitmq_create_policy', 'rabbitmq_delete_policy'] -export const RabbitmqBlock: BlockConfig = { +export const RabbitmqBlock: BlockConfig = { type: 'rabbitmq', name: 'RabbitMQ', description: 'Publish and read messages and manage queues in RabbitMQ', diff --git a/apps/sim/blocks/blocks/railway.ts b/apps/sim/blocks/blocks/railway.ts index 7a5e6c92dd1..deb8c760d6a 100644 --- a/apps/sim/blocks/blocks/railway.ts +++ b/apps/sim/blocks/blocks/railway.ts @@ -1,9 +1,8 @@ import { RailwayIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RailwayResponse } from '@/tools/railway/types' -export const RailwayBlock: BlockConfig = { +export const RailwayBlock: BlockConfig = { type: 'railway', name: 'Railway', description: 'Manage Railway projects, services, deployments, and variables', diff --git a/apps/sim/blocks/blocks/rb2b.ts b/apps/sim/blocks/blocks/rb2b.ts index 733fc647ed6..822cc495ab0 100644 --- a/apps/sim/blocks/blocks/rb2b.ts +++ b/apps/sim/blocks/blocks/rb2b.ts @@ -1,7 +1,6 @@ import { RB2BIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { Rb2bResponse } from '@/tools/rb2b/types' const EMAIL_OPERATIONS = [ 'hem_to_business_profile', @@ -20,7 +19,7 @@ const LINKEDIN_OPERATIONS = [ const IP_OPERATIONS = ['ip_to_hem', 'ip_to_maid', 'ip_to_company'] -export const RB2BBlock: BlockConfig = { +export const RB2BBlock: BlockConfig = { type: 'rb2b', name: 'RB2B', description: 'Identify and enrich website visitors', diff --git a/apps/sim/blocks/blocks/rds.ts b/apps/sim/blocks/blocks/rds.ts index 2b18c711b55..6a66795bae8 100644 --- a/apps/sim/blocks/blocks/rds.ts +++ b/apps/sim/blocks/blocks/rds.ts @@ -2,9 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { RDSIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { RdsIntrospectResponse, RdsResponse } from '@/tools/rds/types' -export const RDSBlock: BlockConfig = { +export const RDSBlock: BlockConfig = { type: 'rds', name: 'Amazon RDS', description: 'Connect to Amazon RDS via Data API', diff --git a/apps/sim/blocks/blocks/reddit.ts b/apps/sim/blocks/blocks/reddit.ts index e05681a0508..7a6a09df0ed 100644 --- a/apps/sim/blocks/blocks/reddit.ts +++ b/apps/sim/blocks/blocks/reddit.ts @@ -2,11 +2,10 @@ import { RedditIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RedditResponse } from '@/tools/reddit/types' const REPORT_REASON_FIELD = ['reportReason', 'reportOtherReason'] as const -export const RedditBlock: BlockConfig = { +export const RedditBlock: BlockConfig = { type: 'reddit', name: 'Reddit', description: 'Access Reddit data and content', diff --git a/apps/sim/blocks/blocks/redis.ts b/apps/sim/blocks/blocks/redis.ts index 93cfab97473..662822e0a96 100644 --- a/apps/sim/blocks/blocks/redis.ts +++ b/apps/sim/blocks/blocks/redis.ts @@ -1,54 +1,6 @@ import { RedisIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - RedisCommandResponse, - RedisDeleteResponse, - RedisExistsResponse, - RedisExpireResponse, - RedisGetResponse, - RedisHDelResponse, - RedisHGetAllResponse, - RedisHGetResponse, - RedisHSetResponse, - RedisIncrbyResponse, - RedisIncrResponse, - RedisKeysResponse, - RedisLLenResponse, - RedisLPopResponse, - RedisLPushResponse, - RedisLRangeResponse, - RedisPersistResponse, - RedisRPopResponse, - RedisRPushResponse, - RedisSetnxResponse, - RedisSetResponse, - RedisTtlResponse, -} from '@/tools/redis/types' - -type RedisResponse = - | RedisGetResponse - | RedisSetResponse - | RedisDeleteResponse - | RedisKeysResponse - | RedisCommandResponse - | RedisHSetResponse - | RedisHGetResponse - | RedisHGetAllResponse - | RedisHDelResponse - | RedisIncrResponse - | RedisIncrbyResponse - | RedisExpireResponse - | RedisTtlResponse - | RedisPersistResponse - | RedisLPushResponse - | RedisRPushResponse - | RedisLPopResponse - | RedisRPopResponse - | RedisLLenResponse - | RedisLRangeResponse - | RedisExistsResponse - | RedisSetnxResponse const KEY_OPERATIONS = [ 'get', @@ -73,7 +25,7 @@ const KEY_OPERATIONS = [ 'ttl', ] as const -export const RedisBlock: BlockConfig = { +export const RedisBlock: BlockConfig = { type: 'redis', name: 'Redis', description: 'Key-value operations with Redis', diff --git a/apps/sim/blocks/blocks/reducto.ts b/apps/sim/blocks/blocks/reducto.ts index 70bfd0d660a..f248c1b841a 100644 --- a/apps/sim/blocks/blocks/reducto.ts +++ b/apps/sim/blocks/blocks/reducto.ts @@ -8,13 +8,12 @@ import { type SubBlockType, } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { ReductoParserOutput } from '@/tools/reducto/types' const DOCUMENT_FIELD = ['fileUpload', 'filePath'] as const /* v2 swaps the advanced URL input for a file reference, so the pair differs. */ const DOCUMENT_V2_FIELD = ['fileUpload', 'fileReference'] as const -export const ReductoBlock: BlockConfig = { +export const ReductoBlock: BlockConfig = { type: 'reducto', name: 'Reducto', description: 'Extract text from PDF documents', @@ -181,7 +180,7 @@ const reductoV2SubBlocks = (ReductoBlock.subBlocks || []).flatMap((subBlock) => return [subBlock] }) -export const ReductoV2Block: BlockConfig = { +export const ReductoV2Block: BlockConfig = { ...ReductoBlock, sunset: undefined, type: 'reducto_v2', diff --git a/apps/sim/blocks/blocks/response.ts b/apps/sim/blocks/blocks/response.ts index c5c1f197299..8183b9cf8c1 100644 --- a/apps/sim/blocks/blocks/response.ts +++ b/apps/sim/blocks/blocks/response.ts @@ -1,8 +1,7 @@ import { ResponseIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' -import type { ResponseBlockOutput } from '@/tools/response/types' -export const ResponseBlock: BlockConfig = { +export const ResponseBlock: BlockConfig = { type: 'response', name: 'Response', description: 'Send structured API response', diff --git a/apps/sim/blocks/blocks/revenuecat.ts b/apps/sim/blocks/blocks/revenuecat.ts index cca408702ae..1904d1386a5 100644 --- a/apps/sim/blocks/blocks/revenuecat.ts +++ b/apps/sim/blocks/blocks/revenuecat.ts @@ -1,10 +1,9 @@ import { RevenueCatIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RevenueCatResponse } from '@/tools/revenuecat/types' import { getTrigger } from '@/triggers' -export const RevenueCatBlock: BlockConfig = { +export const RevenueCatBlock: BlockConfig = { type: 'revenuecat', name: 'RevenueCat', description: 'Manage in-app subscriptions and entitlements', diff --git a/apps/sim/blocks/blocks/rootly.ts b/apps/sim/blocks/blocks/rootly.ts index 0b16a55c81c..4d2f458b601 100644 --- a/apps/sim/blocks/blocks/rootly.ts +++ b/apps/sim/blocks/blocks/rootly.ts @@ -1,10 +1,9 @@ import { RootlyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { RootlyResponse } from '@/tools/rootly/types' import { getTrigger } from '@/triggers' -export const RootlyBlock: BlockConfig = { +export const RootlyBlock: BlockConfig = { type: 'rootly', name: 'Rootly', description: 'Manage incidents, alerts, and on-call with Rootly', diff --git a/apps/sim/blocks/blocks/router.ts b/apps/sim/blocks/blocks/router.ts index 63e988e70e3..259e6d464b0 100644 --- a/apps/sim/blocks/blocks/router.ts +++ b/apps/sim/blocks/blocks/router.ts @@ -7,29 +7,6 @@ import { getSerializedModelProviderId, PROVIDER_CREDENTIAL_INPUTS, } from '@/blocks/utils' -import type { ToolResponse } from '@/tools/types' - -interface RouterResponse extends ToolResponse { - output: { - prompt: string - model: string - tokens?: { - prompt?: number - completion?: number - total?: number - } - cost?: { - input: number - output: number - total: number - } - selectedPath: { - blockId: string - blockType: string - blockTitle: string - } - } -} interface TargetBlock { id: string @@ -141,7 +118,7 @@ Respond with a JSON object containing: * Legacy Router Block (block-based routing). * Hidden from toolbar but still supported for existing workflows. */ -export const RouterBlock: BlockConfig = { +export const RouterBlock: BlockConfig = { type: 'router', name: 'Router (Legacy)', description: 'Route workflow', @@ -239,35 +216,7 @@ export const RouterBlock: BlockConfig = { }, } -/** - * Router V2 Block (port-based routing). - * Uses route definitions with descriptions instead of downstream block names. - */ -interface RouterV2Response extends ToolResponse { - output: { - context: string - model: string - tokens?: { - prompt?: number - completion?: number - total?: number - } - cost?: { - input: number - output: number - total: number - } - selectedRoute: string - reasoning: string - selectedPath: { - blockId: string - blockType: string - blockTitle: string - } - } -} - -export const RouterV2Block: BlockConfig = { +export const RouterV2Block: BlockConfig = { type: 'router_v2', name: 'Router', description: 'Route workflow based on context', diff --git a/apps/sim/blocks/blocks/s3.ts b/apps/sim/blocks/blocks/s3.ts index 9a341a5a055..5875a638b1a 100644 --- a/apps/sim/blocks/blocks/s3.ts +++ b/apps/sim/blocks/blocks/s3.ts @@ -2,7 +2,6 @@ import { S3Icon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { S3Response } from '@/tools/s3/types' /** * Normalize the batch-delete keys input into a string array. Accepts an array, @@ -33,7 +32,7 @@ function parseObjectKeys(value: unknown): string[] { /** Upload payload: an uploaded file, a referenced file, or inline text. */ const UPLOAD_SOURCE_FIELD = ['uploadFile', 'fileReference', 'content'] as const -export const S3Block: BlockConfig = { +export const S3Block: BlockConfig = { type: 's3', name: 'S3', description: 'Upload, download, list, and manage S3 files and buckets', diff --git a/apps/sim/blocks/blocks/salesforce.ts b/apps/sim/blocks/blocks/salesforce.ts index 47f89fd1788..3caa5163e27 100644 --- a/apps/sim/blocks/blocks/salesforce.ts +++ b/apps/sim/blocks/blocks/salesforce.ts @@ -2,10 +2,9 @@ import { SalesforceIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SalesforceResponse } from '@/tools/salesforce/types' import { getTrigger } from '@/triggers' -export const SalesforceBlock: BlockConfig = { +export const SalesforceBlock: BlockConfig = { type: 'salesforce', name: 'Salesforce', description: 'Interact with Salesforce CRM', diff --git a/apps/sim/blocks/blocks/sap_concur.ts b/apps/sim/blocks/blocks/sap_concur.ts index d39d475326d..0d78f1c4c9a 100644 --- a/apps/sim/blocks/blocks/sap_concur.ts +++ b/apps/sim/blocks/blocks/sap_concur.ts @@ -2,7 +2,7 @@ import { SapConcurIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { SapConcurResponse, UserFileLike } from '@/tools/sap_concur/types' +import type { UserFileLike } from '@/tools/sap_concur/types' const toBool = (v: unknown): boolean | undefined => { if (v === undefined || v === null || v === '') return undefined @@ -192,7 +192,7 @@ const BODY_OPS = [ /** Canonical receipt pair: basic upload, advanced file reference. */ const RECEIPT_FIELD = ['receiptFile', 'receiptFileRef'] as const -export const SapConcurBlock: BlockConfig = { +export const SapConcurBlock: BlockConfig = { type: 'sap_concur', name: 'SAP Concur', description: 'Manage expense reports, travel requests, cash advances, and more in SAP Concur', diff --git a/apps/sim/blocks/blocks/sap_s4hana.ts b/apps/sim/blocks/blocks/sap_s4hana.ts index 46137562da2..ac705937c6f 100644 --- a/apps/sim/blocks/blocks/sap_s4hana.ts +++ b/apps/sim/blocks/blocks/sap_s4hana.ts @@ -1,7 +1,6 @@ import { SapS4HanaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta, CanvasSentence } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SapS4HanaResponse } from '@/tools/sap_s4hana/types' /** * Whichever name a new business partner carries: an organization has @@ -37,7 +36,7 @@ function updateSentence(noun: string, keyField: string): CanvasSentence { ] } -export const SapS4HanaBlock: BlockConfig = { +export const SapS4HanaBlock: BlockConfig = { type: 'sap_s4hana', name: 'SAP S4HANA', description: 'Read and write SAP S4HANA Cloud business data via OData', diff --git a/apps/sim/blocks/blocks/secrets_manager.ts b/apps/sim/blocks/blocks/secrets_manager.ts index 74fad7758a5..fe0067ff84d 100644 --- a/apps/sim/blocks/blocks/secrets_manager.ts +++ b/apps/sim/blocks/blocks/secrets_manager.ts @@ -1,9 +1,8 @@ import { SecretsManagerIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { SecretsManagerBaseResponse } from '@/tools/secrets_manager/types' -export const SecretsManagerBlock: BlockConfig = { +export const SecretsManagerBlock: BlockConfig = { type: 'secrets_manager', name: 'AWS Secrets Manager', description: 'Connect to AWS Secrets Manager', diff --git a/apps/sim/blocks/blocks/semrush.ts b/apps/sim/blocks/blocks/semrush.ts index d552a8680f1..069de731450 100644 --- a/apps/sim/blocks/blocks/semrush.ts +++ b/apps/sim/blocks/blocks/semrush.ts @@ -1,7 +1,6 @@ import { SemrushIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SemrushResponse } from '@/tools/semrush/types' const DATABASE_OPTIONS = [ { label: 'United States (us)', id: 'us' }, @@ -347,7 +346,7 @@ Return ONLY the 8-character value - no explanations, no quotes, no extra text.`, generationType: 'timestamp' as const, } -export const SemrushBlock: BlockConfig = { +export const SemrushBlock: BlockConfig = { type: 'semrush', name: 'Semrush', description: 'Research SEO and paid search data with Semrush', diff --git a/apps/sim/blocks/blocks/sendgrid.ts b/apps/sim/blocks/blocks/sendgrid.ts index c31cfd7054a..0553afecc4f 100644 --- a/apps/sim/blocks/blocks/sendgrid.ts +++ b/apps/sim/blocks/blocks/sendgrid.ts @@ -3,9 +3,8 @@ import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' import { toActiveFlag } from '@/tools/sendgrid/create_template_version' -import type { SendMailResult } from '@/tools/sendgrid/types' -export const SendGridBlock: BlockConfig = { +export const SendGridBlock: BlockConfig = { type: 'sendgrid', name: 'SendGrid', description: 'Send emails and manage contacts, lists, and templates with SendGrid', diff --git a/apps/sim/blocks/blocks/sentry.ts b/apps/sim/blocks/blocks/sentry.ts index 8ac6f560aed..c639169b0a3 100644 --- a/apps/sim/blocks/blocks/sentry.ts +++ b/apps/sim/blocks/blocks/sentry.ts @@ -2,10 +2,9 @@ import { Bug } from '@sim/emcn/icons' import { SentryIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SentryResponse } from '@/tools/sentry/types' import { getTrigger } from '@/triggers' -export const SentryBlock: BlockConfig = { +export const SentryBlock: BlockConfig = { type: 'sentry', name: 'Sentry', description: 'Manage Sentry issues, projects, events, and releases', diff --git a/apps/sim/blocks/blocks/serper.ts b/apps/sim/blocks/blocks/serper.ts index 758e23a81c5..f581b39197d 100644 --- a/apps/sim/blocks/blocks/serper.ts +++ b/apps/sim/blocks/blocks/serper.ts @@ -1,9 +1,8 @@ import { SerperIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SearchResponse } from '@/tools/serper/types' -export const SerperBlock: BlockConfig = { +export const SerperBlock: BlockConfig = { type: 'serper', name: 'Serper', description: 'Search the web using Serper', diff --git a/apps/sim/blocks/blocks/servicenow.ts b/apps/sim/blocks/blocks/servicenow.ts index 6ac69083260..b58b6e7b2b8 100644 --- a/apps/sim/blocks/blocks/servicenow.ts +++ b/apps/sim/blocks/blocks/servicenow.ts @@ -15,7 +15,6 @@ import { INCIDENT_STATE_OPTIONS, PRIORITY_OPTIONS, } from '@/tools/servicenow/constants' -import type { ServiceNowResponse } from '@/tools/servicenow/types' import { getTrigger } from '@/triggers' const FILE_FIELD = ['uploadFile', 'fileReference'] as const @@ -1923,7 +1922,7 @@ Output: {"state": "2", "assigned_to": "john.doe", "work_notes": "Assigned and st 'servicenow_webhook', ], }, -} satisfies BlockConfig +} satisfies BlockConfig export const ServiceNowV2Block: BlockConfig = { ...ServiceNowBlock, diff --git a/apps/sim/blocks/blocks/ses.ts b/apps/sim/blocks/blocks/ses.ts index 16e72df3d86..c1f2b2d0125 100644 --- a/apps/sim/blocks/blocks/ses.ts +++ b/apps/sim/blocks/blocks/ses.ts @@ -1,9 +1,8 @@ import { SESIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' -export const SESBlock: BlockConfig = { +export const SESBlock: BlockConfig = { type: 'ses', name: 'AWS SES', description: 'Send emails and manage templates with AWS Simple Email Service', diff --git a/apps/sim/blocks/blocks/sftp.ts b/apps/sim/blocks/blocks/sftp.ts index a4132d27565..aaf84f3126b 100644 --- a/apps/sim/blocks/blocks/sftp.ts +++ b/apps/sim/blocks/blocks/sftp.ts @@ -4,7 +4,6 @@ import { SftpIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { SftpUploadResult } from '@/tools/sftp/types' export const SftpBlock = { type: 'sftp', @@ -335,7 +334,7 @@ export const SftpBlock = { message: { type: 'string', description: 'Operation status message' }, error: { type: 'string', description: 'Error message if operation failed' }, }, -} satisfies BlockConfig +} satisfies BlockConfig const selectSftpV2Tool = createVersionedToolSelector({ baseToolSelector: SftpBlock.tools.config.tool, diff --git a/apps/sim/blocks/blocks/sharepoint.ts b/apps/sim/blocks/blocks/sharepoint.ts index 0e5e587605a..666c7137fd1 100644 --- a/apps/sim/blocks/blocks/sharepoint.ts +++ b/apps/sim/blocks/blocks/sharepoint.ts @@ -5,7 +5,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { SharepointResponse } from '@/tools/sharepoint/types' const logger = createLogger('SharepointBlock') @@ -22,7 +21,7 @@ const V2_FILES_FIELD = ['uploadFiles', 'fileRefs'] as const /* Reading a page accepts either identifier; neither is a canonical pair. */ const PAGE_REF_FIELD = ['pageName', 'pageId'] as const -export const SharepointBlock: BlockConfig = { +export const SharepointBlock: BlockConfig = { type: 'sharepoint', name: 'Sharepoint', description: 'Work with pages and lists', @@ -908,7 +907,7 @@ const SHAREPOINT_V2_PAGE_MUTATION_OPERATIONS = [ 'sharepoint_delete_page', ] as const -export const SharepointV2Block: BlockConfig = { +export const SharepointV2Block: BlockConfig = { ...SharepointBlock, sunset: undefined, type: 'sharepoint_v2', diff --git a/apps/sim/blocks/blocks/shopify.ts b/apps/sim/blocks/blocks/shopify.ts index a4575984d9a..65e09962f4a 100644 --- a/apps/sim/blocks/blocks/shopify.ts +++ b/apps/sim/blocks/blocks/shopify.ts @@ -4,12 +4,6 @@ import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { parseOptionalBooleanInput, parseOptionalNumberInput } from '@/blocks/utils' -interface ShopifyResponse { - success: boolean - error?: string - output: Record -} - const LIST_OPERATIONS = [ 'shopify_list_products', 'shopify_list_orders', @@ -19,7 +13,7 @@ const LIST_OPERATIONS = [ 'shopify_list_collections', ] as const -export const ShopifyBlock: BlockConfig = { +export const ShopifyBlock: BlockConfig = { type: 'shopify', name: 'Shopify', description: 'Manage products, orders, customers, and inventory in your Shopify store', diff --git a/apps/sim/blocks/blocks/slack.ts b/apps/sim/blocks/blocks/slack.ts index 5df2aa2c0d2..90b7ed77696 100644 --- a/apps/sim/blocks/blocks/slack.ts +++ b/apps/sim/blocks/blocks/slack.ts @@ -18,7 +18,6 @@ import { parseOptionalJsonInput, parseOptionalNumberInput, } from '@/blocks/utils' -import type { SlackResponse } from '@/tools/slack/types' import { getTrigger } from '@/triggers' /** @@ -51,8 +50,6 @@ const SLACK_V2_CUSTOM_BOT_OPERATIONS = [ ...SLACK_V2_LIST_OPERATIONS, ] as const -const SLACK_V2_SESSION_OPERATIONS = ['set_agent_session_status', 'rename_agent_session'] as const - const CHANNEL_FIELD = ['channel', 'manualChannel'] as const /** @@ -72,7 +69,7 @@ const MESSAGE_BODY_FIELD = ['text', 'blocks'] as const */ const SLACK_TRIGGER_CHANNEL_FIELD = ['channelFilter', 'manualChannelFilter'] as const -export const SlackBlock: BlockConfig = { +export const SlackBlock: BlockConfig = { type: 'slack', name: 'Slack', description: @@ -1963,7 +1960,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te renameChannelName, conversationTopic, conversationPurpose, - ...rest } = params const isDM = destinationType === 'dm' @@ -3501,7 +3497,7 @@ const { * Slack actions and triggers with reusable credentials. App-scoped operations use * custom bots with the required scopes. */ -export const SlackV2Block: BlockConfig = { +export const SlackV2Block: BlockConfig = { ...SlackBlock, type: 'slack_v2', description: 'Manage Slack messages, channels, users, files, Lists, canvases, and Agent Sessions', diff --git a/apps/sim/blocks/blocks/smartlead.ts b/apps/sim/blocks/blocks/smartlead.ts index 2eef1dc6269..73de2afdb3d 100644 --- a/apps/sim/blocks/blocks/smartlead.ts +++ b/apps/sim/blocks/blocks/smartlead.ts @@ -2,7 +2,6 @@ import { isRecordLike } from '@sim/utils/object' import { SmartleadIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SmartleadResponse } from '@/tools/smartlead/types' const CAMPAIGN_ID_OPERATIONS = [ 'get_campaign', @@ -73,7 +72,7 @@ const EMAIL_ACCOUNT_ID_OPERATIONS = [ 'remove_email_accounts_from_campaign', ] as const -export const SmartleadBlock: BlockConfig = { +export const SmartleadBlock: BlockConfig = { type: 'smartlead', name: 'Smartlead', description: 'Manage Smartlead cold email campaigns, sequences, and leads', diff --git a/apps/sim/blocks/blocks/smtp.ts b/apps/sim/blocks/blocks/smtp.ts index 41ef47f693b..d224dc30229 100644 --- a/apps/sim/blocks/blocks/smtp.ts +++ b/apps/sim/blocks/blocks/smtp.ts @@ -2,9 +2,8 @@ import { SmtpIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { SmtpSendMailResult } from '@/tools/smtp/types' -export const SmtpBlock: BlockConfig = { +export const SmtpBlock: BlockConfig = { type: 'smtp', name: 'SMTP', description: 'Send emails via any SMTP mail server', diff --git a/apps/sim/blocks/blocks/snowflake.ts b/apps/sim/blocks/blocks/snowflake.ts index 29a3e91fe2d..f0fd5994c9e 100644 --- a/apps/sim/blocks/blocks/snowflake.ts +++ b/apps/sim/blocks/blocks/snowflake.ts @@ -2,7 +2,6 @@ import { SnowflakeIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { parseOptionalJsonInput, parseOptionalNumberInput } from '@/blocks/utils' -import type { SnowflakeStatementResponse } from '@/tools/snowflake/types' import { SNOWFLAKE_WAREHOUSE_SIZES } from '@/tools/snowflake/types' const sqlSubmissionOperations = [ @@ -238,7 +237,7 @@ function resolveCopyOnError(value: unknown, threshold: unknown): string | undefi return `SKIP_FILE_${number}${value === 'SKIP_FILE_PERCENT' ? '%' : ''}` } -export const SnowflakeBlock: BlockConfig = { +export const SnowflakeBlock: BlockConfig = { type: 'snowflake', name: 'Snowflake', description: 'Query data, ask Cortex Analyst, and manage warehouses and tasks in Snowflake', diff --git a/apps/sim/blocks/blocks/splunk.ts b/apps/sim/blocks/blocks/splunk.ts index b197ac9f3f7..ee899609859 100644 --- a/apps/sim/blocks/blocks/splunk.ts +++ b/apps/sim/blocks/blocks/splunk.ts @@ -1,7 +1,6 @@ import { SplunkIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SplunkResponse } from '@/tools/splunk/types' /** * Normalize a Splunk toggle. A dropdown supplies the strings `'true'`/`'false'`, @@ -40,7 +39,7 @@ function assignSplunkNumber(target: Record, key: string, value: target[key] = Number.isFinite(parsed) ? parsed : undefined } -export const SplunkBlock: BlockConfig = { +export const SplunkBlock: BlockConfig = { type: 'splunk', name: 'Splunk', description: 'Run SPL searches and manage saved searches and alerts in Splunk', diff --git a/apps/sim/blocks/blocks/spotify.ts b/apps/sim/blocks/blocks/spotify.ts index 06d51b19750..596587140c8 100644 --- a/apps/sim/blocks/blocks/spotify.ts +++ b/apps/sim/blocks/blocks/spotify.ts @@ -2,7 +2,6 @@ import { SpotifyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { ToolResponse } from '@/tools/types' /** * Canonical basic/advanced pair for the playlist cover art, shared by the card @@ -18,7 +17,7 @@ const COVER_IMAGE_FIELD = ['coverImageFile', 'coverImageRef'] as const */ const PLAYBACK_TARGET_FIELD = ['context_uri', 'playUris'] as const -export const SpotifyBlock: BlockConfig = { +export const SpotifyBlock: BlockConfig = { type: 'spotify', name: 'Spotify', description: 'Search music, manage playlists, control playback, and access your library', diff --git a/apps/sim/blocks/blocks/sqs.ts b/apps/sim/blocks/blocks/sqs.ts index 45f6119f5af..f9c66cd1bc6 100644 --- a/apps/sim/blocks/blocks/sqs.ts +++ b/apps/sim/blocks/blocks/sqs.ts @@ -2,9 +2,8 @@ import { getErrorMessage } from '@sim/utils/errors' import { SQSIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SqsResponse } from '@/tools/sqs/types' -export const SQSBlock: BlockConfig = { +export const SQSBlock: BlockConfig = { type: 'sqs', name: 'Amazon SQS', description: 'Connect to Amazon SQS', diff --git a/apps/sim/blocks/blocks/square.ts b/apps/sim/blocks/blocks/square.ts index 4c898ce9917..5be1a1e17a6 100644 --- a/apps/sim/blocks/blocks/square.ts +++ b/apps/sim/blocks/blocks/square.ts @@ -3,7 +3,6 @@ import { SquareIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { SquareResponse } from '@/tools/square/types' const CUSTOMER_NAME_FIELD = ['givenName', 'companyName', 'nickname'] as const @@ -11,7 +10,7 @@ const CUSTOMER_CONTACT_FIELD = ['emailAddress', 'phoneNumber'] as const const CATALOG_IMAGE_FIELD = ['uploadFile', 'fileRef'] as const -export const SquareBlock: BlockConfig = { +export const SquareBlock: BlockConfig = { type: 'square', name: 'Square', description: 'Process payments and manage Square commerce data', diff --git a/apps/sim/blocks/blocks/ssh.ts b/apps/sim/blocks/blocks/ssh.ts index c49a3a4de0c..e85e51bbbb8 100644 --- a/apps/sim/blocks/blocks/ssh.ts +++ b/apps/sim/blocks/blocks/ssh.ts @@ -4,7 +4,6 @@ import { SshIcon, SshTerminalIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector } from '@/blocks/utils' -import type { SSHResponse } from '@/tools/ssh/types' export const SSHBlock = { type: 'ssh', @@ -665,7 +664,7 @@ Examples: os: { type: 'string', description: 'Operating system' }, message: { type: 'string', description: 'Operation status message' }, }, -} satisfies BlockConfig +} satisfies BlockConfig const selectSshV2Tool = createVersionedToolSelector({ baseToolSelector: SSHBlock.tools.config.tool, diff --git a/apps/sim/blocks/blocks/ssm.ts b/apps/sim/blocks/blocks/ssm.ts index 9d9aec3d3f8..91a79774b9c 100644 --- a/apps/sim/blocks/blocks/ssm.ts +++ b/apps/sim/blocks/blocks/ssm.ts @@ -1,7 +1,6 @@ import { SSMIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { SsmSendCommandResponse } from '@/tools/ssm/types' /** Operations whose SSM API caps `MaxResults` at 50. */ const STANDARD_PAGE_OPERATIONS = [ @@ -43,7 +42,7 @@ function toParsedJson(value: unknown): unknown { return JSON.parse(value) } -export const SSMBlock: BlockConfig = { +export const SSMBlock: BlockConfig = { type: 'ssm', name: 'AWS Systems Manager', description: 'Run commands, manage parameters, and audit managed nodes', diff --git a/apps/sim/blocks/blocks/stagehand.ts b/apps/sim/blocks/blocks/stagehand.ts index b68a3eca5bf..981708decec 100644 --- a/apps/sim/blocks/blocks/stagehand.ts +++ b/apps/sim/blocks/blocks/stagehand.ts @@ -4,7 +4,7 @@ import type { StagehandAgentResponse, StagehandExtractResponse } from '@/tools/s export type StagehandResponse = StagehandExtractResponse | StagehandAgentResponse -export const StagehandBlock: BlockConfig = { +export const StagehandBlock: BlockConfig = { type: 'stagehand', name: 'Stagehand', description: 'Web automation and data extraction', diff --git a/apps/sim/blocks/blocks/stripe.ts b/apps/sim/blocks/blocks/stripe.ts index 8e926a3d3fb..6ad2623de75 100644 --- a/apps/sim/blocks/blocks/stripe.ts +++ b/apps/sim/blocks/blocks/stripe.ts @@ -1,7 +1,6 @@ import { StripeIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { StripeResponse } from '@/tools/stripe/types' import { getTrigger } from '@/triggers' /** @@ -10,7 +9,7 @@ import { getTrigger } from '@/triggers' */ const CAPTURE_AMOUNT_FIELD = ['amount_to_capture', 'amount'] as const -export const StripeBlock: BlockConfig = { +export const StripeBlock: BlockConfig = { type: 'stripe', name: 'Stripe', description: 'Process payments and manage Stripe data', diff --git a/apps/sim/blocks/blocks/sts.ts b/apps/sim/blocks/blocks/sts.ts index e18134b9483..5ae3956180f 100644 --- a/apps/sim/blocks/blocks/sts.ts +++ b/apps/sim/blocks/blocks/sts.ts @@ -1,9 +1,8 @@ import { STSIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { STSBaseResponse } from '@/tools/sts/types' -export const STSBlock: BlockConfig = { +export const STSBlock: BlockConfig = { type: 'sts', name: 'AWS STS', description: 'Connect to AWS Security Token Service', diff --git a/apps/sim/blocks/blocks/stt.ts b/apps/sim/blocks/blocks/stt.ts index 0878ec0bdf2..65d21d1fd83 100644 --- a/apps/sim/blocks/blocks/stt.ts +++ b/apps/sim/blocks/blocks/stt.ts @@ -2,13 +2,12 @@ import { omit } from '@sim/utils/object' import { STTIcon } from '@/components/icons' import { AuthMode, type BlockConfig, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { SttBlockResponse } from '@/tools/stt/types' const AUDIO_FIELD = ['audioFile', 'audioFileReference', 'audioUrl'] as const /* v2 drops the URL input, keeping only the upload/reference pair. */ const AUDIO_V2_FIELD = ['audioFile', 'audioFileReference'] as const -export const SttBlock: BlockConfig = { +export const SttBlock: BlockConfig = { type: 'stt', name: 'Speech-to-Text', description: 'Convert speech to text using AI', @@ -372,7 +371,7 @@ export const SttBlock: BlockConfig = { const sttV2Inputs = SttBlock.inputs ? omit(SttBlock.inputs, ['audioUrl']) : {} const sttV2SubBlocks = (SttBlock.subBlocks || []).filter((subBlock) => subBlock.id !== 'audioUrl') -export const SttV2Block: BlockConfig = { +export const SttV2Block: BlockConfig = { ...SttBlock, sunset: undefined, type: 'stt_v2', diff --git a/apps/sim/blocks/blocks/supabase.ts b/apps/sim/blocks/blocks/supabase.ts index 34304f84403..f8db42d42ca 100644 --- a/apps/sim/blocks/blocks/supabase.ts +++ b/apps/sim/blocks/blocks/supabase.ts @@ -1,16 +1,12 @@ -import { createLogger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' import { SupabaseIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { SupabaseResponse } from '@/tools/supabase/types' - -const logger = createLogger('SupabaseBlock') /** Canonical basic/advanced pair for the storage upload payload. */ const FILE_DATA_FIELD = ['file', 'fileContent'] as const -export const SupabaseBlock: BlockConfig = { +export const SupabaseBlock: BlockConfig = { type: 'supabase', name: 'Supabase', description: 'Use Supabase database', diff --git a/apps/sim/blocks/blocks/table.ts b/apps/sim/blocks/blocks/table.ts index 1381a395f6d..1eecf8d7f3d 100644 --- a/apps/sim/blocks/blocks/table.ts +++ b/apps/sim/blocks/blocks/table.ts @@ -5,7 +5,6 @@ import { filterRulesToFilter, sortRulesToSort } from '@/lib/table/query-builder/ import type { BlockConfig } from '@/blocks/types' import { parseOptionalNumberInput } from '@/blocks/utils' import { TABLE_ID_PARAM } from '@/tools/table/params' -import type { TableQueryResponse } from '@/tools/table/types' import { getTrigger } from '@/triggers' /** @@ -205,7 +204,7 @@ const QUERY_FILTER_FIELD = ['filterBuilder', 'filter'] as const const BULK_FILTER_FIELD = ['bulkFilterBuilder', 'filter'] as const const SORT_FIELD = ['sortBuilder', 'sort'] as const -export const TableBlock: BlockConfig = { +export const TableBlock: BlockConfig = { type: 'table', name: 'Table', description: 'User-defined data tables', diff --git a/apps/sim/blocks/blocks/table_v2.ts b/apps/sim/blocks/blocks/table_v2.ts index e208f0c0ba8..e8e79952670 100644 --- a/apps/sim/blocks/blocks/table_v2.ts +++ b/apps/sim/blocks/blocks/table_v2.ts @@ -13,7 +13,6 @@ import type { } from '@/lib/table/types' import type { BlockConfig } from '@/blocks/types' import { TABLE_ID_PARAM } from '@/tools/table/params' -import type { TableQueryV2Response } from '@/tools/table/types' import { getTrigger } from '@/triggers' /** @@ -222,7 +221,7 @@ const TABLE_FIELD = ['tableSelector', 'manualTableId'] as const const FILTER_FIELD = ['filterBuilder', 'filter'] as const const SORT_FIELD = ['sortBuilder', 'order'] as const -export const TableV2Block: BlockConfig = { +export const TableV2Block: BlockConfig = { type: 'table_v2', name: 'Table', description: 'User-defined data tables', diff --git a/apps/sim/blocks/blocks/tavily.ts b/apps/sim/blocks/blocks/tavily.ts index dfb33abf697..62f42707bb4 100644 --- a/apps/sim/blocks/blocks/tavily.ts +++ b/apps/sim/blocks/blocks/tavily.ts @@ -1,9 +1,8 @@ import { TavilyIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TavilyResponse } from '@/tools/tavily/types' -export const TavilyBlock: BlockConfig = { +export const TavilyBlock: BlockConfig = { type: 'tavily', name: 'Tavily', description: 'Search and extract information', diff --git a/apps/sim/blocks/blocks/telegram.ts b/apps/sim/blocks/blocks/telegram.ts index 527f59f785f..b365d376d55 100644 --- a/apps/sim/blocks/blocks/telegram.ts +++ b/apps/sim/blocks/blocks/telegram.ts @@ -3,7 +3,6 @@ import { resolveHttpsUrlFromFileInput } from '@/lib/uploads/utils/file-utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { TelegramResponse } from '@/tools/telegram/types' import { getTrigger } from '@/triggers' /** @@ -45,7 +44,7 @@ const AUDIO_FIELD = ['audioFile', 'audioRef', 'audio'] as const const ANIMATION_FIELD = ['animationFile', 'animationRef', 'animation'] as const const DOCUMENT_FIELD = ['attachmentFiles', 'files'] as const -export const TelegramBlock: BlockConfig = { +export const TelegramBlock: BlockConfig = { type: 'telegram', name: 'Telegram', description: 'Interact with Telegram', diff --git a/apps/sim/blocks/blocks/temporal.ts b/apps/sim/blocks/blocks/temporal.ts index d2f7c22d706..49d8c30133e 100644 --- a/apps/sim/blocks/blocks/temporal.ts +++ b/apps/sim/blocks/blocks/temporal.ts @@ -1,7 +1,6 @@ import { TemporalIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { TemporalResponse } from '@/tools/temporal/types' /** Coerces a subBlock value to a finite number, returning undefined for empty or non-numeric input. */ function toFiniteNumber(value: unknown): number | undefined { @@ -63,7 +62,7 @@ Examples: Return ONLY valid JSON - no explanations, no extra text.` -export const TemporalBlock: BlockConfig = { +export const TemporalBlock: BlockConfig = { type: 'temporal', name: 'Temporal', description: 'Start, signal, query, and manage Temporal workflow executions', diff --git a/apps/sim/blocks/blocks/textract.ts b/apps/sim/blocks/blocks/textract.ts index ca958c66d7d..1ab086cbe35 100644 --- a/apps/sim/blocks/blocks/textract.ts +++ b/apps/sim/blocks/blocks/textract.ts @@ -7,13 +7,12 @@ import { type SubBlockType, } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { TextractParserOutput } from '@/tools/textract/types' const LEGACY_DOCUMENT_FIELD = ['fileUpload', 'filePath', 's3Uri'] as const const DOCUMENT_FIELD = ['fileUpload', 'fileReference', 's3Uri'] as const const UPLOADED_DOCUMENT_FIELD = ['fileUpload', 'fileReference'] as const -export const TextractBlock: BlockConfig = { +export const TextractBlock: BlockConfig = { type: 'textract', name: 'AWS Textract', description: 'Extract text, tables, and forms from documents', @@ -253,7 +252,7 @@ function requireAwsCredentials(params: Record) { return { accessKeyId, secretAccessKey, region } } -export const TextractV2Block: BlockConfig = { +export const TextractV2Block: BlockConfig = { ...TextractBlock, sunset: undefined, type: 'textract_v2', diff --git a/apps/sim/blocks/blocks/thinking.ts b/apps/sim/blocks/blocks/thinking.ts index cb5031b0c45..96cc6ad3054 100644 --- a/apps/sim/blocks/blocks/thinking.ts +++ b/apps/sim/blocks/blocks/thinking.ts @@ -1,8 +1,7 @@ import { BrainIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' -import type { ThinkingToolResponse } from '@/tools/thinking/types' -export const ThinkingBlock: BlockConfig = { +export const ThinkingBlock: BlockConfig = { type: 'thinking', name: 'Thinking', description: 'Forces model to outline its thought process.', diff --git a/apps/sim/blocks/blocks/tiktok.ts b/apps/sim/blocks/blocks/tiktok.ts index af1638baf6d..ce776246e1b 100644 --- a/apps/sim/blocks/blocks/tiktok.ts +++ b/apps/sim/blocks/blocks/tiktok.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { TikTokResponse } from '@/tools/tiktok/types' import { getTrigger } from '@/triggers' const TIKTOK_TOOL_IDS = new Set([ @@ -25,7 +24,7 @@ const TIKTOK_OPERATION_INPUT_KEYS = [ /** Video to upload, whichever mode the card is in. */ const VIDEO_FILE_FIELD = ['videoFile', 'videoFileRef'] as const -export const TikTokBlock: BlockConfig = { +export const TikTokBlock: BlockConfig = { type: 'tiktok', name: 'TikTok', description: 'Access TikTok profiles and videos, and upload inbox drafts', diff --git a/apps/sim/blocks/blocks/tinybird.ts b/apps/sim/blocks/blocks/tinybird.ts index ccbb1e570b9..6a2289b0026 100644 --- a/apps/sim/blocks/blocks/tinybird.ts +++ b/apps/sim/blocks/blocks/tinybird.ts @@ -1,9 +1,8 @@ import { TinybirdIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TinybirdResponse } from '@/tools/tinybird/types' -export const TinybirdBlock: BlockConfig = { +export const TinybirdBlock: BlockConfig = { type: 'tinybird', name: 'Tinybird', description: 'Send events, query data, and manage Data Sources with Tinybird', diff --git a/apps/sim/blocks/blocks/tinyfish.ts b/apps/sim/blocks/blocks/tinyfish.ts index 7dbb70c81bd..8fca074387e 100644 --- a/apps/sim/blocks/blocks/tinyfish.ts +++ b/apps/sim/blocks/blocks/tinyfish.ts @@ -1,7 +1,6 @@ import { TinyFishIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TinyFishRunResponse } from '@/tools/tinyfish/types' /** Operations that build and submit an automation run. */ const AUTOMATION_OPERATIONS = ['tinyfish_run', 'tinyfish_run_async'] @@ -28,7 +27,7 @@ const PROXY_COUNTRY_OPTIONS = [ { label: 'Australia', id: 'AU' }, ] -export const TinyFishBlock: BlockConfig = { +export const TinyFishBlock: BlockConfig = { type: 'tinyfish', name: 'TinyFish', description: 'Automate and read the live web', diff --git a/apps/sim/blocks/blocks/trello.ts b/apps/sim/blocks/blocks/trello.ts index 2b33336d193..9a69478c0cb 100644 --- a/apps/sim/blocks/blocks/trello.ts +++ b/apps/sim/blocks/blocks/trello.ts @@ -3,7 +3,6 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { parseOptionalBooleanInput, parseOptionalNumberInput } from '@/blocks/utils' -import type { TrelloResponse } from '@/tools/trello' function getTrimmedString(value: unknown): string | undefined { if (typeof value !== 'string') { @@ -65,7 +64,7 @@ const ACTIVITY_SOURCE_FIELD = ['boardSelector', 'manualBoardId', 'cardId'] as co * Trello uses a custom token flow and non-UUID credential IDs, so the block keeps * the normal OAuth block UX while relying on the custom Trello auth routes. */ -export const TrelloBlock: BlockConfig = { +export const TrelloBlock: BlockConfig = { type: 'trello', name: 'Trello', description: 'Manage Trello lists, cards, checklists, and activity', diff --git a/apps/sim/blocks/blocks/trigger_dev.ts b/apps/sim/blocks/blocks/trigger_dev.ts index 874e8824cd5..8c9e3059819 100644 --- a/apps/sim/blocks/blocks/trigger_dev.ts +++ b/apps/sim/blocks/blocks/trigger_dev.ts @@ -1,7 +1,6 @@ import { TriggerDevIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TriggerDevResponse } from '@/tools/trigger_dev/types' const TASK_IDENTIFIER_OPERATIONS = ['trigger_dev_trigger_task', 'trigger_dev_batch_trigger_task'] const RUN_ID_OPERATIONS = [ @@ -72,7 +71,7 @@ const CURSOR_PAGE_OPERATIONS = [ const PAGE_BEFORE_OPERATIONS = ['trigger_dev_list_runs', 'trigger_dev_list_waitpoint_tokens'] const NUMBERED_PAGE_OPERATIONS = ['trigger_dev_list_schedules', 'trigger_dev_list_queues'] -export const TriggerDevBlock: BlockConfig = { +export const TriggerDevBlock: BlockConfig = { type: 'trigger_dev', name: 'Trigger.dev', description: 'Trigger tasks and manage runs and schedules', diff --git a/apps/sim/blocks/blocks/tts.ts b/apps/sim/blocks/blocks/tts.ts index 64625bb3a78..d57177dc2e8 100644 --- a/apps/sim/blocks/blocks/tts.ts +++ b/apps/sim/blocks/blocks/tts.ts @@ -1,11 +1,10 @@ import { TTSIcon } from '@/components/icons' import { AuthMode, type BlockConfig, IntegrationType } from '@/blocks/types' -import type { TtsBlockResponse } from '@/tools/tts/types' /** Voice picker id, which differs by provider — first available wins. */ const VOICE_FIELD = ['voice', 'voiceId'] as const -export const TtsBlock: BlockConfig = { +export const TtsBlock: BlockConfig = { type: 'tts', name: 'Text-to-Speech', description: 'Convert text to speech using AI voices', diff --git a/apps/sim/blocks/blocks/twilio.ts b/apps/sim/blocks/blocks/twilio.ts index 265228f0c56..8631eb37990 100644 --- a/apps/sim/blocks/blocks/twilio.ts +++ b/apps/sim/blocks/blocks/twilio.ts @@ -1,10 +1,9 @@ import { TwilioIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TwilioSMSBlockOutput } from '@/tools/twilio/types' import { getTrigger } from '@/triggers' -export const TwilioSMSBlock: BlockConfig = { +export const TwilioSMSBlock: BlockConfig = { type: 'twilio_sms', name: 'Twilio SMS', description: 'Send SMS messages', diff --git a/apps/sim/blocks/blocks/twilio_voice.ts b/apps/sim/blocks/blocks/twilio_voice.ts index 2d203b97fe1..78b49df0f94 100644 --- a/apps/sim/blocks/blocks/twilio_voice.ts +++ b/apps/sim/blocks/blocks/twilio_voice.ts @@ -1,10 +1,9 @@ import { TwilioIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ToolResponse } from '@/tools/types' import { getTrigger } from '@/triggers' -export const TwilioVoiceBlock: BlockConfig = { +export const TwilioVoiceBlock: BlockConfig = { type: 'twilio_voice', name: 'Twilio Voice', description: 'Make and manage phone calls', diff --git a/apps/sim/blocks/blocks/typeform.ts b/apps/sim/blocks/blocks/typeform.ts index b766cdb4836..05991e5a8a2 100644 --- a/apps/sim/blocks/blocks/typeform.ts +++ b/apps/sim/blocks/blocks/typeform.ts @@ -1,10 +1,9 @@ import { TypeformIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { TypeformResponse } from '@/tools/typeform/types' import { getTrigger } from '@/triggers' -export const TypeformBlock: BlockConfig = { +export const TypeformBlock: BlockConfig = { type: 'typeform', name: 'Typeform', description: 'Interact with Typeform', diff --git a/apps/sim/blocks/blocks/upstash.ts b/apps/sim/blocks/blocks/upstash.ts index 6be5483951b..94280ebe787 100644 --- a/apps/sim/blocks/blocks/upstash.ts +++ b/apps/sim/blocks/blocks/upstash.ts @@ -1,44 +1,8 @@ import { UpstashIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { - UpstashRedisCommandResponse, - UpstashRedisDeleteResponse, - UpstashRedisExistsResponse, - UpstashRedisExpireResponse, - UpstashRedisGetResponse, - UpstashRedisHGetAllResponse, - UpstashRedisHGetResponse, - UpstashRedisHSetResponse, - UpstashRedisIncrbyResponse, - UpstashRedisIncrResponse, - UpstashRedisKeysResponse, - UpstashRedisLPushResponse, - UpstashRedisLRangeResponse, - UpstashRedisSetnxResponse, - UpstashRedisSetResponse, - UpstashRedisTtlResponse, -} from '@/tools/upstash/types' -type UpstashResponse = - | UpstashRedisGetResponse - | UpstashRedisSetResponse - | UpstashRedisDeleteResponse - | UpstashRedisKeysResponse - | UpstashRedisCommandResponse - | UpstashRedisHSetResponse - | UpstashRedisHGetResponse - | UpstashRedisHGetAllResponse - | UpstashRedisIncrResponse - | UpstashRedisIncrbyResponse - | UpstashRedisExpireResponse - | UpstashRedisTtlResponse - | UpstashRedisLPushResponse - | UpstashRedisLRangeResponse - | UpstashRedisExistsResponse - | UpstashRedisSetnxResponse - -export const UpstashBlock: BlockConfig = { +export const UpstashBlock: BlockConfig = { type: 'upstash', name: 'Upstash', description: 'Serverless Redis with Upstash', diff --git a/apps/sim/blocks/blocks/uptimerobot.ts b/apps/sim/blocks/blocks/uptimerobot.ts index 29d10877ffc..2ebcfc7b086 100644 --- a/apps/sim/blocks/blocks/uptimerobot.ts +++ b/apps/sim/blocks/blocks/uptimerobot.ts @@ -2,7 +2,6 @@ import { UptimeRobotIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { UptimeRobotMonitorResponse } from '@/tools/uptimerobot/types' /** Incidents narrow by monitor id or by monitor name — whichever the user filled. */ const INCIDENT_MONITOR_FIELD = ['monitorId', 'monitorName'] as const @@ -11,7 +10,7 @@ const MONITOR_EDIT_OPS = ['create_monitor', 'update_monitor'] const MAINTENANCE_EDIT_OPS = ['create_maintenance_window', 'update_maintenance_window'] const PSP_EDIT_OPS = ['create_psp', 'update_psp'] -export const UptimeRobotBlock: BlockConfig = { +export const UptimeRobotBlock: BlockConfig = { type: 'uptimerobot', name: 'UptimeRobot', description: 'Monitor uptime, manage incidents, maintenance windows, and status pages', diff --git a/apps/sim/blocks/blocks/vanta.ts b/apps/sim/blocks/blocks/vanta.ts index 20746de67f5..668733c9c09 100644 --- a/apps/sim/blocks/blocks/vanta.ts +++ b/apps/sim/blocks/blocks/vanta.ts @@ -2,7 +2,6 @@ import { VantaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { ToolResponse } from '@/tools/types' const LIST_OPERATIONS = [ 'list_frameworks', @@ -56,7 +55,7 @@ function optionalString(value: unknown): string | undefined { return typeof value === 'string' && value.trim() !== '' ? value : undefined } -export const VantaBlock: BlockConfig = { +export const VantaBlock: BlockConfig = { type: 'vanta', name: 'Vanta', description: 'Query compliance status and manage evidence in Vanta', diff --git a/apps/sim/blocks/blocks/video_generator.ts b/apps/sim/blocks/blocks/video_generator.ts index 7e17b4a6b7f..94b9b9d9a45 100644 --- a/apps/sim/blocks/blocks/video_generator.ts +++ b/apps/sim/blocks/blocks/video_generator.ts @@ -1,7 +1,6 @@ import { VideoIcon } from '@/components/icons' import { AuthMode, type BlockConfig, IntegrationType, type SubBlockConfig } from '@/blocks/types' import { normalizeFileInput, parseOptionalBooleanInput } from '@/blocks/utils' -import type { VideoBlockResponse } from '@/tools/video/types' const FALAI_PREVIOUS_MODEL_OPTIONS = [ { label: 'Google Veo 3.1', id: 'veo-3.1' }, @@ -70,7 +69,7 @@ const withFalAIModelOptions = ( return subBlock }) -export const VideoGeneratorBlock: BlockConfig = { +export const VideoGeneratorBlock: BlockConfig = { type: 'video_generator', name: 'Video Generator (Legacy)', description: 'Generate videos from text using AI', @@ -897,7 +896,7 @@ export const VideoGeneratorBlock: BlockConfig = { }, } -export const VideoGeneratorV2Block: BlockConfig = { +export const VideoGeneratorV2Block: BlockConfig = { ...VideoGeneratorBlock, type: 'video_generator_v2', name: 'Video Generator', @@ -1658,7 +1657,7 @@ export const VideoGeneratorV2Block: BlockConfig = { }, } -export const VideoGeneratorV3Block: BlockConfig = { +export const VideoGeneratorV3Block: BlockConfig = { ...VideoGeneratorV2Block, sunset: undefined, type: 'video_generator_v3', diff --git a/apps/sim/blocks/blocks/vision.ts b/apps/sim/blocks/blocks/vision.ts index baceb3dab54..1a8db890ef0 100644 --- a/apps/sim/blocks/blocks/vision.ts +++ b/apps/sim/blocks/blocks/vision.ts @@ -2,7 +2,6 @@ import { EyeIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { createVersionedToolSelector, normalizeFileInput } from '@/blocks/utils' -import type { VisionResponse } from '@/tools/vision/types' const VISION_MODEL_OPTIONS = [ { label: 'GPT 5.2', id: 'gpt-5.2' }, @@ -25,7 +24,7 @@ const IMAGE_FIELD = ['imageFile', 'imageFileReference', 'imageUrl'] as const /* v2 drops the URL input, keeping only the upload/reference pair. */ const IMAGE_V2_FIELD = ['imageFile', 'imageFileReference'] as const -export const VisionBlock: BlockConfig = { +export const VisionBlock: BlockConfig = { type: 'vision', name: 'Vision (Legacy)', description: 'Analyze images with vision models', @@ -116,7 +115,7 @@ export const VisionBlock: BlockConfig = { }, } -export const VisionV2Block: BlockConfig = { +export const VisionV2Block: BlockConfig = { ...VisionBlock, type: 'vision_v2', name: 'Vision', diff --git a/apps/sim/blocks/blocks/wealthbox.ts b/apps/sim/blocks/blocks/wealthbox.ts index 5813b6d1c89..83007807c68 100644 --- a/apps/sim/blocks/blocks/wealthbox.ts +++ b/apps/sim/blocks/blocks/wealthbox.ts @@ -2,11 +2,10 @@ import { WealthboxIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { WealthboxResponse } from '@/tools/wealthbox/types' const CONTACT_FIELD = ['contactId', 'manualContactId'] as const -export const WealthboxBlock: BlockConfig = { +export const WealthboxBlock: BlockConfig = { type: 'wealthbox', name: 'Wealthbox', description: 'Interact with Wealthbox', diff --git a/apps/sim/blocks/blocks/webflow.ts b/apps/sim/blocks/blocks/webflow.ts index c78a277ba93..ccb95bc71f1 100644 --- a/apps/sim/blocks/blocks/webflow.ts +++ b/apps/sim/blocks/blocks/webflow.ts @@ -2,7 +2,6 @@ import { WebflowIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { WebflowResponse } from '@/tools/webflow/types' import { getTrigger } from '@/triggers' /** CMS collection, whichever mode the card is in. */ @@ -11,7 +10,7 @@ const COLLECTION_FIELD = ['collectionSelector', 'manualCollectionId'] as const /** CMS item, whichever mode the card is in. */ const ITEM_FIELD = ['itemSelector', 'manualItemId'] as const -export const WebflowBlock: BlockConfig = { +export const WebflowBlock: BlockConfig = { type: 'webflow', name: 'Webflow', description: 'Manage Webflow CMS collections', diff --git a/apps/sim/blocks/blocks/webhook_request.ts b/apps/sim/blocks/blocks/webhook_request.ts index ed4fd582e76..29e95edad19 100644 --- a/apps/sim/blocks/blocks/webhook_request.ts +++ b/apps/sim/blocks/blocks/webhook_request.ts @@ -1,8 +1,7 @@ import { WebhookIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' -import type { RequestResponse } from '@/tools/http/types' -export const WebhookRequestBlock: BlockConfig = { +export const WebhookRequestBlock: BlockConfig = { type: 'webhook_request', name: 'Webhook', description: 'Send a webhook request', diff --git a/apps/sim/blocks/blocks/whatsapp.ts b/apps/sim/blocks/blocks/whatsapp.ts index f94a4e72dac..4643a08204e 100644 --- a/apps/sim/blocks/blocks/whatsapp.ts +++ b/apps/sim/blocks/blocks/whatsapp.ts @@ -2,7 +2,6 @@ import { WhatsAppIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { WhatsAppResponse } from '@/tools/whatsapp/types' import { getTrigger } from '@/triggers' /** Yes/No dropdowns serialize as `'true'`/`'false'` strings; the tools expect booleans. */ @@ -18,7 +17,7 @@ function toOptionalBoolean(value: unknown): boolean | undefined { */ const UPLOAD_FILE_FIELD = ['uploadFile', 'uploadFileRef'] as const -export const WhatsAppBlock: BlockConfig = { +export const WhatsAppBlock: BlockConfig = { type: 'whatsapp', name: 'WhatsApp', description: 'Send WhatsApp messages', diff --git a/apps/sim/blocks/blocks/wikipedia.ts b/apps/sim/blocks/blocks/wikipedia.ts index f6c55c017b8..9eb8ed5b3ff 100644 --- a/apps/sim/blocks/blocks/wikipedia.ts +++ b/apps/sim/blocks/blocks/wikipedia.ts @@ -1,9 +1,8 @@ import { WikipediaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { IntegrationType } from '@/blocks/types' -import type { WikipediaResponse } from '@/tools/wikipedia/types' -export const WikipediaBlock: BlockConfig = { +export const WikipediaBlock: BlockConfig = { type: 'wikipedia', name: 'Wikipedia', description: 'Search and retrieve content from Wikipedia', diff --git a/apps/sim/blocks/blocks/windchill.ts b/apps/sim/blocks/blocks/windchill.ts index d55e6691e09..b3b8fef2282 100644 --- a/apps/sim/blocks/blocks/windchill.ts +++ b/apps/sim/blocks/blocks/windchill.ts @@ -3,7 +3,6 @@ import { WindchillIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { WindchillResponse } from '@/tools/windchill/types' const SINGLE_DOCUMENT_OPERATIONS = [ 'windchill_get_document', @@ -121,7 +120,7 @@ function coerceBoolean(value: unknown): boolean | undefined { throw new Error('Boolean values must be true or false') } -export const WindchillBlock: BlockConfig = { +export const WindchillBlock: BlockConfig = { type: 'windchill', name: 'Windchill', description: 'Manage documents, revisions, and content in PTC Windchill', diff --git a/apps/sim/blocks/blocks/wiza.ts b/apps/sim/blocks/blocks/wiza.ts index 59e41448e63..538c77f98a9 100644 --- a/apps/sim/blocks/blocks/wiza.ts +++ b/apps/sim/blocks/blocks/wiza.ts @@ -2,7 +2,6 @@ import { getErrorMessage } from '@sim/utils/errors' import { WizaIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { WizaResponse } from '@/tools/wiza/types' const PROSPECT_FILTER_FIELD = ['job_title', 'job_role', 'filters'] as const const PROSPECT_EMPLOYER_FIELD = ['job_company', 'company_industry'] as const @@ -15,7 +14,7 @@ const COMPANY_FIELD = [ const CONTACT_FIELD = ['profile_url', 'full_name', 'email'] as const const EMPLOYER_FIELD = ['company', 'domain'] as const -export const WizaBlock: BlockConfig = { +export const WizaBlock: BlockConfig = { type: 'wiza', name: 'Wiza', description: 'Find, enrich, and verify B2B contact data with Wiza', diff --git a/apps/sim/blocks/blocks/wordpress.ts b/apps/sim/blocks/blocks/wordpress.ts index cbc8efb4c32..294e323270a 100644 --- a/apps/sim/blocks/blocks/wordpress.ts +++ b/apps/sim/blocks/blocks/wordpress.ts @@ -3,12 +3,11 @@ import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' import { normalizeFileInput } from '@/blocks/utils' -import type { WordPressResponse } from '@/tools/wordpress/types' /** The media file to upload, whichever mode the user is in. */ const MEDIA_FILE_FIELD = ['fileUpload', 'file'] as const -export const WordPressBlock: BlockConfig = { +export const WordPressBlock: BlockConfig = { type: 'wordpress', name: 'WordPress', description: 'Manage WordPress content', diff --git a/apps/sim/blocks/blocks/youtube.ts b/apps/sim/blocks/blocks/youtube.ts index 053987980f2..11a7424809a 100644 --- a/apps/sim/blocks/blocks/youtube.ts +++ b/apps/sim/blocks/blocks/youtube.ts @@ -1,9 +1,8 @@ import { ElevenLabsIcon, YouTubeIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { YouTubeResponse } from '@/tools/youtube/types' -export const YouTubeBlock: BlockConfig = { +export const YouTubeBlock: BlockConfig = { type: 'youtube', name: 'YouTube', description: 'Interact with YouTube videos, channels, and playlists', diff --git a/apps/sim/blocks/blocks/zep.ts b/apps/sim/blocks/blocks/zep.ts index 9a4f555cb29..ebaaefdda55 100644 --- a/apps/sim/blocks/blocks/zep.ts +++ b/apps/sim/blocks/blocks/zep.ts @@ -1,8 +1,7 @@ import { ZepIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ZepResponse } from '@/tools/zep/types' -export const ZepBlock: BlockConfig = { +export const ZepBlock: BlockConfig = { type: 'zep', name: 'Zep', description: 'Long-term memory for AI agents', diff --git a/apps/sim/blocks/blocks/zerobounce.ts b/apps/sim/blocks/blocks/zerobounce.ts index aeeb34384c0..4c583c58e1a 100644 --- a/apps/sim/blocks/blocks/zerobounce.ts +++ b/apps/sim/blocks/blocks/zerobounce.ts @@ -1,8 +1,7 @@ import { ZeroBounceIcon } from '@/components/icons' import { AuthMode, type BlockConfig, type BlockMeta, IntegrationType } from '@/blocks/types' -import type { ZeroBounceResponse } from '@/tools/zerobounce/types' -export const ZeroBounceBlock: BlockConfig = { +export const ZeroBounceBlock: BlockConfig = { type: 'zerobounce', name: 'ZeroBounce', description: 'Validate email deliverability and check account credits', diff --git a/apps/sim/blocks/blocks/zoho-desk.ts b/apps/sim/blocks/blocks/zoho-desk.ts index c63fddf3a87..3906ad75334 100644 --- a/apps/sim/blocks/blocks/zoho-desk.ts +++ b/apps/sim/blocks/blocks/zoho-desk.ts @@ -2,7 +2,6 @@ import { ZohoDeskIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ZohoDeskResponse } from '@/tools/zoho_desk/types' import { getTrigger } from '@/triggers' /** Both members of the `orgId` canonical pair, so the clause survives advanced mode. */ @@ -63,7 +62,7 @@ function parseCustomFields(value: unknown): Record | undefined } } -export const ZohoDeskBlock: BlockConfig = { +export const ZohoDeskBlock: BlockConfig = { type: 'zoho_desk', name: 'Zoho Desk', description: 'Manage Zoho Desk tickets, comments, threads, and contacts', diff --git a/apps/sim/blocks/blocks/zoom.ts b/apps/sim/blocks/blocks/zoom.ts index c971e41eb53..9514eda292a 100644 --- a/apps/sim/blocks/blocks/zoom.ts +++ b/apps/sim/blocks/blocks/zoom.ts @@ -2,7 +2,6 @@ import { ZoomIcon } from '@/components/icons' import { getScopesForService } from '@/lib/oauth/utils' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ZoomResponse } from '@/tools/zoom/types' import { getTrigger } from '@/triggers' /* @@ -12,7 +11,7 @@ import { getTrigger } from '@/triggers' */ const MEETING_FIELD = ['meetingSelector', 'meetingId'] as const -export const ZoomBlock: BlockConfig = { +export const ZoomBlock: BlockConfig = { type: 'zoom', name: 'Zoom', description: 'Create and manage Zoom meetings and recordings', diff --git a/apps/sim/blocks/blocks/zoominfo.ts b/apps/sim/blocks/blocks/zoominfo.ts index 76d34164750..b13cdda9fbf 100644 --- a/apps/sim/blocks/blocks/zoominfo.ts +++ b/apps/sim/blocks/blocks/zoominfo.ts @@ -1,9 +1,8 @@ import { ZoomInfoIcon } from '@/components/icons' import type { BlockConfig, BlockMeta } from '@/blocks/types' import { AuthMode, IntegrationType } from '@/blocks/types' -import type { ZoomInfoResponse } from '@/tools/zoominfo/types' -export const ZoomInfoBlock: BlockConfig = { +export const ZoomInfoBlock: BlockConfig = { type: 'zoominfo', name: 'ZoomInfo', description: 'Search and enrich B2B company and contact data with ZoomInfo.', diff --git a/apps/sim/blocks/types.ts b/apps/sim/blocks/types.ts index ef363aa7543..2e3181e2cce 100644 --- a/apps/sim/blocks/types.ts +++ b/apps/sim/blocks/types.ts @@ -596,7 +596,7 @@ export type CanvasSentenceClause = /** An ordered set of clauses forming one card summary sentence. */ export type CanvasSentence = readonly CanvasSentenceClause[] -export interface BlockConfig { +export interface BlockConfig { type: string name: string description: string @@ -719,7 +719,3 @@ export interface BlockConfig { available: string[] // List of trigger IDs this block supports } } - -interface OutputConfig { - type: BlockOutput -} diff --git a/apps/sim/components/emails/auth/otp-verification-email.tsx b/apps/sim/components/emails/auth/otp-verification-email.tsx index 6f4170286a9..2bf8e27120c 100644 --- a/apps/sim/components/emails/auth/otp-verification-email.tsx +++ b/apps/sim/components/emails/auth/otp-verification-email.tsx @@ -5,7 +5,6 @@ import { getBrandConfig } from '@/ee/whitelabeling' interface OTPVerificationEmailProps { otp: string - email?: string type?: 'sign-in' | 'email-verification' | 'change-email' | 'forget-password' | 'chat-access' chatTitle?: string } @@ -29,7 +28,6 @@ const getSubjectByType = (type: string, brandName: string, chatTitle?: string) = export function OTPVerificationEmail({ otp, - email = '', type = 'email-verification', chatTitle, }: OTPVerificationEmailProps) { diff --git a/apps/sim/components/emails/render.ts b/apps/sim/components/emails/render.ts index e81f18f85d1..ac49bb129ce 100644 --- a/apps/sim/components/emails/render.ts +++ b/apps/sim/components/emails/render.ts @@ -45,7 +45,6 @@ interface WorkspaceInvitation { export async function renderOTPEmail( otp: string, - email: string, type: | 'sign-in' | 'email-verification' @@ -53,7 +52,7 @@ export async function renderOTPEmail( | 'forget-password' = 'email-verification', chatTitle?: string ): Promise { - return await render(OTPVerificationEmail({ otp, email, type, chatTitle })) + return await render(OTPVerificationEmail({ otp, type, chatTitle })) } export async function renderExistingAccountEmail(username: string): Promise { diff --git a/apps/sim/connectors/google-sheets/google-sheets.ts b/apps/sim/connectors/google-sheets/google-sheets.ts index 5604dd899e1..141854d88a5 100644 --- a/apps/sim/connectors/google-sheets/google-sheets.ts +++ b/apps/sim/connectors/google-sheets/google-sheets.ts @@ -491,7 +491,7 @@ export const googleSheetsConnector: ConnectorConfig = { getDocument: async ( accessToken: string, - sourceConfig: Record, + _sourceConfig: Record, externalId: string, syncContext?: Record ): Promise => { diff --git a/apps/sim/connectors/linear/linear.ts b/apps/sim/connectors/linear/linear.ts index c4e5fe4531a..d2150bd40af 100644 --- a/apps/sim/connectors/linear/linear.ts +++ b/apps/sim/connectors/linear/linear.ts @@ -394,7 +394,7 @@ export const linearConnector: ConnectorConfig = { getDocument: async ( accessToken: string, - sourceConfig: Record, + _sourceConfig: Record, externalId: string ): Promise => { const data = await linearGraphQL(accessToken, ISSUE_BY_ID_QUERY, { id: externalId }) diff --git a/apps/sim/connectors/sftp/sftp.test.ts b/apps/sim/connectors/sftp/sftp.test.ts index 8878064da56..f20df6aceea 100644 --- a/apps/sim/connectors/sftp/sftp.test.ts +++ b/apps/sim/connectors/sftp/sftp.test.ts @@ -105,10 +105,10 @@ vi.mock('ssh2', () => { /** Minimal SFTP subsystem: one directory holding one indexable text file. */ const fakeSftp = { - stat(path: string, cb: (err: Error | null, attrs?: unknown) => void) { + stat(_path: string, cb: (err: Error | null, attrs?: unknown) => void) { cb(null, { mode: S_IFDIR, size: 0, mtime: 0 }) }, - lstat(path: string, cb: (err: Error | null, attrs?: unknown) => void) { + lstat(_path: string, cb: (err: Error | null, attrs?: unknown) => void) { cb(null, { mode: S_IFREG, size: 10, mtime: 1_700_000_000 }) }, opendir(path: string, cb: (err: Error | null, handle?: Buffer) => void) { diff --git a/apps/sim/ee/sso/components/sso-form.test.tsx b/apps/sim/ee/sso/components/sso-form.test.tsx index d9137603060..54e7e7537d3 100644 --- a/apps/sim/ee/sso/components/sso-form.test.tsx +++ b/apps/sim/ee/sso/components/sso-form.test.tsx @@ -3,7 +3,7 @@ */ import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactNode } from 'react' import { apiClientRequestMock } from '@sim/testing/mocks/api-client-request.mock' -import { authClientMock, authClientMockFns } from '@sim/testing/mocks/auth-client.mock' +import { authClientMock } from '@sim/testing/mocks/auth-client.mock' import { envMockFns, resetEnvMock } from '@sim/testing/mocks/env.mock' import { nextNavigationMock, nextNavigationMockFns } from '@sim/testing/mocks/next-navigation.mock' import { renderToString } from 'react-dom/server' @@ -53,8 +53,6 @@ vi.mock('@/app/(auth)/components', () => ({ import SSOForm from '@/ee/sso/components/sso-form' -const mockSsoSignIn = authClientMockFns.mockClient.signIn.sso - const mockUseSearchParams = nextNavigationMockFns.mockUseSearchParams envMockFns.getEnv.mockReturnValue('true') afterAll(resetEnvMock) diff --git a/apps/sim/ee/workspace-forking/application/discovery.ts b/apps/sim/ee/workspace-forking/application/discovery.ts index 50833300adb..2c432ccac22 100644 --- a/apps/sim/ee/workspace-forking/application/discovery.ts +++ b/apps/sim/ee/workspace-forking/application/discovery.ts @@ -85,10 +85,7 @@ export const getWorkspaceForkAvailability = defineForkUseCase({ context: { workspace: { organizationId: string | null }; userId: string } input: WorkspaceInput }) => ({ - available: await isForkingAvailableForWorkspace( - context.workspace.organizationId, - context.userId - ), + available: await isForkingAvailableForWorkspace(context.workspace.organizationId), }), }) diff --git a/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts index a42b6e0ebb0..d0fbf791585 100644 --- a/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts @@ -182,7 +182,7 @@ describe('cleanup-failed', () => { queueTableRows(workflow, [{ id: 'wf-1' }]) queueTableRows(workflowBlocks, [draftBlockRow('failed-kb')]) - const affected = await clearFailedReferencesInWorkflows('child-ws', failedByKind(), 'test') + const affected = await clearFailedReferencesInWorkflows('child-ws', failedByKind()) expect([...affected]).toEqual(['wf-1']) expect(updates()).toHaveLength(1) diff --git a/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts index 538f4e22667..906f919b8f1 100644 --- a/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts @@ -180,11 +180,7 @@ export async function clearFailedForkResourceReferences(params: { let affectedWorkflowIds: Set = new Set() try { - affectedWorkflowIds = await clearFailedReferencesInWorkflows( - childWorkspaceId, - failedByKind, - requestId - ) + affectedWorkflowIds = await clearFailedReferencesInWorkflows(childWorkspaceId, failedByKind) } catch (error) { clearingSucceeded = false logger.error(`[${requestId}] Failed to clear references for failed fork resources`, { @@ -262,8 +258,7 @@ export async function clearFailedForkResourceReferences(params: { */ export async function clearFailedReferencesInWorkflows( childWorkspaceId: string, - failedByKind: Map>, - requestId: string + failedByKind: Map> ): Promise> { const resolve = buildFailedResolver(failedByKind) const affectedWorkflowIds = new Set() diff --git a/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts index b666a36fd29..10064d0d842 100644 --- a/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts @@ -10,10 +10,7 @@ import { workspaceFileManagerMock, workspaceFileManagerMockFns, } from '@sim/testing/mocks/workspace-file-manager.mock' -import { - workspaceFileSecretProvenanceMock, - workspaceFileSecretProvenanceMockFns, -} from '@sim/testing/mocks/workspace-file-secret-provenance.mock' +import { workspaceFileSecretProvenanceMock } from '@sim/testing/mocks/workspace-file-secret-provenance.mock' import { generateShortId } from '@sim/utils/id' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -96,8 +93,6 @@ const { const mockAllocateUniqueWorkspaceFileName = workspaceFileManagerMockFns.mockAllocateUniqueWorkspaceFileName mockAllocateUniqueWorkspaceFileName.mockImplementation(allocateFromFileRows) -const mockCopyWorkspaceFileSecretProvenanceInTx = - workspaceFileSecretProvenanceMockFns.mockCopyWorkspaceFileSecretProvenanceInTx function makeTask(overrides: Partial = {}): BlobCopyTask { return { diff --git a/apps/sim/ee/workspace-forking/lib/lineage/authz.ts b/apps/sim/ee/workspace-forking/lib/lineage/authz.ts index 77e18850308..448340bbadc 100644 --- a/apps/sim/ee/workspace-forking/lib/lineage/authz.ts +++ b/apps/sim/ee/workspace-forking/lib/lineage/authz.ts @@ -41,8 +41,7 @@ export async function assertForkingEnabled(organizationId: string | null): Promi * from what the fork routes actually enforce. */ export async function isForkingAvailableForWorkspace( - organizationId: string | null, - userId: string + organizationId: string | null ): Promise { try { await assertForkingEnabled(organizationId) diff --git a/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts index 06b35eedbb4..7dedf0a8cf4 100644 --- a/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts @@ -225,7 +225,6 @@ describe('copyPromoteUnmappedResources - files + folder content-refs', () => { edge, sourceWorkspaceId: 'src-ws', targetWorkspaceId: 'target-ws', - direction: 'pull', userId: 'user-1', now: new Date(), selection: { diff --git a/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts index 67d11829f5e..97911c62d09 100644 --- a/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts @@ -168,7 +168,6 @@ export async function copyPromoteUnmappedResources(params: { edge: ForkEdge sourceWorkspaceId: string targetWorkspaceId: string - direction: 'push' | 'pull' userId: string now: Date selection: PromoteCopySelection @@ -200,7 +199,6 @@ export async function copyPromoteUnmappedResources(params: { edge, sourceWorkspaceId, targetWorkspaceId, - direction, userId, now, selection, diff --git a/apps/sim/ee/workspace-forking/lib/promote/promote.ts b/apps/sim/ee/workspace-forking/lib/promote/promote.ts index abba1cad4ab..afb47d0bfe3 100644 --- a/apps/sim/ee/workspace-forking/lib/promote/promote.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/promote.ts @@ -869,7 +869,6 @@ export async function promoteFork(params: PromoteForkParams): Promise b.id === startBlockId) if (isRegularBlock) { - this.initializeStarterBlock(context, state, startBlockId) + this.initializeStarterBlock(state, startBlockId) } } else { - this.initializeStarterBlock(context, state, triggerBlockId) + this.initializeStarterBlock(state, triggerBlockId) } return { context, state } @@ -640,11 +640,7 @@ export class DAGExecutor { return parentMap } - private initializeStarterBlock( - context: ExecutionContext, - state: ExecutionState, - triggerBlockId?: string - ): void { + private initializeStarterBlock(state: ExecutionState, triggerBlockId?: string): void { let startResolution: ReturnType | null = null if (triggerBlockId) { diff --git a/apps/sim/executor/handlers/agent/agent-handler.test.ts b/apps/sim/executor/handlers/agent/agent-handler.test.ts index d07e0dab944..9a9781e7a26 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.test.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.test.ts @@ -259,7 +259,7 @@ describe('AgentBlockHandler', () => { timing: { total: 100 }, }) - mockFetch.mockImplementation((url: string) => { + mockFetch.mockImplementation(() => { return Promise.resolve({ ok: true, headers: { @@ -295,7 +295,7 @@ describe('AgentBlockHandler', () => { writable: true, configurable: true, }) - } catch (e) {} + } catch {} }) afterAll(() => { @@ -1233,7 +1233,6 @@ describe('AgentBlockHandler', () => { ).buildAutoRoutingSignals(inputs, undefined) const png = { id: 'f1', type: 'image/png' } - const pdf = { id: 'f2', type: 'application/pdf' } it('detects media carried on inbound messages, not just the files input', async () => { const signals = buildAutoRoutingSignalsFor({ diff --git a/apps/sim/executor/handlers/agent/agent-handler.ts b/apps/sim/executor/handlers/agent/agent-handler.ts index 38fa9e1f054..2fad9b54b0e 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.ts @@ -1918,7 +1918,7 @@ export class AgentBlockHandler implements BlockHandler { } else { try { content = JSON.stringify(systemPrompt, null, 2) - } catch (error) { + } catch { content = String(systemPrompt) } } @@ -3269,7 +3269,7 @@ export class AgentBlockHandler implements BlockHandler { ...extractedJson, ...this.createResponseMetadata(result), } - } catch (error) { + } catch { logger.error( 'LLM did not adhere to structured response format', projectAgentDiagnosticMetadata( diff --git a/apps/sim/executor/handlers/api/api-handler.ts b/apps/sim/executor/handlers/api/api-handler.ts index 1db45b81246..348e29ccb93 100644 --- a/apps/sim/executor/handlers/api/api-handler.ts +++ b/apps/sim/executor/handlers/api/api-handler.ts @@ -1,12 +1,9 @@ -import { createLogger } from '@sim/logger' import { BlockType, HTTP } from '@/executor/constants' import type { BlockHandler, ExecutionContext } from '@/executor/types' import type { SerializedBlock } from '@/serializer/types' import { executeTool } from '@/tools' import { getTool } from '@/tools/utils' -const logger = createLogger('ApiBlockHandler') - /** * Handler for API blocks that make external HTTP requests. */ diff --git a/apps/sim/executor/handlers/generic/generic-handler.ts b/apps/sim/executor/handlers/generic/generic-handler.ts index f57f8ad825f..ada06eea126 100644 --- a/apps/sim/executor/handlers/generic/generic-handler.ts +++ b/apps/sim/executor/handlers/generic/generic-handler.ts @@ -159,7 +159,7 @@ function createStructuredModelProjection( } export class GenericBlockHandler implements BlockHandler { - canHandle(block: SerializedBlock): boolean { + canHandle(): boolean { return true } diff --git a/apps/sim/executor/handlers/generic/keyed-invocation-identity.test.ts b/apps/sim/executor/handlers/generic/keyed-invocation-identity.test.ts index fefe38937c6..d7f8c37a784 100644 --- a/apps/sim/executor/handlers/generic/keyed-invocation-identity.test.ts +++ b/apps/sim/executor/handlers/generic/keyed-invocation-identity.test.ts @@ -1,4 +1,4 @@ -import { toolsMock, toolsMockFns } from '@sim/testing/mocks/tools.mock' +import { toolsMock } from '@sim/testing/mocks/tools.mock' /** * Pins the two properties a `keyed` delivery's idempotency token depends on, at * the layer that supplies them. @@ -22,8 +22,6 @@ vi.mock('@/tools', () => toolsMock) import { deriveDeliveryKey } from '@/lib/core/http/derive-key' -const mockExecuteTool = toolsMockFns.mockExecuteTool - describe('keyed invocation identity', () => { it('derives the same token for every retry layer of one invocation', () => { const context = { diff --git a/apps/sim/executor/handlers/response/response-handler.ts b/apps/sim/executor/handlers/response/response-handler.ts index 389ddda76b1..7c536382ec4 100644 --- a/apps/sim/executor/handlers/response/response-handler.ts +++ b/apps/sim/executor/handlers/response/response-handler.ts @@ -16,7 +16,7 @@ export class ResponseBlockHandler implements BlockHandler { } async execute( - ctx: ExecutionContext, + _ctx: ExecutionContext, block: SerializedBlock, inputs: Record ): Promise { diff --git a/apps/sim/executor/handlers/variables/variables-handler.ts b/apps/sim/executor/handlers/variables/variables-handler.ts index b8b57126eef..ec04c2b1584 100644 --- a/apps/sim/executor/handlers/variables/variables-handler.ts +++ b/apps/sim/executor/handlers/variables/variables-handler.ts @@ -64,7 +64,7 @@ export class VariablesBlockHandler implements BlockHandler { async execute( ctx: ExecutionContext, - block: SerializedBlock, + _block: SerializedBlock, inputs: Record ): Promise { try { diff --git a/apps/sim/executor/handlers/workflow/workflow-handler.test.ts b/apps/sim/executor/handlers/workflow/workflow-handler.test.ts index 665bd926eee..2629d5b79d6 100644 --- a/apps/sim/executor/handlers/workflow/workflow-handler.test.ts +++ b/apps/sim/executor/handlers/workflow/workflow-handler.test.ts @@ -15,7 +15,7 @@ import { loggingSessionMock, loggingSessionMockFns, } from '@sim/testing/mocks/logging-session.mock' -import { permissionsMock, permissionsMockFns } from '@sim/testing/mocks/permissions.mock' +import { permissionsMock } from '@sim/testing/mocks/permissions.mock' import { usersQueriesMock, usersQueriesMockFns } from '@sim/testing/mocks/users-queries.mock' import { afterAll, beforeAll, beforeEach, describe, expect, it, type Mock, vi } from 'vitest' import { createTimeoutAbortController, getExecutionDeadlineAt } from '@/lib/core/execution-limits' @@ -35,7 +35,6 @@ import { import type { SerializedBlock } from '@/serializer/types' const mockResolveBillingAttribution = billingAttributionMockFns.mockResolveBillingAttribution -const mockCheckWorkspaceAccess = permissionsMockFns.mockCheckWorkspaceAccess const { mockGetCustomBlockAuthority } = customBlockOperationsMockFns const { mockGetUserEmailById } = usersQueriesMockFns const { @@ -764,11 +763,11 @@ describe('WorkflowBlockHandler', () => { } expect(() => - (handler as any).mapChildOutputToParent(childResult, 'child-id', 'Child Workflow', 100) + (handler as any).mapChildOutputToParent(childResult, 'child-id', 'Child Workflow') ).toThrow('"Child Workflow" failed: Child workflow failed') try { - ;(handler as any).mapChildOutputToParent(childResult, 'child-id', 'Child Workflow', 100) + ;(handler as any).mapChildOutputToParent(childResult, 'child-id', 'Child Workflow') } catch (error: any) { expect(error.childTraceSpans).toEqual([]) } diff --git a/apps/sim/executor/handlers/workflow/workflow-handler.ts b/apps/sim/executor/handlers/workflow/workflow-handler.ts index 51fdc0f93e7..2138d89bb63 100644 --- a/apps/sim/executor/handlers/workflow/workflow-handler.ts +++ b/apps/sim/executor/handlers/workflow/workflow-handler.ts @@ -948,10 +948,10 @@ export class WorkflowBlockHandler implements BlockHandler { // unmasked in the consumer's stream. let childTraceSpans: WorkflowTraceSpan[] = [] if (!isCustomBlock) { - childTraceSpans = this.captureChildWorkflowLogs(executionResult, childWorkflowName, ctx) + childTraceSpans = this.captureChildWorkflowLogs(executionResult, childWorkflowName) } else if (shouldPropagateCallbacks && childSession) { childTraceSpans = await childSession.projectTraceSpansForLiveDisplay( - this.captureChildWorkflowLogs(executionResult, childWorkflowName, ctx) + this.captureChildWorkflowLogs(executionResult, childWorkflowName) ) } @@ -959,7 +959,6 @@ export class WorkflowBlockHandler implements BlockHandler { executionResult, workflowId, childWorkflowName, - duration, instanceId, childTraceSpans, childWorkflowSnapshotId @@ -1047,7 +1046,7 @@ export class WorkflowBlockHandler implements BlockHandler { logCount: executionResult.logs?.length ?? 0, }) - childTraceSpans = this.captureChildWorkflowLogs(executionResult, childWorkflowName, ctx) + childTraceSpans = this.captureChildWorkflowLogs(executionResult, childWorkflowName) logger.info(`Captured ${childTraceSpans.length} child trace spans from failed execution`) } else if (ChildWorkflowError.isChildWorkflowError(error)) { @@ -1418,8 +1417,7 @@ export class WorkflowBlockHandler implements BlockHandler { */ private captureChildWorkflowLogs( childResult: ExecutionResult, - childWorkflowName: string, - parentContext: ExecutionContext + childWorkflowName: string ): WorkflowTraceSpan[] { try { if (!childResult.logs || !Array.isArray(childResult.logs)) { @@ -1540,7 +1538,6 @@ export class WorkflowBlockHandler implements BlockHandler { childResult: ExecutionResult, childWorkflowId: string, childWorkflowName: string, - duration: number, instanceId: string, childTraceSpans?: WorkflowTraceSpan[], childWorkflowSnapshotId?: string diff --git a/apps/sim/executor/handlers/workflow/workflow-tool-runner.test.ts b/apps/sim/executor/handlers/workflow/workflow-tool-runner.test.ts index f995eca2a25..40c751e23fc 100644 --- a/apps/sim/executor/handlers/workflow/workflow-tool-runner.test.ts +++ b/apps/sim/executor/handlers/workflow/workflow-tool-runner.test.ts @@ -23,7 +23,6 @@ import { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-tr import { EnvResolver } from '@/executor/variables/resolvers/env' const mockDecryptSecret = encryptionMockFns.mockDecryptSecret -const mockEncryptSecret = encryptionMockFns.mockEncryptSecret describe('runWorkflowTool execution context', () => { beforeEach(() => { diff --git a/apps/sim/executor/orchestrators/node.ts b/apps/sim/executor/orchestrators/node.ts index 1c0467afa58..90c4b5f8f63 100644 --- a/apps/sim/executor/orchestrators/node.ts +++ b/apps/sim/executor/orchestrators/node.ts @@ -133,7 +133,7 @@ export class NodeExecutionOrchestrator { } if (subflowType === 'parallel') { - return await this.handleParallelSentinel(ctx, node, sentinelType, subflowId) + return await this.handleParallelSentinel(ctx, sentinelType, subflowId) } switch (sentinelType) { @@ -183,7 +183,6 @@ export class NodeExecutionOrchestrator { private async handleParallelSentinel( ctx: ExecutionContext, - node: DAGNode, sentinelType: string | undefined, parallelId: string ): Promise { diff --git a/apps/sim/executor/types.ts b/apps/sim/executor/types.ts index 5c987d03c79..c51495ed3cd 100644 --- a/apps/sim/executor/types.ts +++ b/apps/sim/executor/types.ts @@ -736,16 +736,6 @@ export interface StreamingExecution { onFullContent?: (content: string) => void | Promise } -interface BlockExecutor { - canExecute(block: SerializedBlock): boolean - - execute( - block: SerializedBlock, - inputs: Record, - context: ExecutionContext - ): Promise -} - /** * Per-invocation identity for one run of one block. * @@ -803,36 +793,3 @@ export interface BlockHandler { nodeMetadata: BlockNodeMetadata ) => Promise } - -interface Tool

> { - id: string - name: string - description: string - version: string - - params: { - [key: string]: { - type: string - required?: boolean - description?: string - default?: any - } - } - - request?: { - url?: string | ((params: P) => string) - method?: string - headers?: (params: P) => Record - body?: (params: P) => Record - } - - transformResponse?: (response: any) => Promise<{ - success: boolean - output: O - error?: string - }> -} - -interface ToolRegistry { - [key: string]: Tool -} diff --git a/apps/sim/executor/utils/json.ts b/apps/sim/executor/utils/json.ts index 1b3bd11ca67..77099e008d9 100644 --- a/apps/sim/executor/utils/json.ts +++ b/apps/sim/executor/utils/json.ts @@ -10,7 +10,7 @@ export function parseJSON(value: unknown, fallback: T): T { try { return JSON.parse(value.trim()) - } catch (error) { + } catch { return fallback } } diff --git a/apps/sim/executor/utils/parallel-expansion.test.ts b/apps/sim/executor/utils/parallel-expansion.test.ts index ba422513afe..6a5116697e1 100644 --- a/apps/sim/executor/utils/parallel-expansion.test.ts +++ b/apps/sim/executor/utils/parallel-expansion.test.ts @@ -411,7 +411,7 @@ describe('Nested parallel expansion + edge resolution', () => { const p3Config = dag.parallelConfigs.get(p3Id)! const leafId = p3Config.nodes![0] - const p3Result = expander.expandParallel(dag, p3Id, 2) + expander.expandParallel(dag, p3Id, 2) // Each expansion creates branch nodes — verify they're unique const branch0 = buildBranchNodeId(leafId, 0) diff --git a/apps/sim/executor/utils/parallel-expansion.ts b/apps/sim/executor/utils/parallel-expansion.ts index e0833f5257f..9e98925ec1f 100644 --- a/apps/sim/executor/utils/parallel-expansion.ts +++ b/apps/sim/executor/utils/parallel-expansion.ts @@ -139,7 +139,7 @@ export class ParallelExpander { branchIndexOffset ) - this.wireSentinelEdges(dag, parallelId, entryNodes, terminalNodes, branchCount) + this.wireSentinelEdges(dag, parallelId, entryNodes, terminalNodes) logger.info('Parallel expanded', { parallelId, @@ -601,8 +601,7 @@ export class ParallelExpander { dag: DAG, parallelId: string, entryNodes: string[], - terminalNodes: string[], - branchCount: number + terminalNodes: string[] ): void { const sentinelStartId = buildParallelSentinelStartId(parallelId) const sentinelEndId = buildParallelSentinelEndId(parallelId) diff --git a/apps/sim/executor/utils/start-block.ts b/apps/sim/executor/utils/start-block.ts index b0ad58e6498..7e67f42a81e 100644 --- a/apps/sim/executor/utils/start-block.ts +++ b/apps/sim/executor/utils/start-block.ts @@ -592,7 +592,7 @@ function buildUnifiedStartOutput( return output } -function buildApiOrInputOutput(finalInput: unknown, workflowInput: unknown): NormalizedBlockOutput { +function buildApiOrInputOutput(finalInput: unknown): NormalizedBlockOutput { const isObjectInput = isRecordLike(finalInput) const output: NormalizedBlockOutput = isObjectInput @@ -770,7 +770,7 @@ export function buildStartBlockOutput(options: StartBlockOutputOptions): Normali case StartBlockPath.SPLIT_API: case StartBlockPath.SPLIT_INPUT: - output = buildApiOrInputOutput(finalInput, workflowInput) + output = buildApiOrInputOutput(finalInput) break case StartBlockPath.SPLIT_CHAT: diff --git a/apps/sim/executor/utils/vertex-credential.test.ts b/apps/sim/executor/utils/vertex-credential.test.ts index 896c6da06fc..92dd519cead 100644 --- a/apps/sim/executor/utils/vertex-credential.test.ts +++ b/apps/sim/executor/utils/vertex-credential.test.ts @@ -18,7 +18,7 @@ vi.mock('@/executor/utils/credential-token', () => ({ import { resolveVertexCredential } from '@/executor/utils/vertex-credential' const { mockGetCredentialActorContext } = credentialsAccessMockFns -const { mockGetServiceAccountToken, mockRefreshTokenIfNeeded } = authOAuthUtilsMockFns +const { mockGetServiceAccountToken } = authOAuthUtilsMockFns function actorContext(workspaceId: string) { return { diff --git a/apps/sim/executor/variables/resolvers/env.ts b/apps/sim/executor/variables/resolvers/env.ts index 4e4483965c6..50fc20ab331 100644 --- a/apps/sim/executor/variables/resolvers/env.ts +++ b/apps/sim/executor/variables/resolvers/env.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import { extractEnvVarName, isEnvVarReference } from '@/executor/constants' import type { ResolutionContext, Resolver } from '@/executor/variables/resolvers/reference' -const logger = createLogger('EnvResolver') - export class EnvResolver implements Resolver { canResolve(reference: string): boolean { return isEnvVarReference(reference) diff --git a/apps/sim/executor/variables/resolvers/parallel.ts b/apps/sim/executor/variables/resolvers/parallel.ts index f8d8be6d3c7..83aef7d49d7 100644 --- a/apps/sim/executor/variables/resolvers/parallel.ts +++ b/apps/sim/executor/variables/resolvers/parallel.ts @@ -426,7 +426,7 @@ export class ParallelResolver implements Resolver { return Object.entries(parsed) } return [] - } catch (e) { + } catch { logger.error('Failed to parse distribution items', { rawItems }) return [] } diff --git a/apps/sim/hooks/kb/use-tag-definitions.ts b/apps/sim/hooks/kb/use-tag-definitions.ts index ac751aa45c2..785ef92d4c2 100644 --- a/apps/sim/hooks/kb/use-tag-definitions.ts +++ b/apps/sim/hooks/kb/use-tag-definitions.ts @@ -10,7 +10,6 @@ import { } from '@/hooks/kb/use-knowledge-base-tag-definitions' import { type DocumentTagDefinitionInput, - useDeleteDocumentTagDefinitions, useDocumentTagDefinitionsQuery, useSaveDocumentTagDefinitions, } from '@/hooks/queries/kb/knowledge' @@ -41,7 +40,6 @@ export function useTagDefinitions( const queryClient = useQueryClient() const query = useDocumentTagDefinitionsQuery(knowledgeBaseId, documentId) const { mutateAsync: saveTagDefinitionsMutation } = useSaveDocumentTagDefinitions() - const { mutateAsync: deleteTagDefinitionsMutation } = useDeleteDocumentTagDefinitions() const tagDefinitions = (query.data ?? EMPTY_TAG_DEFINITIONS) as TagDefinition[] diff --git a/apps/sim/hooks/queries/folders.ts b/apps/sim/hooks/queries/folders.ts index 8afbef3ed52..356942687b5 100644 --- a/apps/sim/hooks/queries/folders.ts +++ b/apps/sim/hooks/queries/folders.ts @@ -1,4 +1,3 @@ -import { createLogger } from '@sim/logger' import { generateId } from '@sim/utils/id' import { keepPreviousData, useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { requestJson } from '@/lib/api/client/request' @@ -30,8 +29,6 @@ import { getTopInsertionSortOrder } from '@/hooks/queries/utils/top-insertion-so import { getWorkflows } from '@/hooks/queries/utils/workflow-cache' import type { WorkflowFolder } from '@/stores/folders/types' -const logger = createLogger('FolderQueries') - async function fetchFolders( workspaceId: string, scope: FolderQueryScope = 'active', @@ -171,7 +168,7 @@ function createFolderMutationHandlers< ) return createOptimisticFolder(variables, tempId, previousFolders) }, - applyOptimisticUpdate: (tempId, item) => { + applyOptimisticUpdate: (_tempId, item) => { queryClient.setQueryData( folderKeys.list(item.workspaceId, 'active', item.resourceType), (old) => [...(old ?? []), item] diff --git a/apps/sim/hooks/queries/organization.test.tsx b/apps/sim/hooks/queries/organization.test.tsx index 7439625a497..84a8e618e38 100644 --- a/apps/sim/hooks/queries/organization.test.tsx +++ b/apps/sim/hooks/queries/organization.test.tsx @@ -39,8 +39,7 @@ import { } from '@/hooks/queries/organization' import { shouldRetryOrganizationBillingSummary } from '@/hooks/queries/organization-billing-summary' -const { getFullOrganization: mockGetFullOrganization, setActive: mockSetActiveOrganization } = - authClientMockFns.mockClient.organization +const { getFullOrganization: mockGetFullOrganization } = authClientMockFns.mockClient.organization const mockRequestJson = apiClientRequestMockFns.mockRequestJson diff --git a/apps/sim/hooks/queries/organization.ts b/apps/sim/hooks/queries/organization.ts index 849e493abc0..47b7f611adb 100644 --- a/apps/sim/hooks/queries/organization.ts +++ b/apps/sim/hooks/queries/organization.ts @@ -1,4 +1,3 @@ -import { createLogger } from '@sim/logger' import { isRecordLike, toRecord } from '@sim/utils/object' import { queryOptions, @@ -45,7 +44,6 @@ import { organizationUsageKeys } from '@/hooks/queries/utils/organization-usage- import { subscriptionKeys } from '@/hooks/queries/utils/subscription-keys' import { workspaceKeys } from '@/hooks/queries/workspace' -const logger = createLogger('OrganizationQueries') const invitationListsKey = ['invitations', 'list'] as const export const ORGANIZATION_ROSTER_STALE_TIME = 30 * 1000 diff --git a/apps/sim/hooks/queries/utils/optimistic-mutation.ts b/apps/sim/hooks/queries/utils/optimistic-mutation.ts index 2af55b543af..16bab2ffc19 100644 --- a/apps/sim/hooks/queries/utils/optimistic-mutation.ts +++ b/apps/sim/hooks/queries/utils/optimistic-mutation.ts @@ -4,7 +4,7 @@ import type { QueryClient } from '@tanstack/react-query' const logger = createLogger('OptimisticMutation') -export interface OptimisticMutationConfig { +export interface OptimisticMutationConfig { name: string getQueryKey: (variables: TVariables) => readonly unknown[] getSnapshot: (variables: TVariables) => Record @@ -23,7 +23,7 @@ export interface OptimisticMutationContext { export function createOptimisticMutationHandlers( queryClient: QueryClient, - config: OptimisticMutationConfig> + config: OptimisticMutationConfig ) { const { name, diff --git a/apps/sim/hooks/use-oauth-return-hooks.test.tsx b/apps/sim/hooks/use-oauth-return-hooks.test.tsx index c573c2e4d0c..573cb5b1fed 100644 --- a/apps/sim/hooks/use-oauth-return-hooks.test.tsx +++ b/apps/sim/hooks/use-oauth-return-hooks.test.tsx @@ -53,7 +53,7 @@ const mockReplace = nextNavigationMockFns.router.replace nextNavigationMockFns.mockUseParams.mockReturnValue({ workspaceId: 'workspace-1' }) const mockRequestJson = apiClientRequestMockFns.mockRequestJson -const { success: mockToastSuccess, error: mockToastError } = emcnMockFns.mockToast +const { error: mockToastError } = emcnMockFns.mockToast libDesktopMockFns.mockGetDesktopBridge.mockImplementation(() => mocks.desktop ? { onOAuthConnectComplete: mocks.onOAuthConnectComplete } : undefined ) diff --git a/apps/sim/lib/api/contracts/copilot.ts b/apps/sim/lib/api/contracts/copilot.ts index 5989ca03b4e..ec3057c5a43 100644 --- a/apps/sim/lib/api/contracts/copilot.ts +++ b/apps/sim/lib/api/contracts/copilot.ts @@ -390,38 +390,6 @@ export type SubmitCopilotFeedbackResult = ContractJsonResponse().refine( { message: 'Filter must not be empty' } ) -const filterSchema = domainObjectSchema() - // v2 predicate grammar /** diff --git a/apps/sim/lib/api/contracts/tools/aws/ses-send-bulk-email.ts b/apps/sim/lib/api/contracts/tools/aws/ses-send-bulk-email.ts index 1817ccd7a18..06cc349435f 100644 --- a/apps/sim/lib/api/contracts/tools/aws/ses-send-bulk-email.ts +++ b/apps/sim/lib/api/contracts/tools/aws/ses-send-bulk-email.ts @@ -7,11 +7,6 @@ import type { import { defineRouteContract } from '@/lib/api/contracts/types' import { validateAwsRegion } from '@/lib/core/security/input-validation' -const DestinationSchema = z.object({ - toAddresses: z.array(z.string().email()), - templateData: z.string().optional(), -}) - const SendBulkEmailSchema = z.object({ region: z .string() diff --git a/apps/sim/lib/api/contracts/v2/openapi/resources.ts b/apps/sim/lib/api/contracts/v2/openapi/resources.ts index 3a32461c0f7..94863b337b1 100644 --- a/apps/sim/lib/api/contracts/v2/openapi/resources.ts +++ b/apps/sim/lib/api/contracts/v2/openapi/resources.ts @@ -247,11 +247,6 @@ const TOOL_EXECUTION_EXAMPLE = { error: null, } as const -const SANDBOX_ADMIN_PLAN_NOTE = - 'Requires a workspace admin on Max or Enterprise; lower plans return `403` with `error.details.code: WORKSPACE_PLAN_CAPABILITY_REQUIRED`.' -const SANDBOX_BUILD_BUDGET_NOTE = - 'Creates and updates share a write budget; bursts return `429` with `Retry-After`.' - const TOOL_DETAIL_EXAMPLE = { ...TOOL_SUMMARY_EXAMPLE, params: { diff --git a/apps/sim/lib/api/contracts/v2/openapi/tables.ts b/apps/sim/lib/api/contracts/v2/openapi/tables.ts index 5f6be8207ab..d162f682bf3 100644 --- a/apps/sim/lib/api/contracts/v2/openapi/tables.ts +++ b/apps/sim/lib/api/contracts/v2/openapi/tables.ts @@ -87,7 +87,6 @@ const VIEW_ID = 'view_6b8d0f2a4c3e4e5da28f7c9b1d3f5a07' const GROUP_ID = 'grp_5d8b2f0a6c1e4739a8b3d5f7e9c1a204' const IMPORT_ID = 'imp_4f6a8c0e2b1d43759a7c9e1f3b5d7082' const EXPORT_ID = 'exp_3e5f7a9c1b2d4068a0c2e4f6b8d0f193' -const DISPATCH_ID = 'dsp_9a1c3e5f7b2d40689c4e6a8b0d2f4173' /** * Only for operations that genuinely reach a `lib/table/mutation-locks` assert diff --git a/apps/sim/lib/api/contracts/v2/openapi/workflows.ts b/apps/sim/lib/api/contracts/v2/openapi/workflows.ts index fc8759a8b6d..50282bd2887 100644 --- a/apps/sim/lib/api/contracts/v2/openapi/workflows.ts +++ b/apps/sim/lib/api/contracts/v2/openapi/workflows.ts @@ -140,9 +140,6 @@ const WORKFLOW_VERSION_EXAMPLE = { const WORKFLOW_DEPLOYMENT_VS_CHAT = '`/workflows/{workflowId}/deployment` controls overall API executability; `/deployments/chat` controls only the hosted-chat surface. A workflow can remain deployed without a chat.' -const CHAT_VS_WORKFLOW_DEPLOYMENT = - '`/workflows/{workflowId}/deployment` controls API execution; this singleton path controls hosted chat. `PUT` creates or replaces it without a chat-id path.' - const CHAT_DEPLOYMENT_EXAMPLE = { id: 'chat_01J8ZK3QW4M6X2R9T7B5C0V2', workflowId: WORKFLOW_ID, diff --git a/apps/sim/lib/api/contracts/workspace-files.ts b/apps/sim/lib/api/contracts/workspace-files.ts index c9d3b075b95..22453430e7e 100644 --- a/apps/sim/lib/api/contracts/workspace-files.ts +++ b/apps/sim/lib/api/contracts/workspace-files.ts @@ -344,8 +344,3 @@ export const workspaceFileStyleContract = defineRouteContract({ schema: documentStyleSummarySchema, }, }) - -const compiledCheckResponseSchema = z.union([ - z.object({ ok: z.literal(true) }), - z.object({ ok: z.literal(false), error: z.string(), errorName: z.string() }), -]) diff --git a/apps/sim/lib/auth/auth-client.ts b/apps/sim/lib/auth/auth-client.ts index 9801e513563..ca2bd947edc 100644 --- a/apps/sim/lib/auth/auth-client.ts +++ b/apps/sim/lib/auth/auth-client.ts @@ -67,5 +67,4 @@ export const useSubscription = () => { } } -const { signIn, signUp, signOut } = client -export { signOut } +export const { signOut } = client diff --git a/apps/sim/lib/auth/auth.ts b/apps/sim/lib/auth/auth.ts index f1b655e1ca9..65ac5d554e0 100644 --- a/apps/sim/lib/auth/auth.ts +++ b/apps/sim/lib/auth/auth.ts @@ -883,7 +883,7 @@ export const auth = betterAuth({ ...additionalFields, id, }), - sendResetPassword: async ({ user, url, token }, request) => { + sendResetPassword: async ({ user, url }) => { const username = user.name || '' const html = await renderPasswordResetEmail(username, url) @@ -1250,7 +1250,7 @@ export const auth = betterAuth({ ) } - const html = await renderOTPEmail(data.otp, data.email, data.type) + const html = await renderOTPEmail(data.otp, data.type) const result = await sendEmail({ to: data.email, diff --git a/apps/sim/lib/auth/internal.ts b/apps/sim/lib/auth/internal.ts index ec2b1a38e19..d73721ce8bb 100644 --- a/apps/sim/lib/auth/internal.ts +++ b/apps/sim/lib/auth/internal.ts @@ -306,7 +306,7 @@ export async function verifyInternalToken( } return { valid: false } - } catch (error) { + } catch { // Token verification failed return { valid: false } } diff --git a/apps/sim/lib/billing/client/types.ts b/apps/sim/lib/billing/client/types.ts index 6357a66a0a3..01e3baf309f 100644 --- a/apps/sim/lib/billing/client/types.ts +++ b/apps/sim/lib/billing/client/types.ts @@ -11,15 +11,6 @@ export interface UsageData { copilotCost?: number } -interface UsageLimitData { - currentLimit: number - canEdit: boolean - minimumLimit: number - plan: string - setBy?: string - updatedAt?: Date -} - export interface SubscriptionData { isPaid: boolean isPro: boolean @@ -40,41 +31,3 @@ export interface SubscriptionData { } export type BillingStatus = 'unknown' | 'ok' | 'warning' | 'exceeded' | 'blocked' - -interface SubscriptionStore { - subscriptionData: SubscriptionData | null - usageLimitData: UsageLimitData | null - isLoading: boolean - error: string | null - lastFetched: number | null - loadSubscriptionData: () => Promise - loadUsageLimitData: () => Promise - loadData: () => Promise<{ - subscriptionData: SubscriptionData | null - usageLimitData: UsageLimitData | null - }> - updateUsageLimit: (newLimit: number) => Promise<{ success: boolean; error?: string }> - refresh: () => Promise - clearError: () => void - reset: () => void - getSubscriptionStatus: () => { - isPaid: boolean - isPro: boolean - isTeam: boolean - isEnterprise: boolean - isOrgScoped: boolean - organizationId: string | null - isFree: boolean - plan: string - status: string | null - seats: number | null - metadata: any | null - } - getUsage: () => UsageData - getBillingStatus: () => BillingStatus - getRemainingBudget: () => number - getDaysRemainingInPeriod: () => number | null - isAtLeastPro: () => boolean - isAtLeastTeam: () => boolean - canUpgrade: () => boolean -} diff --git a/apps/sim/lib/billing/credits/balance.ts b/apps/sim/lib/billing/credits/balance.ts index 5334bb4d4a7..37eaf5d5e5c 100644 --- a/apps/sim/lib/billing/credits/balance.ts +++ b/apps/sim/lib/billing/credits/balance.ts @@ -4,7 +4,7 @@ import { createLogger } from '@sim/logger' import { eq, sql } from 'drizzle-orm' import { getHighestPrioritySubscription } from '@/lib/billing/core/subscription' import { isOrgScopedSubscription } from '@/lib/billing/subscriptions/utils' -import { toDecimal, toFixedString, toNumber } from '@/lib/billing/utils/decimal' +import { toDecimal, toNumber } from '@/lib/billing/utils/decimal' import type { DbClient } from '@/lib/db/types' const logger = createLogger('CreditBalance') @@ -86,62 +86,3 @@ export async function addCredits( logger.info('Added credits to user', { userId: entityId, amount }) } } - -interface DeductResult { - creditsUsed: number - overflow: number -} - -async function atomicDeductUserCredits(userId: string, cost: number): Promise { - const costDecimal = toDecimal(cost) - const costStr = toFixedString(costDecimal) - - // Use raw SQL with CTE to capture old balance before update - const result = await db.execute<{ old_balance: string; new_balance: string }>(sql` - WITH old_balance AS ( - SELECT credit_balance FROM user_stats WHERE user_id = ${userId} - ) - UPDATE user_stats - SET credit_balance = CASE - WHEN credit_balance >= ${costStr}::decimal THEN credit_balance - ${costStr}::decimal - ELSE 0 - END - WHERE user_id = ${userId} AND credit_balance >= 0 - RETURNING - (SELECT credit_balance FROM old_balance) as old_balance, - credit_balance as new_balance - `) - - const rows = Array.from(result) - if (rows.length === 0) return 0 - - const oldBalance = toDecimal(rows[0].old_balance) - return toNumber(oldBalance.lessThan(costDecimal) ? oldBalance : costDecimal) -} - -async function atomicDeductOrgCredits(orgId: string, cost: number): Promise { - const costDecimal = toDecimal(cost) - const costStr = toFixedString(costDecimal) - - // Use raw SQL with CTE to capture old balance before update - const result = await db.execute<{ old_balance: string; new_balance: string }>(sql` - WITH old_balance AS ( - SELECT credit_balance FROM organization WHERE id = ${orgId} - ) - UPDATE organization - SET credit_balance = CASE - WHEN credit_balance >= ${costStr}::decimal THEN credit_balance - ${costStr}::decimal - ELSE 0 - END - WHERE id = ${orgId} AND credit_balance >= 0 - RETURNING - (SELECT credit_balance FROM old_balance) as old_balance, - credit_balance as new_balance - `) - - const rows = Array.from(result) - if (rows.length === 0) return 0 - - const oldBalance = toDecimal(rows[0].old_balance) - return toNumber(oldBalance.lessThan(costDecimal) ? oldBalance : costDecimal) -} diff --git a/apps/sim/lib/billing/types/index.ts b/apps/sim/lib/billing/types/index.ts index 3d59032ddd6..11370eafe51 100644 --- a/apps/sim/lib/billing/types/index.ts +++ b/apps/sim/lib/billing/types/index.ts @@ -102,101 +102,6 @@ export interface BillingData { daysRemaining: number } -interface SubscriptionPlan { - name: string - priceId: string - limits: { - cost: number - } -} - -interface BillingEntity { - id: string - type: 'user' | 'organization' - referenceId: string - metadata?: { stripeCustomerId?: string; [key: string]: any } | null - createdAt: Date - updatedAt: Date -} - -interface BillingConfig { - id: string - entityType: 'user' | 'organization' - entityId: string - usageLimit: number - limitSetBy?: string - limitUpdatedAt?: Date - billingPeriodType: 'monthly' | 'annual' - autoResetEnabled: boolean - createdAt: Date - updatedAt: Date -} - -interface UsagePeriod { - id: string - entityType: 'user' | 'organization' - entityId: string - periodStart: Date - periodEnd: Date - totalCost: number - finalCost?: number - isCurrent: boolean - status: 'active' | 'finalized' | 'billed' - createdAt: Date - finalizedAt?: Date -} - -interface BillingStatus { - status: 'ok' | 'warning' | 'exceeded' - usageData: UsageData -} - -interface TeamUsageLimit { - userId: string - userName: string - userEmail: string - currentLimit: number - currentUsage: number - limitSetBy: string | null - limitUpdatedAt: Date | null -} - -interface BillingSummary { - userId: string - email: string - name: string - currentPeriodCost: number - currentUsageLimit: number - currentUsagePercentage: number - billingPeriodStart: Date | null - billingPeriodEnd: Date | null - plan: string - subscriptionStatus: string | null - seats: number | null - billingStatus: 'ok' | 'warning' | 'exceeded' -} - -interface SubscriptionAPIResponse { - isPaid: boolean - isPro: boolean - isTeam: boolean - isEnterprise: boolean - plan: string - status: string | null - seats: number | null - metadata: any | null - usage: UsageData -} - -interface UsageLimitAPIResponse { - currentLimit: number - canEdit: boolean - minimumLimit: number - plan: string - setBy?: string - updatedAt?: Date -} - // Utility Types export type PlanType = 'free' | 'pro' | 'team' | 'enterprise' export type SubscriptionStatus = @@ -213,51 +118,5 @@ export type UsagePeriodStatus = 'active' | 'finalized' | 'billed' export type BillingStatusType = 'ok' | 'warning' | 'exceeded' // Error Types -interface BillingError { - code: string - message: string - details?: any -} - -interface UpdateUsageLimitResult { - success: boolean - error?: string -} // Hook Types for React -interface UseSubscriptionStateReturn { - subscription: { - isPaid: boolean - isPro: boolean - isTeam: boolean - isEnterprise: boolean - isFree: boolean - plan: string - status?: string - seats?: number - metadata?: any - } - usage: UsageData - isLoading: boolean - error: Error | null - refetch: () => Promise - isAtLeastPro: () => boolean - isAtLeastTeam: () => boolean - canUpgrade: () => boolean - getBillingStatus: () => BillingStatusType - getRemainingBudget: () => number - getDaysRemainingInPeriod: () => number | null -} - -interface UseUsageLimitReturn { - currentLimit: number - canEdit: boolean - minimumLimit: number - plan: string - setBy?: string - updatedAt?: Date - updateLimit: (newLimit: number) => Promise<{ success: boolean }> - isLoading: boolean - error: Error | null - refetch: () => Promise -} diff --git a/apps/sim/lib/core/async-jobs/backends/trigger-dev.test.ts b/apps/sim/lib/core/async-jobs/backends/trigger-dev.test.ts index e4cc6089868..98a5d982be7 100644 --- a/apps/sim/lib/core/async-jobs/backends/trigger-dev.test.ts +++ b/apps/sim/lib/core/async-jobs/backends/trigger-dev.test.ts @@ -25,7 +25,6 @@ import { TriggerDevJobQueue } from '@/lib/core/async-jobs/backends/trigger-dev' import { AsyncJobEnqueueError, JOB_PENDING_RETENTION_HOURS } from '@/lib/core/async-jobs/types' const { - mockTasksBatchTriggerAndWait: mockBatchTriggerAndWait, mockRunsCancel: mockCancel, mockRunsList: mockList, mockRunsRetrieve: mockRetrieve, diff --git a/apps/sim/lib/core/execution-limits/types.ts b/apps/sim/lib/core/execution-limits/types.ts index b81c817e531..02984464a4b 100644 --- a/apps/sim/lib/core/execution-limits/types.ts +++ b/apps/sim/lib/core/execution-limits/types.ts @@ -176,7 +176,7 @@ export function isTimeoutError(error: unknown): boolean { return false } -export function getTimeoutErrorMessage(error: unknown, timeoutMs?: number): string { +export function getTimeoutErrorMessage(timeoutMs?: number): string { if (timeoutMs) { const timeoutSeconds = Math.floor(timeoutMs / 1000) const timeoutMinutes = Math.floor(timeoutSeconds / 60) diff --git a/apps/sim/lib/core/telemetry.ts b/apps/sim/lib/core/telemetry.ts index e763fbdc7e8..ed7d850b23f 100644 --- a/apps/sim/lib/core/telemetry.ts +++ b/apps/sim/lib/core/telemetry.ts @@ -392,7 +392,7 @@ export function trackPlatformEvent( }) span.setStatus({ code: SpanStatusCode.OK }) span.end() - } catch (error) { + } catch { // Silently fail } } diff --git a/apps/sim/lib/core/utils/response-format.ts b/apps/sim/lib/core/utils/response-format.ts index caf1c9a97b5..b84690879d7 100644 --- a/apps/sim/lib/core/utils/response-format.ts +++ b/apps/sim/lib/core/utils/response-format.ts @@ -109,7 +109,7 @@ export function parseOutputContentSafely(output: any): any { if (typeof output.content === 'string') { try { return JSON.parse(output.content) - } catch (e) { + } catch { // Fallback to original structure if parsing fails return output } diff --git a/apps/sim/lib/credential-groups/application/manage-mcp-connectors.ts b/apps/sim/lib/credential-groups/application/manage-mcp-connectors.ts index e2974b868be..c8527e861f2 100644 --- a/apps/sim/lib/credential-groups/application/manage-mcp-connectors.ts +++ b/apps/sim/lib/credential-groups/application/manage-mcp-connectors.ts @@ -79,7 +79,7 @@ export const createCredentialGroupMcpConnector = defineAuthorizedWorkspaceUseCas resourceName: result.mcpServer.name, description: `Added managed MCP connector "${result.mcpServer.name}"`, }), - afterSuccess: ({ context, result }) => + afterSuccess: ({ context }) => applyManagedMcpConnectorEffects({ workspaceId: context.workspaceId, serverIds: [], diff --git a/apps/sim/lib/custom-tools/application/use-cases.ts b/apps/sim/lib/custom-tools/application/use-cases.ts index c70e9944c1e..87f7358f027 100644 --- a/apps/sim/lib/custom-tools/application/use-cases.ts +++ b/apps/sim/lib/custom-tools/application/use-cases.ts @@ -107,7 +107,7 @@ export const listAvailableCustomToolsUseCase = defineAuthorizedWorkspaceUseCase( resolveContext: ({ input }: { input: ListAvailableCustomToolsInput }) => resolveWorkspaceContext(input.workspaceId), authorizationOptions, - async execute({ principal, input, context }) { + async execute({ principal, context }) { const tools = await listCustomTools({ userId: requireCustomToolUserId(principal), workspaceId: context.workspaceId, diff --git a/apps/sim/lib/execution/event-buffer.test.ts b/apps/sim/lib/execution/event-buffer.test.ts index 43209a39623..b8ce4cee781 100644 --- a/apps/sim/lib/execution/event-buffer.test.ts +++ b/apps/sim/lib/execution/event-buffer.test.ts @@ -332,7 +332,7 @@ describe('execution event buffer', () => { () => Promise.resolve(), ] - mockRedis.eval.mockImplementation(async (script: string, ...args: unknown[]) => { + mockRedis.eval.mockImplementation(async (_script: string, ...args: unknown[]) => { const batchEntries: ExecutionEventEntry[] = [] const { zaddArgs } = parseFlushEvalArgs(args) for (let i = 0; i < zaddArgs.length; i += 2) { @@ -417,7 +417,7 @@ describe('execution event buffer', () => { it('flushes replay events after a recovered final replay flush without terminal meta', async () => { mockRedis.incrby.mockResolvedValue(100) let flushAttempt = 0 - mockRedis.eval.mockImplementation(async (script: string, ...args: unknown[]) => { + mockRedis.eval.mockImplementation(async (_script: string, ...args: unknown[]) => { const { zaddArgs } = parseFlushEvalArgs(args) if (flushAttempt > 0) { for (let i = 0; i < zaddArgs.length; i += 2) { @@ -470,7 +470,7 @@ describe('execution event buffer', () => { it('budgets only net event bytes after pruning during flush', async () => { mockRedis.incrby.mockResolvedValue(100) let netBudgetBytes = 0 - mockRedis.eval.mockImplementation(async (script: string, ...args: unknown[]) => { + mockRedis.eval.mockImplementation(async (_script: string, ...args: unknown[]) => { const keyCount = Number(args[0]) netBudgetBytes = Number(args[keyCount + 5]) const { zaddArgs } = parseFlushEvalArgs(args) diff --git a/apps/sim/lib/execution/files.ts b/apps/sim/lib/execution/files.ts index 38a7604fb2b..ed9291ab86e 100644 --- a/apps/sim/lib/execution/files.ts +++ b/apps/sim/lib/execution/files.ts @@ -129,7 +129,6 @@ async function resolveStoredFileReference( export async function processExecutionFile( fileInput: unknown, executionContext: { workspaceId: string; workflowId: string; executionId: string }, - requestId: string, userId?: string, storedFileScope: StoredFileReferenceScope = 'execution' ): Promise { @@ -262,13 +261,7 @@ export async function processExecutionFiles( for (const file of files) { try { - const userFile = await processExecutionFile( - file, - fullContext, - requestId, - userId, - storedFileScope - ) + const userFile = await processExecutionFile(file, fullContext, userId, storedFileScope) if (userFile) { uploadedFiles.push(userFile) diff --git a/apps/sim/lib/execution/payloads/materialization.server.test.ts b/apps/sim/lib/execution/payloads/materialization.server.test.ts index f86928330bf..1c3ad6f87fe 100644 --- a/apps/sim/lib/execution/payloads/materialization.server.test.ts +++ b/apps/sim/lib/execution/payloads/materialization.server.test.ts @@ -134,7 +134,6 @@ describe('readUserFileContent', () => { 'reader', undefined, 'knowledge-base', - false, { knowledgeAccess: expect.objectContaining({ get: expect.any(Function), @@ -408,7 +407,6 @@ describe('readUserFileContent', () => { 'reader', undefined, 'workspace', - false, { knowledgeAccess: undefined } ) } diff --git a/apps/sim/lib/execution/payloads/materialization.server.ts b/apps/sim/lib/execution/payloads/materialization.server.ts index 93be16c2efb..85f918e295d 100644 --- a/apps/sim/lib/execution/payloads/materialization.server.ts +++ b/apps/sim/lib/execution/payloads/materialization.server.ts @@ -343,7 +343,7 @@ export async function assertUserFileContentAccess( context === 'knowledge-base' && options.principal ? createKnowledgeAccessProvider(options.principal, { workspaceId: options.workspaceId }) : undefined - const hasAccess = await verifyFileAccess(file.key, options.userId, undefined, context, false, { + const hasAccess = await verifyFileAccess(file.key, options.userId, undefined, context, { knowledgeAccess, }) if (!hasAccess) { diff --git a/apps/sim/lib/execution/payloads/serializer.test.ts b/apps/sim/lib/execution/payloads/serializer.test.ts index c22a4bda001..ab4ebea813c 100644 --- a/apps/sim/lib/execution/payloads/serializer.test.ts +++ b/apps/sim/lib/execution/payloads/serializer.test.ts @@ -24,7 +24,7 @@ import { import type { TraceSpan } from '@/lib/logs/types' import type { BlockLog, UserFile } from '@/executor/types' -const { mockDownloadFile, mockUploadFile } = storageServiceMockFns +const { mockUploadFile } = storageServiceMockFns vi.mock('@/lib/uploads', () => uploadsMock) vi.mock('@/lib/uploads/core/storage-service', () => storageServiceMock) diff --git a/apps/sim/lib/execution/remote-sandbox/resolve.ts b/apps/sim/lib/execution/remote-sandbox/resolve.ts index ad87f12b86a..184ec2f4562 100644 --- a/apps/sim/lib/execution/remote-sandbox/resolve.ts +++ b/apps/sim/lib/execution/remote-sandbox/resolve.ts @@ -218,7 +218,7 @@ export async function resolveWorkspaceSandbox(args: { await requireSandboxPlan(workspaceId) const provider = resolveProvider() - const { db, sandboxImage, workspaceSandbox, and, eq } = await sandboxDb() + const { db, workspaceSandbox, and, eq } = await sandboxDb() const [row] = await db .select({ id: workspaceSandbox.id, diff --git a/apps/sim/lib/file-parsers/html-parser.ts b/apps/sim/lib/file-parsers/html-parser.ts index 24bdf8cd47c..fc2793b4657 100644 --- a/apps/sim/lib/file-parsers/html-parser.ts +++ b/apps/sim/lib/file-parsers/html-parser.ts @@ -337,10 +337,7 @@ function processListItem( } /** A table's own rows: direct `` children and those under its section elements. */ -function directRows( - $: cheerio.CheerioAPI, - table: cheerio.Cheerio -): cheerio.Cheerio { +function directRows(table: cheerio.Cheerio): cheerio.Cheerio { return table.children('thead, tbody, tfoot').children('tr').add(table.children('tr')) } @@ -359,7 +356,7 @@ function topLevelNestedTables( */ function flattenedTableCells($: cheerio.CheerioAPI, table: cheerio.Cheerio): string[] { const cells: string[] = [] - directRows($, table).each((_, row) => { + directRows(table).each((_, row) => { $(row) .children('td, th') .each((_, cell) => { @@ -412,7 +409,7 @@ function processTable( ): void { contentParts.push('\n[Table]') - directRows($, table).each((_, row) => { + directRows(table).each((_, row) => { const cells: string[] = [] $(row) diff --git a/apps/sim/lib/folders/bulk.ts b/apps/sim/lib/folders/bulk.ts index 2e32c343132..592aa7c02a0 100644 --- a/apps/sim/lib/folders/bulk.ts +++ b/apps/sim/lib/folders/bulk.ts @@ -86,7 +86,7 @@ export async function planFolderSelection( } const insideAnotherSelection = new Set() - for (const [folderId, descendants] of descendantsOf) { + for (const descendants of descendantsOf.values()) { for (const descendantId of descendants) { if (requested.has(descendantId)) insideAnotherSelection.add(descendantId) } diff --git a/apps/sim/lib/guardrails/validate_hallucination.ts b/apps/sim/lib/guardrails/validate_hallucination.ts index 0e25c657a5b..33d4ed3d34c 100644 --- a/apps/sim/lib/guardrails/validate_hallucination.ts +++ b/apps/sim/lib/guardrails/validate_hallucination.ts @@ -266,7 +266,6 @@ export async function validateHallucination( providerCredentials, workflowId, workspaceId, - actorUserId, executionContext, billingAttribution, requestId, diff --git a/apps/sim/lib/integrations/credential-visibility.server.ts b/apps/sim/lib/integrations/credential-visibility.server.ts index 41d024a4445..a38ae4bcc05 100644 --- a/apps/sim/lib/integrations/credential-visibility.server.ts +++ b/apps/sim/lib/integrations/credential-visibility.server.ts @@ -44,7 +44,6 @@ export function createIntegrationCredentialVisibility({ blockVisibility, oauthServices = getAllOAuthServices(), }: IntegrationCredentialVisibilityOptions): IntegrationCredentialVisibility { - const oauthOwners = oauthServices.filter((service) => service.authType === 'oauth') const oauthOwnersByProviderId = new Map() const serviceAccountOwnersByProviderId = new Map() const availabilityByType = new Map( diff --git a/apps/sim/lib/internal/agiloft/protocol.test.ts b/apps/sim/lib/internal/agiloft/protocol.test.ts index f4187b4c4e1..b6e8c7c82b6 100644 --- a/apps/sim/lib/internal/agiloft/protocol.test.ts +++ b/apps/sim/lib/internal/agiloft/protocol.test.ts @@ -28,17 +28,6 @@ EWREST_id_2 = '325';` /** REST - Select: the documented empty result. */ const SELECT_EMPTY_BODY = "EWREST_id_length = '0';" -/** REST - Search, Example 2: two requested fields across four records. */ -const SEARCH_BODY = `EWREST_length = '4'; -EWREST_summary_0='Here is a new service request with some tasks'; -EWREST_priority_0='High'; -EWREST_summary_1='New Employee Setup for Patricia Smith'; -EWREST_priority_1='High'; -EWREST_summary_2='Upgrading Our Software'; -EWREST_priority_2='High'; -EWREST_summary_3='Need New Wireless Card for Laptop'; -EWREST_priority_3='High';` - describe('parseEwRest', () => { it('reads the field assignments EWRead returns', () => { const values = parseEwRest(READ_BODY) diff --git a/apps/sim/lib/internal/asana/operations.test.ts b/apps/sim/lib/internal/asana/operations.test.ts index 6770949800d..c47112a442d 100644 --- a/apps/sim/lib/internal/asana/operations.test.ts +++ b/apps/sim/lib/internal/asana/operations.test.ts @@ -1,26 +1,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { AsanaOperationError } from '@/lib/internal/asana/errors' -import { - executeAsanaAddComment, - executeAsanaAddFollowers, - executeAsanaCreateProject, - executeAsanaCreateSection, - executeAsanaCreateSubtask, - executeAsanaCreateTask, - executeAsanaDeleteTask, - executeAsanaGetProject, - executeAsanaGetProjects, - executeAsanaGetTask, - executeAsanaListSections, - executeAsanaListWorkspaces, - executeAsanaSearchTasks, - executeAsanaUpdateTask, -} from '@/lib/internal/asana/operations' +import { executeAsanaAddFollowers, executeAsanaGetTask } from '@/lib/internal/asana/operations' -const API_BASE_URL = 'https://app.asana.com/api/1.0' -const TASK_OPT_FIELDS = - 'gid,name,notes,completed,assignee,assignee.name,due_on,created_at,modified_at,created_by,created_by.name,resource_type,resource_subtype' -const PROJECT_OPT_FIELDS = 'name,notes,archived,color,created_at,modified_at,permalink_url' const AUTH = { accessToken: 'access-token' } describe('Asana operations', () => { @@ -33,105 +14,6 @@ describe('Asana operations', () => { ) }) - const searchParams = new URLSearchParams({ opt_fields: TASK_OPT_FIELDS }) - const operationCases = [ - { - name: 'add comment', - run: (signal: AbortSignal) => - executeAsanaAddComment({ ...AUTH, taskGid: 'task1', text: 'Comment' }, signal), - url: `${API_BASE_URL}/tasks/task1/stories`, - method: 'POST', - }, - { - name: 'add followers', - run: (signal: AbortSignal) => - executeAsanaAddFollowers({ ...AUTH, taskGid: 'task1', followers: ['user1'] }, signal), - url: `${API_BASE_URL}/tasks/task1/addFollowers?opt_fields=name,followers.name`, - method: 'POST', - }, - { - name: 'create project', - run: (signal: AbortSignal) => - executeAsanaCreateProject({ ...AUTH, workspace: 'workspace1', name: 'Project' }, signal), - url: `${API_BASE_URL}/projects?opt_fields=${PROJECT_OPT_FIELDS}`, - method: 'POST', - }, - { - name: 'create section', - run: (signal: AbortSignal) => - executeAsanaCreateSection({ ...AUTH, projectGid: 'project1', name: 'Section' }, signal), - url: `${API_BASE_URL}/projects/project1/sections`, - method: 'POST', - }, - { - name: 'create subtask', - run: (signal: AbortSignal) => - executeAsanaCreateSubtask({ ...AUTH, taskGid: 'task1', name: 'Subtask' }, signal), - url: `${API_BASE_URL}/tasks/task1/subtasks?opt_fields=name,notes,completed,created_at,permalink_url`, - method: 'POST', - }, - { - name: 'create task', - run: (signal: AbortSignal) => - executeAsanaCreateTask({ ...AUTH, workspace: 'workspace1', name: 'Task' }, signal), - url: `${API_BASE_URL}/tasks?opt_fields=name,notes,completed,created_at,permalink_url`, - method: 'POST', - }, - { - name: 'delete task', - run: (signal: AbortSignal) => executeAsanaDeleteTask({ ...AUTH, taskGid: 'task1' }, signal), - url: `${API_BASE_URL}/tasks/task1`, - method: 'DELETE', - }, - { - name: 'get project', - run: (signal: AbortSignal) => - executeAsanaGetProject({ ...AUTH, projectGid: 'project1' }, signal), - url: `${API_BASE_URL}/projects/project1?opt_fields=${PROJECT_OPT_FIELDS}`, - method: 'GET', - }, - { - name: 'get projects', - run: (signal: AbortSignal) => - executeAsanaGetProjects({ ...AUTH, workspace: 'workspace1' }, signal), - url: `${API_BASE_URL}/projects?workspace=workspace1`, - method: 'GET', - }, - { - name: 'get task', - run: (signal: AbortSignal) => executeAsanaGetTask({ ...AUTH, taskGid: 'task1' }, signal), - url: `${API_BASE_URL}/tasks/task1?opt_fields=${TASK_OPT_FIELDS}`, - method: 'GET', - }, - { - name: 'list sections', - run: (signal: AbortSignal) => - executeAsanaListSections({ ...AUTH, projectGid: 'project1' }, signal), - url: `${API_BASE_URL}/projects/project1/sections`, - method: 'GET', - }, - { - name: 'list workspaces', - run: (signal: AbortSignal) => executeAsanaListWorkspaces(AUTH, signal), - url: `${API_BASE_URL}/workspaces?limit=100`, - method: 'GET', - }, - { - name: 'search tasks', - run: (signal: AbortSignal) => - executeAsanaSearchTasks({ ...AUTH, workspace: 'workspace1' }, signal), - url: `${API_BASE_URL}/workspaces/workspace1/tasks/search?${searchParams.toString()}`, - method: 'GET', - }, - { - name: 'update task', - run: (signal: AbortSignal) => - executeAsanaUpdateTask({ ...AUTH, taskGid: 'task1', completed: true }, signal), - url: `${API_BASE_URL}/tasks/task1`, - method: 'PUT', - }, - ] - it('preserves task-list pagination, project precedence, and the default limit', async () => { fetchMock.mockResolvedValueOnce( new Response( diff --git a/apps/sim/lib/internal/discord/client.ts b/apps/sim/lib/internal/discord/client.ts index 612fac7ef21..30959f99873 100644 --- a/apps/sim/lib/internal/discord/client.ts +++ b/apps/sim/lib/internal/discord/client.ts @@ -27,7 +27,7 @@ export async function sendDiscordMessage( label: 'Discord message response', signal, }) - } catch (error) { + } catch { signal?.throwIfAborted() data = null } diff --git a/apps/sim/lib/internal/file/parser.test.ts b/apps/sim/lib/internal/file/parser.test.ts index 67f78334c46..b1f72c57cee 100644 --- a/apps/sim/lib/internal/file/parser.test.ts +++ b/apps/sim/lib/internal/file/parser.test.ts @@ -38,7 +38,6 @@ import { FileParserError } from '@/lib/file-parsers/errors' const { mockVerifyFileAccess, - mockVerifyWorkspaceFileAccess, mockPdfParseBuffer, mockCreateReadStream, mockFsAccess, @@ -56,7 +55,6 @@ const { const actualPath = require('path') as typeof import('path') return { mockVerifyFileAccess: vi.fn().mockResolvedValue(true), - mockVerifyWorkspaceFileAccess: vi.fn().mockResolvedValue(true), mockPdfParseBuffer: vi.fn().mockResolvedValue({ content: 'parsed PDF content', metadata: { pageCount: 1 }, diff --git a/apps/sim/lib/internal/file/parser.ts b/apps/sim/lib/internal/file/parser.ts index d8f20be48f5..6a8ff461961 100644 --- a/apps/sim/lib/internal/file/parser.ts +++ b/apps/sim/lib/internal/file/parser.ts @@ -1136,7 +1136,6 @@ async function handlePdfBuffer( logger.error('Failed to parse PDF in memory:', error) const content = createPdfFailureMessage( - 0, fileBuffer.length, originalPath || filename, (error as Error).message @@ -1366,12 +1365,7 @@ Please use a PDF viewer for best results.` /** * Create error message for PDF parsing failure and make it more readable */ -function createPdfFailureMessage( - pageCount: number, - size: number, - path: string, - error: string -): string { +function createPdfFailureMessage(size: number, path: string, error: string): string { return `PDF document - Processing failed, ${prettySize(size)} Path: ${path} Error: ${error} diff --git a/apps/sim/lib/internal/google-slides/operations.test.ts b/apps/sim/lib/internal/google-slides/operations.test.ts index 8438f4af172..d93e05fd29d 100644 --- a/apps/sim/lib/internal/google-slides/operations.test.ts +++ b/apps/sim/lib/internal/google-slides/operations.test.ts @@ -2,7 +2,7 @@ import { inputValidationMock, inputValidationMockFns, } from '@sim/testing/mocks/input-validation.mock' -import { uploadsCopilotMock, uploadsCopilotMockFns } from '@sim/testing/mocks/uploads-copilot.mock' +import { uploadsCopilotMock } from '@sim/testing/mocks/uploads-copilot.mock' import { uploadsExecutionMock, uploadsExecutionMockFns, @@ -19,8 +19,6 @@ const { mockSecureFetchWithPinnedIP, mockValidateUrlWithDNS } = inputValidationM import { exportGoogleSlidesPresentation } from '@/lib/internal/google-slides/operations' -const { mockUploadCopilotFile } = uploadsCopilotMockFns - const { mockUploadExecutionFile } = uploadsExecutionMockFns describe('exportGoogleSlidesPresentation', () => { diff --git a/apps/sim/lib/internal/image/operations.test.ts b/apps/sim/lib/internal/image/operations.test.ts index 70de9c70bf3..a01dd538ec5 100644 --- a/apps/sim/lib/internal/image/operations.test.ts +++ b/apps/sim/lib/internal/image/operations.test.ts @@ -7,10 +7,7 @@ import { inputValidationMockFns, } from '@sim/testing/mocks/input-validation.mock' import { uploadsCopilotMock, uploadsCopilotMockFns } from '@sim/testing/mocks/uploads-copilot.mock' -import { - uploadsExecutionMock, - uploadsExecutionMockFns, -} from '@sim/testing/mocks/uploads-execution.mock' +import { uploadsExecutionMock } from '@sim/testing/mocks/uploads-execution.mock' import { utilsHelpersMock, utilsHelpersMockFns } from '@sim/testing/mocks/utils-helpers.mock' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -45,8 +42,6 @@ const { mockUploadCopilotFile } = uploadsCopilotMockFns executionLimitsMockFns.mockGetMaxExecutionTimeout.mockReturnValue(9000) -const { mockUploadExecutionFile } = uploadsExecutionMockFns - const falInput = { provider: 'falai' as const, apiKey: 'fal-key', diff --git a/apps/sim/lib/internal/instagram/execute-tool.test.ts b/apps/sim/lib/internal/instagram/execute-tool.test.ts index f4e3153ceb9..4e660b36145 100644 --- a/apps/sim/lib/internal/instagram/execute-tool.test.ts +++ b/apps/sim/lib/internal/instagram/execute-tool.test.ts @@ -3,7 +3,7 @@ import { fileUtilsServerMockFns, } from '@sim/testing/mocks/file-utils-server.mock' import { storageServiceMock, storageServiceMockFns } from '@sim/testing/mocks/storage-service.mock' -import { uploadsCopilotMock, uploadsCopilotMockFns } from '@sim/testing/mocks/uploads-copilot.mock' +import { uploadsCopilotMock } from '@sim/testing/mocks/uploads-copilot.mock' import { uploadsExecutionMock, uploadsExecutionMockFns, @@ -27,8 +27,6 @@ const { mockDeleteFileMetadata } = uploadsMetadataMockFns import { executeInstagramTool } from '@/lib/internal/instagram/execute-tool' import type { InternalToolOperationCall } from '@/lib/internal/tool-operations/types' -const { mockUploadCopilotFile } = uploadsCopilotMockFns - const { mockUploadExecutionFile } = uploadsExecutionMockFns const mockFetch = vi.fn() diff --git a/apps/sim/lib/internal/instagram/operations.ts b/apps/sim/lib/internal/instagram/operations.ts index 805c60e8453..faa36a63bf4 100644 --- a/apps/sim/lib/internal/instagram/operations.ts +++ b/apps/sim/lib/internal/instagram/operations.ts @@ -291,7 +291,7 @@ export async function executeInstagramDownloadMedia( body: InstagramDownloadMediaBody, context: InstagramOperationContext ): Promise { - const { executionId, requestId, signal, userId, workflowId, workspaceId } = context + const { executionId, signal, userId, workflowId, workspaceId } = context signal?.throwIfAborted() const files: UserFile[] = [] let storageContext: StorageContext = 'copilot' diff --git a/apps/sim/lib/internal/mistral/operations.test.ts b/apps/sim/lib/internal/mistral/operations.test.ts index 62a64d8c6c6..5949e50ae11 100644 --- a/apps/sim/lib/internal/mistral/operations.test.ts +++ b/apps/sim/lib/internal/mistral/operations.test.ts @@ -43,11 +43,8 @@ import { } from '@/lib/internal/mistral/operations' const authorizeFile = filesAuthorizationMockFns.mockAssertToolFileAccess -const { - mockDownloadServableFileFromStorage: downloadFile, - mockDownloadFileFromUrl: downloadUrl, - mockResolveInternalFileUrl: resolveUrl, -} = fileUtilsServerMockFns +const { mockDownloadServableFileFromStorage: downloadFile, mockDownloadFileFromUrl: downloadUrl } = + fileUtilsServerMockFns const modelSafeFile = workspaceFileSecretProvenanceMockFns.mockIsModelSafeWorkspaceFileKey const validateUrl = inputValidationMockFns.mockValidateUrlWithDNS diff --git a/apps/sim/lib/internal/pipedrive/operations.ts b/apps/sim/lib/internal/pipedrive/operations.ts index 068def9a162..e5fc60374dd 100644 --- a/apps/sim/lib/internal/pipedrive/operations.ts +++ b/apps/sim/lib/internal/pipedrive/operations.ts @@ -44,7 +44,7 @@ export async function executePipedriveGetFiles( mimeType: downloaded.contentType || getMimeTypeFromExtension(extension), buffer: downloaded.buffer, }) - } catch (error) { + } catch { context.signal?.throwIfAborted() logger.warn('Failed to download Pipedrive file', { fileId: file.id, diff --git a/apps/sim/lib/invitations/send.ts b/apps/sim/lib/invitations/send.ts index 44da5aae753..04e2244934c 100644 --- a/apps/sim/lib/invitations/send.ts +++ b/apps/sim/lib/invitations/send.ts @@ -7,7 +7,6 @@ import { organization, workspace, } from '@sim/db/schema' -import { createLogger } from '@sim/logger' import { isOrgAdminRole } from '@sim/platform-authz/workspace' import { getPostgresConstraintName, getPostgresErrorCode } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' @@ -31,8 +30,6 @@ import { sendEmail } from '@/lib/messaging/email/mailer' import { getFromEmailAddress } from '@/lib/messaging/email/utils' import { getBrandConfig } from '@/ee/whitelabeling' -const logger = createLogger('InvitationSend') - interface WorkspaceGrantInput { workspaceId: string permission: 'admin' | 'write' | 'read' diff --git a/apps/sim/lib/knowledge/__integration__/application-acl.integration.ts b/apps/sim/lib/knowledge/__integration__/application-acl.integration.ts index 209f2142ebb..814e7f5270e 100644 --- a/apps/sim/lib/knowledge/__integration__/application-acl.integration.ts +++ b/apps/sim/lib/knowledge/__integration__/application-acl.integration.ts @@ -88,8 +88,7 @@ describe('indexed source content through real application access', () => { } const revokedSiteReaders = new Set() const ids = createKnowledgeAclFixtureIds() - const { aliceId, bobId, workspaceId, knowledgeBaseId, connectorId, lockId, groups, groupIds } = - ids + const { aliceId, bobId, workspaceId, knowledgeBaseId, connectorId, lockId, groups } = ids const alice: Principal = { kind: 'session', userId: aliceId, sessionId: 'fixture-alice' } const bob: Principal = { kind: 'personal_api_key', userId: bobId, keyId: 'fixture-bob' } const workspaceKey: Principal = { diff --git a/apps/sim/lib/knowledge/__integration__/search-latency.integration.ts b/apps/sim/lib/knowledge/__integration__/search-latency.integration.ts index 687a872fa56..270e642001e 100644 --- a/apps/sim/lib/knowledge/__integration__/search-latency.integration.ts +++ b/apps/sim/lib/knowledge/__integration__/search-latency.integration.ts @@ -133,7 +133,6 @@ const report: Record = { }, } let capture = false -let embeddingCalls = 0 let readerCalls = 0 let readerRevoked = false const previousDebug = db.$client.options.debug @@ -533,7 +532,6 @@ describe.skipIf(!enabled)('Knowledge search latency on a realistic indexed corpu ) .length(1), }).parse(JSON.parse(String(init?.body))) - embeddingCalls++ return Response.json({ embeddings: [{ values: queryVector }], usageMetadata: { promptTokenCount: 4 }, @@ -548,7 +546,6 @@ describe.skipIf(!enabled)('Knowledge search latency on a realistic indexed corpu model: z.literal('text-embedding-3-small'), }) .parse(JSON.parse(String(init?.body))) - embeddingCalls += body.input.length const bytes = Buffer.alloc(dimensions * 4) const topic = Number(/^Topic (\d+) deployment$/.exec(body.input[0])?.[1] ?? 0) topicVector(topic).forEach((value, index) => bytes.writeFloatLE(value, index * 4)) diff --git a/apps/sim/lib/knowledge/__integration__/slack-search-turns.integration.ts b/apps/sim/lib/knowledge/__integration__/slack-search-turns.integration.ts index 888c4ddb567..754b824a6aa 100644 --- a/apps/sim/lib/knowledge/__integration__/slack-search-turns.integration.ts +++ b/apps/sim/lib/knowledge/__integration__/slack-search-turns.integration.ts @@ -422,7 +422,7 @@ describe('durable Slack Search turns in PostgreSQL', () => { it('does not save a title when access is revoked during generation', async () => { const input = job() await persistSlackSearchTurn(input) - const chat = await resolveSlackSearchChat(principal(input), input) + await resolveSlackSearchChat(principal(input), input) title.request.mockReset().mockResolvedValue('Generated title') await expect( generateSlackSearchChatTitle(principal(input), { diff --git a/apps/sim/lib/knowledge/access/predicate.integration.ts b/apps/sim/lib/knowledge/access/predicate.integration.ts index d00e3f08dcf..770005d4cf3 100644 --- a/apps/sim/lib/knowledge/access/predicate.integration.ts +++ b/apps/sim/lib/knowledge/access/predicate.integration.ts @@ -1,6 +1,5 @@ import { readFile } from 'node:fs/promises' import { readTestDatabaseUrl } from '@sim/db/testing/test-infrastructure' -import type { SQL } from 'drizzle-orm' import type postgres from 'postgres' import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import { createEnterpriseSearchMigrationFixture } from '@/lib/knowledge/__integration__/migration-fixture' @@ -23,9 +22,7 @@ const { mergeMirroredAcls, hideUnlistedDocuments } = await import( '@/lib/knowledge/connectors/mirrored-acls' ) const { PgDialect } = await import('drizzle-orm/pg-core') -const { knowledgeAccessCondition, knowledgeMetadataCandidateAccessCondition } = await import( - '@/lib/knowledge/access/predicate' -) +const { knowledgeAccessCondition } = await import('@/lib/knowledge/access/predicate') const { confluencePageAcl } = await import('@/lib/knowledge/access/confluence-permissions') /** Every table and index belongs to an isolated disposable schema. */ @@ -110,20 +107,6 @@ describe('knowledge ACLs in PostgreSQL', () => { return rows.length > 0 } - /** Runs any predicate over one document, so two shapes can be compared row by row. */ - async function admits(condition: SQL, documentId: string): Promise { - const query = new PgDialect().sqlToQuery(condition) - const values = query.params.map((value: unknown) => { - if (typeof value === 'string' || typeof value === 'number') return value - throw new Error('The access predicate must bind scalar strings and numbers') - }) - const rows = await connection.unsafe( - `SELECT document.id FROM document WHERE ${query.sql} AND document.id = $${values.length + 1}`, - [...values, documentId] - ) - return rows.length > 0 - } - async function putDocument(id: string, acl: string[], requirements: string[][] = []) { await connection.unsafe( `INSERT INTO document(id, connector_id, acl, acl_requirements, acl_verified_at) diff --git a/apps/sim/lib/knowledge/api/internal-route.test.ts b/apps/sim/lib/knowledge/api/internal-route.test.ts index 01d936443d2..86a2e61e241 100644 --- a/apps/sim/lib/knowledge/api/internal-route.test.ts +++ b/apps/sim/lib/knowledge/api/internal-route.test.ts @@ -1,5 +1,5 @@ import type { WorkflowExecutionDelegatedPrincipal } from '@sim/auth/principal' -import { posthogServerMock, posthogServerMockFns } from '@sim/testing/mocks/posthog-server.mock' +import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { createMockRequest } from '@sim/testing/mocks/request.mock' import type { NextRequest } from 'next/server' import { describe, expect, it, vi } from 'vitest' @@ -13,8 +13,6 @@ import { } from '@/lib/knowledge/api/internal-route' import { resolveKnowledgeAttributedUserId } from '@/lib/knowledge/application/billing' -const capture = posthogServerMockFns.mockCaptureServerEvent - vi.mock('@/lib/posthog/server', () => posthogServerMock) const BILLING_ATTRIBUTION = { diff --git a/apps/sim/lib/knowledge/application/bulk.ts b/apps/sim/lib/knowledge/application/bulk.ts index e86c4457d19..9d1b6d420af 100644 --- a/apps/sim/lib/knowledge/application/bulk.ts +++ b/apps/sim/lib/knowledge/application/bulk.ts @@ -176,13 +176,8 @@ async function runKnowledgeItems( export const bulkMoveKnowledgeItems = defineAuthorizedKnowledgeUseCase({ operation: knowledgeOperations.bulkMoveItems, - resolveContext: ({ - principal, - input, - }: { - principal: Principal - input: BulkMoveKnowledgeItemsInput - }) => resolveBulkKnowledgeContext(input, BULK_MOVE_KNOWLEDGE_ITEMS_COST_POLICY.maxItems), + resolveContext: ({ input }: { principal: Principal; input: BulkMoveKnowledgeItemsInput }) => + resolveBulkKnowledgeContext(input, BULK_MOVE_KNOWLEDGE_ITEMS_COST_POLICY.maxItems), async execute({ principal, input, context }): Promise { /** * The destination check and the folder plan read different rows and share @@ -318,13 +313,8 @@ export const bulkMoveKnowledgeItems = defineAuthorizedKnowledgeUseCase({ export const bulkDeleteKnowledgeItems = defineAuthorizedKnowledgeUseCase({ operation: knowledgeOperations.bulkDeleteItems, - resolveContext: ({ - principal, - input, - }: { - principal: Principal - input: BulkDeleteKnowledgeItemsInput - }) => resolveBulkKnowledgeContext(input, BULK_DELETE_KNOWLEDGE_ITEMS_COST_POLICY.maxItems), + resolveContext: ({ input }: { principal: Principal; input: BulkDeleteKnowledgeItemsInput }) => + resolveBulkKnowledgeContext(input, BULK_DELETE_KNOWLEDGE_ITEMS_COST_POLICY.maxItems), async execute({ principal, context }): Promise { const plan = await planFolderSelection( context.workspaceId, diff --git a/apps/sim/lib/knowledge/application/chat.ts b/apps/sim/lib/knowledge/application/chat.ts index 9d4d85fbdf5..778e6e87392 100644 --- a/apps/sim/lib/knowledge/application/chat.ts +++ b/apps/sim/lib/knowledge/application/chat.ts @@ -148,26 +148,23 @@ export const organizationSearchChat: OperationUseCase< try { controller.signal.throwIfAborted() running = true - const payload = await buildCopilotRequestPayload( - { - message: query, - userMessageId: messageId, + const payload = await buildCopilotRequestPayload({ + message: query, + userMessageId: messageId, + userId, + organizationId, + chatId, + mode: 'assistant', + model: '', + assistantSearch: filters, + workspaceContext: await loadCopilotSearchIntegrations({ userId, organizationId, chatId, - mode: 'assistant', - model: '', - assistantSearch: filters, - workspaceContext: await loadCopilotSearchIntegrations({ - userId, - organizationId, - chatId, - messageId, - signal: controller.signal, - }), - }, - { selectedModel: '' } - ) + messageId, + signal: controller.signal, + }), + }) const result = await runHeadlessCopilotLifecycle(payload, { userId, organizationId, diff --git a/apps/sim/lib/knowledge/application/knowledge-bases.ts b/apps/sim/lib/knowledge/application/knowledge-bases.ts index db8677b55ac..738ab7d739a 100644 --- a/apps/sim/lib/knowledge/application/knowledge-bases.ts +++ b/apps/sim/lib/knowledge/application/knowledge-bases.ts @@ -420,13 +420,7 @@ export const listKnowledgeBases = defineAuthorizedKnowledgeUseCase({ */ export const restoreKnowledgeBase = defineAuthorizedKnowledgeUseCase({ operation: knowledgeOperations.restore, - resolveContext: ({ - principal, - input, - }: { - principal: Principal - input: RestoreKnowledgeBaseInput - }) => + resolveContext: ({ input }: { principal: Principal; input: RestoreKnowledgeBaseInput }) => resolveArchivedKnowledgeBaseContext({ knowledgeBaseId: input.knowledgeBaseId, assertedWorkspaceId: input.assertedWorkspaceId, diff --git a/apps/sim/lib/knowledge/application/operations.ts b/apps/sim/lib/knowledge/application/operations.ts index c8f1e7768d6..28202ce3788 100644 --- a/apps/sim/lib/knowledge/application/operations.ts +++ b/apps/sim/lib/knowledge/application/operations.ts @@ -94,13 +94,6 @@ const ALL_PRINCIPAL_WITH_EXECUTOR_POLICY = { delegatedServices: ['copilot', 'executor'], } as const -const HTTP_PRINCIPAL_KINDS = [ - 'session', - 'personal_api_key', - 'oauth_access_token', - 'workspace_api_key', -] as const - const HUMAN_AND_DELEGATED_PRINCIPAL_KINDS = [ 'session', 'personal_api_key', diff --git a/apps/sim/lib/knowledge/application/personal-search-integrations.test.ts b/apps/sim/lib/knowledge/application/personal-search-integrations.test.ts index 92bc535c87b..ea8ceff3597 100644 --- a/apps/sim/lib/knowledge/application/personal-search-integrations.test.ts +++ b/apps/sim/lib/knowledge/application/personal-search-integrations.test.ts @@ -80,12 +80,6 @@ const mockGetConnectorAccessAvailability = const principal = createSessionPrincipal({ userId: 'person', sessionId: 'session' }) const input = { organizationId: 'org' } -const target = { - type: 'link', - provider: 'google-email', - connectorType: 'gmail', - connectorId: 'source', -} as const const source = { connectorType: 'gmail', connectorId: 'source', diff --git a/apps/sim/lib/knowledge/application/slack-search/assistant.ts b/apps/sim/lib/knowledge/application/slack-search/assistant.ts index 0906f3ea506..84776780e27 100644 --- a/apps/sim/lib/knowledge/application/slack-search/assistant.ts +++ b/apps/sim/lib/knowledge/application/slack-search/assistant.ts @@ -234,25 +234,22 @@ export async function runSlackSearchAssistant( }), }) stream = responseStream - const payload = await buildCopilotRequestPayload( - { - message: job.message.query, + const payload = await buildCopilotRequestPayload({ + message: job.message.query, + userId, + userMessageId: messageId, + organizationId: installation.organizationId, + chatId: chat.id, + mode: 'assistant', + workspaceContext: await loadCopilotSearchIntegrations({ userId, - userMessageId: messageId, organizationId: installation.organizationId, chatId: chat.id, - mode: 'assistant', - workspaceContext: await loadCopilotSearchIntegrations({ - userId, - organizationId: installation.organizationId, - chatId: chat.id, - messageId, - signal: controller.signal, - }), - model: '', - }, - { selectedModel: '' } - ) + messageId, + signal: controller.signal, + }), + model: '', + }) const billingAttribution = await resolveOrganizationBillingAttribution({ actorUserId: userId, organizationId: installation.organizationId, diff --git a/apps/sim/lib/knowledge/application/upload-sessions.ts b/apps/sim/lib/knowledge/application/upload-sessions.ts index 67789d30112..acd60f14bd4 100644 --- a/apps/sim/lib/knowledge/application/upload-sessions.ts +++ b/apps/sim/lib/knowledge/application/upload-sessions.ts @@ -1,6 +1,5 @@ import { AuditAction, AuditResourceType } from '@sim/audit' import type { Principal } from '@sim/auth/principal' -import { createLogger } from '@sim/logger' import { checkAttributedUsageLimits } from '@/lib/billing/core/billing-attribution' import { authorizeWorkspaceOperation, type WorkspaceOperation } from '@/lib/core/application' import { OrchestrationError } from '@/lib/core/orchestration/types' @@ -38,8 +37,6 @@ import { } from '@/lib/uploads/upload-session/service' import { validateFileType } from '@/lib/uploads/utils/validation' -const logger = createLogger('KnowledgeUploadSessions') - export class KnowledgeDocumentUnsupportedMediaTypeError extends Error { constructor(message: string) { super(message) diff --git a/apps/sim/lib/knowledge/connectors/access-token.test.ts b/apps/sim/lib/knowledge/connectors/access-token.test.ts index ca17e64c612..00414a3dcd1 100644 --- a/apps/sim/lib/knowledge/connectors/access-token.test.ts +++ b/apps/sim/lib/knowledge/connectors/access-token.test.ts @@ -233,16 +233,14 @@ describe.each([ { name: 'Gmail', auth: gmailConnectorMeta.auth, - contentScope: 'https://www.googleapis.com/auth/gmail.readonly', delegatedScopes: ['https://www.googleapis.com/auth/gmail.readonly'], }, { name: 'Google Calendar', auth: googleCalendarConnectorMeta.auth, - contentScope: 'https://www.googleapis.com/auth/calendar.events.readonly', delegatedScopes: ['https://www.googleapis.com/auth/calendar.events.readonly'], }, -])('$name declared company authentication', ({ auth, contentScope, delegatedScopes }) => { +])('$name declared company authentication', ({ auth, delegatedScopes }) => { const directoryScope = 'https://www.googleapis.com/auth/admin.directory.user.readonly' const resolve = (accessMode: ConnectorAccessMode) => resolveConnectorAccessToken({ diff --git a/apps/sim/lib/knowledge/connectors/member-sync-engine.ts b/apps/sim/lib/knowledge/connectors/member-sync-engine.ts index 7260a3aa8fa..69dc6bac404 100644 --- a/apps/sim/lib/knowledge/connectors/member-sync-engine.ts +++ b/apps/sim/lib/knowledge/connectors/member-sync-engine.ts @@ -137,8 +137,6 @@ import { PER_MEMBER_LISTING_CONTEXT } from '@/connectors/utils' const logger = createLogger('ConnectorMemberSyncEngine') -/** Observers tried, in listing order, before a document's hydration is given up on. */ -const HYDRATION_OBSERVER_ATTEMPTS = 3 /** A minted token is reused for this long before the member is re-minted. */ const MEMBER_TOKEN_REUSE_MS = 45 * 60 * 1000 /** Members whose tokens one run keeps at once; a memory backstop, not a working-set limit. */ diff --git a/apps/sim/lib/knowledge/documents/service.ts b/apps/sim/lib/knowledge/documents/service.ts index 91b68123ad9..707c75b65c3 100644 --- a/apps/sim/lib/knowledge/documents/service.ts +++ b/apps/sim/lib/knowledge/documents/service.ts @@ -1616,7 +1616,7 @@ export async function processDocumentAsync( fileSize: number mimeType: string }, - processingOptions: ProcessingOptions = {}, + _processingOptions: ProcessingOptions = {}, providedBillingContext?: BillingAttributionSnapshot | DocumentProcessingBillingContext, indexingPassId?: string, attemptContext?: DocumentProcessingAttemptContext @@ -2592,7 +2592,7 @@ export async function createDocumentRecords( tx, trackedBindings ) - for (const [documentIndex, docData] of resolvedDocuments.entries()) { + for (const docData of resolvedDocuments) { const currentSize = getServerKnownDocumentSize( docData.fileUrl, docData.fileSize, diff --git a/apps/sim/lib/knowledge/documents/types.ts b/apps/sim/lib/knowledge/documents/types.ts index 8e2ab0bf46a..509a330a254 100644 --- a/apps/sim/lib/knowledge/documents/types.ts +++ b/apps/sim/lib/knowledge/documents/types.ts @@ -129,19 +129,3 @@ export type DocumentSortField = | 'processingStatus' | 'enabled' export type SortOrder = 'asc' | 'desc' - -interface DocumentSortOptions { - sortBy?: DocumentSortField - sortOrder?: SortOrder -} - -interface HeaderInfo { - /** Header text */ - text: string - /** Header level (1-6) */ - level: number - /** Anchor link */ - anchor: string - /** Position in document */ - position: number -} diff --git a/apps/sim/lib/knowledge/documents/utils.ts b/apps/sim/lib/knowledge/documents/utils.ts index 879525bf723..9f391604541 100644 --- a/apps/sim/lib/knowledge/documents/utils.ts +++ b/apps/sim/lib/knowledge/documents/utils.ts @@ -120,13 +120,6 @@ export async function readBoundedHttpErrorPayload(response: { } } -interface RetryResult { - success: boolean - data?: T - error?: Error - attemptCount: number -} - function hasStatus( error: RetryableError ): error is HTTPError | { status?: number; message?: string } { diff --git a/apps/sim/lib/knowledge/filters/types.ts b/apps/sim/lib/knowledge/filters/types.ts index 90e5846a149..ecd8c98da96 100644 --- a/apps/sim/lib/knowledge/filters/types.ts +++ b/apps/sim/lib/knowledge/filters/types.ts @@ -92,31 +92,6 @@ export type FilterCondition = | DateFilterCondition | BooleanFilterCondition -/** - * Filter group with logical operator - */ -interface FilterGroup { - operator: LogicalOperator - conditions: FilterCondition[] -} - -/** - * Complete filter query structure - * Supports nested groups with AND/OR logic - */ -interface TagFilter { - rootOperator: LogicalOperator - groups: FilterGroup[] -} - -/** - * Simplified flat filter structure for simple use cases - */ -interface SimpleTagFilter { - operator: LogicalOperator - conditions: FilterCondition[] -} - /** * Operator metadata for UI display */ diff --git a/apps/sim/lib/knowledge/folders.test.ts b/apps/sim/lib/knowledge/folders.test.ts index 223253eec5c..af4de6c130e 100644 --- a/apps/sim/lib/knowledge/folders.test.ts +++ b/apps/sim/lib/knowledge/folders.test.ts @@ -23,8 +23,6 @@ import { const mockApplyStorageUsageDeltasInTx = billingStorageMockFns.mockApplyStorageUsageDeltasInTx const mockEnsureUserStatsExists = billingUsageMockFns.mockEnsureUserStatsExists const mockFindActiveFolder = folderQueriesMockFns.mockFindActiveFolder -const mockMaybeNotifyStorageLimitForBillingContext = - billingStorageMockFns.mockMaybeNotifyStorageLimitForBillingContext const mockResolveStorageBillingContext = billingStorageMockFns.mockResolveStorageBillingContext const mockGetHighestPrioritySubscription = diff --git a/apps/sim/lib/knowledge/orchestration/documents.test.ts b/apps/sim/lib/knowledge/orchestration/documents.test.ts index 4063c13ef64..1db93eb8ff0 100644 --- a/apps/sim/lib/knowledge/orchestration/documents.test.ts +++ b/apps/sim/lib/knowledge/orchestration/documents.test.ts @@ -4,7 +4,7 @@ import { knowledgeDocumentsServiceMock, knowledgeDocumentsServiceMockFns, } from '@sim/testing/mocks/knowledge-documents-service.mock' -import { posthogServerMock, posthogServerMockFns } from '@sim/testing/mocks/posthog-server.mock' +import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { telemetryMock } from '@sim/testing/mocks/telemetry.mock' import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -20,19 +20,15 @@ import { performUploadKnowledgeDocument, } from '@/lib/knowledge/orchestration/documents' -const mockCreateDocumentRecords = knowledgeDocumentsServiceMockFns.mockCreateDocumentRecords const mockCreateSingleDocument = knowledgeDocumentsServiceMockFns.mockCreateSingleDocument -const mockDeleteDocument = knowledgeDocumentsServiceMockFns.mockDeleteDocument const mockGetDocumentByUploadId = knowledgeDocumentsServiceMockFns.mockGetDocumentByUploadId const mockMarkDocumentAsFailedTimeout = knowledgeDocumentsServiceMockFns.mockMarkDocumentAsFailedTimeout const mockProcessDocumentAsync = knowledgeDocumentsServiceMockFns.mockProcessDocumentAsync const mockProcessDocumentsWithQueue = knowledgeDocumentsServiceMockFns.mockProcessDocumentsWithQueue const mockRetryDocumentProcessing = knowledgeDocumentsServiceMockFns.mockRetryDocumentProcessing -const mockUpdateDocument = knowledgeDocumentsServiceMockFns.mockUpdateDocument const mockRecordAudit = auditMockFns.mockRecordAudit -const mockCaptureServerEvent = posthogServerMockFns.mockCaptureServerEvent const KB = { id: 'kb-1', name: 'Docs', workspaceId: 'ws-1' } const FILE = { diff --git a/apps/sim/lib/knowledge/orchestration/knowledge-bases.test.ts b/apps/sim/lib/knowledge/orchestration/knowledge-bases.test.ts index 08ea47191eb..1d7fd4cad96 100644 --- a/apps/sim/lib/knowledge/orchestration/knowledge-bases.test.ts +++ b/apps/sim/lib/knowledge/orchestration/knowledge-bases.test.ts @@ -21,7 +21,6 @@ import { } from '@/lib/knowledge/orchestration/knowledge-bases' const mockCreateKnowledgeBase = knowledgeServiceMockFns.mockCreateKnowledgeBase -const mockDeleteKnowledgeBase = knowledgeServiceMockFns.mockDeleteKnowledgeBase const mockUpdateKnowledgeBase = knowledgeServiceMockFns.mockUpdateKnowledgeBase const mockRecordAudit = auditMockFns.mockRecordAudit diff --git a/apps/sim/lib/knowledge/search/queries.test.ts b/apps/sim/lib/knowledge/search/queries.test.ts index 9f390d4431d..1dd7fcb8234 100644 --- a/apps/sim/lib/knowledge/search/queries.test.ts +++ b/apps/sim/lib/knowledge/search/queries.test.ts @@ -105,15 +105,11 @@ describe('retrieval leg budgets', () => { }) describe('many-base tag and keyword legs rank globally', () => { - const knowledgeBaseIds = ['kb-1', 'kb-2', 'kb-3', 'kb-4', 'kb-5'] const queryVector = { vector: '[1,0]', dimensions: 1536 as const, model: 'text-embedding-3-small', } - const tags: StructuredFilter[] = [ - { tagSlot: 'tag1', fieldType: 'text', operator: 'eq', value: 'release' }, - ] const reader: UserAccessScope = { kind: 'user', userId: 'reader', diff --git a/apps/sim/lib/knowledge/service.test.ts b/apps/sim/lib/knowledge/service.test.ts index ee1d4308f64..db333fd2ba2 100644 --- a/apps/sim/lib/knowledge/service.test.ts +++ b/apps/sim/lib/knowledge/service.test.ts @@ -23,8 +23,6 @@ import { } from '@/lib/knowledge/service' const mockApplyStorageUsageDeltasInTx = billingStorageMockFns.mockApplyStorageUsageDeltasInTx -const mockMaybeNotifyStorageLimitForBillingContext = - billingStorageMockFns.mockMaybeNotifyStorageLimitForBillingContext const mockResolveStorageBillingContext = billingStorageMockFns.mockResolveStorageBillingContext /** diff --git a/apps/sim/lib/knowledge/types.ts b/apps/sim/lib/knowledge/types.ts index 43ad5697ec8..56b808a55d2 100644 --- a/apps/sim/lib/knowledge/types.ts +++ b/apps/sim/lib/knowledge/types.ts @@ -208,20 +208,6 @@ export interface ChunkData { updatedAt: string } -interface ChunksPagination { - total: number - limit: number - offset: number - hasMore: boolean -} - -interface DocumentsPagination { - total: number - limit: number - offset: number - hasMore: boolean -} - /** The member engine's states, as stored on `knowledge_connector.member_sync_status`. */ export const MEMBER_SYNC_STATUSES = ['idle', 'pending', 'running', 'error', 'disabled'] as const export type MemberSyncStatus = (typeof MEMBER_SYNC_STATUSES)[number] diff --git a/apps/sim/lib/logs/execution/logger.test.ts b/apps/sim/lib/logs/execution/logger.test.ts index 07f4b4b8bb8..9af4277d1b1 100644 --- a/apps/sim/lib/logs/execution/logger.test.ts +++ b/apps/sim/lib/logs/execution/logger.test.ts @@ -22,7 +22,6 @@ import { billingUsageMonitorMock, billingUsageMonitorMockFns, } from '@sim/testing/mocks/billing-usage-monitor.mock' -import { getMockLogger } from '@sim/testing/mocks/logger.mock' import { isPlainRecord } from '@sim/utils/object' import { afterAll, beforeEach, describe, expect, test, vi } from 'vitest' import { recordUsage } from '@/lib/billing/core/usage-log' @@ -84,8 +83,6 @@ billingSubscriptionMockFns.mockGetHighestPrioritySubscription.mockImplementation afterAll(resetDbChainMock) -const mockLogger = getMockLogger('ExecutionLogger') - // Mock billing modules vi.mock('@/lib/billing/core/subscription', () => billingSubscriptionMock) @@ -926,11 +923,6 @@ describe('recordExecutionUsage boundary-delta reconciliation', () => { expect(recordUsage).not.toHaveBeenCalled() }) - const unbilledErrorCalls = () => - mockLogger.error.mock.calls.filter((call) => - String(call[0]).includes('Failed to record execution usage to usage_log ledger') - ) - test('retry with everything already billed records nothing (idempotent)', async () => { await run( costSummary({ diff --git a/apps/sim/lib/logs/execution/logging-session.test.ts b/apps/sim/lib/logs/execution/logging-session.test.ts index 15922bbd5fe..a7a904f25eb 100644 --- a/apps/sim/lib/logs/execution/logging-session.test.ts +++ b/apps/sim/lib/logs/execution/logging-session.test.ts @@ -5,10 +5,7 @@ import { billingUsageReservationMockFns, } from '@sim/testing/mocks/billing-usage-reservation.mock' import { encryptionMock, encryptionMockFns } from '@sim/testing/mocks/encryption.mock' -import { - executionPayloadStoreMock, - executionPayloadStoreMockFns, -} from '@sim/testing/mocks/execution-payload-store.mock' +import { executionPayloadStoreMock } from '@sim/testing/mocks/execution-payload-store.mock' import { getMockPlatformEvent, telemetryMock, @@ -99,9 +96,6 @@ import { } from '@/executor/utils/resolved-secret-trace-registry' import { LoggingSession } from './logging-session' -const materializeLargeValueRefMock = executionPayloadStoreMockFns.mockMaterializeLargeValueRef -const storeLargeValueMock = executionPayloadStoreMockFns.mockStoreLargeValue - const releaseExecutionSlotMock = billingUsageReservationMockFns.mockReleaseExecutionSlot /** `elapsedDurationMsSql` binds `ended_at` through the column's own mapper, so `sql.param` is observed too. */ diff --git a/apps/sim/lib/mcp/application/use-cases.ts b/apps/sim/lib/mcp/application/use-cases.ts index cf8de0ad340..58de636ee78 100644 --- a/apps/sim/lib/mcp/application/use-cases.ts +++ b/apps/sim/lib/mcp/application/use-cases.ts @@ -471,7 +471,7 @@ export const deleteMcpServerUseCase = defineAuthorizedWorkspaceUseCase({ resolveContext: ({ input }: { input: DeleteMcpServerInput }) => resolveMcpServerContext(input.workspaceId, input.serverId), authorizationOptions, - async execute({ principal, input, context }) { + async execute({ principal, context }) { if (context.server.managedConnectorId) { throw new OrchestrationError( 'conflict', diff --git a/apps/sim/lib/mcp/client.test.ts b/apps/sim/lib/mcp/client.test.ts index c73fc01b692..7e042d32971 100644 --- a/apps/sim/lib/mcp/client.test.ts +++ b/apps/sim/lib/mcp/client.test.ts @@ -17,12 +17,6 @@ vi.mock('@/lib/mcp/pinned-fetch', () => ({ createPinnedPrivateMcpFetch: vi.fn(() => ({ fetch: vi.fn(), close: mockPinnedClose })), })) -/** - * Capture the notification handler registered via `client.setNotificationHandler()`. - * This lets us simulate the MCP SDK delivering a `tools/list_changed` notification. - */ -let capturedNotificationHandler: (() => Promise) | null = null - vi.mock('@modelcontextprotocol/sdk/client/index.js', () => ({ Client: vi.fn().mockImplementation( class { @@ -32,11 +26,7 @@ vi.mock('@modelcontextprotocol/sdk/client/index.js', () => ({ close: vi.fn().mockResolvedValue(undefined), getServerVersion: vi.fn().mockReturnValue('2025-06-18'), getServerCapabilities: vi.fn().mockReturnValue({ tools: { listChanged: true } }), - setNotificationHandler: vi - .fn() - .mockImplementation((_schema: unknown, handler: () => Promise) => { - capturedNotificationHandler = handler - }), + setNotificationHandler: vi.fn(), listTools: mockSdkListTools, }) } @@ -84,7 +74,6 @@ function createConfig(): McpServerConfig { describe('McpClient notification handler', () => { beforeEach(() => { - capturedNotificationHandler = null mockSdkConnect.mockResolvedValue(undefined) mockSdkListTools.mockResolvedValue({ tools: [] }) // clearAllMocks resets call history but not implementations; re-establish the diff --git a/apps/sim/lib/mcp/orchestration/server-lifecycle.test.ts b/apps/sim/lib/mcp/orchestration/server-lifecycle.test.ts index 581943cc94f..cd0370c8453 100644 --- a/apps/sim/lib/mcp/orchestration/server-lifecycle.test.ts +++ b/apps/sim/lib/mcp/orchestration/server-lifecycle.test.ts @@ -38,17 +38,12 @@ import { } from '@/lib/mcp/orchestration/server-lifecycle' const mockClearCache = mcpServiceMockFns.mockClearCache -const mockEvictServerConnections = mcpServiceMockFns.mockEvictServerConnections const mockOauthCredsChanged = mcpOauthMockFns.mockOauthCredsChanged const mockRevokeOauthTokens = mcpOauthMockFns.mockRevokeMcpOauthTokens describe('MCP server lifecycle orchestration', () => { const auditUpdatedFields = (): string[] | undefined => auditMockFns.mockRecordAudit.mock.calls.at(-1)?.[0].metadata.updatedFields - const auditAction = (): string | undefined => - auditMockFns.mockRecordAudit.mock.calls.at(-1)?.[0].action - const auditMetadata = (): Record | undefined => - auditMockFns.mockRecordAudit.mock.calls.at(-1)?.[0].metadata beforeEach(() => { resetDbChainMock() diff --git a/apps/sim/lib/messaging/sms/service.ts b/apps/sim/lib/messaging/sms/service.ts index eb07441e96e..e34611ac9f8 100644 --- a/apps/sim/lib/messaging/sms/service.ts +++ b/apps/sim/lib/messaging/sms/service.ts @@ -12,10 +12,6 @@ export interface SMSOptions { from?: string } -interface BatchSMSOptions { - messages: SMSOptions[] -} - interface SMSResponseData { sid?: string status?: string @@ -32,13 +28,6 @@ export interface SendSMSResult { data?: SMSResponseData } -interface BatchSendSMSResult { - success: boolean - message: string - results: SendSMSResult[] - data?: SMSResponseData -} - const twilioAccountSid = env.TWILIO_ACCOUNT_SID const twilioAuthToken = env.TWILIO_AUTH_TOKEN const twilioPhoneNumber = env.TWILIO_PHONE_NUMBER diff --git a/apps/sim/lib/mothership/agent-cli/engines.test.ts b/apps/sim/lib/mothership/agent-cli/engines.test.ts index cab1eb118e6..a8d5bf2a8d2 100644 --- a/apps/sim/lib/mothership/agent-cli/engines.test.ts +++ b/apps/sim/lib/mothership/agent-cli/engines.test.ts @@ -8,15 +8,6 @@ import { runEngine } from '@/lib/mothership/agent-cli/engines' import type { AgentCliRuntime } from '@/lib/mothership/agent-cli/types' import { navigatePath } from '@/executor/variables/resolvers/reference' -const WORKFLOW_STATE = { - blocks: { - 'block-1': { type: 'starter', name: 'Start', enabled: true }, - 'block-2': { type: 'agent', name: 'Summarize emails', enabled: true }, - }, - edges: [{ source: 'block-1', target: 'block-2', sourceHandle: 'source', id: 'edge-1' }], - variables: { apiBase: 'https://api.example.com' }, -} - function runtimeWith(responses: Record): AgentCliRuntime { return { workspaceId: 'ws-1', @@ -32,7 +23,6 @@ function runtimeWith(responses: Record): AgentCliRuntime { } const STATE_PATH = '/api/v2/workflows/wf-1/state' -const stateResponse = { data: WORKFLOW_STATE } const RUNS_PATH = '/api/v2/workflows/wf-1/runs' const COUNT_ROWS_RUNS = { diff --git a/apps/sim/lib/mothership/chat/application/workspace-context.ts b/apps/sim/lib/mothership/chat/application/workspace-context.ts index 2a1da8e1e46..9f8cb686405 100644 --- a/apps/sim/lib/mothership/chat/application/workspace-context.ts +++ b/apps/sim/lib/mothership/chat/application/workspace-context.ts @@ -28,7 +28,6 @@ export const readWorkspaceContext = defineAuthorizedChatUseCase({ }), async resolveContext({ principal, - input, }: { principal: DelegatedPrincipal | OrganizationDelegatedPrincipal input: { workspaceId: string } diff --git a/apps/sim/lib/mothership/chat/fork-chat-files.test.ts b/apps/sim/lib/mothership/chat/fork-chat-files.test.ts index 8c118c6abf5..18bc226ce69 100644 --- a/apps/sim/lib/mothership/chat/fork-chat-files.test.ts +++ b/apps/sim/lib/mothership/chat/fork-chat-files.test.ts @@ -3,13 +3,9 @@ import { workspaceFileManagerMock, workspaceFileManagerMockFns, } from '@sim/testing/mocks/workspace-file-manager.mock' -import { - workspaceFileSecretProvenanceMock, - workspaceFileSecretProvenanceMockFns, -} from '@sim/testing/mocks/workspace-file-secret-provenance.mock' +import { workspaceFileSecretProvenanceMock } from '@sim/testing/mocks/workspace-file-secret-provenance.mock' import { beforeEach, describe, expect, it, vi } from 'vitest' -const { mockCopyWorkspaceFileSecretProvenanceInTx } = workspaceFileSecretProvenanceMockFns const { mockGenerateWorkspaceFileKey: mockGenerateKey } = workspaceFileManagerMockFns const { mockDownloadFile, mockUploadFile } = storageServiceMockFns diff --git a/apps/sim/lib/mothership/chat/payload.test.ts b/apps/sim/lib/mothership/chat/payload.test.ts index 33ac385ba36..509f5cde55e 100644 --- a/apps/sim/lib/mothership/chat/payload.test.ts +++ b/apps/sim/lib/mothership/chat/payload.test.ts @@ -356,36 +356,30 @@ describe('buildCopilotRequestPayload', () => { async (enabled) => { const principal = { kind: 'session' as const, userId: 'actor' } mockDashboardAvailability.mockResolvedValueOnce(enabled) - const payload = await buildCopilotRequestPayload( - { - message: 'Show my dashboard', - userId: 'actor', - userMessageId: 'message-1', - workspaceId: 'workspace-1', - principal, - mode: 'agent', - model: '', - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Show my dashboard', + userId: 'actor', + userMessageId: 'message-1', + workspaceId: 'workspace-1', + principal, + mode: 'agent', + model: '', + }) expect(payload.entitlements).toEqual(enabled ? ['dashboards'] : []) } ) it('never grants the workspace-only dashboards entitlement to an organization chat', async () => { mockDashboardAvailability.mockResolvedValue(true) - const payload = await buildCopilotRequestPayload( - { - message: 'Show my dashboard', - userId: 'actor', - userMessageId: 'message-1', - organizationId: 'org-1', - principal: { kind: 'session' as const, userId: 'actor' }, - mode: 'agent', - model: '', - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Show my dashboard', + userId: 'actor', + userMessageId: 'message-1', + organizationId: 'org-1', + principal: { kind: 'session' as const, userId: 'actor' }, + mode: 'agent', + model: '', + }) expect(payload.entitlements).toEqual([]) }) @@ -397,28 +391,25 @@ describe('buildCopilotRequestPayload', () => { it.each(['workspace', 'organization'] as const)( 'emits contract-valid %s Assistant context with no Build inventory or desktop declaration', async (owner) => { - const payload = await buildCopilotRequestPayload( - { - message: 'Find the document', - userId: 'actor', - userMessageId: '11111111-1111-4111-8111-111111111111', - chatId: '22222222-2222-4222-8222-222222222222', - mode: 'assistant', - model: 'legacy-ui-model', - ...(owner === 'organization' - ? { organizationId: 'org-1' } - : { workspaceId: '33333333-3333-4333-8333-333333333333' }), - workflowId: 'ignored-workflow', - workflowName: 'ignored-name', - provider: 'legacy-provider', - workspaceContext: '{"credentials":[]}', - contexts: [{ type: 'workflow', content: 'ignored-context' }], - browser: true, - terminalCapable: true, - mcpServerIds: ['mcp-1'], - }, - { selectedModel: 'legacy-ui-model' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Find the document', + userId: 'actor', + userMessageId: '11111111-1111-4111-8111-111111111111', + chatId: '22222222-2222-4222-8222-222222222222', + mode: 'assistant', + model: 'legacy-ui-model', + ...(owner === 'organization' + ? { organizationId: 'org-1' } + : { workspaceId: '33333333-3333-4333-8333-333333333333' }), + workflowId: 'ignored-workflow', + workflowName: 'ignored-name', + provider: 'legacy-provider', + workspaceContext: '{"credentials":[]}', + contexts: [{ type: 'workflow', content: 'ignored-context' }], + browser: true, + terminalCapable: true, + mcpServerIds: ['mcp-1'], + }) expect(ChatPayloadSchema.safeParse(payload).success).toBe(true) expect(payload.context).toEqual([ { @@ -445,18 +436,15 @@ describe('buildCopilotRequestPayload', () => { 'discovers Generic Secrets only for Build and Plan: %s', async (mode) => { mockSecretNames.mockResolvedValueOnce({ names: ['SERVICE_TOKEN'] }) - const payload = await buildCopilotRequestPayload( - { - message: 'Use the service', - userId: 'actor', - userMessageId: 'message', - chatId: 'chat', - organizationId: 'org', - mode, - model: '', - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Use the service', + userId: 'actor', + userMessageId: 'message', + chatId: 'chat', + organizationId: 'org', + mode, + model: '', + }) const context = payload.context?.find((entry) => entry.type === 'generic_secrets') if (mode !== 'assistant') { expect(mockSecretNames).toHaveBeenCalledOnce() @@ -506,19 +494,13 @@ describe('buildCopilotRequestPayload', () => { * chat endpoint must not gain that write through an attachment. */ it.each(['read', undefined])('does not track attachments for permission %s', async (perm) => { - await buildCopilotRequestPayload( - { ...attachmentParams, userPermission: perm }, - { selectedModel: 'claude-opus-4-8' } - ) + await buildCopilotRequestPayload({ ...attachmentParams, userPermission: perm }) expect(mockTrackChatUpload).not.toHaveBeenCalled() }) it.each(['write', 'admin'])('tracks attachments for permission %s', async (perm) => { - await buildCopilotRequestPayload( - { ...attachmentParams, userPermission: perm }, - { selectedModel: 'claude-opus-4-8' } - ) + await buildCopilotRequestPayload({ ...attachmentParams, userPermission: perm }) expect(mockTrackChatUpload).toHaveBeenCalledWith( 'ws-1', @@ -533,10 +515,10 @@ describe('buildCopilotRequestPayload', () => { }) it('includes successfully prepared attachments in the model context', async () => { - const payload = await buildCopilotRequestPayload( - { ...attachmentParams, userPermission: 'write' }, - { selectedModel: 'claude-opus-4-8' } - ) + const payload = await buildCopilotRequestPayload({ + ...attachmentParams, + userPermission: 'write', + }) expect(payload.context).toEqual([ { @@ -556,23 +538,20 @@ describe('buildCopilotRequestPayload', () => { .mockRejectedValueOnce(cause) .mockResolvedValueOnce({ displayName: 'photo.png' }) - const payload = await buildCopilotRequestPayload( - { - ...attachmentParams, - userPermission: 'write', - fileAttachments: [ - ...attachmentParams.fileAttachments, - { - id: 'a2', - key: 'workspace/ws-1/1731000000001-ab12cd35-photo.png', - filename: 'photo.png', - media_type: 'image/png', - size: 10, - }, - ], - }, - { selectedModel: 'claude-opus-4-8' } - ) + const payload = await buildCopilotRequestPayload({ + ...attachmentParams, + userPermission: 'write', + fileAttachments: [ + ...attachmentParams.fileAttachments, + { + id: 'a2', + key: 'workspace/ws-1/1731000000001-ab12cd35-photo.png', + filename: 'photo.png', + media_type: 'image/png', + size: 10, + }, + ], + }) expect(mockTrackChatUpload).toHaveBeenCalledTimes(2) expect(payload.context).toEqual([ @@ -594,20 +573,17 @@ describe('buildCopilotRequestPayload', () => { }) it('emits ONLY the shared ChatRequest contract fields — nothing legacy rides the wire', async () => { - const payload = await buildCopilotRequestPayload( - { - message: 'debug workspace', - userId: 'user-1', - userMessageId: '00000000-0000-4000-8000-000000000001', - mode: 'agent', - model: 'claude-opus-4-8', - workspaceId: '00000000-0000-4000-8000-000000000002', - userTimezone: 'America/Los_Angeles', - effort: 'max', - modelSelection: { model: 'gpt-6-astra', fastMode: true }, - }, - { selectedModel: 'claude-opus-4-8' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'debug workspace', + userId: 'user-1', + userMessageId: '00000000-0000-4000-8000-000000000001', + mode: 'agent', + model: 'claude-opus-4-8', + workspaceId: '00000000-0000-4000-8000-000000000002', + userTimezone: 'America/Los_Angeles', + effort: 'max', + modelSelection: { model: 'gpt-6-astra', fastMode: true }, + }) expect(payload).toEqual( expect.objectContaining({ @@ -710,19 +686,16 @@ describe('Assistant payload', () => { filename: 'image.png', source: { type: 'base64' as const, media_type: 'image/png', data: 'aW1hZ2U=' }, } - const payload = await buildCopilotRequestPayload( - { - message: '', - userId: 'user-1', - userMessageId: 'message-1', - organizationId: 'org-1', - mode: 'assistant', - model: '', - assistantImages: [image], - fileAttachments: [{ id: 'image', key: 'private-upload', size: 5 }], - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: '', + userId: 'user-1', + userMessageId: 'message-1', + organizationId: 'org-1', + mode: 'assistant', + model: '', + assistantImages: [image], + fileAttachments: [{ id: 'image', key: 'private-upload', size: 5 }], + }) expect(payload.message).toBe('') expect(payload.assistantImages).toEqual([image]) expect(payload).not.toHaveProperty('context') @@ -731,21 +704,18 @@ describe('Assistant payload', () => { }) it('forwards organization scope without workspace, integration, or desktop authority', async () => { - const payload = await buildCopilotRequestPayload( - { - message: 'Find the policy', - userId: 'user-1', - userMessageId: 'message-1', - organizationId: 'org-1', - mode: 'assistant', - model: '', - browser: true, - terminalCapable: true, - desktopLocalFilesystem: true, - desktopLocalFiles: true, - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Find the policy', + userId: 'user-1', + userMessageId: 'message-1', + organizationId: 'org-1', + mode: 'assistant', + model: '', + browser: true, + terminalCapable: true, + desktopLocalFilesystem: true, + desktopLocalFiles: true, + }) expect(payload.organizationId).toBe('org-1') expect(payload).not.toHaveProperty('integrationCatalog') expect(payload).not.toHaveProperty('workspaceId') @@ -755,26 +725,23 @@ describe('Assistant payload', () => { it('keeps the shared search scope without an integration gateway catalog', async () => { clearIntegrationToolSchemaCacheForTests() - const payload = await buildCopilotRequestPayload( - { - message: 'Find it and update it', - userId: 'user-1', - userMessageId: 'assistant-message', - mode: 'assistant', - model: '', - workspaceId: 'ws-1', - workflowId: 'forbidden-workflow', - assistantSearch: { source: 'slack', documentIds: ['document-1'] }, - contexts: [{ type: 'skill', content: 'Build instructions' }], - commands: ['run_function'], - mcpServerIds: ['shared-server'], - desktopLocalFilesystem: true, - desktopLocalFiles: true, - browser: true, - terminalCapable: true, - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Find it and update it', + userId: 'user-1', + userMessageId: 'assistant-message', + mode: 'assistant', + model: '', + workspaceId: 'ws-1', + workflowId: 'forbidden-workflow', + assistantSearch: { source: 'slack', documentIds: ['document-1'] }, + contexts: [{ type: 'skill', content: 'Build instructions' }], + commands: ['run_function'], + mcpServerIds: ['shared-server'], + desktopLocalFilesystem: true, + desktopLocalFiles: true, + browser: true, + terminalCapable: true, + }) expect(payload).not.toHaveProperty('desktop') expect(payload.clientCapabilities).toEqual([]) expect(payload.mode).toBe('assistant') @@ -789,23 +756,20 @@ describe('Assistant payload', () => { describe('desktop request capabilities', () => { it('preserves desktop capabilities and current session hints on the worker wire', async () => { - const payload = await buildCopilotRequestPayload( - { - message: 'Inspect my local page', - workspaceId: 'workspace', - userId: 'user', - userMessageId: 'message', - mode: 'ask', - model: 'gpt-6-astra', - browser: true, - terminalCapable: true, - terminals: [{ id: 'terminal-1', cwd: '/work/app', active: true }], - browserSessions: [ - { hostname: 'example.com', evidence: 'cookies', lastObservedAt: '2026-09-08' }, - ], - }, - { selectedModel: 'gpt-6-astra' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Inspect my local page', + workspaceId: 'workspace', + userId: 'user', + userMessageId: 'message', + mode: 'ask', + model: 'gpt-6-astra', + browser: true, + terminalCapable: true, + terminals: [{ id: 'terminal-1', cwd: '/work/app', active: true }], + browserSessions: [ + { hostname: 'example.com', evidence: 'cookies', lastObservedAt: '2026-09-08' }, + ], + }) expect(payload.desktop).toEqual({ browser: true, terminal: true, @@ -816,19 +780,16 @@ describe('desktop request capabilities', () => { }) }) it('advertises native files in org mode independently of browser and terminal', async () => { - const payload = await buildCopilotRequestPayload( - { - message: 'Read and import my report', - organizationId: 'org-files', - chatId: 'org-chat', - userId: 'user', - userMessageId: 'message', - mode: 'ask', - model: 'gpt-6-astra', - desktopLocalFiles: true, - }, - { selectedModel: 'gpt-6-astra' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Read and import my report', + organizationId: 'org-files', + chatId: 'org-chat', + userId: 'user', + userMessageId: 'message', + mode: 'ask', + model: 'gpt-6-astra', + desktopLocalFiles: true, + }) expect(payload.desktop).toEqual({ localFiles: true, browser: false, @@ -839,18 +800,15 @@ describe('desktop request capabilities', () => { expect(payload.workspaceId).toBeUndefined() }) it('does not advertise desktop tools for a web-only turn', async () => { - const payload = await buildCopilotRequestPayload( - { - message: 'Hello', - workspaceId: 'workspace', - userId: 'user', - userMessageId: 'message', - mode: 'ask', - model: 'gpt-6-astra', - terminals: [{ id: 'stale-terminal' }], - }, - { selectedModel: 'gpt-6-astra' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Hello', + workspaceId: 'workspace', + userId: 'user', + userMessageId: 'message', + mode: 'ask', + model: 'gpt-6-astra', + terminals: [{ id: 'stale-terminal' }], + }) expect(payload.desktop).toBeUndefined() }) }) @@ -861,22 +819,19 @@ it('carries only enabled MCP IDs without eager catalog discovery while preservin vi.mocked(getBlockVisibilityForCopilot).mockClear() vi.mocked(buildOrganizationTaggedMcpToolSchemas).mockClear() const principal = createSessionPrincipal({ userId: 'user-org' }) - const payload = await buildCopilotRequestPayload( - { - message: 'Use my tools', - userId: 'user-org', - userMessageId: 'message-org', - organizationId: 'org-catalog', - chatId: 'chat-org', - principal, - mode: 'agent', - model: '', - mcpServerIds: ['server-a', 'server-b'], - browser: true, - terminalCapable: true, - }, - { selectedModel: '' } - ) + const payload = await buildCopilotRequestPayload({ + message: 'Use my tools', + userId: 'user-org', + userMessageId: 'message-org', + organizationId: 'org-catalog', + chatId: 'chat-org', + principal, + mode: 'agent', + model: '', + mcpServerIds: ['server-a', 'server-b'], + browser: true, + terminalCapable: true, + }) expect(getBlockVisibilityForCopilot).not.toHaveBeenCalled() expect(buildOrganizationTaggedMcpToolSchemas).not.toHaveBeenCalled() expect(payload.integrationCatalog).toEqual({ mcpServerIds: ['server-a', 'server-b'] }) diff --git a/apps/sim/lib/mothership/chat/payload.ts b/apps/sim/lib/mothership/chat/payload.ts index 7ca78e3d76f..cf8d336178c 100644 --- a/apps/sim/lib/mothership/chat/payload.ts +++ b/apps/sim/lib/mothership/chat/payload.ts @@ -311,12 +311,7 @@ async function buildIntegrationToolSchemasUncached({ /** * Build the request payload for the copilot backend. */ -export async function buildCopilotRequestPayload( - params: BuildPayloadParams, - options: { - selectedModel: string - } -): Promise { +export async function buildCopilotRequestPayload(params: BuildPayloadParams): Promise { const { message, workflowId, userId, userMessageId, mode, contexts, fileAttachments, chatId } = params const effectiveMode = mode === 'agent' ? 'build' : mode diff --git a/apps/sim/lib/mothership/chat/post.test.ts b/apps/sim/lib/mothership/chat/post.test.ts index 9d5519a274f..6e28a4e67ae 100644 --- a/apps/sim/lib/mothership/chat/post.test.ts +++ b/apps/sim/lib/mothership/chat/post.test.ts @@ -265,8 +265,7 @@ describe('handleUnifiedChatPost', () => { expect(response.status).toBe(enabled ? 200 : 400) if (enabled) expect(buildCopilotRequestPayload).toHaveBeenCalledWith( - expect.objectContaining({ mode: 'plan' }), - expect.anything() + expect.objectContaining({ mode: 'plan' }) ) else expect(buildCopilotRequestPayload).not.toHaveBeenCalled() } finally { @@ -385,8 +384,7 @@ describe('handleUnifiedChatPost', () => { expect.objectContaining({ organizationId: 'org-1', mode: 'agent' }) ) expect(buildCopilotRequestPayload).toHaveBeenCalledWith( - expect.objectContaining({ organizationId: 'org-1', mode: 'agent' }), - expect.anything() + expect.objectContaining({ organizationId: 'org-1', mode: 'agent' }) ) expect(getEffectiveEnvironmentSnapshot).not.toHaveBeenCalled() }) @@ -439,8 +437,7 @@ describe('handleUnifiedChatPost', () => { organizationId: 'org-1', }) expect(buildCopilotRequestPayload).toHaveBeenCalledWith( - expect.objectContaining({ organizationId: 'org-1', mode: 'assistant', contexts: [] }), - expect.anything() + expect.objectContaining({ organizationId: 'org-1', mode: 'assistant', contexts: [] }) ) expect(createSSEStream).toHaveBeenCalledWith( expect.objectContaining({ @@ -502,8 +499,7 @@ describe('handleUnifiedChatPost', () => { source: { type: 'base64', media_type: 'image/png', data: 'aW1hZ2U=' }, }, ], - }), - expect.anything() + }) ) expect(admitTurn).toHaveBeenCalledWith( expect.objectContaining({ @@ -717,8 +713,7 @@ describe('handleUnifiedChatPost', () => { }, ], }), - }), - expect.anything() + }) ) expect(createSSEStream).toHaveBeenCalledWith( expect.objectContaining({ @@ -765,7 +760,7 @@ describe('handleUnifiedChatPost', () => { it.each([ ['agent', 'assistant'], ['assistant', 'agent'], - ] as const)('keeps the same chat when switching from %s to %s', async (previousMode, mode) => { + ] as const)('keeps the same chat when switching from %s to %s', async (_previousMode, mode) => { dbChainMockFns.returning.mockResolvedValueOnce([{ model: null }]) getSession.mockResolvedValue({ user: { id: 'user-1' }, session: { id: 'session-1' } }) listPersonal.mockResolvedValue({ credentials: [{ id: 'mine', providerId: 'google-drive' }] }) @@ -840,8 +835,7 @@ describe('handleUnifiedChatPost', () => { expect.objectContaining({ effort: expected, modelSelection: { model: 'gpt-6-astra', fastMode: false }, - }), - expect.anything() + }) ) } ) @@ -871,8 +865,7 @@ describe('handleUnifiedChatPost', () => { userId: 'user-1', workflowId: 'wf-1', workspaceId: 'ws-1', - }), - { selectedModel: 'claude-opus-4-8' } + }) ) const workflowParams = buildCopilotRequestPayload.mock.calls[0]![0] as Record expect(workflowParams).not.toHaveProperty('workspaceContext') @@ -941,8 +934,7 @@ describe('handleUnifiedChatPost', () => { modelSelection: { model: 'gpt-6-astra', fastMode: true }, userId: 'user-1', workspaceId: 'ws-1', - }), - { selectedModel: '' } + }) ) const workspaceParams = buildCopilotRequestPayload.mock.calls[0]![0] as Record expect(workspaceParams.workspaceContext).toBeUndefined() @@ -1021,8 +1013,7 @@ describe('handleUnifiedChatPost', () => { expect.objectContaining({ terminalCapable: true, terminals, - }), - { selectedModel: '' } + }) ) }) @@ -1264,8 +1255,7 @@ describe('handleUnifiedChatPost', () => { expect(response.status).toBe(200) expect(buildCopilotRequestPayload).toHaveBeenCalledWith( - expect.objectContaining({ mcpServerIds: ['mcp-server-1'] }), - { selectedModel: '' } + expect.objectContaining({ mcpServerIds: ['mcp-server-1'] }) ) // The tools ride the tool array every turn, so re-expanding the listing for // an inherited server would only duplicate what the model already sees. @@ -1298,8 +1288,7 @@ describe('handleUnifiedChatPost', () => { expect(response.status).toBe(200) expect(buildCopilotRequestPayload).toHaveBeenCalledWith( - expect.objectContaining({ mcpServerIds: ['mcp-server-1', 'mcp-server-2'] }), - { selectedModel: '' } + expect.objectContaining({ mcpServerIds: ['mcp-server-1', 'mcp-server-2'] }) ) }) diff --git a/apps/sim/lib/mothership/chat/post.ts b/apps/sim/lib/mothership/chat/post.ts index 210eb1c585b..e980d9be025 100644 --- a/apps/sim/lib/mothership/chat/post.ts +++ b/apps/sim/lib/mothership/chat/post.ts @@ -450,7 +450,6 @@ type UnifiedChatBranch = assistantImages?: AssistantImageContent[] userPermission?: string userTimezone?: string - userMetadata?: { name?: string; email?: string; timezone?: string } assistantSearchLevel?: AssistantSearchLevel assistantFast?: boolean assistantSearch?: WorkspaceSearchFilters @@ -756,16 +755,13 @@ async function resolveBranch(params: { titleModel: DEFAULT_MODEL, notifyChatStatus: true, buildPayload: async (payloadParams) => - buildCopilotRequestPayload( - { - ...payloadParams, - principal, - organizationId, - mode, - model: '', - }, - { selectedModel: '' } - ), + buildCopilotRequestPayload({ + ...payloadParams, + principal, + organizationId, + mode, + model: '', + }), buildExecutionContext: async ({ userId, chatId, userTimezone, messageId }) => buildInitialExecutionContext({ userId, @@ -807,41 +803,38 @@ async function resolveBranch(params: { titleProvider: provider, notifyChatStatus: false, buildPayload: async (payloadParams) => - buildCopilotRequestPayload( - { - message: payloadParams.message, - workflowId: payloadParams.workflowId, - workflowName: payloadParams.workflowName, - workspaceId: payloadParams.workspaceId, - userId: payloadParams.userId, - principal, - userMessageId: payloadParams.userMessageId, - mode: payloadParams.mode ?? 'agent', - model: selectedModel, - provider: payloadParams.provider, - contexts: payloadParams.contexts, - assistantSearch: payloadParams.assistantSearch, - assistantFast: payloadParams.assistantFast, - assistantSearchLevel: payloadParams.assistantSearchLevel, - mcpServerIds: payloadParams.mcpServerIds, - fileAttachments: payloadParams.fileAttachments, - commands: payloadParams.commands, - chatId: payloadParams.chatId, - prefetch: payloadParams.prefetch, - implicitFeedback: payloadParams.implicitFeedback, - userPermission: payloadParams.userPermission, - userTimezone: payloadParams.userTimezone, - effort: payloadParams.effort, - modelSelection: payloadParams.modelSelection, - desktopLocalFilesystem: payloadParams.desktopLocalFilesystem, - desktopLocalFiles: payloadParams.desktopLocalFiles, - browser: payloadParams.browser, - terminalCapable: payloadParams.terminalCapable, - terminals: payloadParams.terminals, - browserSessions: payloadParams.browserSessions, - }, - { selectedModel } - ), + buildCopilotRequestPayload({ + message: payloadParams.message, + workflowId: payloadParams.workflowId, + workflowName: payloadParams.workflowName, + workspaceId: payloadParams.workspaceId, + userId: payloadParams.userId, + principal, + userMessageId: payloadParams.userMessageId, + mode: payloadParams.mode ?? 'agent', + model: selectedModel, + provider: payloadParams.provider, + contexts: payloadParams.contexts, + assistantSearch: payloadParams.assistantSearch, + assistantFast: payloadParams.assistantFast, + assistantSearchLevel: payloadParams.assistantSearchLevel, + mcpServerIds: payloadParams.mcpServerIds, + fileAttachments: payloadParams.fileAttachments, + commands: payloadParams.commands, + chatId: payloadParams.chatId, + prefetch: payloadParams.prefetch, + implicitFeedback: payloadParams.implicitFeedback, + userPermission: payloadParams.userPermission, + userTimezone: payloadParams.userTimezone, + effort: payloadParams.effort, + modelSelection: payloadParams.modelSelection, + desktopLocalFilesystem: payloadParams.desktopLocalFilesystem, + desktopLocalFiles: payloadParams.desktopLocalFiles, + browser: payloadParams.browser, + terminalCapable: payloadParams.terminalCapable, + terminals: payloadParams.terminals, + browserSessions: payloadParams.browserSessions, + }), buildExecutionContext: async ({ userId, chatId, userTimezone, messageId }) => buildInitialExecutionContext({ userId, @@ -878,36 +871,33 @@ async function resolveBranch(params: { titleModel: DEFAULT_MODEL, notifyChatStatus: true, buildPayload: async (payloadParams) => - buildCopilotRequestPayload( - { - message: payloadParams.message, - workspaceId: requestedWorkspaceId, - userId: payloadParams.userId, - principal, - userMessageId: payloadParams.userMessageId, - mode: mode ?? 'agent', - model: '', - contexts: payloadParams.contexts, - workspaceContext: payloadParams.workspaceContext, - assistantSearch: payloadParams.assistantSearch, - assistantFast: payloadParams.assistantFast, - assistantSearchLevel: payloadParams.assistantSearchLevel, - mcpServerIds: payloadParams.mcpServerIds, - fileAttachments: payloadParams.fileAttachments, - chatId: payloadParams.chatId, - userPermission: payloadParams.userPermission, - userTimezone: payloadParams.userTimezone, - effort: payloadParams.effort, - modelSelection: payloadParams.modelSelection, - desktopLocalFilesystem: payloadParams.desktopLocalFilesystem, - desktopLocalFiles: payloadParams.desktopLocalFiles, - browser: payloadParams.browser, - terminalCapable: payloadParams.terminalCapable, - terminals: payloadParams.terminals, - browserSessions: payloadParams.browserSessions, - }, - { selectedModel: '' } - ), + buildCopilotRequestPayload({ + message: payloadParams.message, + workspaceId: requestedWorkspaceId, + userId: payloadParams.userId, + principal, + userMessageId: payloadParams.userMessageId, + mode: mode ?? 'agent', + model: '', + contexts: payloadParams.contexts, + workspaceContext: payloadParams.workspaceContext, + assistantSearch: payloadParams.assistantSearch, + assistantFast: payloadParams.assistantFast, + assistantSearchLevel: payloadParams.assistantSearchLevel, + mcpServerIds: payloadParams.mcpServerIds, + fileAttachments: payloadParams.fileAttachments, + chatId: payloadParams.chatId, + userPermission: payloadParams.userPermission, + userTimezone: payloadParams.userTimezone, + effort: payloadParams.effort, + modelSelection: payloadParams.modelSelection, + desktopLocalFilesystem: payloadParams.desktopLocalFilesystem, + desktopLocalFiles: payloadParams.desktopLocalFiles, + browser: payloadParams.browser, + terminalCapable: payloadParams.terminalCapable, + terminals: payloadParams.terminals, + browserSessions: payloadParams.browserSessions, + }), buildExecutionContext: async ({ userId, chatId, userTimezone, messageId }) => buildInitialExecutionContext({ userId, @@ -990,7 +980,6 @@ export async function handleUnifiedChatPost(req: NextRequest) { return createUnauthorizedResponse() } const authenticatedUserId = session.user.id - const authenticatedUserName = session.user.name const authenticatedUserEmail = session.user.email const body = ChatMessageSchema.parse(await req.json()) @@ -1015,11 +1004,6 @@ export async function handleUnifiedChatPost(req: NextRequest) { ) } - const userMetadata = { - ...(authenticatedUserName ? { name: authenticatedUserName } : {}), - ...(authenticatedUserEmail ? { email: authenticatedUserEmail } : {}), - ...(body.userTimezone ? { timezone: body.userTimezone } : {}), - } const normalizedContexts = body.mode === 'assistant' ? [] : (normalizeContexts(body.contexts) ?? []) userMessageId = body.userMessageId || generateId() diff --git a/apps/sim/lib/mothership/chat/process-contents.ts b/apps/sim/lib/mothership/chat/process-contents.ts index 3c6a07884a6..f9ca6810707 100644 --- a/apps/sim/lib/mothership/chat/process-contents.ts +++ b/apps/sim/lib/mothership/chat/process-contents.ts @@ -976,7 +976,7 @@ async function resolveTableResource( input: { tableId, workspaceId, viewId: selectedViewId }, }) : undefined - const { table } = await readTableUseCase.execute({ + await readTableUseCase.execute({ principal, input: { tableId, workspaceId }, }) diff --git a/apps/sim/lib/mothership/inbox/types.ts b/apps/sim/lib/mothership/inbox/types.ts index f79685c9cf6..a0b1801fc43 100644 --- a/apps/sim/lib/mothership/inbox/types.ts +++ b/apps/sim/lib/mothership/inbox/types.ts @@ -14,21 +14,6 @@ export interface InboxConfig { providerId: string | null } -interface InboxTaskStats { - total: number - completed: number - processing: number - failed: number -} - -interface AllowedSender { - id: string - email: string - label: string | null - addedBy: string - createdAt: Date -} - export interface AgentMailInbox { organization_id?: string pod_id: string diff --git a/apps/sim/lib/mothership/request/tools/resolved-secret-result.test.ts b/apps/sim/lib/mothership/request/tools/resolved-secret-result.test.ts index 7def95a15ac..cb7f63cfe97 100644 --- a/apps/sim/lib/mothership/request/tools/resolved-secret-result.test.ts +++ b/apps/sim/lib/mothership/request/tools/resolved-secret-result.test.ts @@ -23,7 +23,7 @@ function createRegistry(): ResolvedSecretTraceRegistry { describe('projectToolResultForCopilot', () => { it.each([RunFunction.id, RunCode.id])( 'projects active exact and embedded secrets for %s without mutating runtime output', - (toolName) => { + () => { const registry = createRegistry() registry.recordResolved('SECRET', 'secret-value', { propagated: true }) const runtimeResult = { diff --git a/apps/sim/lib/mothership/request/types.ts b/apps/sim/lib/mothership/request/types.ts index ce53d57fa8e..e09e8038afe 100644 --- a/apps/sim/lib/mothership/request/types.ts +++ b/apps/sim/lib/mothership/request/types.ts @@ -240,30 +240,6 @@ export interface StreamingContext { } } -interface FileAttachment { - id: string - key: string - name: string - mimeType: string - size: number -} - -interface OrchestratorRequest { - message: string - workflowId: string - userId: string - chatId?: string - mode?: 'agent' | 'assistant' | 'plan' - model?: string - contexts?: Array<{ type: string; content: string }> - fileAttachments?: FileAttachment[] - commands?: string[] - provider?: string - version?: string - prefetch?: boolean - userName?: string -} - export interface OrchestratorOptions { /** Checks the server controller, independently of user cancellation. */ assertControllerOwnership?: () => Promise diff --git a/apps/sim/lib/mothership/tools/server/files/doc-compile.ts b/apps/sim/lib/mothership/tools/server/files/doc-compile.ts index 19f0515e745..030128fe095 100644 --- a/apps/sim/lib/mothership/tools/server/files/doc-compile.ts +++ b/apps/sim/lib/mothership/tools/server/files/doc-compile.ts @@ -440,7 +440,7 @@ fs.writeFileSync('/home/user/output.docx', __buf); * engines. Throws DocCompileUserError on a script error. */ async function compileDocViaE2BNode( - { source, fileName, workspaceId, filePrincipal }: CompileArgs, + { source, workspaceId, filePrincipal }: CompileArgs, ext: 'pptx' | 'docx', referencedImages: ReferencedImageResolution ): Promise { diff --git a/apps/sim/lib/mothership/tools/server/files/file-preview.ts b/apps/sim/lib/mothership/tools/server/files/file-preview.ts index 85f708d169d..55ec225c7f7 100644 --- a/apps/sim/lib/mothership/tools/server/files/file-preview.ts +++ b/apps/sim/lib/mothership/tools/server/files/file-preview.ts @@ -7,19 +7,6 @@ import { readWorkspaceFileContent } from '@/lib/workspace-files/application/read const logger = createLogger('CopilotFilePreview') const MAX_PREVIEW_SOURCE_BYTES = 5 * 1024 * 1024 -type FilePreviewEdit = { - strategy?: string - search?: string - replaceAll?: boolean - mode?: string - occurrence?: number - before_anchor?: string - after_anchor?: string - anchor?: string - start_anchor?: string - end_anchor?: string -} - interface BuildFilePreviewTextOptions { operation: 'create' | 'append' | 'update' | 'patch' streamedContent: string diff --git a/apps/sim/lib/oauth/token-resolution.test.ts b/apps/sim/lib/oauth/token-resolution.test.ts index f1c5f18d6ad..87ce487f073 100644 --- a/apps/sim/lib/oauth/token-resolution.test.ts +++ b/apps/sim/lib/oauth/token-resolution.test.ts @@ -2,7 +2,7 @@ import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' import { authOAuthUtilsMock, authOAuthUtilsMockFns } from '@sim/testing/mocks/auth-oauth-utils.mock' import { credentialsManagedOauthMock } from '@sim/testing/mocks/credentials-managed-oauth.mock' import { oauthUtilsMock } from '@sim/testing/mocks/oauth-utils.mock' -import { posthogServerMock, posthogServerMockFns } from '@sim/testing/mocks/posthog-server.mock' +import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { beforeEach, describe, expect, it, vi } from 'vitest' const { mockAuthorizeCredentialUseForAuth, mockExecuteManagedToken } = vi.hoisted(() => ({ @@ -52,7 +52,6 @@ const { mockResolveOAuthAccountId, mockResolveServiceAccountToken, } = authOAuthUtilsMockFns -const mockCaptureServerEvent = posthogServerMockFns.mockCaptureServerEvent const INTERNAL_AUTH = { success: true, userId: 'user-1', authType: 'internal_jwt' } as const diff --git a/apps/sim/lib/permission-groups/capabilities.ts b/apps/sim/lib/permission-groups/capabilities.ts index e210e952f6c..8260dea111d 100644 --- a/apps/sim/lib/permission-groups/capabilities.ts +++ b/apps/sim/lib/permission-groups/capabilities.ts @@ -453,16 +453,15 @@ export type StaticPermissionGroupCapability = { * any capability and every gate would silently never fire. Nothing at runtime * would look wrong, so it is asserted here. * - * The aliases below are deliberately unexported: the constraint on - * {@link Assert} is checked where the alias is declared, so an export bought - * nothing but the appearance of a consumer that never existed. They are unused - * on purpose, and deleting one deletes the proof. + * The constraint on {@link Assert} is checked where each alias below is + * declared. They are exported only so the unused-variable lint treats them as + * live; nothing imports them, and deleting one deletes the proof. */ type Assert = T -type AssertsStaticCapabilityResolves = Assert< +export type AssertsStaticCapabilityResolves = Assert< 'tables.use' extends StaticPermissionGroupCapability ? true : false > -type AssertsParameterizedCapabilityIsExcluded = Assert< +export type AssertsParameterizedCapabilityIsExcluded = Assert< 'deploy.chat.auth_mode' extends StaticPermissionGroupCapability ? false : true > diff --git a/apps/sim/lib/permission-groups/fields.ts b/apps/sim/lib/permission-groups/fields.ts index 88894010d1f..8bb73786daf 100644 --- a/apps/sim/lib/permission-groups/fields.ts +++ b/apps/sim/lib/permission-groups/fields.ts @@ -598,24 +598,27 @@ type Exact = [A] extends [B] ? ([B] extends [A] ? true : false) : false /** * Fails to compile unless `T` is exactly `true`, which is what makes the aliases - * below load-bearing. They are deliberately unexported: the constraint is - * checked where the alias is declared, so an export bought nothing but the - * appearance of a consumer that never existed. Nothing may import them; they - * are unused on purpose, and deleting one deletes the proof. + * below load-bearing. The constraint is checked where each alias is declared; + * they are exported only so the unused-variable lint treats them as live. + * Nothing imports them, and deleting one deletes the proof. */ type Assert = T -type AssertsAllowlistStaysPrecise = Assert< +export type AssertsAllowlistStaysPrecise = Assert< Exact > -type AssertsDenylistStaysPrecise = Assert> -type AssertsRestrictionStaysPrecise = Assert> -type AssertsAuthTypesStayPrecise = Assert< +export type AssertsDenylistStaysPrecise = Assert< + Exact +> +export type AssertsRestrictionStaysPrecise = Assert< + Exact +> +export type AssertsAuthTypesStayPrecise = Assert< Exact< PermissionGroupConfig['allowedFileShareAuthTypes'], (typeof FILE_SHARE_AUTH_TYPES)[number][] | null > > -type AssertsParserReturnsTheConfig = Assert< +export type AssertsParserReturnsTheConfig = Assert< Exact, PermissionGroupConfig> > diff --git a/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts index 2a21203dc9d..ccce38fd396 100644 --- a/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts @@ -1470,7 +1470,6 @@ function buildBarChartOption( } function buildLineChartOption( - chartTypeNode: SafeXmlNode, chartNode: SafeXmlNode, seriesArr: SeriesData[], ctx: RenderContext, @@ -2166,7 +2165,7 @@ function buildStockChartOption( seriesArr[2].values[i] ?? 0, ]), // eslint-disable-next-line @typescript-eslint/no-explicit-any - renderItem: (params: any, api: any) => { + renderItem: (_params: any, api: any) => { const xValue = api.value(0) const high = api.value(1) const low = api.value(2) @@ -2462,24 +2461,6 @@ function parseChartStyleId(chartXml: SafeXmlNode): number | undefined { return undefined } -function clamp01(v: number): number { - if (v < 0) return 0 - if (v > 1) return 1 - return v -} - -function tintHex(hex: string, amount: number): string { - const normalized = hex.startsWith('#') ? hex.slice(1) : hex - if (normalized.length !== 6) return hex.startsWith('#') ? hex : `#${hex}` - const r = Number.parseInt(normalized.slice(0, 2), 16) - const g = Number.parseInt(normalized.slice(2, 4), 16) - const b = Number.parseInt(normalized.slice(4, 6), 16) - if ([r, g, b].some((n) => Number.isNaN(n))) return hex.startsWith('#') ? hex : `#${hex}` - const a = clamp01(amount) - const mix = (c: number) => Math.round(c + (255 - c) * a) - return `#${[mix(r), mix(g), mix(b)].map((n) => n.toString(16).padStart(2, '0')).join('')}` -} - /** * Build a chart color palette from theme accents and chart style id. * This improves parity with Office chart styles when series colors are implicit. @@ -2811,30 +2792,6 @@ function extractChartDefaultFontSize(chartSpaceNode: SafeXmlNode): number | unde return undefined } -/** - * Estimate legend width as a percentage of chart width based on legend text length and font size. - * Used to reserve grid space when legend is at right or left (non-overlay). - */ -function estimateLegendWidthPct( - legendInfo: LegendInfo | undefined, - legendNames: string[], - baseFontSize: number -): string { - if (!legendInfo || legendInfo.overlay) return '2%' - const opt = legendInfo.option as Record | undefined - if (!opt) return '2%' - const isRight = opt.right !== undefined && opt.top !== undefined && opt.bottom === undefined - const isLeft = opt.left !== undefined && opt.top !== undefined && opt.bottom === undefined - if (!isRight && !isLeft) return '2%' - // Estimate based on longest label + icon + padding - const maxLen = Math.max(1, ...legendNames.map((n) => n.length)) - // Approximate: each char ≈ 0.6 * fontSize, plus icon (≈ fontSize) and padding (≈ fontSize) - const estimatedPx = maxLen * baseFontSize * 0.6 + baseFontSize * 3 - // Convert to percentage of typical chart width (assume ~600px as base) - const pct = Math.min(40, Math.max(15, Math.round((estimatedPx / 600) * 100))) - return `${pct}%` -} - function createLegendIcon( icon: string | undefined, color: string, @@ -3041,11 +2998,11 @@ function buildOptionForChartType( return buildBarChartOption(chartTypeNode, chartNode, seriesArr, ctx) case 'lineChart': case 'line3DChart': - return buildLineChartOption(chartTypeNode, chartNode, seriesArr, ctx, false) + return buildLineChartOption(chartNode, seriesArr, ctx, false) case 'areaChart': case 'area3DChart': case 'surface3DChart': - return buildLineChartOption(chartTypeNode, chartNode, seriesArr, ctx, true) + return buildLineChartOption(chartNode, seriesArr, ctx, true) case 'pieChart': case 'pie3DChart': return buildPieChartOption(chartTypeNode, chartNode, seriesArr, false, ctx) diff --git a/apps/sim/lib/settings/application/workspace-section-access.ts b/apps/sim/lib/settings/application/workspace-section-access.ts index 6072a7541c0..02ae44cff93 100644 --- a/apps/sim/lib/settings/application/workspace-section-access.ts +++ b/apps/sim/lib/settings/application/workspace-section-access.ts @@ -52,9 +52,7 @@ async function authorizeWorkspaceSection( workspace.organizationId ) : null, - section === 'forks' - ? isForkingAvailableForWorkspace(workspace.organizationId, input.userId) - : false, + section === 'forks' ? isForkingAvailableForWorkspace(workspace.organizationId) : false, section === 'custom-blocks' && workspace.organizationId ? isCustomBlocksEligibleForOrganization(workspace.organizationId) : false, diff --git a/apps/sim/lib/table/application/rows.test.ts b/apps/sim/lib/table/application/rows.test.ts index dc9ba3e2e29..24782791ef9 100644 --- a/apps/sim/lib/table/application/rows.test.ts +++ b/apps/sim/lib/table/application/rows.test.ts @@ -101,7 +101,6 @@ import { encodeCursor } from '@/lib/table/rows/cursor' const { mockReplaceTableRows: mockReplaceRowsPrimitive, - mockDeleteRowsByIds, mockQueryRows, mockUpsertRow, mockWithLockedTable, @@ -127,7 +126,6 @@ const mockGetWorkspaceOrganizationId = workspacesUtilsMockFns.mockGetWorkspaceOr const mockRecordAudit = auditMockFns.mockRecordAudit const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission const mockSignalRowsChanged = tableEventsMockFns.mockSignalTableRowsChanged -const mockSignalRowsChangedByActor = tableEventsMockFns.mockSignalTableRowsChangedByActor const TABLE: TableDefinition = { id: 'table-1', diff --git a/apps/sim/lib/table/columns/service.ts b/apps/sim/lib/table/columns/service.ts index 433c57f4fdd..12d918ae86b 100644 --- a/apps/sim/lib/table/columns/service.ts +++ b/apps/sim/lib/table/columns/service.ts @@ -810,10 +810,7 @@ export async function updateColumnType( } const columnKey = getColumnId(column) - // Options the column will carry after the change — a `select` value is only - // compatible if it resolves against this set. const isSelectType = data.newType === 'select' - const targetOptions = data.options ?? column.options ?? [] const targetMultiple = data.multiple ?? column.multiple // Leaving `select` behind: stored cells hold option ids, which mean nothing // once the column is text/number/etc. Check compatibility against the option diff --git a/apps/sim/lib/table/dispatcher.test.ts b/apps/sim/lib/table/dispatcher.test.ts index 6aa8744389e..7b0404302bf 100644 --- a/apps/sim/lib/table/dispatcher.test.ts +++ b/apps/sim/lib/table/dispatcher.test.ts @@ -1,5 +1,5 @@ import { dbChainMockFns, resetDbChainMock } from '@sim/testing' -import { tableEventsMock, tableEventsMockFns } from '@sim/testing/mocks/table-events.mock' +import { tableEventsMock } from '@sim/testing/mocks/table-events.mock' import { tableServiceMock, tableServiceMockFns } from '@sim/testing/mocks/table-service.mock' import { tableWorkflowColumnsMock, @@ -45,7 +45,6 @@ tableWorkflowColumnsMockFns.mockBuildPendingRuns.mockImplementation( ) ) -const mockAppendTableEvent = tableEventsMockFns.mockAppendTableEvent const mockGetTableById = tableServiceMockFns.mockGetTableById const DISPATCH = { diff --git a/apps/sim/lib/table/import-runner.test.ts b/apps/sim/lib/table/import-runner.test.ts index 583102858b8..a7e02987364 100644 --- a/apps/sim/lib/table/import-runner.test.ts +++ b/apps/sim/lib/table/import-runner.test.ts @@ -1,7 +1,7 @@ import { Readable } from 'node:stream' import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { storageServiceMock, storageServiceMockFns } from '@sim/testing/mocks/storage-service.mock' -import { tableEventsMock, tableEventsMockFns } from '@sim/testing/mocks/table-events.mock' +import { tableEventsMock } from '@sim/testing/mocks/table-events.mock' import { tableJobsServiceMock, tableJobsServiceMockFns, @@ -42,7 +42,6 @@ const mockUpdateJobProgress = tableJobsServiceMockFns.mockUpdateJobProgressInWor const mockMarkJobReady = tableJobsServiceMockFns.mockMarkJobReadyInWorkspace const mockMarkJobFailed = tableJobsServiceMockFns.mockMarkJobFailedInWorkspace const mockRecordImportRejections = tableJobsServiceMockFns.mockRecordImportRejections -const mockAppendTableEvent = tableEventsMockFns.mockAppendTableEvent const mockDeleteFile = storageServiceMockFns.mockDeleteFile const mockDownloadFileStream = storageServiceMockFns.mockDownloadFileStream const mockHeadObject = storageServiceMockFns.mockHeadObject diff --git a/apps/sim/lib/table/llm/enrichment.test.ts b/apps/sim/lib/table/llm/enrichment.test.ts index 416734a9011..b15d8ad33d4 100644 --- a/apps/sim/lib/table/llm/enrichment.test.ts +++ b/apps/sim/lib/table/llm/enrichment.test.ts @@ -22,11 +22,7 @@ const V2_SCHEMA = { } describe('enrichTableToolParameters for table_query_rows_v2', () => { - const { properties, required } = enrichTableToolParameters( - V2_SCHEMA, - TABLE, - 'table_query_rows_v2' - ) + const { properties } = enrichTableToolParameters(V2_SCHEMA, TABLE, 'table_query_rows_v2') it('describes filter with the predicate grammar and real columns', () => { expect(properties.filter.description).toContain('status, wins') diff --git a/apps/sim/lib/table/orchestration/import.test.ts b/apps/sim/lib/table/orchestration/import.test.ts index 01d5111a7af..928c9af7e44 100644 --- a/apps/sim/lib/table/orchestration/import.test.ts +++ b/apps/sim/lib/table/orchestration/import.test.ts @@ -4,7 +4,7 @@ */ import { Readable } from 'node:stream' import { tableBillingMock, tableBillingMockFns } from '@sim/testing/mocks/table-billing.mock' -import { tableEventsMock, tableEventsMockFns } from '@sim/testing/mocks/table-events.mock' +import { tableEventsMock } from '@sim/testing/mocks/table-events.mock' import { tableJobsServiceMock, tableJobsServiceMockFns, @@ -33,7 +33,6 @@ vi.mock('@/lib/table/events', () => tableEventsMock) import { performCreateTableFromCsv, performTableCsvImport } from '@/lib/table/orchestration/import' -const mockSignalSchemaChanged = tableEventsMockFns.mockSignalTableSchemaChanged const mockMarkTableJobRunning = tableJobsServiceMockFns.mockMarkTableJobRunning const mockReleaseJobClaim = tableJobsServiceMockFns.mockReleaseJobClaim const mockGetMaxRowsPerTable = tableBillingMockFns.mockGetMaxRowsPerTable diff --git a/apps/sim/lib/table/secret-provenance-selection.ts b/apps/sim/lib/table/secret-provenance-selection.ts index 17e247d36ae..1cab589b36f 100644 --- a/apps/sim/lib/table/secret-provenance-selection.ts +++ b/apps/sim/lib/table/secret-provenance-selection.ts @@ -9,7 +9,7 @@ export function selectTableRowSecretProvenance( return rows.flatMap((row, rowIndex) => Object.entries(row) .filter(([, value]) => value !== undefined) - .map(([columnKey, value]) => ({ + .map(([columnKey]) => ({ key: tableRowSecretProvenanceSelectionKey(rowIndex, columnKey), inputPaths: [ inputRoot === 'rows' ? ['rows', String(rowIndex), columnKey] : ['data', columnKey], diff --git a/apps/sim/lib/table/workflow-cell-result.ts b/apps/sim/lib/table/workflow-cell-result.ts index c94b89c2ab0..b46708b6e25 100644 --- a/apps/sim/lib/table/workflow-cell-result.ts +++ b/apps/sim/lib/table/workflow-cell-result.ts @@ -25,7 +25,7 @@ export function classifyWorkflowCellTerminalResult( if (timeout.timedOut) { return { status: 'error', - error: getTimeoutErrorMessage(null, timeout.timeoutMs), + error: getTimeoutErrorMessage(timeout.timeoutMs), } } return { status: 'cancelled', error: 'Cancelled' } diff --git a/apps/sim/lib/tokenization/accurate.ts b/apps/sim/lib/tokenization/accurate.ts index 160196f7a4d..1ae1756daf9 100644 --- a/apps/sim/lib/tokenization/accurate.ts +++ b/apps/sim/lib/tokenization/accurate.ts @@ -29,7 +29,7 @@ function getEncoding(modelName: string): Tiktoken { const encoding = encodingForModel(modelName as Parameters[0]) encodingCache.set(modelName, encoding) return encoding - } catch (error) { + } catch { logger.warn(`Failed to get encoding for model ${modelName}, falling back to cl100k_base`) const encoding = encodingForModel('gpt-4') encodingCache.set(modelName, encoding) diff --git a/apps/sim/lib/uploads/utils/file-utils.server.ts b/apps/sim/lib/uploads/utils/file-utils.server.ts index 274cc056f8b..555339bb125 100644 --- a/apps/sim/lib/uploads/utils/file-utils.server.ts +++ b/apps/sim/lib/uploads/utils/file-utils.server.ts @@ -112,7 +112,7 @@ export async function resolveFileInputToUrl( // point at a different object than the verified key. if (userFile.key) { const context = resolveTrustedFileContext(userFile.key, userFile.context) - const hasAccess = await verifyFileAccess(userFile.key, userId, undefined, context, false) + const hasAccess = await verifyFileAccess(userFile.key, userId, undefined, context) if (!hasAccess) { logger.warn(`[${requestId}] Unauthorized presigned URL generation attempt`, { @@ -279,7 +279,7 @@ export async function downloadFileFromUrl( const context = inferContextFromKey(key) - const hasAccess = await verifyFileAccess(key, userId, undefined, context, false, { + const hasAccess = await verifyFileAccess(key, userId, undefined, context, { knowledgeAccess, }) if (!hasAccess) { @@ -328,7 +328,7 @@ export async function resolveInternalFileUrl( try { const storageKey = extractStorageKey(filePath) const context = inferContextFromKey(storageKey) - const hasAccess = await verifyFileAccess(storageKey, userId, undefined, context, false) + const hasAccess = await verifyFileAccess(storageKey, userId, undefined, context) if (!hasAccess) { logger.warn(`[${requestId}] Unauthorized presigned URL generation attempt`, { diff --git a/apps/sim/lib/uploads/utils/user-file-base64.server.test.ts b/apps/sim/lib/uploads/utils/user-file-base64.server.test.ts index 9f7a6c7455a..a6fbdf94c6a 100644 --- a/apps/sim/lib/uploads/utils/user-file-base64.server.test.ts +++ b/apps/sim/lib/uploads/utils/user-file-base64.server.test.ts @@ -245,7 +245,6 @@ describe('hydrateUserFilesWithBase64', () => { 'user-1', undefined, 'knowledge-base', - false, { knowledgeAccess: access } ) } diff --git a/apps/sim/lib/webhooks/deploy.test.ts b/apps/sim/lib/webhooks/deploy.test.ts index 9c13bf2e0e8..7a14c48ed39 100644 --- a/apps/sim/lib/webhooks/deploy.test.ts +++ b/apps/sim/lib/webhooks/deploy.test.ts @@ -99,11 +99,6 @@ const driveTrigger = trigger([ { id: 'manualFolderId', mode: 'trigger-advanced', canonicalParamId: 'folderId', required: false }, ]) -const tableTrigger = trigger([ - { id: 'tableSelector', mode: 'trigger', canonicalParamId: 'tableId', required: true }, - { id: 'manualTableId', mode: 'trigger-advanced', canonicalParamId: 'tableId', required: true }, -]) - const slackTrigger = trigger([ { id: 'eventType', mode: 'trigger', required: true }, { diff --git a/apps/sim/lib/webhooks/polling/google-calendar.ts b/apps/sim/lib/webhooks/polling/google-calendar.ts index 94a3c120e8c..973117297b8 100644 --- a/apps/sim/lib/webhooks/polling/google-calendar.ts +++ b/apps/sim/lib/webhooks/polling/google-calendar.ts @@ -120,7 +120,7 @@ export const googleCalendarPollingHandler: PollingProviderHandler = { } // Fetch changed events since last poll - const events = await fetchChangedEvents(accessToken, calendarId, config, requestId, logger) + const events = await fetchChangedEvents(accessToken, calendarId, config) if (!events.length) { await markWebhookSuccess(webhookId, logger) @@ -180,9 +180,7 @@ export const googleCalendarPollingHandler: PollingProviderHandler = { async function fetchChangedEvents( accessToken: string, calendarId: string, - config: GoogleCalendarWebhookConfig, - requestId: string, - logger: Logger + config: GoogleCalendarWebhookConfig ): Promise { const allEvents: CalendarEvent[] = [] const maxEvents = config.maxEventsPerPoll || MAX_EVENTS_PER_POLL diff --git a/apps/sim/lib/webhooks/polling/google-drive.ts b/apps/sim/lib/webhooks/polling/google-drive.ts index aaf321c14e8..da3198ac9f5 100644 --- a/apps/sim/lib/webhooks/polling/google-drive.ts +++ b/apps/sim/lib/webhooks/polling/google-drive.ts @@ -93,7 +93,7 @@ export const googleDrivePollingHandler: PollingProviderHandler = { // First poll (or re-seed after 410): seed page token, preserve any existing known file IDs. if (!config.pageToken) { - const startPageToken = await getStartPageToken(accessToken, config, requestId, logger) + const startPageToken = await getStartPageToken(accessToken, config) await updateWebhookProviderConfig( webhookId, { pageToken: startPageToken, knownFileIds: config.knownFileIds ?? [] }, @@ -106,12 +106,7 @@ export const googleDrivePollingHandler: PollingProviderHandler = { return 'success' } - const { changes, newStartPageToken } = await fetchChanges( - accessToken, - config, - requestId, - logger - ) + const { changes, newStartPageToken } = await fetchChanges(accessToken, config) if (!changes.length) { await updateWebhookProviderConfig(webhookId, { pageToken: newStartPageToken }, logger) @@ -208,9 +203,7 @@ function isDriveRateLimitError(status: number, errorData: Record { const params = new URLSearchParams() if (config.includeSharedDrives) { @@ -241,9 +234,7 @@ async function getStartPageToken( async function fetchChanges( accessToken: string, - config: GoogleDriveWebhookConfig, - requestId: string, - logger: Logger + config: GoogleDriveWebhookConfig ): Promise<{ changes: DriveChangeEntry[]; newStartPageToken: string }> { const allChanges: DriveChangeEntry[] = [] let currentPageToken = config.pageToken! diff --git a/apps/sim/lib/webhooks/polling/google-sheets.ts b/apps/sim/lib/webhooks/polling/google-sheets.ts index 72147225469..f9baf8f028b 100644 --- a/apps/sim/lib/webhooks/polling/google-sheets.ts +++ b/apps/sim/lib/webhooks/polling/google-sheets.ts @@ -100,15 +100,7 @@ export const googleSheetsPollingHandler: PollingProviderHandler = { rowCount: currentRowCount, headers, headerRowIndex, - } = await fetchSheetState( - accessToken, - spreadsheetId, - sheetName, - valueRender, - dateTimeRender, - requestId, - logger - ) + } = await fetchSheetState(accessToken, spreadsheetId, sheetName, valueRender, dateTimeRender) // First poll: seed state, emit nothing if (config.lastIndexChecked === undefined) { @@ -191,9 +183,7 @@ export const googleSheetsPollingHandler: PollingProviderHandler = { adjustedStartRow, endRow, valueRender, - dateTimeRender, - requestId, - logger + dateTimeRender ) const { processedCount, failedCount } = await processRows( @@ -252,12 +242,12 @@ async function isDriveFileUnchanged( logger: Logger ): Promise<{ unchanged: boolean; currentModifiedTime?: string }> { try { - const currentModifiedTime = await getDriveFileModifiedTime(accessToken, spreadsheetId, logger) + const currentModifiedTime = await getDriveFileModifiedTime(accessToken, spreadsheetId) if (!lastModifiedTime || !currentModifiedTime) { return { unchanged: false, currentModifiedTime } } return { unchanged: currentModifiedTime === lastModifiedTime, currentModifiedTime } - } catch (error) { + } catch { logger.warn(`[${requestId}] Drive modifiedTime check failed, proceeding with Sheets API`) return { unchanged: false } } @@ -265,8 +255,7 @@ async function isDriveFileUnchanged( async function getDriveFileModifiedTime( accessToken: string, - fileId: string, - logger: Logger + fileId: string ): Promise { try { const response = await fetch( @@ -295,9 +284,7 @@ async function fetchSheetState( spreadsheetId: string, sheetName: string, valueRenderOption: ValueRenderOption, - dateTimeRenderOption: DateTimeRenderOption, - requestId: string, - logger: Logger + dateTimeRenderOption: DateTimeRenderOption ): Promise<{ rowCount: number; headers: string[]; headerRowIndex: number }> { const encodedSheet = encodeURIComponent(sheetName) const params = new URLSearchParams({ @@ -350,9 +337,7 @@ async function fetchRowRange( startRow: number, endRow: number, valueRenderOption: ValueRenderOption, - dateTimeRenderOption: DateTimeRenderOption, - requestId: string, - logger: Logger + dateTimeRenderOption: DateTimeRenderOption ): Promise { const encodedSheet = encodeURIComponent(sheetName) const params = new URLSearchParams({ diff --git a/apps/sim/lib/webhooks/polling/imap.ts b/apps/sim/lib/webhooks/polling/imap.ts index 55f7f1b3b1d..c57144569f9 100644 --- a/apps/sim/lib/webhooks/polling/imap.ts +++ b/apps/sim/lib/webhooks/polling/imap.ts @@ -200,7 +200,7 @@ export const imapPollingHandler: PollingProviderHandler = { } catch {} throw innerError } - } catch (error) { + } catch { logger.error(`[${requestId}] Error processing IMAP webhook ${webhookId}`) await markWebhookFailed(webhookId, logger) return 'failure' diff --git a/apps/sim/lib/webhooks/providers/airtable.ts b/apps/sim/lib/webhooks/providers/airtable.ts index 39463c56dc4..63f609e2ee3 100644 --- a/apps/sim/lib/webhooks/providers/airtable.ts +++ b/apps/sim/lib/webhooks/providers/airtable.ts @@ -55,7 +55,6 @@ async function fetchAndProcessAirtablePayloads( // Logging handles all error logging let currentCursor: number | null = null let mightHaveMore = true - let payloadsFetched = 0 let apiCallCount = 0 // Use a Map to consolidate changes per record ID const consolidatedChangesMap = new Map() @@ -193,7 +192,6 @@ async function fetchAndProcessAirtablePayloads( const fullUrl = `${apiUrl}?${queryParams.toString()}` try { - const fetchStartTime = Date.now() const response = await fetch(fullUrl, { method: 'GET', headers: { @@ -225,12 +223,10 @@ async function fetchAndProcessAirtablePayloads( const receivedPayloads = responseBody.payloads || [] if (receivedPayloads.length > 0) { - payloadsFetched += receivedPayloads.length // Keep the raw payloads for later exposure to the workflow for (const p of receivedPayloads) { allPayloads.push(p) } - let changeCount = 0 for (const payload of receivedPayloads) { if (payload.changedTablesById) { for (const [tableId, tableChangesUntyped] of Object.entries( @@ -239,9 +235,6 @@ async function fetchAndProcessAirtablePayloads( const tableChanges = tableChangesUntyped as AirtableTableChanges if (tableChanges.createdRecordsById) { - const createdCount = Object.keys(tableChanges.createdRecordsById).length - changeCount += createdCount - for (const [recordId, recordData] of Object.entries( tableChanges.createdRecordsById )) { @@ -267,9 +260,6 @@ async function fetchAndProcessAirtablePayloads( // Handle updated records if (tableChanges.changedRecordsById) { - const updatedCount = Object.keys(tableChanges.changedRecordsById).length - changeCount += updatedCount - for (const [recordId, recordData] of Object.entries( tableChanges.changedRecordsById )) { @@ -440,7 +430,6 @@ async function fetchAndProcessAirtablePayloads( export const airtableHandler: WebhookProviderHandler = { async createSubscription({ webhook: webhookRecord, - workflow, userId, requestId, }: SubscriptionContext): Promise { @@ -560,7 +549,6 @@ export const airtableHandler: WebhookProviderHandler = { async deleteSubscription({ webhook: webhookRecord, - workflow, requestId, strict, }: DeleteSubscriptionContext): Promise { diff --git a/apps/sim/lib/webhooks/providers/attio.ts b/apps/sim/lib/webhooks/providers/attio.ts index f01f03748c5..c8fde94a4cd 100644 --- a/apps/sim/lib/webhooks/providers/attio.ts +++ b/apps/sim/lib/webhooks/providers/attio.ts @@ -102,7 +102,6 @@ export const attioHandler: WebhookProviderHandler = { async createSubscription({ webhook: webhookRecord, - workflow, userId, requestId, }: SubscriptionContext): Promise { @@ -234,7 +233,6 @@ export const attioHandler: WebhookProviderHandler = { async deleteSubscription({ webhook: webhookRecord, - workflow, requestId, strict, }: DeleteSubscriptionContext): Promise { diff --git a/apps/sim/lib/webhooks/providers/bitbucket.test.ts b/apps/sim/lib/webhooks/providers/bitbucket.test.ts index 7da611d8c23..4cb5b505b95 100644 --- a/apps/sim/lib/webhooks/providers/bitbucket.test.ts +++ b/apps/sim/lib/webhooks/providers/bitbucket.test.ts @@ -28,26 +28,6 @@ const fetchMock = vi.fn() const CALLBACK_URL = 'https://app.example.com/api/webhooks/trigger/bitbucket-path' const CANDIDATE_DESCRIPTION = 'Sim workflow trigger (bitbucket_push) [sim:webhook-1]' -const BASE_OUTPUT_KEYS = [ - 'actor', - 'attemptNumber', - 'eventType', - 'hookUuid', - 'payload', - 'repository', - 'requestUuid', -] - -const PULL_REQUEST_OUTPUT_KEYS = [ - ...BASE_OUTPUT_KEYS, - 'destinationBranch', - 'pullRequest', - 'pullRequestId', - 'pullRequestState', - 'pullRequestTitle', - 'sourceBranch', -].sort() - function requestWithHeaders(headers: Record): NextRequest { return new NextRequest('http://localhost/test', { headers }) } @@ -259,14 +239,6 @@ describe('Bitbucket webhook provider', () => { ) } ) - - const pullRequest = { - id: 42, - title: 'Add Bitbucket triggers', - state: 'OPEN', - source: { branch: { name: 'feature' } }, - destination: { branch: { name: 'staging' } }, - } }) describe('createSubscription', () => { diff --git a/apps/sim/lib/webhooks/providers/incidentio.test.ts b/apps/sim/lib/webhooks/providers/incidentio.test.ts index 67bfbe8eed2..a087d7ce961 100644 --- a/apps/sim/lib/webhooks/providers/incidentio.test.ts +++ b/apps/sim/lib/webhooks/providers/incidentio.test.ts @@ -12,12 +12,7 @@ function signIncidentioBody(msgId: string, timestamp: string, rawBody: string): return `v1,${sig}` } -function requestWithSvixHeaders( - msgId: string, - timestamp: string, - rawBody: string, - signature?: string -): NextRequest { +function requestWithSvixHeaders(msgId: string, timestamp: string, signature?: string): NextRequest { const headers: Record = { 'webhook-id': msgId, 'webhook-timestamp': timestamp, @@ -38,7 +33,7 @@ describe('incident.io webhook provider', () => { it('rejects requests when the signing secret is missing', async () => { const res = await incidentioHandler.verifyAuth!({ ...baseAuthCtx, - request: requestWithSvixHeaders('msg_1', `${Math.floor(Date.now() / 1000)}`, '{}'), + request: requestWithSvixHeaders('msg_1', `${Math.floor(Date.now() / 1000)}`), rawBody: '{}', requestId: 'incidentio-t1', providerConfig: {}, @@ -53,7 +48,7 @@ describe('incident.io webhook provider', () => { const res = await incidentioHandler.verifyAuth!({ ...baseAuthCtx, - request: requestWithSvixHeaders('msg_1', ts, rawBody, 'v1,not-a-valid-signature'), + request: requestWithSvixHeaders('msg_1', ts, 'v1,not-a-valid-signature'), rawBody, requestId: 'incidentio-t3', providerConfig: { signingSecret: SIGNING_SECRET }, @@ -69,7 +64,7 @@ describe('incident.io webhook provider', () => { const res = await incidentioHandler.verifyAuth!({ ...baseAuthCtx, - request: requestWithSvixHeaders('msg_1', ts, rawBody, signature), + request: requestWithSvixHeaders('msg_1', ts, signature), rawBody, requestId: 'incidentio-t4', providerConfig: { signingSecret: SIGNING_SECRET }, @@ -85,7 +80,7 @@ describe('incident.io webhook provider', () => { const res = await incidentioHandler.verifyAuth!({ ...baseAuthCtx, - request: requestWithSvixHeaders('msg_1', ts, rawBody, signature), + request: requestWithSvixHeaders('msg_1', ts, signature), rawBody, requestId: 'incidentio-t5', providerConfig: { signingSecret: SIGNING_SECRET }, diff --git a/apps/sim/lib/webhooks/providers/microsoft-teams.ts b/apps/sim/lib/webhooks/providers/microsoft-teams.ts index 5af7b2c95cb..fa9e9b632d1 100644 --- a/apps/sim/lib/webhooks/providers/microsoft-teams.ts +++ b/apps/sim/lib/webhooks/providers/microsoft-teams.ts @@ -122,17 +122,14 @@ async function fetchWithDNSPinning( */ async function formatTeamsGraphNotification( body: Record, - foundWebhook: Record, - foundWorkflow: { id: string; userId: string } + foundWebhook: Record ): Promise { const notification = (body.value as unknown[])?.[0] as Record | undefined if (!notification) { logger.warn('Received empty Teams notification body') return null } - const changeType = (notification.changeType as string) || 'created' const resource = (notification.resource as string) || '' - const subscriptionId = (notification.subscriptionId as string) || '' let chatId: string | null = null let messageId: string | null = null @@ -593,10 +590,7 @@ export const microsoftTeamsHandler: WebhookProviderHandler = { async createSubscription({ webhook, - workflow, - userId, requestId, - request, }: SubscriptionContext): Promise { const config = getProviderConfig(webhook) @@ -736,7 +730,6 @@ export const microsoftTeamsHandler: WebhookProviderHandler = { async deleteSubscription({ webhook, - workflow, requestId, strict, }: DeleteSubscriptionContext): Promise { @@ -778,7 +771,8 @@ export const microsoftTeamsHandler: WebhookProviderHandler = { `[${requestId}] Successfully deleted Teams subscription ${externalSubscriptionId} for webhook ${webhook.id}` ) } else { - const errorBody = await res.text() + // Drain the unread body so the connection is released. + await res.text() logger.warn( `[${requestId}] Failed to delete Teams subscription ${externalSubscriptionId} for webhook ${webhook.id}. Status: ${res.status}` ) @@ -793,22 +787,16 @@ export const microsoftTeamsHandler: WebhookProviderHandler = { } }, - async formatInput({ - body, - webhook, - workflow, - requestId, - }: FormatInputContext): Promise { + async formatInput({ body, webhook }: FormatInputContext): Promise { const b = body as Record const value = b?.value as unknown[] | undefined if (value && Array.isArray(value) && value.length > 0) { - const result = await formatTeamsGraphNotification(b, webhook, workflow) + const result = await formatTeamsGraphNotification(b, webhook) return { input: result } } const messageText = (b?.text as string) || '' - const messageId = (b?.id as string) || '' const timestamp = (b?.timestamp as string) || (b?.localTimestamp as string) || '' const from = (b?.from || {}) as Record const conversation = (b?.conversation || {}) as Record diff --git a/apps/sim/lib/webhooks/providers/slack.test.ts b/apps/sim/lib/webhooks/providers/slack.test.ts index 695895e7ef5..f38a5a0387c 100644 --- a/apps/sim/lib/webhooks/providers/slack.test.ts +++ b/apps/sim/lib/webhooks/providers/slack.test.ts @@ -472,11 +472,6 @@ describe('shouldSkipSlackTriggerEvent - interactions', () => { user: { id: 'U1' }, actions: [{ action_id: 'approve_btn', value: 'v' }], } - const viewSubmission = { - type: 'view_submission', - user: { id: 'U1' }, - view: { callback_id: 'create_ticket' }, - } it('drops an interaction when the configured eventType is a different event', () => { expect(interactionFires({ eventType: 'message' }, blockActions)).toBe(false) diff --git a/apps/sim/lib/webhooks/providers/twilio.test.ts b/apps/sim/lib/webhooks/providers/twilio.test.ts index 04b0f661396..9d03c50842d 100644 --- a/apps/sim/lib/webhooks/providers/twilio.test.ts +++ b/apps/sim/lib/webhooks/providers/twilio.test.ts @@ -134,7 +134,6 @@ describe('twilioHandler', () => { }) const inbound = { MessageSid: 'SM1', From: '+1', Body: 'hi', SmsStatus: 'received' } - const status = { MessageSid: 'SM1', MessageStatus: 'delivered', SmsStatus: 'delivered' } it('routes inbound messages only to the received trigger', () => { expect(match('twilio_sms_received', inbound)).toBe(true) diff --git a/apps/sim/lib/webhooks/providers/webflow.ts b/apps/sim/lib/webhooks/providers/webflow.ts index dd25cb21cd9..dfbea875859 100644 --- a/apps/sim/lib/webhooks/providers/webflow.ts +++ b/apps/sim/lib/webhooks/providers/webflow.ts @@ -22,16 +22,14 @@ const logger = createLogger('WebhookProvider:Webflow') export const webflowHandler: WebhookProviderHandler = { async createSubscription({ webhook: webhookRecord, - workflow, userId, requestId, }: SubscriptionContext): Promise { try { const config = getProviderConfig(webhookRecord) - const { siteId, triggerId, collectionId, formName, credentialId } = config as { + const { siteId, triggerId, formName, credentialId } = config as { siteId?: string triggerId?: string - collectionId?: string formName?: string credentialId?: string } @@ -142,7 +140,6 @@ export const webflowHandler: WebhookProviderHandler = { async deleteSubscription({ webhook: webhookRecord, - workflow, requestId, strict, }: DeleteSubscriptionContext): Promise { diff --git a/apps/sim/lib/webhooks/providers/whatsapp.test.ts b/apps/sim/lib/webhooks/providers/whatsapp.test.ts index 6895e7e2b1a..8f33ac83025 100644 --- a/apps/sim/lib/webhooks/providers/whatsapp.test.ts +++ b/apps/sim/lib/webhooks/providers/whatsapp.test.ts @@ -187,30 +187,6 @@ describe('WhatsApp webhook provider', () => { ]) }) - async function formatMediaMessage(message: Record) { - const result = await whatsappHandler.formatInput!({ - webhook: { id: 'wh_media', providerConfig: {} }, - workflow: { id: 'wf_media', userId: 'user_media' }, - body: { - object: 'whatsapp_business_account', - entry: [ - { - changes: [ - { - field: 'messages', - value: { metadata: { phone_number_id: '12345' }, messages: [message] }, - }, - ], - }, - ], - }, - headers: {}, - requestId: 'wa-format-media', - }) - - return result.input as Record - } - describe('handleChallenge', () => { function verificationRequest(): NextRequest { return new NextRequest( diff --git a/apps/sim/lib/webhooks/providers/zoho-desk.ts b/apps/sim/lib/webhooks/providers/zoho-desk.ts index 719038fe31b..1fc90809cf0 100644 --- a/apps/sim/lib/webhooks/providers/zoho-desk.ts +++ b/apps/sim/lib/webhooks/providers/zoho-desk.ts @@ -244,7 +244,6 @@ export const zohoDeskHandler: WebhookProviderHandler = { async createSubscription({ webhook: webhookRecord, - userId, requestId, }: SubscriptionContext): Promise { const config = ((webhookRecord as Record).providerConfig ?? {}) as Record< diff --git a/apps/sim/lib/workflows/application/execute-manual-workflow.ts b/apps/sim/lib/workflows/application/execute-manual-workflow.ts index 2ba1c8e5afb..840e89d5108 100644 --- a/apps/sim/lib/workflows/application/execute-manual-workflow.ts +++ b/apps/sim/lib/workflows/application/execute-manual-workflow.ts @@ -90,10 +90,7 @@ export const executeManualWorkflowOperation = defineAuthorizedWorkflowUseCase({ ) } const state = await loadManualState(context.workflowId) - const options = resolveTriggerRunOptions( - mergeSubblockStateWithValues(state.blocks), - state.edges - ) + const options = resolveTriggerRunOptions(mergeSubblockStateWithValues(state.blocks)) if (options.length === 0) { throw new OrchestrationError( 'validation', diff --git a/apps/sim/lib/workflows/application/list-workflow-runs.test.ts b/apps/sim/lib/workflows/application/list-workflow-runs.test.ts index a73ccfa935d..4b13a0d9a6d 100644 --- a/apps/sim/lib/workflows/application/list-workflow-runs.test.ts +++ b/apps/sim/lib/workflows/application/list-workflow-runs.test.ts @@ -15,7 +15,7 @@ import { resetPermissionGroupScopeMock, } from '@sim/testing' import { createWorkspaceApiKeyPrincipal } from '@sim/testing/factories/principal.factory' -import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' +import { auditMock } from '@sim/testing/mocks/audit.mock' import { workflowContextMock, workflowContextMockFns, @@ -50,7 +50,6 @@ import { listWorkflowRuns } from '@/lib/workflows/application/list-workflow-runs const mockLoadWorkspace = workspaceContextMockFns.mockLoadActiveWorkspaceApplicationContext const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission -const mockRecordAudit = auditMockFns.mockRecordAudit const WORKSPACE_ID = 'workspace-1' const WORKFLOW_ID = 'workflow-1' diff --git a/apps/sim/lib/workflows/application/read-workflow-copilot-metadata.ts b/apps/sim/lib/workflows/application/read-workflow-copilot-metadata.ts index d6b7f83d323..73d17da88ff 100644 --- a/apps/sim/lib/workflows/application/read-workflow-copilot-metadata.ts +++ b/apps/sim/lib/workflows/application/read-workflow-copilot-metadata.ts @@ -25,7 +25,7 @@ export const readCopilotWorkflowRunOptions = defineAuthorizedWorkflowUseCase({ async execute({ context }) { const state = await loadDraftWorkflow(context.workflowId) const merged = mergeSubblockStateWithValues(state.blocks) - const options = resolveTriggerRunOptions(merged, state.edges) + const options = resolveTriggerRunOptions(merged) return { options: options.map((option) => toPublicRunOption(option)), } diff --git a/apps/sim/lib/workflows/application/read-workflow-graph.test.ts b/apps/sim/lib/workflows/application/read-workflow-graph.test.ts index 663e26079dd..7e64bfb1d24 100644 --- a/apps/sim/lib/workflows/application/read-workflow-graph.test.ts +++ b/apps/sim/lib/workflows/application/read-workflow-graph.test.ts @@ -1,5 +1,5 @@ import { createPersonalApiKeyPrincipal } from '@sim/testing/factories/principal.factory' -import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' +import { auditMock } from '@sim/testing/mocks/audit.mock' import { workflowContextMock, workflowContextMockFns, @@ -20,7 +20,6 @@ vi.mock('@/lib/workflows/queries', () => workflowsQueriesMock) import { readWorkflowGraph } from '@/lib/workflows/application/read-workflow-graph' -const mockRecordAudit = auditMockFns.mockRecordAudit const mockLoadSnapshot = workflowsQueriesMockFns.mockLoadWorkflowReadSnapshot const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission const mockResolveContext = workflowContextMockFns.mockResolveActiveWorkflowApplicationContext diff --git a/apps/sim/lib/workflows/application/read-workflow-run.test.ts b/apps/sim/lib/workflows/application/read-workflow-run.test.ts index d3a06936348..d61738db48e 100644 --- a/apps/sim/lib/workflows/application/read-workflow-run.test.ts +++ b/apps/sim/lib/workflows/application/read-workflow-run.test.ts @@ -2,7 +2,7 @@ import { createPersonalApiKeyPrincipal, createWorkspaceApiKeyPrincipal, } from '@sim/testing/factories/principal.factory' -import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' +import { auditMock } from '@sim/testing/mocks/audit.mock' import { workflowContextMock, workflowContextMockFns, @@ -31,7 +31,6 @@ vi.mock('@/lib/workflows/executor/execution-run-files', () => ({ import { readWorkflowRun } from '@/lib/workflows/application/read-workflow-run' -const mockRecordAudit = auditMockFns.mockRecordAudit const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission const mockResolveContext = workflowContextMockFns.mockResolveActiveWorkflowRunApplicationContext diff --git a/apps/sim/lib/workflows/application/run-workflow-from-copilot.ts b/apps/sim/lib/workflows/application/run-workflow-from-copilot.ts index acbec79fafa..97300d598ef 100644 --- a/apps/sim/lib/workflows/application/run-workflow-from-copilot.ts +++ b/apps/sim/lib/workflows/application/run-workflow-from-copilot.ts @@ -116,7 +116,7 @@ async function resolveTriggerExecution(params: { ) } const merged = mergeSubblockStateWithValues(state.blocks) - const options = resolveTriggerRunOptions(merged, state.edges) + const options = resolveTriggerRunOptions(merged) if (options.length === 0) { throw new OrchestrationError( 'validation', diff --git a/apps/sim/lib/workflows/application/workflow-crud.test.ts b/apps/sim/lib/workflows/application/workflow-crud.test.ts index 778cf00fed8..9fe47625166 100644 --- a/apps/sim/lib/workflows/application/workflow-crud.test.ts +++ b/apps/sim/lib/workflows/application/workflow-crud.test.ts @@ -4,7 +4,7 @@ import { } from '@sim/testing/factories/principal.factory' import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' import { folderQueriesMock, folderQueriesMockFns } from '@sim/testing/mocks/folder-queries.mock' -import { realtimeNotifyMock, realtimeNotifyMockFns } from '@sim/testing/mocks/realtime-notify.mock' +import { realtimeNotifyMock } from '@sim/testing/mocks/realtime-notify.mock' import { telemetryMock } from '@sim/testing/mocks/telemetry.mock' import { workflowContextMock, @@ -89,9 +89,6 @@ const mockResolveWorkspaceContext = workspaceContextMockFns.mockResolveActiveWorkspaceApplicationContext const mockResolveWorkflowContext = workflowContextMockFns.mockResolveActiveWorkflowApplicationContext -const mockNotifyWorkflowUpdated = realtimeNotifyMockFns.mockNotifyWorkflowUpdated -const mockNotifyWorkspaceWorkflowsChanged = - realtimeNotifyMockFns.mockNotifyWorkspaceWorkflowsChanged const WORKSPACE_ID = 'workspace-1' const WORKFLOW_ID = 'workflow-1' diff --git a/apps/sim/lib/workflows/application/workflow-custom-block-authoring.test.ts b/apps/sim/lib/workflows/application/workflow-custom-block-authoring.test.ts index 10103a5ace3..6b6be9f2201 100644 --- a/apps/sim/lib/workflows/application/workflow-custom-block-authoring.test.ts +++ b/apps/sim/lib/workflows/application/workflow-custom-block-authoring.test.ts @@ -1,6 +1,6 @@ import { workflowAuthzMockFns } from '@sim/testing' import { createSessionPrincipal } from '@sim/testing/factories/principal.factory' -import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' +import { auditMock } from '@sim/testing/mocks/audit.mock' import { blockVisibilityMock } from '@sim/testing/mocks/block-visibility.mock' import { customBlockOperationsMock, @@ -78,7 +78,6 @@ workflowDeploymentStatusMockFns.mockCheckNeedsRedeployment.mockResolvedValue(tru const mockLoadNormalized = workflowsPersistenceUtilsMockFns.mockLoadWorkflowFromNormalizedTables -const mockRecordAudit = auditMockFns.mockRecordAudit const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission const mockResolveContext = workflowContextMockFns.mockResolveActiveWorkflowApplicationContext diff --git a/apps/sim/lib/workflows/application/workflow-folders.test.ts b/apps/sim/lib/workflows/application/workflow-folders.test.ts index 8fccf2bbc71..a70564972c9 100644 --- a/apps/sim/lib/workflows/application/workflow-folders.test.ts +++ b/apps/sim/lib/workflows/application/workflow-folders.test.ts @@ -37,11 +37,8 @@ const mocks = { listRows: folderQueriesMockFns.mockListActiveFolderRows, } -const { - mockCreateFolderAtPathTransition, - mockDeleteFolderByPathTransition, - mockRelocateFolderByPathTransition, -} = foldersOrchestrationMockFns +const { mockCreateFolderAtPathTransition, mockDeleteFolderByPathTransition } = + foldersOrchestrationMockFns const mockResolveContext = workspaceContextMockFns.mockResolveActiveWorkspaceApplicationContext const mockResolvePermission = workspaceAuthzMockFns.mockResolveEffectiveWorkspacePermission diff --git a/apps/sim/lib/workflows/autolayout/types.ts b/apps/sim/lib/workflows/autolayout/types.ts index a2cb5953776..4906be255e3 100644 --- a/apps/sim/lib/workflows/autolayout/types.ts +++ b/apps/sim/lib/workflows/autolayout/types.ts @@ -49,11 +49,6 @@ export interface BoundingBox { height: number } -interface LayerInfo { - layer: number - order: number -} - export interface GraphNode { id: string block: BlockState @@ -63,8 +58,3 @@ export interface GraphNode { layer: number position: Position } - -interface AdjustmentOptions extends LayoutOptions { - preservePositions?: boolean - minimalShift?: boolean -} diff --git a/apps/sim/lib/workflows/blocks/fallback-models.test.ts b/apps/sim/lib/workflows/blocks/fallback-models.test.ts index 4c6c1982f52..b3e7f880127 100644 --- a/apps/sim/lib/workflows/blocks/fallback-models.test.ts +++ b/apps/sim/lib/workflows/blocks/fallback-models.test.ts @@ -5,8 +5,10 @@ import { import { beforeEach, describe, expect, it, vi } from 'vitest' const { mockShouldRequireApiKey, mockRequiresFamilyCredentials } = vi.hoisted(() => ({ - mockShouldRequireApiKey: vi.fn((model: string) => false), - mockRequiresFamilyCredentials: vi.fn((provider: string | null | undefined) => false), + mockShouldRequireApiKey: vi.fn<(model: string) => boolean>(() => false), + mockRequiresFamilyCredentials: vi.fn<(provider: string | null | undefined) => boolean>( + () => false + ), })) vi.mock('@/blocks/utils', () => ({ diff --git a/apps/sim/lib/workflows/custom-blocks/operations.test.ts b/apps/sim/lib/workflows/custom-blocks/operations.test.ts index 8dd16672baa..0da915faeb2 100644 --- a/apps/sim/lib/workflows/custom-blocks/operations.test.ts +++ b/apps/sim/lib/workflows/custom-blocks/operations.test.ts @@ -1,8 +1,5 @@ import { queueTableRows, resetDbChainMock, schemaMock } from '@sim/testing' -import { - billingSubscriptionMock, - billingSubscriptionMockFns, -} from '@sim/testing/mocks/billing-subscription.mock' +import { billingSubscriptionMock } from '@sim/testing/mocks/billing-subscription.mock' import { permissionsMock } from '@sim/testing/mocks/permissions.mock' import { workflowsPersistenceUtilsMock, @@ -30,8 +27,6 @@ import { publishCustomBlock, } from '@/lib/workflows/custom-blocks/operations' -const mockIsOrganizationFeatureEntitled = - billingSubscriptionMockFns.mockIsOrganizationFeatureEntitled const mockLoadDeployedWorkflowState = workflowsPersistenceUtilsMockFns.mockLoadDeployedWorkflowState const publishParams = { diff --git a/apps/sim/lib/workflows/executor/execute-service.ts b/apps/sim/lib/workflows/executor/execute-service.ts index 5f6d7363863..d76c07f6595 100644 --- a/apps/sim/lib/workflows/executor/execute-service.ts +++ b/apps/sim/lib/workflows/executor/execute-service.ts @@ -718,7 +718,7 @@ export async function executeWorkflowService( timeoutController.isTimedOut() && timeoutController.timeoutMs ) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) reqLogger.info('Execution timed out', { timeoutMs: timeoutController.timeoutMs }) await loggingSession.markAsFailed(timeoutErrorMessage) const compactTimeoutOutput = await compactServiceOutput(result.output, compactionContext) diff --git a/apps/sim/lib/workflows/executor/execute-workflow.test.ts b/apps/sim/lib/workflows/executor/execute-workflow.test.ts index 7db940d3324..91b8b469382 100644 --- a/apps/sim/lib/workflows/executor/execute-workflow.test.ts +++ b/apps/sim/lib/workflows/executor/execute-workflow.test.ts @@ -1,7 +1,6 @@ import { createSessionPrincipal } from '@sim/testing/factories/principal.factory' import { encryptionMock, encryptionMockFns } from '@sim/testing/mocks/encryption.mock' import { idMock, idMockFns } from '@sim/testing/mocks/id.mock' -import { getMockLogger } from '@sim/testing/mocks/logger.mock' import { loggingSessionMock, loggingSessionMockFns } from '@sim/testing/mocks/logging-session.mock' import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { tableEventsMock } from '@sim/testing/mocks/table-events.mock' @@ -46,8 +45,6 @@ encryptionMockFns.mockDecryptSecret.mockImplementation(async (value: string) => return { decrypted: 'secret-value' } }) -const workflowExecutionLogger = getMockLogger('WorkflowExecution') - const billingAttribution: BillingAttributionSnapshot = { actorUserId: 'actor-1', workspaceId: 'workspace-1', diff --git a/apps/sim/lib/workflows/executor/execution-core.ts b/apps/sim/lib/workflows/executor/execution-core.ts index 37d9759f793..0f994a481f6 100644 --- a/apps/sim/lib/workflows/executor/execution-core.ts +++ b/apps/sim/lib/workflows/executor/execution-core.ts @@ -356,7 +356,7 @@ async function finalizeExecutionOutcome(params: { await loggingSession.safeCompleteWithError({ endedAt, totalDurationMs: totalDuration || 0, - error: { message: getTimeoutErrorMessage(null) }, + error: { message: getTimeoutErrorMessage() }, traceSpans: traceSpans || [], executionState: result.executionState, }) diff --git a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.ts b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.ts index b5b182b2ef4..526902b3882 100644 --- a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.ts +++ b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.test.ts @@ -14,10 +14,7 @@ import { executionPreprocessingMock, executionPreprocessingMockFns, } from '@sim/testing/mocks/execution-preprocessing.mock' -import { - largeValueMetadataMock, - largeValueMetadataMockFns, -} from '@sim/testing/mocks/large-value-metadata.mock' +import { largeValueMetadataMock } from '@sim/testing/mocks/large-value-metadata.mock' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { createTimeoutAbortController, getExecutionDeadlineAt } from '@/lib/core/execution-limits' import { abortManualExecution } from '@/lib/execution/manual-cancellation' @@ -74,7 +71,6 @@ import type { PausePoint, SerializedSnapshot } from '@/executor/types' const { mockPreprocessExecution } = executionPreprocessingMockFns const { mockReleaseExecutionSlot } = billingUsageReservationMockFns -const { mockReplaceLargeValueReferenceKeysWithClient } = largeValueMetadataMockFns const humanInTheLoopLoggerCallIndex = loggerMock.createLogger.mock.calls.findIndex( ([name]) => name === 'HumanInTheLoopManager' diff --git a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts index 82f64214ac3..ec9c0bd60c7 100644 --- a/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts +++ b/apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts @@ -1918,7 +1918,7 @@ export class PauseResumeManager { timeoutController.isTimedOut() && timeoutController.timeoutMs ) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) logger.info('Resume execution timed out', { resumeExecutionId, timeoutMs: timeoutController.timeoutMs, diff --git a/apps/sim/lib/workflows/operations/import-export.ts b/apps/sim/lib/workflows/operations/import-export.ts index 13b658cca63..d0e03d317de 100644 --- a/apps/sim/lib/workflows/operations/import-export.ts +++ b/apps/sim/lib/workflows/operations/import-export.ts @@ -63,15 +63,6 @@ export interface FolderExportData { sortOrder?: number } -interface WorkspaceExportStructure { - workspace: { - name: string - exportedAt: string - } - workflows: WorkflowExportData[] - folders: FolderExportData[] -} - /** * Sanitizes a string for use as a path segment in a ZIP file. */ diff --git a/apps/sim/lib/workflows/orchestration/deploy.test.ts b/apps/sim/lib/workflows/orchestration/deploy.test.ts index 2bfdda71ed0..1f5bba01a72 100644 --- a/apps/sim/lib/workflows/orchestration/deploy.test.ts +++ b/apps/sim/lib/workflows/orchestration/deploy.test.ts @@ -7,7 +7,7 @@ import { workflowAuthzMockFns, } from '@sim/testing' import { auditMock, auditMockFns } from '@sim/testing/mocks/audit.mock' -import { posthogServerMock, posthogServerMockFns } from '@sim/testing/mocks/posthog-server.mock' +import { posthogServerMock } from '@sim/testing/mocks/posthog-server.mock' import { workflowsPersistenceUtilsMock, workflowsPersistenceUtilsMockFns, @@ -88,7 +88,6 @@ import { const mockRecordAudit = auditMockFns.mockRecordAudit -const mockCaptureServerEvent = posthogServerMockFns.mockCaptureServerEvent const mockLoadWorkflowDeploymentSnapshot = workflowsPersistenceUtilsMockFns.mockLoadWorkflowDeploymentSnapshot const mockSaveWorkflowToNormalizedTables = diff --git a/apps/sim/lib/workflows/sanitization/json-sanitizer.ts b/apps/sim/lib/workflows/sanitization/json-sanitizer.ts index 3025cf9f878..44c71007b86 100644 --- a/apps/sim/lib/workflows/sanitization/json-sanitizer.ts +++ b/apps/sim/lib/workflows/sanitization/json-sanitizer.ts @@ -45,17 +45,6 @@ interface CopilotBlockState { triggerMode?: boolean } -/** - * Edge state for copilot (only semantic connection data) - */ -interface CopilotEdge { - id: string - source: string - target: string - sourceHandle?: string - targetHandle?: string -} - /** * Export workflow state (includes positions but removes secrets) */ diff --git a/apps/sim/lib/workflows/schedules/utils.ts b/apps/sim/lib/workflows/schedules/utils.ts index 11791e90e8f..4e33965648a 100644 --- a/apps/sim/lib/workflows/schedules/utils.ts +++ b/apps/sim/lib/workflows/schedules/utils.ts @@ -50,9 +50,6 @@ export function validateCronExpression( } } -/** Upper bound on how many excluded occurrences the next-run search skips before giving up. */ -const MAX_OCCURRENCE_SKIP = 1000 - interface SubBlockValue { value: string } @@ -475,15 +472,4 @@ export const parseCronToHumanReadable = (cronExpression: string, timezone?: stri } } -const REVERSE_DAY_MAP: Record = { - 0: 'SUN', - 1: 'MON', - 2: 'TUE', - 3: 'WED', - 4: 'THU', - 5: 'FRI', - 6: 'SAT', - 7: 'SUN', -} - export type ScheduleType = 'minutes' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'custom' diff --git a/apps/sim/lib/workflows/search-replace/replacements.ts b/apps/sim/lib/workflows/search-replace/replacements.ts index 1256af519a2..e79e02eab88 100644 --- a/apps/sim/lib/workflows/search-replace/replacements.ts +++ b/apps/sim/lib/workflows/search-replace/replacements.ts @@ -200,7 +200,6 @@ export function buildWorkflowSearchReplacePlan({ replacement ) const parsedReplacement = parseWorkflowSearchSubflowReplacement({ - blockType: block.type, fieldId: match.target.fieldId, replacement: nextTextValue, }) diff --git a/apps/sim/lib/workflows/search-replace/subflow-fields.ts b/apps/sim/lib/workflows/search-replace/subflow-fields.ts index 6f46d9039e8..626c83adc55 100644 --- a/apps/sim/lib/workflows/search-replace/subflow-fields.ts +++ b/apps/sim/lib/workflows/search-replace/subflow-fields.ts @@ -146,11 +146,9 @@ export function workflowSearchSubflowFieldMatchesExpected( } export function parseWorkflowSearchSubflowReplacement({ - blockType, fieldId, replacement, }: { - blockType: 'loop' | 'parallel' fieldId: WorkflowSearchSubflowFieldId replacement: string }): diff --git a/apps/sim/lib/workflows/streaming/streaming.ts b/apps/sim/lib/workflows/streaming/streaming.ts index 82d32f99195..a739dbc09a0 100644 --- a/apps/sim/lib/workflows/streaming/streaming.ts +++ b/apps/sim/lib/workflows/streaming/streaming.ts @@ -900,7 +900,7 @@ export async function createStreamingResponse( timeoutController.timeoutMs && !requestAborted ) { - const timeoutErrorMessage = getTimeoutErrorMessage(null, timeoutController.timeoutMs) + const timeoutErrorMessage = getTimeoutErrorMessage(timeoutController.timeoutMs) logger.info(`[${requestId}] Streaming execution timed out`, { timeoutMs: timeoutController.timeoutMs, }) diff --git a/apps/sim/lib/workflows/triggers/run-options.ts b/apps/sim/lib/workflows/triggers/run-options.ts index ef2ffc713be..ccba0ec5d9b 100644 --- a/apps/sim/lib/workflows/triggers/run-options.ts +++ b/apps/sim/lib/workflows/triggers/run-options.ts @@ -284,8 +284,7 @@ function buildTriggerRunOption( * guaranteeing describe == enforce. */ export function resolveTriggerRunOptions( - blocks: Record, - edges?: Array<{ source: string; target: string }> + blocks: Record ): TriggerRunOption[] { const manual = resolveStartCandidates(blocks, { execution: 'manual' }) const chat = resolveStartCandidates(blocks, { execution: 'chat' }) @@ -302,7 +301,7 @@ export function resolveTriggerRunOptions( return [] } - // Single overall default (no edges => one best); ties broken by trigger priority. + // Single overall default; ties broken by trigger priority. const defaultBlockId = selectBestTrigger(candidates)[0]?.blockId return candidates.map((candidate) => diff --git a/apps/sim/lib/workspace-files/application/delete-workspace-file.ts b/apps/sim/lib/workspace-files/application/delete-workspace-file.ts index 1e29b040c83..4ff30446cb3 100644 --- a/apps/sim/lib/workspace-files/application/delete-workspace-file.ts +++ b/apps/sim/lib/workspace-files/application/delete-workspace-file.ts @@ -24,7 +24,6 @@ export interface DeleteWorkspaceFileResult { } async function executeDeleteWorkspaceFile({ - principal, context, }: AuthorizedWorkspaceUseCaseContext< typeof fileOperations.delete, diff --git a/apps/sim/lib/workspace-files/application/extract-workspace-file.test.ts b/apps/sim/lib/workspace-files/application/extract-workspace-file.test.ts index 4eb4170a4fb..121d8e5b3a2 100644 --- a/apps/sim/lib/workspace-files/application/extract-workspace-file.test.ts +++ b/apps/sim/lib/workspace-files/application/extract-workspace-file.test.ts @@ -297,14 +297,6 @@ describe('extractWorkspaceFile', () => { expect(mocks.notify).toHaveBeenCalledWith('workspace-1') }) - /** Fires the deadline the way `AbortSignal.timeout` does: `reason` is what gets thrown. */ - function expireDeadline(signal: AbortSignal): unknown { - const reason = new DOMException('The operation was aborted due to timeout', 'TimeoutError') - Object.defineProperty(signal, 'aborted', { value: true }) - Object.defineProperty(signal, 'reason', { value: reason }) - return reason - } - it('leaves a destination folder that gained collaborators content during rollback', async () => { mocks.decompress.mockImplementationOnce(async (_content, options) => { await options.prepareRootFolder() diff --git a/apps/sim/lib/workspace-files/orchestration/content.ts b/apps/sim/lib/workspace-files/orchestration/content.ts index bde261f5a15..9ba88376899 100644 --- a/apps/sim/lib/workspace-files/orchestration/content.ts +++ b/apps/sim/lib/workspace-files/orchestration/content.ts @@ -1,7 +1,3 @@ -import { createLogger } from '@sim/logger' - -const logger = createLogger('WorkspaceFileContentOrchestration') - /** Ceiling on a single content replace, independent of the workspace quota. */ export const MAX_WORKSPACE_FILE_CONTENT_BYTES = 50 * 1024 * 1024 diff --git a/apps/sim/lib/workspaces/organization-workspaces.test.ts b/apps/sim/lib/workspaces/organization-workspaces.test.ts index 2b0b76ea390..eb919215c51 100644 --- a/apps/sim/lib/workspaces/organization-workspaces.test.ts +++ b/apps/sim/lib/workspaces/organization-workspaces.test.ts @@ -7,7 +7,7 @@ import { organizationMembershipMock, organizationMembershipMockFns, } from '@sim/testing/mocks/organization-membership.mock' -import { tableBillingMock, tableBillingMockFns } from '@sim/testing/mocks/table-billing.mock' +import { tableBillingMock } from '@sim/testing/mocks/table-billing.mock' import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest' const { mockAcquireInvitationMutationLocks, mockChangeWorkspaceStoragePayersInTx } = vi.hoisted( @@ -47,7 +47,6 @@ const { mockAcquireOrganizationMutationLock, } = organizationMembershipMockFns const { mockSyncUsageLimitsFromSubscription } = billingUsageMockFns -const { mockInvalidateWorkspaceTableLimitsCache } = tableBillingMockFns idMockFns.mockGenerateId.mockReturnValue('generated-id') idMockFns.mockGenerateShortId.mockReturnValue('short-id') diff --git a/apps/sim/providers/anthropic/core.ts b/apps/sim/providers/anthropic/core.ts index 163e35be17b..17fb4a64cb6 100644 --- a/apps/sim/providers/anthropic/core.ts +++ b/apps/sim/providers/anthropic/core.ts @@ -779,16 +779,8 @@ export async function executeAnthropicProviderRequest( const toolResultBlocks: Anthropic.Messages.ToolResultBlockParam[] = [] for (const executionResult of executionResults) { - const { - toolUseId, - toolName, - toolArgs, - toolParams, - result, - startTime, - endTime, - duration, - } = executionResult + const { toolUseId, toolName, toolParams, result, startTime, endTime, duration } = + executionResult const modelResult = 'modelResult' in executionResult && executionResult.modelResult ? executionResult.modelResult diff --git a/apps/sim/providers/anthropic/streaming-tool-loop.ts b/apps/sim/providers/anthropic/streaming-tool-loop.ts index c67f53d8cc8..40e5f162ccd 100644 --- a/apps/sim/providers/anthropic/streaming-tool-loop.ts +++ b/apps/sim/providers/anthropic/streaming-tool-loop.ts @@ -480,16 +480,7 @@ export function createAnthropicStreamingToolLoopStream( const toolResultBlocks: Anthropic.Messages.ToolResultBlockParam[] = [] for (const value of orderedResults) { - const { - toolUse, - toolName, - toolArgs, - toolParams, - result, - startTime, - endTime, - duration, - } = value + const { toolUse, toolName, toolParams, result, startTime, endTime, duration } = value const modelResult = 'modelResult' in value ? value.modelResult : result timeSegments.push({ diff --git a/apps/sim/providers/bedrock/index.ts b/apps/sim/providers/bedrock/index.ts index 46e4cf2fe0d..88685eb3a59 100644 --- a/apps/sim/providers/bedrock/index.ts +++ b/apps/sim/providers/bedrock/index.ts @@ -740,16 +740,8 @@ export const bedrockProvider: ProviderConfig = { const toolResultContent: ContentBlock[] = [] for (const executionResult of executionResults) { - const { - toolUseId, - toolName, - toolArgs, - toolParams, - result, - startTime, - endTime, - duration, - } = executionResult + const { toolUseId, toolName, toolParams, result, startTime, endTime, duration } = + executionResult const modelResult = 'modelResult' in executionResult && executionResult.modelResult ? executionResult.modelResult diff --git a/apps/sim/providers/file-attachments.server.ts b/apps/sim/providers/file-attachments.server.ts index 6fad9893e81..5475c2ee3df 100644 --- a/apps/sim/providers/file-attachments.server.ts +++ b/apps/sim/providers/file-attachments.server.ts @@ -116,7 +116,7 @@ export async function attachLargeFileRemoteUrls( ) } context = resolveTrustedFileContext(file.key, file.context) - const hasAccess = await verifyFileAccess(file.key, request.userId, undefined, context, false) + const hasAccess = await verifyFileAccess(file.key, request.userId, undefined, context) if (!hasAccess) { throw new Error(`File "${file.name}" is not accessible for provider "${providerId}"`) } @@ -188,7 +188,7 @@ async function assertFileAccessForUpload( throw new Error(`File "${file.name}" requires an authenticated user to upload`) } const context = resolveTrustedFileContext(file.key, file.context) - const hasAccess = await verifyFileAccess(file.key, userId, undefined, context, false) + const hasAccess = await verifyFileAccess(file.key, userId, undefined, context) if (!hasAccess) { throw new Error(`File "${file.name}" is not accessible`) } diff --git a/apps/sim/providers/gemini/core.test.ts b/apps/sim/providers/gemini/core.test.ts index 1dbfde9461c..9e0ce6a8d77 100644 --- a/apps/sim/providers/gemini/core.test.ts +++ b/apps/sim/providers/gemini/core.test.ts @@ -17,7 +17,6 @@ import { calculateCost } from '@/providers/utils' providersMock.MAX_TOOL_ITERATIONS = 5 const mockCapture = providersConversationHistoryMockFns.mockCaptureProviderConversationStep -const mockRecordError = providersConversationHistoryMockFns.mockRecordProviderConversationToolError const mockExecuteTool = toolsMockFns.mockExecuteTool diff --git a/apps/sim/providers/gemini/streaming-tool-loop.test.ts b/apps/sim/providers/gemini/streaming-tool-loop.test.ts index 7e058aeef3f..d72cd4438aa 100644 --- a/apps/sim/providers/gemini/streaming-tool-loop.test.ts +++ b/apps/sim/providers/gemini/streaming-tool-loop.test.ts @@ -10,7 +10,6 @@ import { createGeminiStreamingToolLoopStream } from '@/providers/gemini/streamin import { resetLocalToolIdCounterForTests } from '@/providers/tool-call-id' const mockCapture = providersConversationHistoryMockFns.mockCaptureProviderConversationStep -const mockRecordError = providersConversationHistoryMockFns.mockRecordProviderConversationToolError const mockExecuteTool = toolsMockFns.mockExecuteTool providersUtilsMockFns.mockPrepareToolExecution.mockReturnValue({ diff --git a/apps/sim/providers/gemini/types.ts b/apps/sim/providers/gemini/types.ts index b605e835a78..d73d6b550ea 100644 --- a/apps/sim/providers/gemini/types.ts +++ b/apps/sim/providers/gemini/types.ts @@ -16,14 +16,6 @@ export interface GeminiUsage { totalTokenCount: number } -/** - * Parsed function call from Gemini response - */ -interface ParsedFunctionCall { - name: string - args: Record -} - /** * Accumulated state during tool execution loop */ @@ -42,29 +34,6 @@ export interface ExecutionState { currentToolConfig: ToolConfig | undefined } -/** - * Result from forced tool usage check - */ -interface ForcedToolResult { - hasUsedForcedTool: boolean - usedForcedTools: string[] - nextToolConfig: ToolConfig | undefined -} - -/** - * Configuration for creating a Gemini client - */ -interface GeminiClientConfig { - /** For Google Gemini API */ - apiKey?: string - /** For Vertex AI */ - vertexai?: boolean - project?: string - location?: string - /** OAuth access token for Vertex AI */ - accessToken?: string -} - /** * Provider type for logging and model lookup */ diff --git a/apps/sim/providers/groq/index.test.ts b/apps/sim/providers/groq/index.test.ts index 8a6c7ae1a35..62888d871c3 100644 --- a/apps/sim/providers/groq/index.test.ts +++ b/apps/sim/providers/groq/index.test.ts @@ -93,7 +93,7 @@ describe('groqProvider reasoning payload', () => { })) mockExecuteTool.mockResolvedValue({ success: true, output: {} }) let generated = 0 - mockCreate.mockImplementation((payload) => { + mockCreate.mockImplementation(() => { const final = false return Promise.resolve({ choices: [ diff --git a/apps/sim/providers/models.test.ts b/apps/sim/providers/models.test.ts index 5cfa99d5d5d..07bfa2118aa 100644 --- a/apps/sim/providers/models.test.ts +++ b/apps/sim/providers/models.test.ts @@ -225,8 +225,6 @@ describe('orderModelIdsByReleaseDate', () => { }) describe('sakana provider definition', () => { - const sakana = PROVIDER_DEFINITIONS.sakana - it('routes bare fugu model IDs to the sakana provider', () => { const baseModels = getBaseModelProviders() expect(baseModels.fugu).toBe('sakana') @@ -237,8 +235,6 @@ describe('sakana provider definition', () => { }) describe('nvidia provider definition', () => { - const nvidia = PROVIDER_DEFINITIONS.nvidia - const expectedModels = [ { id: 'nvidia/nemotron-3.5-lightning-30b-a3b', contextWindow: 1000000 }, { id: 'nvidia/llama-3.1-nemotron-70b-instruct', contextWindow: 128000 }, @@ -258,8 +254,6 @@ describe('nvidia provider definition', () => { }) describe('zai provider definition', () => { - const zai = PROVIDER_DEFINITIONS.zai - const expectedModels = [ { id: 'glm-5.3', contextWindow: 1000000 }, { id: 'glm-5.3-flash', contextWindow: 1000000 }, @@ -286,8 +280,6 @@ describe('zai provider definition', () => { }) describe('kimi provider definition', () => { - const kimi = PROVIDER_DEFINITIONS.kimi - const expectedModels = [ { id: 'kimi-k3', contextWindow: 1048576 }, { id: 'kimi-k2.7-code', contextWindow: 262144 }, diff --git a/apps/sim/providers/openai-compat/streaming-tool-loop.test.ts b/apps/sim/providers/openai-compat/streaming-tool-loop.test.ts index 8f7eb1ad4b1..510cdef184b 100644 --- a/apps/sim/providers/openai-compat/streaming-tool-loop.test.ts +++ b/apps/sim/providers/openai-compat/streaming-tool-loop.test.ts @@ -20,7 +20,6 @@ import type { ProviderToolConfig, TimeSegment } from '@/providers/types' providersMock.MAX_TOOL_ITERATIONS = 5 const mockCapture = providersConversationHistoryMockFns.mockCaptureProviderConversationStep -const mockRecordError = providersConversationHistoryMockFns.mockRecordProviderConversationToolError const mockPrepareToolExecution = providersUtilsMockFns.mockPrepareToolExecution const mockExecuteTool = toolsMockFns.mockExecuteTool @@ -53,7 +52,7 @@ vi.mock('@/providers/utils', () => providersUtilsMock) vi.mock('@/providers', () => providersMock) -function toolThenAnswerChunks(toolName: string, args: string, answer: string) { +function toolThenAnswerChunks(toolName: string, args: string) { return [ { choices: [ @@ -133,7 +132,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{}', '') + yield* toolThenAnswerChunks('lookup', '{}') })() } return (async function* () { @@ -332,7 +331,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{}', '') + yield* toolThenAnswerChunks('lookup', '{}') })() } return (async function* () { @@ -379,7 +378,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{}', '') + yield* toolThenAnswerChunks('lookup', '{}') })() } return (async function* () { @@ -436,7 +435,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{"query": "unterminated', '') + yield* toolThenAnswerChunks('lookup', '{"query": "unterminated') })() } return (async function* () { @@ -485,7 +484,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', argumentsJson, '') + yield* toolThenAnswerChunks('lookup', argumentsJson) })() } return (async function* () { @@ -522,7 +521,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { it('fails an unexpected tool AbortError and reports completed usage', async () => { const createStream = vi.fn(async () => { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{}', '') + yield* toolThenAnswerChunks('lookup', '{}') })() }) mockExecuteTool.mockRejectedValueOnce(new DOMException('cancelled', 'AbortError')) @@ -562,7 +561,7 @@ describe('createOpenAICompatStreamingToolLoopStream', () => { call += 1 if (call === 1) { return (async function* () { - yield* toolThenAnswerChunks('lookup', '{}', '') + yield* toolThenAnswerChunks('lookup', '{}') })() } return (async function* () { diff --git a/apps/sim/providers/types.ts b/apps/sim/providers/types.ts index d602c275649..9884dcbe8ea 100644 --- a/apps/sim/providers/types.ts +++ b/apps/sim/providers/types.ts @@ -50,17 +50,6 @@ export interface ModelPricing extends ModelTokenPricing { export type ModelPricingMap = Record -interface TokenInfo { - input?: number - output?: number - total?: number -} - -interface TransformedResponse { - content: string - tokens?: TokenInfo -} - export interface ProviderConfig { id: string name: string diff --git a/apps/sim/scripts/backfill-table-workflow-deployments.test.ts b/apps/sim/scripts/backfill-table-workflow-deployments.test.ts index 155153a6795..54545d3f8c3 100644 --- a/apps/sim/scripts/backfill-table-workflow-deployments.test.ts +++ b/apps/sim/scripts/backfill-table-workflow-deployments.test.ts @@ -28,10 +28,6 @@ const ORIGINAL_ENV = { SIM_ENV_SECRET_ID: process.env.SIM_ENV_SECRET_ID, } -interface MockSqlQuery { - toSQL(): { sql: string } -} - function restoreEnvironmentVariable(key: keyof typeof ORIGINAL_ENV): void { const value = ORIGINAL_ENV[key] if (value === undefined) { diff --git a/apps/sim/scripts/export-workflow.ts b/apps/sim/scripts/export-workflow.ts index 8cdcb4416d9..02877bea925 100755 --- a/apps/sim/scripts/export-workflow.ts +++ b/apps/sim/scripts/export-workflow.ts @@ -14,11 +14,6 @@ */ // Suppress console logs from imported modules - only JSON should go to stdout -const originalConsole = { - log: console.log, - warn: console.warn, - error: console.error, -} console.log = () => {} console.warn = () => {} console.error = () => {} diff --git a/apps/sim/serializer/index.ts b/apps/sim/serializer/index.ts index c9c330361bc..ef578463e6a 100644 --- a/apps/sim/serializer/index.ts +++ b/apps/sim/serializer/index.ts @@ -173,10 +173,6 @@ export class Serializer { const safeLoops = Object.keys(canonicalLoops).length > 0 ? canonicalLoops : loops || {} const safeParallels = Object.keys(canonicalParallels).length > 0 ? canonicalParallels : parallels || {} - if (validateRequired) { - this.validateSubflowsBeforeExecution(blocks, safeLoops, safeParallels) - } - // A custom block whose definition was deleted (or is out of scope) no longer // resolves via `getBlock`. Treat it as a removed block — drop it and any edges // touching it — so the rest of the workflow still serializes and runs, instead @@ -212,18 +208,6 @@ export class Serializer { } } - /** - * Validate loop and parallel subflows for required inputs when running in "each/collection" modes - */ - private validateSubflowsBeforeExecution( - blocks: Record, - loops: Record, - parallels: Record - ): void { - // Note: Empty collections in forEach loops and parallel collection mode are handled gracefully - // at runtime - the loop/parallel will simply be skipped. No build-time validation needed. - } - private serializeBlock( block: BlockState, options: { diff --git a/apps/sim/stores/constants.ts b/apps/sim/stores/constants.ts index 99de17d001f..83694a563b8 100644 --- a/apps/sim/stores/constants.ts +++ b/apps/sim/stores/constants.ts @@ -1,12 +1,3 @@ -const API_ENDPOINTS = { - ENVIRONMENT: '/api/environment', - SETTINGS: '/api/users/me/settings', - WORKFLOWS: '/api/workflows', - WORKSPACE_PERMISSIONS: (id: string) => `/api/workspaces/${id}/permissions`, - WORKSPACE_ENVIRONMENT: (id: string) => `/api/workspaces/${id}/environment`, - WORKSPACE_BYOK_KEYS: (id: string) => `/api/workspaces/${id}/byok-keys`, -} - /** * Layout dimension constants. * diff --git a/apps/sim/stores/folders/store.ts b/apps/sim/stores/folders/store.ts index 90506e37cf5..f3d4b4c8ac9 100644 --- a/apps/sim/stores/folders/store.ts +++ b/apps/sim/stores/folders/store.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import { create } from 'zustand' import { devtools } from 'zustand/middleware' -const logger = createLogger('FoldersStore') - interface FolderState { expandedFolders: Set selectedWorkflows: Set diff --git a/apps/sim/stores/operation-queue/store.ts b/apps/sim/stores/operation-queue/store.ts index 502435e1581..72f18edd77d 100644 --- a/apps/sim/stores/operation-queue/store.ts +++ b/apps/sim/stores/operation-queue/store.ts @@ -250,7 +250,6 @@ export const useOperationQueueStore = create((set, get) => confirmOperation: (operationId) => { const state = get() - const operation = state.operations.find((op) => op.id === operationId) const newOperations = state.operations.filter((op) => op.id !== operationId) const retryTimeout = retryTimeouts.get(operationId) diff --git a/apps/sim/stores/terminal/console/store.ts b/apps/sim/stores/terminal/console/store.ts index 2bb1713c2a2..448f0a747ab 100644 --- a/apps/sim/stores/terminal/console/store.ts +++ b/apps/sim/stores/terminal/console/store.ts @@ -161,7 +161,6 @@ function cloneWorkflowEntries( } function removeWorkflowIndexes( - workflowId: string, entries: ConsoleEntry[], entryIdsByBlockExecution: Record, entryLocationById: Record @@ -222,7 +221,7 @@ function replaceWorkflowEntries( const entryLocationById = { ...state.entryLocationById } const previousEntries = workflowEntries[workflowId] ?? EMPTY_CONSOLE_ENTRIES - removeWorkflowIndexes(workflowId, previousEntries, entryIdsByBlockExecution, entryLocationById) + removeWorkflowIndexes(previousEntries, entryIdsByBlockExecution, entryLocationById) if (nextEntries.length === 0) { delete workflowEntries[workflowId] @@ -250,7 +249,7 @@ function appendWorkflowEntry( const survivingIds = new Set(trimmedEntries.map((e) => e.id)) const droppedEntries = previousEntries.filter((e) => !survivingIds.has(e.id)) if (droppedEntries.length > 0) { - removeWorkflowIndexes(workflowId, droppedEntries, entryIdsByBlockExecution, entryLocationById) + removeWorkflowIndexes(droppedEntries, entryIdsByBlockExecution, entryLocationById) } trimmedEntries.forEach((entry, index) => { diff --git a/apps/sim/tools/apify/run_actor_async.ts b/apps/sim/tools/apify/run_actor_async.ts index bfd78999919..cc827516298 100644 --- a/apps/sim/tools/apify/run_actor_async.ts +++ b/apps/sim/tools/apify/run_actor_async.ts @@ -101,7 +101,7 @@ export const apifyRunActorAsyncTool: ToolConfig if (params.input) { try { inputData = JSON.parse(params.input) - } catch (e) { + } catch { throw new Error('Invalid JSON in input parameter') } } diff --git a/apps/sim/tools/apify/run_actor_sync.ts b/apps/sim/tools/apify/run_actor_sync.ts index c57f728b1db..2deaa13dd84 100644 --- a/apps/sim/tools/apify/run_actor_sync.ts +++ b/apps/sim/tools/apify/run_actor_sync.ts @@ -79,7 +79,7 @@ export const apifyRunActorSyncTool: ToolConfig = if (params.input) { try { inputData = JSON.parse(params.input) - } catch (e) { + } catch { throw new Error('Invalid JSON in input parameter') } } diff --git a/apps/sim/tools/asana/types.ts b/apps/sim/tools/asana/types.ts index dfa688c7570..5bf7d09e1c6 100644 --- a/apps/sim/tools/asana/types.ts +++ b/apps/sim/tools/asana/types.ts @@ -155,33 +155,6 @@ export interface AsanaSearchTasksResponse extends ToolResponse { } } -interface AsanaTask { - gid: string - resource_type: string - resource_subtype: string - name: string - notes?: string - completed: boolean - assignee?: { - gid: string - name: string - } - created_by?: { - gid: string - resource_type: string - name: string - } - due_on?: string - created_at: string - modified_at: string -} - -interface AsanaProject { - gid: string - name: string - resource_type: string -} - export interface AsanaAddCommentParams { accessToken: string taskGid: string diff --git a/apps/sim/tools/confluence/types.ts b/apps/sim/tools/confluence/types.ts index 20d89f93a88..416d4bd258d 100644 --- a/apps/sim/tools/confluence/types.ts +++ b/apps/sim/tools/confluence/types.ts @@ -430,14 +430,6 @@ export interface ConfluenceRetrieveResponse extends ToolResponse { } } -interface ConfluencePage { - id: string - title: string - spaceKey?: string - url?: string - lastModified?: string -} - export interface ConfluenceUpdateParams { accessToken: string domain: string @@ -456,16 +448,6 @@ export interface ConfluenceUpdateResponse extends ToolResponse { } } -interface ConfluenceCreatePageParams { - accessToken: string - domain: string - spaceId: string - title: string - content: string - parentId?: string - cloudId?: string -} - interface ConfluenceCreatePageResponse extends ToolResponse { output: { ts: string @@ -475,13 +457,6 @@ interface ConfluenceCreatePageResponse extends ToolResponse { } } -interface ConfluenceDeletePageParams { - accessToken: string - domain: string - pageId: string - cloudId?: string -} - interface ConfluenceDeletePageResponse extends ToolResponse { output: { ts: string @@ -490,14 +465,6 @@ interface ConfluenceDeletePageResponse extends ToolResponse { } } -interface ConfluenceSearchParams { - accessToken: string - domain: string - query: string - limit?: number - cloudId?: string -} - interface ConfluenceSearchResponse extends ToolResponse { output: { ts: string @@ -511,14 +478,6 @@ interface ConfluenceSearchResponse extends ToolResponse { } } -interface ConfluenceCommentParams { - accessToken: string - domain: string - pageId: string - comment: string - cloudId?: string -} - interface ConfluenceCommentResponse extends ToolResponse { output: { ts: string @@ -527,15 +486,6 @@ interface ConfluenceCommentResponse extends ToolResponse { } } -interface ConfluenceAttachmentParams { - accessToken: string - domain: string - pageId?: string - attachmentId?: string - limit?: number - cloudId?: string -} - interface ConfluenceAttachmentResponse extends ToolResponse { output: { ts: string @@ -551,16 +501,6 @@ interface ConfluenceAttachmentResponse extends ToolResponse { } } -interface ConfluenceUploadAttachmentParams { - accessToken: string - domain: string - pageId: string - file: any - fileName?: string - comment?: string - cloudId?: string -} - interface ConfluenceUploadAttachmentResponse extends ToolResponse { output: { ts: string @@ -573,14 +513,6 @@ interface ConfluenceUploadAttachmentResponse extends ToolResponse { } } -interface ConfluenceLabelParams { - accessToken: string - domain: string - pageId: string - labelName?: string - cloudId?: string -} - interface ConfluenceLabelResponse extends ToolResponse { output: { ts: string @@ -596,14 +528,6 @@ interface ConfluenceLabelResponse extends ToolResponse { } } -interface ConfluenceSpaceParams { - accessToken: string - domain: string - spaceId?: string - limit?: number - cloudId?: string -} - interface ConfluenceSpaceResponse extends ToolResponse { output: { ts: string diff --git a/apps/sim/tools/datadog/list_monitors.ts b/apps/sim/tools/datadog/list_monitors.ts index 20a192b1e63..a387f141812 100644 --- a/apps/sim/tools/datadog/list_monitors.ts +++ b/apps/sim/tools/datadog/list_monitors.ts @@ -129,7 +129,7 @@ export const listMonitorsTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/assign_role.ts b/apps/sim/tools/discord/assign_role.ts index 2fd161707b8..d7857e58aee 100644 --- a/apps/sim/tools/discord/assign_role.ts +++ b/apps/sim/tools/discord/assign_role.ts @@ -45,7 +45,7 @@ export const discordAssignRoleTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/ban_member.ts b/apps/sim/tools/discord/ban_member.ts index e998f04cf28..5afdfac32e7 100644 --- a/apps/sim/tools/discord/ban_member.ts +++ b/apps/sim/tools/discord/ban_member.ts @@ -64,7 +64,7 @@ export const discordBanMemberTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/delete_invite.ts b/apps/sim/tools/discord/delete_invite.ts index f58be5d5390..b76acf85692 100644 --- a/apps/sim/tools/discord/delete_invite.ts +++ b/apps/sim/tools/discord/delete_invite.ts @@ -41,7 +41,7 @@ export const discordDeleteInviteTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/delete_message.ts b/apps/sim/tools/discord/delete_message.ts index 551335b34e4..2a9e1343639 100644 --- a/apps/sim/tools/discord/delete_message.ts +++ b/apps/sim/tools/discord/delete_message.ts @@ -50,7 +50,7 @@ export const discordDeleteMessageTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/delete_role.ts b/apps/sim/tools/discord/delete_role.ts index 83b1c190abc..067f6190de8 100644 --- a/apps/sim/tools/discord/delete_role.ts +++ b/apps/sim/tools/discord/delete_role.ts @@ -39,7 +39,7 @@ export const discordDeleteRoleTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/delete_webhook.ts b/apps/sim/tools/discord/delete_webhook.ts index 0b5169999cd..9e18379eebe 100644 --- a/apps/sim/tools/discord/delete_webhook.ts +++ b/apps/sim/tools/discord/delete_webhook.ts @@ -44,7 +44,7 @@ export const discordDeleteWebhookTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/join_thread.ts b/apps/sim/tools/discord/join_thread.ts index 58caf12693b..fbfbbbd68f4 100644 --- a/apps/sim/tools/discord/join_thread.ts +++ b/apps/sim/tools/discord/join_thread.ts @@ -39,7 +39,7 @@ export const discordJoinThreadTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/kick_member.ts b/apps/sim/tools/discord/kick_member.ts index 8c865a1e8b6..cedee6e69e5 100644 --- a/apps/sim/tools/discord/kick_member.ts +++ b/apps/sim/tools/discord/kick_member.ts @@ -51,7 +51,7 @@ export const discordKickMemberTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/leave_thread.ts b/apps/sim/tools/discord/leave_thread.ts index 3011b408358..a092aa8f6c5 100644 --- a/apps/sim/tools/discord/leave_thread.ts +++ b/apps/sim/tools/discord/leave_thread.ts @@ -41,7 +41,7 @@ export const discordLeaveThreadTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/pin_message.ts b/apps/sim/tools/discord/pin_message.ts index d526b3387d6..4dbf9f2cc9e 100644 --- a/apps/sim/tools/discord/pin_message.ts +++ b/apps/sim/tools/discord/pin_message.ts @@ -45,7 +45,7 @@ export const discordPinMessageTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/remove_reaction.ts b/apps/sim/tools/discord/remove_reaction.ts index e03924d16e1..b958ecfef89 100644 --- a/apps/sim/tools/discord/remove_reaction.ts +++ b/apps/sim/tools/discord/remove_reaction.ts @@ -66,7 +66,7 @@ export const discordRemoveReactionTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/remove_role.ts b/apps/sim/tools/discord/remove_role.ts index 889b86f5283..3918633d76d 100644 --- a/apps/sim/tools/discord/remove_role.ts +++ b/apps/sim/tools/discord/remove_role.ts @@ -45,7 +45,7 @@ export const discordRemoveRoleTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/types.ts b/apps/sim/tools/discord/types.ts index 353311d63db..cb968aa916b 100644 --- a/apps/sim/tools/discord/types.ts +++ b/apps/sim/tools/discord/types.ts @@ -20,12 +20,6 @@ export interface DiscordMessage { mention_everyone: boolean } -interface DiscordAPIError { - code: number - message: string - errors?: Record -} - export interface DiscordGuild { id: string name: string diff --git a/apps/sim/tools/discord/unban_member.ts b/apps/sim/tools/discord/unban_member.ts index dc3ed0f3456..e38e695ea37 100644 --- a/apps/sim/tools/discord/unban_member.ts +++ b/apps/sim/tools/discord/unban_member.ts @@ -53,7 +53,7 @@ export const discordUnbanMemberTool: ToolConfig< }, }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/discord/unpin_message.ts b/apps/sim/tools/discord/unpin_message.ts index 5ba2b894832..e6d0d3a7261 100644 --- a/apps/sim/tools/discord/unpin_message.ts +++ b/apps/sim/tools/discord/unpin_message.ts @@ -47,7 +47,7 @@ export const discordUnpinMessageTool: ToolConfig< }), }, - transformResponse: async (response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/dropbox/types.ts b/apps/sim/tools/dropbox/types.ts index 05c9594b9a4..2955f472386 100644 --- a/apps/sim/tools/dropbox/types.ts +++ b/apps/sim/tools/dropbox/types.ts @@ -202,10 +202,6 @@ export interface DropboxSearchResponse extends ToolResponse { } } -interface DropboxGetTemporaryLinkParams extends DropboxBaseParams { - path: string -} - interface DropboxGetTemporaryLinkResponse extends ToolResponse { output: { metadata?: DropboxFileMetadata diff --git a/apps/sim/tools/elasticsearch/types.ts b/apps/sim/tools/elasticsearch/types.ts index ac351b635a1..741ce5457a5 100644 --- a/apps/sim/tools/elasticsearch/types.ts +++ b/apps/sim/tools/elasticsearch/types.ts @@ -80,27 +80,7 @@ export interface ElasticsearchGetIndexParams extends ElasticsearchBaseParams { index: string } -interface ElasticsearchIndexExistsParams extends ElasticsearchBaseParams { - index: string -} - -interface ElasticsearchRefreshIndexParams extends ElasticsearchBaseParams { - index: string -} - -interface ElasticsearchIndexStatsParams extends ElasticsearchBaseParams { - index: string -} - // Mapping Operations -interface ElasticsearchPutMappingParams extends ElasticsearchBaseParams { - index: string - mappings: string // JSON string -} - -interface ElasticsearchGetMappingParams extends ElasticsearchBaseParams { - index: string -} // Cluster Operations export interface ElasticsearchClusterHealthParams extends ElasticsearchBaseParams { diff --git a/apps/sim/tools/file/types.ts b/apps/sim/tools/file/types.ts index f9d3a466cc5..24ac3710206 100644 --- a/apps/sim/tools/file/types.ts +++ b/apps/sim/tools/file/types.ts @@ -79,25 +79,3 @@ export interface FileParserV3OutputData { export interface FileParserV3Output extends ToolResponse { output: FileParserV3OutputData } - -/** API response structure for single file parse */ -interface FileParseApiResponse { - success: boolean - output?: FileParseResult - content?: string - filePath?: string - viewerUrl?: string | null - error?: string -} - -/** API response structure for multiple file parse */ -interface FileParseApiMultiResponse { - success: boolean - results: Array<{ - success: boolean - output?: FileParseResult - filePath?: string - viewerUrl?: string | null - error?: string - }> -} diff --git a/apps/sim/tools/github/delete_branch.ts b/apps/sim/tools/github/delete_branch.ts index 65555453192..8f3cda2b74a 100644 --- a/apps/sim/tools/github/delete_branch.ts +++ b/apps/sim/tools/github/delete_branch.ts @@ -47,7 +47,7 @@ export const deleteBranchTool: ToolConfig { + transformResponse: async (_response, params) => { if (!params) { return { success: false, diff --git a/apps/sim/tools/github/get_file_content.ts b/apps/sim/tools/github/get_file_content.ts index 812b888a4d7..d7f51feb153 100644 --- a/apps/sim/tools/github/get_file_content.ts +++ b/apps/sim/tools/github/get_file_content.ts @@ -89,7 +89,7 @@ export const getFileContentTool: ToolConfig { + transformResponse: async (_response, params) => { if (!params) { return { success: false, diff --git a/apps/sim/tools/gmail/utils.ts b/apps/sim/tools/gmail/utils.ts index 7e19495e5d6..6fa514107fc 100644 --- a/apps/sim/tools/gmail/utils.ts +++ b/apps/sim/tools/gmail/utils.ts @@ -48,7 +48,7 @@ export async function fetchThreadingHeaders( subject: headers.find((h: any) => h.name.toLowerCase() === 'subject')?.value, } } - } catch (error) { + } catch { // Continue without threading headers rather than failing } diff --git a/apps/sim/tools/google_calendar/types.ts b/apps/sim/tools/google_calendar/types.ts index 2abca07bfdf..5d4302d6ae4 100644 --- a/apps/sim/tools/google_calendar/types.ts +++ b/apps/sim/tools/google_calendar/types.ts @@ -208,13 +208,6 @@ interface ListMetadata { timeZone: string } -interface GoogleCalendarToolResponse extends ToolResponse { - output: { - content: string - metadata: EventMetadata | ListMetadata - } -} - export interface GoogleCalendarCreateResponse extends ToolResponse { output: { content: string @@ -264,43 +257,6 @@ export interface GoogleCalendarRespondResponse extends ToolResponse { } } -interface GoogleCalendarEvent { - id: string - status: string - htmlLink: string - created: string - updated: string - summary: string - description?: string - location?: string - start: { - dateTime?: string - date?: string - timeZone?: string - } - end: { - dateTime?: string - date?: string - timeZone?: string - } - attendees?: CalendarAttendee[] - creator?: { - email: string - displayName?: string - } - organizer?: { - email: string - displayName?: string - } - reminders?: { - useDefault: boolean - overrides?: Array<{ - method: string - minutes: number - }> - } -} - interface GoogleCalendarEventDateTime { dateTime?: string date?: string diff --git a/apps/sim/tools/google_forms/get_responses.ts b/apps/sim/tools/google_forms/get_responses.ts index 29c62419f3a..ab12db60d25 100644 --- a/apps/sim/tools/google_forms/get_responses.ts +++ b/apps/sim/tools/google_forms/get_responses.ts @@ -75,7 +75,7 @@ export const getResponsesTool: ToolConfig = { }), }, - transformResponse: async (response: Response, params?: GoogleFormsGetResponsesParams) => { + transformResponse: async (response: Response) => { const data = (await response.json()) as unknown if (!response.ok) { diff --git a/apps/sim/tools/google_vault/types.ts b/apps/sim/tools/google_vault/types.ts index c5527ec3365..daf8207ca21 100644 --- a/apps/sim/tools/google_vault/types.ts +++ b/apps/sim/tools/google_vault/types.ts @@ -1,5 +1,3 @@ -import type { ToolResponse } from '@/tools/types' - interface GoogleVaultCommonParams { accessToken: string matterId: string @@ -43,10 +41,6 @@ export interface GoogleVaultListMattersExportParams extends GoogleVaultCommonPar exportId?: string } -interface GoogleVaultListMattersExportResponse extends ToolResponse { - output: any -} - export type GoogleVaultHoldView = 'BASIC_HOLD' | 'FULL_HOLD' export type GoogleVaultCorpus = 'MAIL' | 'DRIVE' | 'GROUPS' | 'HANGOUTS_CHAT' | 'VOICE' @@ -146,7 +140,3 @@ export interface GoogleVaultListSavedQueriesParams extends GoogleVaultCommonPara export interface GoogleVaultDeleteSavedQueryParams extends GoogleVaultCommonParams { savedQueryId: string } - -interface GoogleVaultListMattersHoldsResponse extends ToolResponse { - output: any -} diff --git a/apps/sim/tools/greptile/types.ts b/apps/sim/tools/greptile/types.ts index 2360491398b..bc72161cef3 100644 --- a/apps/sim/tools/greptile/types.ts +++ b/apps/sim/tools/greptile/types.ts @@ -8,15 +8,6 @@ interface GreptileBaseParams { githubToken: string } -/** - * Repository identifier format - */ -interface GreptileRepository { - remote: 'github' | 'gitlab' - branch: string - repository: string -} - /** * Query tool parameters */ diff --git a/apps/sim/tools/harmonic/utils.ts b/apps/sim/tools/harmonic/utils.ts index 49112dba9d3..b6d0f736324 100644 --- a/apps/sim/tools/harmonic/utils.ts +++ b/apps/sim/tools/harmonic/utils.ts @@ -97,11 +97,6 @@ const KNOWN_UTC_LEAP_SECOND_DATES = new Set([ '2015-06-30', '2016-12-31', ]) -const HARMONIC_USER_SAVED_SEARCH_TYPES = new Set([ - 'USER_CREATED', - 'GENERATED_FROM_PREFERENCES', - 'TEMPLATE_FROM_PREFERENCES', -]) /** * Scout returns `content` as an object matching this schema when the request succeeds. diff --git a/apps/sim/tools/hubspot/create_appointment.ts b/apps/sim/tools/hubspot/create_appointment.ts index c1633f07e43..ea733503b6c 100644 --- a/apps/sim/tools/hubspot/create_appointment.ts +++ b/apps/sim/tools/hubspot/create_appointment.ts @@ -62,7 +62,7 @@ export const hubspotCreateAppointmentTool: ToolConfig< if (typeof properties === 'string') { try { properties = JSON.parse(properties) - } catch (e) { + } catch { throw new Error('Invalid JSON format for properties. Please provide a valid JSON object.') } } @@ -71,7 +71,7 @@ export const hubspotCreateAppointmentTool: ToolConfig< if (typeof associations === 'string') { try { associations = JSON.parse(associations) - } catch (e) { + } catch { throw new Error( 'Invalid JSON format for associations. Please provide a valid JSON array.' ) diff --git a/apps/sim/tools/hubspot/create_company.ts b/apps/sim/tools/hubspot/create_company.ts index 9e78c180eeb..fb7faf50ccc 100644 --- a/apps/sim/tools/hubspot/create_company.ts +++ b/apps/sim/tools/hubspot/create_company.ts @@ -63,7 +63,7 @@ export const hubspotCreateCompanyTool: ToolConfig< if (typeof properties === 'string') { try { properties = JSON.parse(properties) - } catch (e) { + } catch { throw new Error('Invalid JSON format for properties. Please provide a valid JSON object.') } } @@ -76,7 +76,7 @@ export const hubspotCreateCompanyTool: ToolConfig< if (typeof associations === 'string') { try { associations = JSON.parse(associations) - } catch (e) { + } catch { throw new Error( 'Invalid JSON format for associations. Please provide a valid JSON array.' ) diff --git a/apps/sim/tools/hubspot/create_contact.ts b/apps/sim/tools/hubspot/create_contact.ts index dd0360f25b6..f6d359776f1 100644 --- a/apps/sim/tools/hubspot/create_contact.ts +++ b/apps/sim/tools/hubspot/create_contact.ts @@ -64,7 +64,7 @@ export const hubspotCreateContactTool: ToolConfig< if (typeof properties === 'string') { try { properties = JSON.parse(properties) - } catch (e) { + } catch { throw new Error('Invalid JSON format for properties. Please provide a valid JSON object.') } } @@ -77,7 +77,7 @@ export const hubspotCreateContactTool: ToolConfig< if (typeof associations === 'string') { try { associations = JSON.parse(associations) - } catch (e) { + } catch { throw new Error( 'Invalid JSON format for associations. Please provide a valid JSON array.' ) diff --git a/apps/sim/tools/hubspot/create_deal.ts b/apps/sim/tools/hubspot/create_deal.ts index a2b8dd9ec38..236cedc8074 100644 --- a/apps/sim/tools/hubspot/create_deal.ts +++ b/apps/sim/tools/hubspot/create_deal.ts @@ -58,7 +58,7 @@ export const hubspotCreateDealTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/incidentio/escalation_paths_delete.ts b/apps/sim/tools/incidentio/escalation_paths_delete.ts index ba70fa8f294..9e64ced8142 100644 --- a/apps/sim/tools/incidentio/escalation_paths_delete.ts +++ b/apps/sim/tools/incidentio/escalation_paths_delete.ts @@ -37,7 +37,7 @@ export const escalationPathsDeleteTool: ToolConfig< }), }, - transformResponse: async (response: Response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/incidentio/incident_roles_delete.ts b/apps/sim/tools/incidentio/incident_roles_delete.ts index c28c9ae5796..db2f5886365 100644 --- a/apps/sim/tools/incidentio/incident_roles_delete.ts +++ b/apps/sim/tools/incidentio/incident_roles_delete.ts @@ -37,7 +37,7 @@ export const incidentRolesDeleteTool: ToolConfig< }), }, - transformResponse: async (response: Response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/incidentio/schedules_delete.ts b/apps/sim/tools/incidentio/schedules_delete.ts index 4a1fc8829aa..37f37c2e1e1 100644 --- a/apps/sim/tools/incidentio/schedules_delete.ts +++ b/apps/sim/tools/incidentio/schedules_delete.ts @@ -37,7 +37,7 @@ export const schedulesDeleteTool: ToolConfig< }), }, - transformResponse: async (response: Response) => { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/incidentio/workflows_delete.ts b/apps/sim/tools/incidentio/workflows_delete.ts index 31a418aefb9..6cc560e9480 100644 --- a/apps/sim/tools/incidentio/workflows_delete.ts +++ b/apps/sim/tools/incidentio/workflows_delete.ts @@ -31,7 +31,7 @@ export const workflowsDeleteTool: ToolConfig { + transformResponse: async () => { return { success: true, output: { diff --git a/apps/sim/tools/index.test.ts b/apps/sim/tools/index.test.ts index c00162deb52..dbf1ae8a2d4 100644 --- a/apps/sim/tools/index.test.ts +++ b/apps/sim/tools/index.test.ts @@ -4662,7 +4662,7 @@ describe('Internal Route Trust', () => { // The actual external fetch uses secureFetchWithPinnedIP which uses Node's http/https // This will fail with a network error in tests, which is expected - const result = await executeTool('test_external_tool', {}) + await executeTool('test_external_tool', {}) // We expect it to attempt direct fetch (which will fail in test env due to network) // The key point is it should NOT try to call /api/proxy @@ -4847,7 +4847,7 @@ describe('Internal Route Trust', () => { // External URLs are now called directly with SSRF protection // The test verifies proxy is NOT called - const result = await executeTool('test_dynamic_external', { endpoint: 'users' }) + await executeTool('test_dynamic_external', { endpoint: 'users' }) // Verify proxy was not called expect(global.fetch).not.toHaveBeenCalledWith( @@ -5668,7 +5668,7 @@ describe('Centralized Error Handling', () => { cleanupEnvVars() }) - const testErrorFormat = async (name: string, errorResponse: any, expectedError: string) => { + const testErrorFormat = async (errorResponse: any, expectedError: string) => { mockValidateUrlWithDNS.mockResolvedValue({ isValid: true, resolvedIP: '93.184.216.34' }) mockSecureFetchWithPinnedIP.mockResolvedValue( toSecureFetchResponse( @@ -5695,7 +5695,7 @@ describe('Centralized Error Handling', () => { tools.http_request.errorExtractor = ErrorExtractorId.PROSPEO_ERRORS try { - await testErrorFormat('Prospeo', { error: true, error_code: 'NO_MATCH' }, 'NO_MATCH') + await testErrorFormat({ error: true, error_code: 'NO_MATCH' }, 'NO_MATCH') } finally { tools.http_request.errorExtractor = originalExtractor } diff --git a/apps/sim/tools/index.ts b/apps/sim/tools/index.ts index 45d94efbf52..99099f6de0a 100644 --- a/apps/sim/tools/index.ts +++ b/apps/sim/tools/index.ts @@ -883,7 +883,6 @@ async function processHostedKeyCost( tool: ToolDefinition, params: Record, response: Record, - executionContext: ExecutionContext | undefined, requestId: string ): Promise { if (!tool.hosting?.pricing) { @@ -1000,7 +999,6 @@ async function applyHostedKeyCostToResult( tool, params, finalResult.output, - executionContext, requestId )) } catch (error) { diff --git a/apps/sim/tools/intercom/search_contacts.ts b/apps/sim/tools/intercom/search_contacts.ts index 4b4bd4e89df..3b65d36ee9c 100644 --- a/apps/sim/tools/intercom/search_contacts.ts +++ b/apps/sim/tools/intercom/search_contacts.ts @@ -133,7 +133,7 @@ const searchContactsBase = { let query try { query = JSON.parse(params.query) - } catch (error) { + } catch { // If not JSON, treat as simple text search query = { field: 'name', diff --git a/apps/sim/tools/intercom/types.ts b/apps/sim/tools/intercom/types.ts index 3cd754b48ea..4316f14658d 100644 --- a/apps/sim/tools/intercom/types.ts +++ b/apps/sim/tools/intercom/types.ts @@ -862,36 +862,6 @@ export const INTERCOM_PAGES_OUTPUT_PROPERTIES = { }, } as const satisfies Record -interface IntercomBaseParams { - accessToken: string -} - -interface IntercomPaginationParams { - per_page?: number - starting_after?: string -} - -interface IntercomPagingInfo { - next?: { - page: number - starting_after: string - } | null - total_count?: number -} - -interface IntercomResponse { - success: boolean - output: { - data?: T - pages?: IntercomPagingInfo - metadata: { - operation: string - [key: string]: any - } - success: boolean - } -} - export function buildIntercomUrl(path: string): string { return `https://api.intercom.io${path}` } diff --git a/apps/sim/tools/jira/create_issue_link.ts b/apps/sim/tools/jira/create_issue_link.ts index 770fc2ead4c..f8e14238c65 100644 --- a/apps/sim/tools/jira/create_issue_link.ts +++ b/apps/sim/tools/jira/create_issue_link.ts @@ -78,7 +78,7 @@ export const jiraCreateIssueLinkTool: ToolConfig< body: () => undefined as any, }, - transformResponse: async (response: Response, params?: JiraCreateIssueLinkParams) => { + transformResponse: async (_response: Response, params?: JiraCreateIssueLinkParams) => { const cloudId = params?.cloudId || (await getJiraCloudId(params!.domain, params!.accessToken)) const typesResp = await fetch( diff --git a/apps/sim/tools/jira/types.ts b/apps/sim/tools/jira/types.ts index 6083d725fea..fab5e3bc910 100644 --- a/apps/sim/tools/jira/types.ts +++ b/apps/sim/tools/jira/types.ts @@ -946,30 +946,6 @@ export interface JiraWriteResponse extends ToolResponse { } } -interface JiraIssue { - key: string - summary: string - status: string - priority?: string - assignee?: string - updated: string -} - -interface JiraProject { - id: string - key: string - name: string - url: string -} - -interface JiraCloudResource { - id: string - url: string - name: string - scopes: string[] - avatarUrl: string -} - export interface JiraDeleteIssueParams { accessToken: string domain: string diff --git a/apps/sim/tools/kalshi/amend_order.ts b/apps/sim/tools/kalshi/amend_order.ts index 040ea7e04e5..c3d125b78dc 100644 --- a/apps/sim/tools/kalshi/amend_order.ts +++ b/apps/sim/tools/kalshi/amend_order.ts @@ -140,7 +140,7 @@ export const kalshiAmendOrderTool: ToolConfig ({ diff --git a/apps/sim/tools/kalshi/cancel_order.ts b/apps/sim/tools/kalshi/cancel_order.ts index 7c29528e693..031e17d1142 100644 --- a/apps/sim/tools/kalshi/cancel_order.ts +++ b/apps/sim/tools/kalshi/cancel_order.ts @@ -55,7 +55,7 @@ export const kalshiCancelOrderTool: ToolConfig | null): BidAskDistribution => ({ diff --git a/apps/sim/tools/kalshi/get_event.ts b/apps/sim/tools/kalshi/get_event.ts index 8abe7269775..88fd1574e34 100644 --- a/apps/sim/tools/kalshi/get_event.ts +++ b/apps/sim/tools/kalshi/get_event.ts @@ -55,7 +55,7 @@ export const kalshiGetEventTool: ToolConfig | null): BidAskDistribution => ({ diff --git a/apps/sim/tools/kalshi/get_events.ts b/apps/sim/tools/kalshi/get_events.ts index c6fcabe03ef..7c65e1cb83a 100644 --- a/apps/sim/tools/kalshi/get_events.ts +++ b/apps/sim/tools/kalshi/get_events.ts @@ -83,7 +83,7 @@ export const kalshiGetEventsTool: ToolConfig) => ({ diff --git a/apps/sim/tools/kalshi/get_exchange_announcements.ts b/apps/sim/tools/kalshi/get_exchange_announcements.ts index 71c77cb00d0..e8e3591fa69 100644 --- a/apps/sim/tools/kalshi/get_exchange_announcements.ts +++ b/apps/sim/tools/kalshi/get_exchange_announcements.ts @@ -37,7 +37,7 @@ export const kalshiGetExchangeAnnouncementsTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_announcements') + handleKalshiError(data, 'get_exchange_announcements') } return { @@ -98,7 +98,7 @@ export const kalshiGetExchangeAnnouncementsV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_announcements_v2') + handleKalshiError(data, 'get_exchange_announcements_v2') } const announcements = (data.announcements || []).map((a: Record) => ({ diff --git a/apps/sim/tools/kalshi/get_exchange_schedule.ts b/apps/sim/tools/kalshi/get_exchange_schedule.ts index 24172a9cb46..8e961ef2553 100644 --- a/apps/sim/tools/kalshi/get_exchange_schedule.ts +++ b/apps/sim/tools/kalshi/get_exchange_schedule.ts @@ -33,7 +33,7 @@ export const kalshiGetExchangeScheduleTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_schedule') + handleKalshiError(data, 'get_exchange_schedule') } return { @@ -92,7 +92,7 @@ export const kalshiGetExchangeScheduleV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_schedule_v2') + handleKalshiError(data, 'get_exchange_schedule_v2') } const schedule = data.schedule || {} diff --git a/apps/sim/tools/kalshi/get_exchange_status.ts b/apps/sim/tools/kalshi/get_exchange_status.ts index 20c131bf298..70303bdab73 100644 --- a/apps/sim/tools/kalshi/get_exchange_status.ts +++ b/apps/sim/tools/kalshi/get_exchange_status.ts @@ -36,7 +36,7 @@ export const kalshiGetExchangeStatusTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_status') + handleKalshiError(data, 'get_exchange_status') } const status = { @@ -102,7 +102,7 @@ export const kalshiGetExchangeStatusV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_exchange_status_v2') + handleKalshiError(data, 'get_exchange_status_v2') } return { diff --git a/apps/sim/tools/kalshi/get_fills.ts b/apps/sim/tools/kalshi/get_fills.ts index 9b05ad4e59c..b524ff251ef 100644 --- a/apps/sim/tools/kalshi/get_fills.ts +++ b/apps/sim/tools/kalshi/get_fills.ts @@ -109,7 +109,7 @@ export const kalshiGetFillsTool: ToolConfig) => ({ diff --git a/apps/sim/tools/kalshi/get_market.ts b/apps/sim/tools/kalshi/get_market.ts index 102724a5875..49990705e97 100644 --- a/apps/sim/tools/kalshi/get_market.ts +++ b/apps/sim/tools/kalshi/get_market.ts @@ -40,7 +40,7 @@ export const kalshiGetMarketTool: ToolConfig) => ({ diff --git a/apps/sim/tools/kalshi/get_order.ts b/apps/sim/tools/kalshi/get_order.ts index 3dfab03149e..2631704b691 100644 --- a/apps/sim/tools/kalshi/get_order.ts +++ b/apps/sim/tools/kalshi/get_order.ts @@ -53,7 +53,7 @@ export const kalshiGetOrderTool: ToolConfig) => ({ diff --git a/apps/sim/tools/kalshi/get_series_by_ticker.ts b/apps/sim/tools/kalshi/get_series_by_ticker.ts index 3d6586fb129..735c11d2a75 100644 --- a/apps/sim/tools/kalshi/get_series_by_ticker.ts +++ b/apps/sim/tools/kalshi/get_series_by_ticker.ts @@ -45,7 +45,7 @@ export const kalshiGetSeriesByTickerTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_series_by_ticker') + handleKalshiError(data, 'get_series_by_ticker') } const series = data.series || data @@ -145,7 +145,7 @@ export const kalshiGetSeriesByTickerV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_series_by_ticker_v2') + handleKalshiError(data, 'get_series_by_ticker_v2') } const series = data.series || data diff --git a/apps/sim/tools/kalshi/get_series_list.ts b/apps/sim/tools/kalshi/get_series_list.ts index c6d184a37ab..9df75b59fb6 100644 --- a/apps/sim/tools/kalshi/get_series_list.ts +++ b/apps/sim/tools/kalshi/get_series_list.ts @@ -62,7 +62,7 @@ export const kalshiGetSeriesListTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_series_list') + handleKalshiError(data, 'get_series_list') } return { @@ -189,7 +189,7 @@ export const kalshiGetSeriesListV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_series_list_v2') + handleKalshiError(data, 'get_series_list_v2') } const series = (data.series || []).map((s: Record) => { diff --git a/apps/sim/tools/kalshi/get_settlements.ts b/apps/sim/tools/kalshi/get_settlements.ts index e5e7ac80542..ad944d1b676 100644 --- a/apps/sim/tools/kalshi/get_settlements.ts +++ b/apps/sim/tools/kalshi/get_settlements.ts @@ -111,7 +111,7 @@ export const kalshiGetSettlementsTool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_settlements') + handleKalshiError(data, 'get_settlements') } return { @@ -267,7 +267,7 @@ export const kalshiGetSettlementsV2Tool: ToolConfig< const data = await response.json() if (!response.ok) { - handleKalshiError(data, response.status, 'get_settlements_v2') + handleKalshiError(data, 'get_settlements_v2') } const settlements = (data.settlements || []).map((s: Record) => ({ diff --git a/apps/sim/tools/kalshi/get_trades.ts b/apps/sim/tools/kalshi/get_trades.ts index 1358eedfcff..170c6e2f0f0 100644 --- a/apps/sim/tools/kalshi/get_trades.ts +++ b/apps/sim/tools/kalshi/get_trades.ts @@ -57,7 +57,7 @@ export const kalshiGetTradesTool: ToolConfig) => ({ diff --git a/apps/sim/tools/kalshi/types.ts b/apps/sim/tools/kalshi/types.ts index 729d9c5e7d2..2eadeb8326d 100644 --- a/apps/sim/tools/kalshi/types.ts +++ b/apps/sim/tools/kalshi/types.ts @@ -250,18 +250,6 @@ export interface KalshiPagingInfo { cursor?: string | null } -interface KalshiResponse { - success: boolean - output: T & { - paging?: KalshiPagingInfo - metadata: { - operation: string - [key: string]: any - } - success: boolean - } -} - export interface KalshiMarket { ticker: string event_ticker: string @@ -303,13 +291,6 @@ export interface KalshiEvent { status?: string } -interface KalshiBalance { - /** In cents */ - balance: number - /** In cents */ - portfolio_value: number -} - export interface KalshiPosition { ticker: string event_ticker: string @@ -492,7 +473,7 @@ export function buildKalshiAuthHeaders( } } -export function handleKalshiError(data: any, status: number, operation: string): never { +export function handleKalshiError(data: any, operation: string): never { const errorMessage = data.error?.message || data.error || data.message || data.detail || 'Unknown error' throw new Error(`Kalshi ${operation} failed: ${errorMessage}`) diff --git a/apps/sim/tools/knowledge/types.ts b/apps/sim/tools/knowledge/types.ts index ab3bc83e790..a08d99dff58 100644 --- a/apps/sim/tools/knowledge/types.ts +++ b/apps/sim/tools/knowledge/types.ts @@ -70,12 +70,6 @@ export interface KnowledgeSearchResponse { error?: string } -interface KnowledgeSearchParams { - knowledgeBaseIds: string | string[] - query: string - topK?: number -} - interface KnowledgeUploadChunkResult { chunkId: string chunkIndex: number @@ -114,12 +108,6 @@ export interface KnowledgeUploadChunkResponse { error?: string } -interface KnowledgeUploadChunkParams { - documentId: string - content: string - enabled?: boolean -} - interface KnowledgeCreateDocumentResult { documentId: string documentName: string @@ -147,10 +135,6 @@ interface KnowledgeTagDefinition { updatedAt: string | null } -interface KnowledgeListTagsParams { - knowledgeBaseId: string -} - export interface KnowledgeListTagsResponse { success: boolean output: { diff --git a/apps/sim/tools/linkedin/share_post.ts b/apps/sim/tools/linkedin/share_post.ts index 002b576e89e..bd756e487b7 100644 --- a/apps/sim/tools/linkedin/share_post.ts +++ b/apps/sim/tools/linkedin/share_post.ts @@ -62,7 +62,7 @@ export const linkedInSharePostTool: ToolConfig { + postProcess: async (profileResult, params) => { try { // Extract profile from the first request if (!profileResult.success || !profileResult.output) { diff --git a/apps/sim/tools/linkedin/types.ts b/apps/sim/tools/linkedin/types.ts index 94c9d72f72b..7b0397b43cb 100644 --- a/apps/sim/tools/linkedin/types.ts +++ b/apps/sim/tools/linkedin/types.ts @@ -1,41 +1,5 @@ import type { ToolResponse } from '@/tools/types' -interface LinkedInProfile { - sub: string - name: string - given_name: string - family_name: string - email?: string - picture?: string - email_verified?: boolean -} - -interface LinkedInPost { - author: string // URN format: urn:li:person:abc123 - lifecycleState: 'PUBLISHED' - specificContent: { - 'com.linkedin.ugc.ShareContent': { - shareCommentary: { - text: string - } - shareMediaCategory: 'NONE' | 'ARTICLE' | 'IMAGE' - media?: Array<{ - status: 'READY' - description: { - text: string - } - media: string // URN format - title: { - text: string - } - }> - } - } - visibility: { - 'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC' | 'CONNECTIONS' - } -} - export type LinkedInResponse = { success: boolean output: { diff --git a/apps/sim/tools/mailchimp/types.ts b/apps/sim/tools/mailchimp/types.ts index a2815fb14ee..a5d65b0b5ff 100644 --- a/apps/sim/tools/mailchimp/types.ts +++ b/apps/sim/tools/mailchimp/types.ts @@ -3,30 +3,6 @@ import { createLogger } from '@sim/logger' const logger = createLogger('Mailchimp') // Base params -interface MailchimpBaseParams { - apiKey: string // API key with server prefix (e.g., "key-us19") -} - -interface MailchimpPaginationParams { - count?: string - offset?: string -} - -interface MailchimpPagingInfo { - total_items: number -} - -interface MailchimpResponse { - success: boolean - output: { - data?: T - paging?: MailchimpPagingInfo - metadata?: { - [key: string]: unknown - } - success: boolean - } -} // Member/Subscriber export interface MailchimpMember { @@ -381,17 +357,6 @@ export interface MailchimpTag { } // Error Response -interface MailchimpErrorResponse { - type?: string - title?: string - status?: number - detail?: string - instance?: string - errors?: Array<{ - field?: string - message?: string - }> -} // Helper function to extract server prefix from API key export function extractServerPrefix(apiKey: string): string { diff --git a/apps/sim/tools/mailgun/add_list_member.ts b/apps/sim/tools/mailgun/add_list_member.ts index 3522c4020ce..d29c6a7d5a4 100644 --- a/apps/sim/tools/mailgun/add_list_member.ts +++ b/apps/sim/tools/mailgun/add_list_member.ts @@ -77,7 +77,7 @@ export const mailgunAddListMemberTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to add list member') diff --git a/apps/sim/tools/mailgun/create_mailing_list.ts b/apps/sim/tools/mailgun/create_mailing_list.ts index 4c6275e322f..a74d42e6b0e 100644 --- a/apps/sim/tools/mailgun/create_mailing_list.ts +++ b/apps/sim/tools/mailgun/create_mailing_list.ts @@ -74,7 +74,7 @@ export const mailgunCreateMailingListTool: ToolConfig< }, }, - transformResponse: async (response, params): Promise => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to create mailing list') diff --git a/apps/sim/tools/mailgun/get_domain.ts b/apps/sim/tools/mailgun/get_domain.ts index 053e38bf1ea..082f3a14710 100644 --- a/apps/sim/tools/mailgun/get_domain.ts +++ b/apps/sim/tools/mailgun/get_domain.ts @@ -37,7 +37,7 @@ export const mailgunGetDomainTool: ToolConfig }), }, - transformResponse: async (response, params): Promise => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to get domain') diff --git a/apps/sim/tools/mailgun/get_mailing_list.ts b/apps/sim/tools/mailgun/get_mailing_list.ts index 260d656f095..782a7c9985a 100644 --- a/apps/sim/tools/mailgun/get_mailing_list.ts +++ b/apps/sim/tools/mailgun/get_mailing_list.ts @@ -37,7 +37,7 @@ export const mailgunGetMailingListTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to get mailing list') diff --git a/apps/sim/tools/mailgun/get_message.ts b/apps/sim/tools/mailgun/get_message.ts index d4875635699..312a0bf7ba4 100644 --- a/apps/sim/tools/mailgun/get_message.ts +++ b/apps/sim/tools/mailgun/get_message.ts @@ -44,7 +44,7 @@ export const mailgunGetMessageTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to get message') diff --git a/apps/sim/tools/mailgun/list_domains.ts b/apps/sim/tools/mailgun/list_domains.ts index 57ba6f1521b..0f7fdddc875 100644 --- a/apps/sim/tools/mailgun/list_domains.ts +++ b/apps/sim/tools/mailgun/list_domains.ts @@ -31,7 +31,7 @@ export const mailgunListDomainsTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to list domains') diff --git a/apps/sim/tools/mailgun/list_messages.ts b/apps/sim/tools/mailgun/list_messages.ts index 27b511617c0..a536b235148 100644 --- a/apps/sim/tools/mailgun/list_messages.ts +++ b/apps/sim/tools/mailgun/list_messages.ts @@ -62,7 +62,7 @@ export const mailgunListMessagesTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to list messages') diff --git a/apps/sim/tools/mailgun/send_message.ts b/apps/sim/tools/mailgun/send_message.ts index ae0386f8f92..5196e78b96b 100644 --- a/apps/sim/tools/mailgun/send_message.ts +++ b/apps/sim/tools/mailgun/send_message.ts @@ -113,7 +113,7 @@ export const mailgunSendMessageTool: ToolConfig => { + transformResponse: async (response): Promise => { if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Failed to send message') diff --git a/apps/sim/tools/mailgun/types.ts b/apps/sim/tools/mailgun/types.ts index 36cfb6abe2d..02080922c52 100644 --- a/apps/sim/tools/mailgun/types.ts +++ b/apps/sim/tools/mailgun/types.ts @@ -38,13 +38,6 @@ interface MailgunBaseParams { region?: MailgunRegion } -interface MailgunMailingListMember { - address: string - name?: string - subscribed: boolean - vars?: Record -} - // Send Message export interface SendMessageParams extends MailgunBaseParams { domain: string diff --git a/apps/sim/tools/memory/types.ts b/apps/sim/tools/memory/types.ts index d5cef596bb7..700811037a1 100644 --- a/apps/sim/tools/memory/types.ts +++ b/apps/sim/tools/memory/types.ts @@ -21,25 +21,3 @@ export interface MemoryResponse extends ToolResponse { message?: string } } - -interface AgentMemoryData { - role: 'user' | 'assistant' | 'system' - content: string -} - -interface MemoryRecord { - id: string - key: string - conversationId: string - data: AgentMemoryData[] - createdAt: string - updatedAt: string - workflowId?: string - workspaceId?: string -} - -interface MemoryError { - code: string - message: string - details?: Record -} diff --git a/apps/sim/tools/microsoft_planner/delete_bucket.ts b/apps/sim/tools/microsoft_planner/delete_bucket.ts index f9e1ffda19e..c7a92d819b7 100644 --- a/apps/sim/tools/microsoft_planner/delete_bucket.ts +++ b/apps/sim/tools/microsoft_planner/delete_bucket.ts @@ -78,7 +78,7 @@ export const deleteBucketTool: ToolConfig< }, }, - transformResponse: async (response: Response) => { + transformResponse: async () => { logger.info('Bucket deleted successfully') const result: MicrosoftPlannerDeleteBucketResponse = { diff --git a/apps/sim/tools/microsoft_planner/delete_plan.ts b/apps/sim/tools/microsoft_planner/delete_plan.ts index afc0c9e1ba3..7d22af31bce 100644 --- a/apps/sim/tools/microsoft_planner/delete_plan.ts +++ b/apps/sim/tools/microsoft_planner/delete_plan.ts @@ -80,7 +80,7 @@ export const deletePlanTool: ToolConfig< }, }, - transformResponse: async (response: Response) => { + transformResponse: async () => { logger.info('Plan deleted successfully') const result: MicrosoftPlannerDeletePlanResponse = { diff --git a/apps/sim/tools/microsoft_planner/delete_task.ts b/apps/sim/tools/microsoft_planner/delete_task.ts index b4af0dc3d52..ff6e1788283 100644 --- a/apps/sim/tools/microsoft_planner/delete_task.ts +++ b/apps/sim/tools/microsoft_planner/delete_task.ts @@ -78,7 +78,7 @@ export const deleteTaskTool: ToolConfig< }, }, - transformResponse: async (response: Response) => { + transformResponse: async () => { logger.info('Task deleted successfully') const result: MicrosoftPlannerDeleteTaskResponse = { diff --git a/apps/sim/tools/mongodb/types.ts b/apps/sim/tools/mongodb/types.ts index 58b587a7c1f..862b583a0dd 100644 --- a/apps/sim/tools/mongodb/types.ts +++ b/apps/sim/tools/mongodb/types.ts @@ -77,11 +77,6 @@ interface MongoDBBaseResponse extends ToolResponse { error?: string } -interface MongoDBQueryResponse extends MongoDBBaseResponse {} -interface MongoDBInsertResponse extends MongoDBBaseResponse {} -interface MongoDBUpdateResponse extends MongoDBBaseResponse {} -interface MongoDBDeleteResponse extends MongoDBBaseResponse {} -interface MongoDBExecuteResponse extends MongoDBBaseResponse {} export interface MongoDBResponse extends MongoDBBaseResponse {} export interface MongoDBIntrospectResponse extends ToolResponse { diff --git a/apps/sim/tools/mysql/types.ts b/apps/sim/tools/mysql/types.ts index 61b615e9805..be1100ab831 100644 --- a/apps/sim/tools/mysql/types.ts +++ b/apps/sim/tools/mysql/types.ts @@ -42,11 +42,6 @@ interface MySQLBaseResponse extends ToolResponse { error?: string } -interface MySQLQueryResponse extends MySQLBaseResponse {} -interface MySQLInsertResponse extends MySQLBaseResponse {} -interface MySQLUpdateResponse extends MySQLBaseResponse {} -interface MySQLDeleteResponse extends MySQLBaseResponse {} -interface MySQLExecuteResponse extends MySQLBaseResponse {} export interface MySQLResponse extends MySQLBaseResponse {} export interface MySQLIntrospectParams extends MySQLConnectionConfig {} diff --git a/apps/sim/tools/neo4j/types.ts b/apps/sim/tools/neo4j/types.ts index 952d76349b3..ce5b70f4565 100644 --- a/apps/sim/tools/neo4j/types.ts +++ b/apps/sim/tools/neo4j/types.ts @@ -66,12 +66,6 @@ interface Neo4jBaseResponse extends ToolResponse { error?: string } -interface Neo4jQueryResponse extends Neo4jBaseResponse {} -interface Neo4jCreateResponse extends Neo4jBaseResponse {} -interface Neo4jMergeResponse extends Neo4jBaseResponse {} -interface Neo4jUpdateResponse extends Neo4jBaseResponse {} -interface Neo4jDeleteResponse extends Neo4jBaseResponse {} -interface Neo4jExecuteResponse extends Neo4jBaseResponse {} export interface Neo4jResponse extends Neo4jBaseResponse {} export interface Neo4jIntrospectParams extends Neo4jConnectionConfig {} diff --git a/apps/sim/tools/parallel/types.ts b/apps/sim/tools/parallel/types.ts index cc248c93eea..bcc7a70b1f4 100644 --- a/apps/sim/tools/parallel/types.ts +++ b/apps/sim/tools/parallel/types.ts @@ -1,5 +1,3 @@ -import type { ToolResponse } from '@/tools/types' - export interface ParallelSearchParams { search_queries: string[] | string objective?: string @@ -11,20 +9,6 @@ export interface ParallelSearchParams { apiKey: string } -interface ParallelSearchResult { - url: string | null - title: string | null - publish_date?: string | null - excerpts: string[] -} - -interface ParallelSearchResponse extends ToolResponse { - output: { - search_id: string | null - results: ParallelSearchResult[] - } -} - export interface ParallelExtractParams { urls: string objective?: string @@ -32,29 +16,6 @@ export interface ParallelExtractParams { apiKey: string } -interface ParallelExtractResult { - url: string | null - title?: string | null - publish_date?: string | null - excerpts?: string[] - full_content?: string | null -} - -interface ParallelExtractError { - url: string | null - error_type: string | null - http_status_code: number | null - content: string | null -} - -interface ParallelExtractResponse extends ToolResponse { - output: { - extract_id: string | null - results: ParallelExtractResult[] - errors: ParallelExtractError[] - } -} - export interface ParallelDeepResearchParams { input: string output_format?: string @@ -63,24 +24,3 @@ export interface ParallelDeepResearchParams { exclude_domains?: string apiKey: string } - -interface ParallelDeepResearchBasis { - field: string - reasoning: string - citations: { - url: string - title: string | null - excerpts: string[] | null - }[] - confidence: string | null -} - -interface ParallelDeepResearchResponse extends ToolResponse { - output: { - status: string - run_id: string - message: string - content: string | Record - basis: ParallelDeepResearchBasis[] - } -} diff --git a/apps/sim/tools/perplexity/types.ts b/apps/sim/tools/perplexity/types.ts index b772dd84d50..9ef476d7f6e 100644 --- a/apps/sim/tools/perplexity/types.ts +++ b/apps/sim/tools/perplexity/types.ts @@ -1,10 +1,5 @@ import type { ToolResponse } from '@/tools/types' -interface PerplexityMessage { - role: string - content: string -} - export interface PerplexityChatParams { systemPrompt?: string content: string diff --git a/apps/sim/tools/pinecone/types.ts b/apps/sim/tools/pinecone/types.ts index c967b856db0..ef911c9cc2a 100644 --- a/apps/sim/tools/pinecone/types.ts +++ b/apps/sim/tools/pinecone/types.ts @@ -76,30 +76,8 @@ export interface PineconeUpsertTextParams extends PineconeBaseParams { } // Upsert Vectors -interface PineconeUpsertVectorsParams extends PineconeBaseParams { - vectors: { - id: string - values: number[] - metadata?: Record - sparseValues?: { - indices: number[] - values: number[] - } - }[] -} // Search Text -interface PineconeSearchQuery { - inputs?: { text: string } - vector?: { - values: number[] - sparse_values?: number[] - sparse_indices?: number[] - } - id?: string - top_k: number - filter?: Record -} interface PineconeRerank { model: string @@ -123,17 +101,6 @@ export interface PineconeSearchHit { fields?: Record } -interface PineconeSearchResponse { - result: { - hits: PineconeSearchHit[] - } - usage: { - read_units: number - embed_total_tokens?: number - rerank_units?: number - } -} - // Fetch Vectors export interface PineconeFetchParams extends PineconeBaseParams { ids: string[] @@ -145,33 +112,6 @@ export interface PineconeVector { metadata?: Record } -interface PineconeUsage { - readUnits: number -} - -interface PineconeFetchResponse { - vectors: Record - namespace?: string - usage: PineconeUsage -} - -interface PineconeParams { - apiKey: string - indexHost: string - operation: 'query' | 'upsert' | 'delete' - // Query operation - queryVector?: number[] - topK?: number - includeMetadata?: boolean - includeValues?: boolean - // Upsert operation - vectors?: Array<{ - id: string - values: number[] - metadata?: Record - }> -} - // Search Vector export interface PineconeSearchVectorParams extends PineconeBaseParams { vector: number[] | string diff --git a/apps/sim/tools/pipedrive/get_all_deals.ts b/apps/sim/tools/pipedrive/get_all_deals.ts index a7e203418f8..80c0f81ba4c 100644 --- a/apps/sim/tools/pipedrive/get_all_deals.ts +++ b/apps/sim/tools/pipedrive/get_all_deals.ts @@ -109,7 +109,7 @@ export const pipedriveGetAllDealsTool: ToolConfig< headers: (params) => getPipedriveAuthHeaders(params), }, - transformResponse: async (response: Response, params?: PipedriveGetAllDealsParams) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!data.success) { diff --git a/apps/sim/tools/pitchbook/lookup_table_structure.ts b/apps/sim/tools/pitchbook/lookup_table_structure.ts index 3dc285d5ad4..5327401cd90 100644 --- a/apps/sim/tools/pitchbook/lookup_table_structure.ts +++ b/apps/sim/tools/pitchbook/lookup_table_structure.ts @@ -29,7 +29,7 @@ export const pitchbookLookupTableStructureTool: ToolConfig `${PITCHBOOK_API_BASE}/lookup-tables/structure`, + url: () => `${PITCHBOOK_API_BASE}/lookup-tables/structure`, method: 'GET', headers: (params) => pitchbookAuthHeaders(params.apiKey, params.currency), }, diff --git a/apps/sim/tools/planetscale/close-deploy-request.ts b/apps/sim/tools/planetscale/close-deploy-request.ts index a9adca352b7..14b92e96ead 100644 --- a/apps/sim/tools/planetscale/close-deploy-request.ts +++ b/apps/sim/tools/planetscale/close-deploy-request.ts @@ -62,7 +62,7 @@ export const planetScaleCloseDeployRequestTool: ToolConfig< ), method: 'PATCH', headers: planetScaleHeaders, - body: (params) => planetScaleBody({ state: 'closed' }), + body: () => planetScaleBody({ state: 'closed' }), }, transformResponse: async (response) => ({ success: true, diff --git a/apps/sim/tools/polymarket/types.ts b/apps/sim/tools/polymarket/types.ts index 2483c33ebc2..8aa2864c370 100644 --- a/apps/sim/tools/polymarket/types.ts +++ b/apps/sim/tools/polymarket/types.ts @@ -19,12 +19,6 @@ export interface PolymarketPaginationParams { offset?: string } -interface PolymarketPagingInfo { - limit: number - offset: number - count: number -} - export interface PolymarketMarket { id: string question: string @@ -117,10 +111,6 @@ export interface PolymarketOrderBook { last_trade_price: string } -interface PolymarketPrice { - price: string -} - export interface PolymarketPriceHistoryEntry { t: number p: number diff --git a/apps/sim/tools/posthog/batch_events.ts b/apps/sim/tools/posthog/batch_events.ts index 0e16fea5951..5abea8c9d93 100644 --- a/apps/sim/tools/posthog/batch_events.ts +++ b/apps/sim/tools/posthog/batch_events.ts @@ -60,7 +60,7 @@ export const batchEventsTool: ToolConfig ({ + headers: () => ({ 'Content-Type': 'application/json', }), body: (params) => { diff --git a/apps/sim/tools/posthog/capture_event.ts b/apps/sim/tools/posthog/capture_event.ts index 154f89c5e41..0b96a90844d 100644 --- a/apps/sim/tools/posthog/capture_event.ts +++ b/apps/sim/tools/posthog/capture_event.ts @@ -83,7 +83,7 @@ export const captureEventTool: ToolConfig ({ + headers: () => ({ 'Content-Type': 'application/json', }), body: (params) => { diff --git a/apps/sim/tools/posthog/create_cohort.ts b/apps/sim/tools/posthog/create_cohort.ts index 25ebdf8fc05..c68711bce4a 100644 --- a/apps/sim/tools/posthog/create_cohort.ts +++ b/apps/sim/tools/posthog/create_cohort.ts @@ -131,7 +131,7 @@ export const createCohortTool: ToolConfig = { let query: any try { query = JSON.parse(params.query) - } catch (e) { + } catch { // If it's not valid JSON, treat it as a raw HogQL string query = { kind: 'HogQLQuery', @@ -101,7 +101,7 @@ export const queryTool: ToolConfig = { if (params.values) { try { body.values = JSON.parse(params.values) - } catch (e) { + } catch { // Ignore invalid values JSON } } diff --git a/apps/sim/tools/posthog/types.ts b/apps/sim/tools/posthog/types.ts deleted file mode 100644 index 1afc97ade3a..00000000000 --- a/apps/sim/tools/posthog/types.ts +++ /dev/null @@ -1,206 +0,0 @@ -// Common types for PostHog tools -import type { ToolResponse } from '@/tools/types' - -// Common base parameters -interface PostHogBaseParams { - region?: 'us' | 'eu' -} - -interface PostHogPublicParams extends PostHogBaseParams { - projectApiKey: string -} - -interface PostHogPrivateParams extends PostHogBaseParams { - apiKey: string - projectId: string -} - -// Common data types -interface PostHogPerson { - id: string - name: string - distinct_ids: string[] - properties: Record - created_at: string - uuid: string -} - -interface PostHogEvent { - id: string - distinct_id: string - properties: Record - event: string - timestamp: string - person?: PostHogPerson -} - -interface PostHogFeatureFlag { - id: number - name: string - key: string - filters: Record - deleted: boolean - active: boolean - created_at: string - created_by: any - is_simple_flag: boolean - rollout_percentage?: number - ensure_experience_continuity?: boolean -} - -interface PostHogInsight { - id: number - name: string - description: string - favorited: boolean - filters: Record - query?: Record - result?: any - created_at: string - created_by: any - last_modified_at: string - last_modified_by: any - deleted: boolean - saved: boolean - short_id: string -} - -interface PostHogDashboard { - id: number - name: string - description: string - pinned: boolean - created_at: string - created_by: any - is_shared: boolean - deleted: boolean - creation_mode: string - restriction_level: number - filters: Record - tiles: any[] -} - -interface PostHogCohort { - id: number - name: string - description: string - groups: any[] - filters?: Record - query?: Record - is_calculating: boolean - count?: number - created_at: string - created_by: any - deleted: boolean - is_static: boolean - version?: number -} - -interface PostHogExperiment { - id: number - name: string - description: string - feature_flag_key: string - feature_flag: any - parameters: Record - filters: Record - start_date?: string - end_date?: string - created_at: string - created_by: any - archived: boolean -} - -interface PostHogSurvey { - id: string - name: string - description: string - type: 'popover' | 'api' - questions: any[] - appearance?: Record - conditions?: Record - start_date?: string - end_date?: string - archived: boolean - created_at: string - created_by: any -} - -interface PostHogSessionRecording { - id: string - distinct_id: string - viewed: boolean - recording_duration: number - start_time: string - end_time: string - click_count: number - keypress_count: number - console_error_count: number - console_warn_count: number - console_log_count: number - person?: PostHogPerson -} - -interface PostHogAnnotation { - id: number - content: string - date_marker: string - created_at: string - updated_at: string - created_by: any - dashboard_item?: number - scope: string - deleted: boolean -} - -interface PostHogEventDefinition { - id: string - name: string - description: string - tags: string[] - created_at: string - last_seen_at?: string - verified: boolean -} - -interface PostHogPropertyDefinition { - id: string - name: string - description: string - tags: string[] - is_numerical: boolean - property_type: 'DateTime' | 'String' | 'Numeric' | 'Boolean' - verified: boolean -} - -interface PostHogProject { - id: number - uuid: string - organization: string - api_token: string - app_urls: string[] - name: string - slack_incoming_webhook?: string - created_at: string - updated_at: string - anonymize_ips: boolean - completed_snippet_onboarding: boolean - ingested_event: boolean - test_account_filters: any[] - is_demo: boolean -} - -interface PostHogOrganization { - id: string - name: string - created_at: string - updated_at: string - membership_level?: number - personalization?: Record - setup?: Record - available_features: string[] - is_member_join_email_enabled: boolean -} - -// Union type for all PostHog responses -export type PostHogResponse = ToolResponse diff --git a/apps/sim/tools/reddit/get_comments.ts b/apps/sim/tools/reddit/get_comments.ts index d5eccbc61da..65ee2a65d7a 100644 --- a/apps/sim/tools/reddit/get_comments.ts +++ b/apps/sim/tools/reddit/get_comments.ts @@ -136,7 +136,7 @@ export const getCommentsTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() const postData = data[0]?.data?.children?.[0]?.data || {} diff --git a/apps/sim/tools/response/types.ts b/apps/sim/tools/response/types.ts deleted file mode 100644 index 47f41e04a70..00000000000 --- a/apps/sim/tools/response/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ToolResponse } from '@/tools/types' - -export interface ResponseBlockOutput extends ToolResponse { - success: boolean - output: { - data: Record - status: number - headers: Record - } -} diff --git a/apps/sim/tools/rocketlane/types.ts b/apps/sim/tools/rocketlane/types.ts index cce25ba2de5..5c2867c94ed 100644 --- a/apps/sim/tools/rocketlane/types.ts +++ b/apps/sim/tools/rocketlane/types.ts @@ -45,8 +45,6 @@ export async function rocketlaneError(response: Response): Promise { return text || `Rocketlane API error (HTTP ${response.status})` } -type Raw = Record - // region Shared object shapes /** Compact user reference returned inside most Rocketlane resources. */ diff --git a/apps/sim/tools/s3/types.ts b/apps/sim/tools/s3/types.ts deleted file mode 100644 index aa6c7fd0731..00000000000 --- a/apps/sim/tools/s3/types.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { UserFile } from '@/executor/types' -import type { ToolResponse } from '@/tools/types' - -export interface S3Response extends ToolResponse { - output: { - url?: string - uri?: string - file?: UserFile - objects?: Array<{ - key: string - size: number - lastModified: string - etag: string - }> - buckets?: Array<{ - name: string - creationDate: string | null - region: string | null - }> - deleted?: - | boolean - | Array<{ key: string | null; versionId: string | null; deleteMarker: boolean | null }> - errors?: Array<{ key: string | null; code: string | null; message: string | null }> - exists?: boolean - metadata: { - fileType?: string | null - size?: number | null - name?: string - lastModified?: string | null - etag?: string | null - location?: string | null - key?: string - bucket?: string - isTruncated?: boolean - nextContinuationToken?: string | null - keyCount?: number - prefix?: string | null - deleteMarker?: boolean | null - versionId?: string | null - copySourceVersionId?: string - storageClass?: string | null - serverSideEncryption?: string | null - userMetadata?: Record - owner?: { displayName: string | null; id: string | null } | null - continuationToken?: string | null - bucketArn?: string | null - method?: string - expiresIn?: number - expiresAt?: string - deletedCount?: number - errorCount?: number - error?: string - } - } -} diff --git a/apps/sim/tools/salesforce/get_accounts.ts b/apps/sim/tools/salesforce/get_accounts.ts index 575039102b4..1a85ebb955b 100644 --- a/apps/sim/tools/salesforce/get_accounts.ts +++ b/apps/sim/tools/salesforce/get_accounts.ts @@ -88,7 +88,7 @@ export const salesforceGetAccountsTool: ToolConfig< }, }, - transformResponse: async (response: Response, params) => { + transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { diff --git a/apps/sim/tools/sendgrid/types.ts b/apps/sim/tools/sendgrid/types.ts index fcd0c24ff2d..59c736e1616 100644 --- a/apps/sim/tools/sendgrid/types.ts +++ b/apps/sim/tools/sendgrid/types.ts @@ -42,13 +42,6 @@ export interface SendGridTemplate { versions?: SendGridTemplateVersion[] } -interface SendGridPersonalization { - to: Array<{ email: string; name?: string }> - cc?: Array<{ email: string }> - bcc?: Array<{ email: string }> - dynamic_template_data?: Record -} - interface SendGridAttachment { content: string filename: string @@ -57,16 +50,6 @@ interface SendGridAttachment { content_id?: string } -interface SendGridMailBody { - personalizations: SendGridPersonalization[] - from: { email: string; name?: string } - subject?: string - template_id?: string - content?: Array<{ type: 'text/plain' | 'text/html'; value?: string }> - reply_to?: { email: string; name?: string } - attachments?: SendGridAttachment[] | UserFile[] -} - export interface SendGridContactObject { email: string first_name?: string diff --git a/apps/sim/tools/ses/types.ts b/apps/sim/tools/ses/types.ts index 671dda155d9..50ff6b9ef44 100644 --- a/apps/sim/tools/ses/types.ts +++ b/apps/sim/tools/ses/types.ts @@ -312,7 +312,3 @@ export interface SESSendCustomVerificationEmailResponse extends ToolResponse { messageId: string } } - -interface SESBaseResponse extends ToolResponse { - output: { message: string } -} diff --git a/apps/sim/tools/shared/tags.ts b/apps/sim/tools/shared/tags.ts index eba49b21b53..f343d4ffa1e 100644 --- a/apps/sim/tools/shared/tags.ts +++ b/apps/sim/tools/shared/tags.ts @@ -9,18 +9,6 @@ export interface DocumentTagEntry { value: string } -/** - * Tag filter entry format used in search tool. - */ -interface TagFilterEntry { - tagName: string - tagSlot?: string - tagValue: string | number | boolean - fieldType?: string - operator?: string - valueTo?: string | number -} - /** * Checks if a tag value is effectively empty (unfilled/default entry). */ diff --git a/apps/sim/tools/shopify/types.ts b/apps/sim/tools/shopify/types.ts index f735931218c..b4ca0d10a00 100644 --- a/apps/sim/tools/shopify/types.ts +++ b/apps/sim/tools/shopify/types.ts @@ -550,17 +550,6 @@ export const CANCEL_ORDER_OUTPUT_PROPERTIES = { } as const satisfies Record // Common GraphQL Response Types -interface ShopifyGraphQLError { - message: string - locations?: { line: number; column: number }[] - path?: string[] - extensions?: Record -} - -interface ShopifyUserError { - field: string[] - message: string -} // Product Types interface ShopifyProduct { @@ -710,17 +699,6 @@ interface ShopifyInventoryLevel { } } -interface ShopifyInventoryItem { - id: string - sku: string | null - tracked: boolean - inventoryLevels: { - edges: Array<{ - node: ShopifyInventoryLevel - }> - } -} - // Tool Parameter Types interface ShopifyBaseParams { accessToken: string diff --git a/apps/sim/tools/spotify/types.ts b/apps/sim/tools/spotify/types.ts index 443128edde9..6e8686d1f55 100644 --- a/apps/sim/tools/spotify/types.ts +++ b/apps/sim/tools/spotify/types.ts @@ -209,138 +209,6 @@ export const CURRENTLY_PLAYING_TRACK_OUTPUT_PROPERTIES = { external_url: { type: 'string', description: 'Spotify URL' }, } as const satisfies Record -/** - * Common Spotify objects - */ -interface SpotifyImage { - url: string - height: number | null - width: number | null -} - -interface SpotifyExternalUrls { - spotify: string -} - -interface SpotifyArtistSimplified { - id: string - name: string - external_urls: SpotifyExternalUrls -} - -interface SpotifyAlbumSimplified { - id: string - name: string - album_type: string - total_tracks: number - release_date: string - images: SpotifyImage[] - artists: SpotifyArtistSimplified[] - external_urls: SpotifyExternalUrls -} - -interface SpotifyTrack { - id: string - name: string - duration_ms: number - explicit: boolean - popularity: number - preview_url: string | null - track_number: number - disc_number: number - album: SpotifyAlbumSimplified - artists: SpotifyArtistSimplified[] - external_urls: SpotifyExternalUrls - uri: string -} - -interface SpotifyArtist { - id: string - name: string - genres: string[] - popularity: number - followers: { total: number } - images: SpotifyImage[] - external_urls: SpotifyExternalUrls -} - -interface SpotifyAlbum { - id: string - name: string - album_type: string - total_tracks: number - release_date: string - release_date_precision: string - label: string - popularity: number - genres: string[] - images: SpotifyImage[] - artists: SpotifyArtistSimplified[] - tracks: { - items: SpotifyTrack[] - total: number - } - external_urls: SpotifyExternalUrls -} - -interface SpotifyPlaylist { - id: string - name: string - description: string | null - public: boolean - collaborative: boolean - owner: { - id: string - display_name: string - } - images: SpotifyImage[] - tracks: { - total: number - } - external_urls: SpotifyExternalUrls - snapshot_id: string -} - -interface SpotifyPlaylistTrack { - added_at: string - added_by: { - id: string - } - track: SpotifyTrack -} - -interface SpotifyUser { - id: string - display_name: string - email?: string - country?: string - product?: string - followers: { total: number } - images: SpotifyImage[] - external_urls: SpotifyExternalUrls -} - -interface SpotifyDevice { - id: string - is_active: boolean - is_private_session: boolean - is_restricted: boolean - name: string - type: string - volume_percent: number -} - -interface SpotifyPlaybackState { - device: SpotifyDevice - shuffle_state: boolean - repeat_state: string - timestamp: number - progress_ms: number - is_playing: boolean - item: SpotifyTrack | null - currently_playing_type: string -} - /** * Search */ @@ -479,33 +347,6 @@ export interface SpotifyGetAlbumResponse extends ToolResponse { } } -/** - * Get Album Tracks - */ -interface SpotifyGetAlbumTracksParams extends SpotifyBaseParams { - albumId: string - limit?: number - offset?: number - market?: string -} - -interface SpotifyGetAlbumTracksResponse extends ToolResponse { - output: { - tracks: Array<{ - id: string - name: string - artists: Array<{ id: string; name: string }> - duration_ms: number - track_number: number - disc_number: number - explicit: boolean - preview_url: string | null - }> - total: number - next: string | null - } -} - /** * Get Artist */ @@ -715,23 +556,6 @@ export interface SpotifyRemoveTracksFromPlaylistResponse extends ToolResponse { } } -/** - * Update Playlist - */ -interface SpotifyUpdatePlaylistParams extends SpotifyBaseParams { - playlistId: string - name?: string - description?: string - public?: boolean - collaborative?: boolean -} - -interface SpotifyUpdatePlaylistResponse extends ToolResponse { - output: { - success: boolean - } -} - /** * Get Current User */ @@ -750,23 +574,6 @@ export interface SpotifyGetCurrentUserResponse extends ToolResponse { } } -/** - * Get User Profile - */ -interface SpotifyGetUserProfileParams extends SpotifyBaseParams { - userId: string -} - -interface SpotifyGetUserProfileResponse extends ToolResponse { - output: { - id: string - display_name: string - followers: number - image_url: string | null - external_url: string - } -} - /** * Get Top Items (Tracks or Artists) */ @@ -888,19 +695,6 @@ export interface SpotifySaveTracksResponse extends ToolResponse { } } -/** - * Remove Saved Tracks - */ -interface SpotifyRemoveSavedTracksParams extends SpotifyBaseParams { - trackIds: string -} - -interface SpotifyRemoveSavedTracksResponse extends ToolResponse { - output: { - success: boolean - } -} - /** * Check Saved Tracks */ @@ -919,54 +713,6 @@ export interface SpotifyCheckSavedTracksResponse extends ToolResponse { } } -/** - * Browse Categories - */ -interface SpotifyBrowseCategoriesParams extends SpotifyBaseParams { - country?: string - locale?: string - limit?: number - offset?: number -} - -interface SpotifyBrowseCategoriesResponse extends ToolResponse { - output: { - categories: Array<{ - id: string - name: string - icon_url: string | null - }> - total: number - next: string | null - } -} - -/** - * Browse New Releases - */ -interface SpotifyBrowseNewReleasesParams extends SpotifyBaseParams { - country?: string - limit?: number - offset?: number -} - -interface SpotifyBrowseNewReleasesResponse extends ToolResponse { - output: { - albums: Array<{ - id: string - name: string - artists: string[] - album_type: string - total_tracks: number - release_date: string - image_url: string | null - external_url: string - }> - total: number - next: string | null - } -} - /** * Player - Get Playback State */ @@ -1001,32 +747,6 @@ export interface SpotifyGetPlaybackStateResponse extends ToolResponse { } } -/** - * Player - Get Currently Playing - */ -interface SpotifyGetCurrentlyPlayingParams extends SpotifyBaseParams { - market?: string -} - -interface SpotifyGetCurrentlyPlayingResponse extends ToolResponse { - output: { - is_playing: boolean - progress_ms: number | null - track: { - id: string - name: string - artists: Array<{ id: string; name: string }> - album: { - id: string - name: string - image_url: string | null - } - duration_ms: number - external_url: string - } | null - } -} - /** * Player - Get Devices */ @@ -1102,20 +822,6 @@ export interface SpotifySkipPreviousResponse extends ToolResponse { } } -/** - * Player - Seek - */ -interface SpotifySeekParams extends SpotifyBaseParams { - position_ms: number - device_id?: string -} - -interface SpotifySeekResponse extends ToolResponse { - output: { - success: boolean - } -} - /** * Player - Set Volume */ @@ -1144,48 +850,6 @@ export interface SpotifyAddToQueueResponse extends ToolResponse { } } -/** - * Player - Transfer Playback - */ -interface SpotifyTransferPlaybackParams extends SpotifyBaseParams { - device_id: string - play?: boolean -} - -interface SpotifyTransferPlaybackResponse extends ToolResponse { - output: { - success: boolean - } -} - -/** - * Player - Set Repeat - */ -interface SpotifySetRepeatParams extends SpotifyBaseParams { - state: 'track' | 'context' | 'off' - device_id?: string -} - -interface SpotifySetRepeatResponse extends ToolResponse { - output: { - success: boolean - } -} - -/** - * Player - Set Shuffle - */ -interface SpotifySetShuffleParams extends SpotifyBaseParams { - state: boolean - device_id?: string -} - -interface SpotifySetShuffleResponse extends ToolResponse { - output: { - success: boolean - } -} - /** * Get New Releases */ diff --git a/apps/sim/tools/ssh/types.ts b/apps/sim/tools/ssh/types.ts index a5a4fcbf80c..b64d8d73d61 100644 --- a/apps/sim/tools/ssh/types.ts +++ b/apps/sim/tools/ssh/types.ts @@ -131,22 +131,6 @@ interface SSHFileInfo { } // System info interface -interface SSHSystemInfo { - hostname: string - os: string - architecture: string - uptime: number - memory: { - total: number - free: number - used: number - } - diskSpace: { - total: number - free: number - used: number - } -} export interface SSHResponse extends ToolResponse { output: { diff --git a/apps/sim/tools/telegram/types.ts b/apps/sim/tools/telegram/types.ts index ff25da5ddc6..9be17369e54 100644 --- a/apps/sim/tools/telegram/types.ts +++ b/apps/sim/tools/telegram/types.ts @@ -303,8 +303,3 @@ export type TelegramResponse = | TelegramGetChatMemberResponse // Legacy type for backwards compatibility -interface TelegramMessageParams { - botToken: string - chatId: string - text: string -} diff --git a/apps/sim/tools/wordpress/types.ts b/apps/sim/tools/wordpress/types.ts index 9b87b1a62eb..e3b41d78c74 100644 --- a/apps/sim/tools/wordpress/types.ts +++ b/apps/sim/tools/wordpress/types.ts @@ -121,12 +121,6 @@ export interface WordPressListPostsResponse extends ToolResponse { } } -interface WordPressSearchPostsParams extends WordPressBaseParams { - query: string - perPage?: number - page?: number -} - interface WordPressSearchPostsResponse extends ToolResponse { output: { posts: WordPressPost[] @@ -342,10 +336,6 @@ export interface WordPressCreateCommentResponse extends ToolResponse { } } -interface WordPressGetCommentParams extends WordPressBaseParams { - commentId: number -} - interface WordPressGetCommentResponse extends ToolResponse { output: { comment: WordPressComment diff --git a/apps/sim/tools/workflow/executor.ts b/apps/sim/tools/workflow/executor.ts index 3a102a9e53e..d36e7002f32 100644 --- a/apps/sim/tools/workflow/executor.ts +++ b/apps/sim/tools/workflow/executor.ts @@ -35,7 +35,7 @@ export const workflowExecutorTool: InternalToolConfig< }, operation: { secretProvenance: { - request: (params) => [ + request: () => [ { key: WORKFLOW_EXECUTOR_INPUT_PROVENANCE_KEY, inputPaths: [['inputMapping']], diff --git a/apps/sim/tools/x/user.ts b/apps/sim/tools/x/user.ts index 63918a4d9dc..562a4197874 100644 --- a/apps/sim/tools/x/user.ts +++ b/apps/sim/tools/x/user.ts @@ -46,7 +46,7 @@ export const xUserTool: ToolConfig = { }), }, - transformResponse: async (response, params) => { + transformResponse: async (response) => { // Handle rate limit issues (429 status code) if (response.status === 429) { logger.warn('X API rate limit exceeded', { diff --git a/apps/sim/tools/zendesk/types.ts b/apps/sim/tools/zendesk/types.ts index 2c55da3f233..a24661e54ae 100644 --- a/apps/sim/tools/zendesk/types.ts +++ b/apps/sim/tools/zendesk/types.ts @@ -4,11 +4,6 @@ import type { OutputProperty } from '@/tools/types' const logger = createLogger('Zendesk') // Base params - following Sentry pattern where subdomain is user-provided -interface ZendeskBaseParams { - email: string // Zendesk user email (required for API token authentication) - apiToken: string // API token (hidden) - subdomain: string // Zendesk subdomain (user-visible, required - e.g., "mycompany" for mycompany.zendesk.com) -} export interface ZendeskPaginationParams { perPage?: string diff --git a/apps/sim/tools/zep/types.ts b/apps/sim/tools/zep/types.ts index 58048c25b83..cb6b3749d34 100644 --- a/apps/sim/tools/zep/types.ts +++ b/apps/sim/tools/zep/types.ts @@ -173,20 +173,6 @@ interface ZepThread { metadata?: Record } -/** - * User object interface for type safety. - */ -interface ZepUser { - userId: string - email?: string - firstName?: string - lastName?: string - uuid?: string - createdAt?: string - updatedAt?: string - metadata?: Record -} - /** * Message object interface for type safety. */ diff --git a/apps/sim/tools/zoom/types.ts b/apps/sim/tools/zoom/types.ts index abce6f218f0..0a3911ac8b9 100644 --- a/apps/sim/tools/zoom/types.ts +++ b/apps/sim/tools/zoom/types.ts @@ -300,15 +300,6 @@ interface ZoomMeeting { }> } -interface ZoomMeetingListResponse { - page_count: number - page_number: number - page_size: number - total_records: number - next_page_token?: string - meetings: ZoomMeeting[] -} - // Create Meeting tool types export interface ZoomCreateMeetingParams extends ZoomBaseParams { userId: string diff --git a/apps/sim/triggers/lemlist/email_bounced.ts b/apps/sim/triggers/lemlist/email_bounced.ts index cda91d0b6a9..0647c9577d0 100644 --- a/apps/sim/triggers/lemlist/email_bounced.ts +++ b/apps/sim/triggers/lemlist/email_bounced.ts @@ -23,7 +23,7 @@ export const lemlistEmailBouncedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_email_bounced', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('emailsBounced'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_email_bounced'), }), diff --git a/apps/sim/triggers/lemlist/email_clicked.ts b/apps/sim/triggers/lemlist/email_clicked.ts index e618ef02535..eb049b9e265 100644 --- a/apps/sim/triggers/lemlist/email_clicked.ts +++ b/apps/sim/triggers/lemlist/email_clicked.ts @@ -23,7 +23,7 @@ export const lemlistEmailClickedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_email_clicked', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('emailsClicked'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_email_clicked'), }), diff --git a/apps/sim/triggers/lemlist/email_opened.ts b/apps/sim/triggers/lemlist/email_opened.ts index e6ac4c574b8..7597eca8f90 100644 --- a/apps/sim/triggers/lemlist/email_opened.ts +++ b/apps/sim/triggers/lemlist/email_opened.ts @@ -23,7 +23,7 @@ export const lemlistEmailOpenedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_email_opened', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('emailsOpened'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_email_opened'), }), diff --git a/apps/sim/triggers/lemlist/email_replied.ts b/apps/sim/triggers/lemlist/email_replied.ts index be2dc41521e..df05ef4c2a0 100644 --- a/apps/sim/triggers/lemlist/email_replied.ts +++ b/apps/sim/triggers/lemlist/email_replied.ts @@ -26,7 +26,7 @@ export const lemlistEmailRepliedTrigger: TriggerConfig = { triggerId: 'lemlist_email_replied', triggerOptions: lemlistTriggerOptions, includeDropdown: true, - setupInstructions: lemlistSetupInstructions('emailsReplied'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_email_replied'), }), diff --git a/apps/sim/triggers/lemlist/email_sent.ts b/apps/sim/triggers/lemlist/email_sent.ts index 7fd38bb9513..1be235ef20a 100644 --- a/apps/sim/triggers/lemlist/email_sent.ts +++ b/apps/sim/triggers/lemlist/email_sent.ts @@ -23,7 +23,7 @@ export const lemlistEmailSentTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_email_sent', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('emailsSent'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_email_sent'), }), diff --git a/apps/sim/triggers/lemlist/interested.ts b/apps/sim/triggers/lemlist/interested.ts index a0b2b64289f..1493ff3ec1b 100644 --- a/apps/sim/triggers/lemlist/interested.ts +++ b/apps/sim/triggers/lemlist/interested.ts @@ -23,7 +23,7 @@ export const lemlistInterestedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_interested', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('interested'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_interested'), }), diff --git a/apps/sim/triggers/lemlist/linkedin_replied.ts b/apps/sim/triggers/lemlist/linkedin_replied.ts index 267b562094c..282c831aa5d 100644 --- a/apps/sim/triggers/lemlist/linkedin_replied.ts +++ b/apps/sim/triggers/lemlist/linkedin_replied.ts @@ -23,7 +23,7 @@ export const lemlistLinkedInRepliedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_linkedin_replied', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('linkedinReplied'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_linkedin_replied'), }), diff --git a/apps/sim/triggers/lemlist/not_interested.ts b/apps/sim/triggers/lemlist/not_interested.ts index f53f5c51270..63d652b761b 100644 --- a/apps/sim/triggers/lemlist/not_interested.ts +++ b/apps/sim/triggers/lemlist/not_interested.ts @@ -23,7 +23,7 @@ export const lemlistNotInterestedTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_not_interested', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('notInterested'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_not_interested'), }), diff --git a/apps/sim/triggers/lemlist/utils.ts b/apps/sim/triggers/lemlist/utils.ts index c3c8e853a39..b850514ae43 100644 --- a/apps/sim/triggers/lemlist/utils.ts +++ b/apps/sim/triggers/lemlist/utils.ts @@ -19,7 +19,7 @@ export const lemlistTriggerOptions = [ * Generates setup instructions for Lemlist webhooks * The webhook is automatically created in Lemlist when you save */ -export function lemlistSetupInstructions(eventType: string): string { +export function lemlistSetupInstructions(): string { const instructions = [ 'Enter your Lemlist API Key above.', 'You can find your API key in Lemlist at Settings > Integrations. See the Lemlist API documentation for details.', diff --git a/apps/sim/triggers/lemlist/webhook.ts b/apps/sim/triggers/lemlist/webhook.ts index ef557b1c59c..2106e1e458a 100644 --- a/apps/sim/triggers/lemlist/webhook.ts +++ b/apps/sim/triggers/lemlist/webhook.ts @@ -23,7 +23,7 @@ export const lemlistWebhookTrigger: TriggerConfig = { subBlocks: buildTriggerSubBlocks({ triggerId: 'lemlist_webhook', triggerOptions: lemlistTriggerOptions, - setupInstructions: lemlistSetupInstructions('All Events (no type filter)'), + setupInstructions: lemlistSetupInstructions(), extraFields: buildLemlistExtraFields('lemlist_webhook'), }), diff --git a/apps/sim/triggers/types.ts b/apps/sim/triggers/types.ts index 1e9d97614fc..1e165a6f5e1 100644 --- a/apps/sim/triggers/types.ts +++ b/apps/sim/triggers/types.ts @@ -43,15 +43,3 @@ export interface TriggerConfig { export interface TriggerRegistry { [triggerId: string]: TriggerConfig } - -interface TriggerInstance { - id: string - triggerId: string - blockId: string - workflowId: string - config: Record - webhookPath?: string - isActive: boolean - createdAt: Date - updatedAt: Date -} diff --git a/biome.json b/biome.json index f87153397c8..5187423281a 100644 --- a/biome.json +++ b/biome.json @@ -99,8 +99,12 @@ }, "correctness": { "useExhaustiveDependencies": "off", - "noUnusedFunctionParameters": "off", - "noUnusedVariables": "off" + "noUnusedFunctionParameters": { "level": "error", "fix": "none" }, + "noUnusedVariables": { + "level": "error", + "fix": "none", + "options": { "ignoreRestSiblings": true } + } }, "security": { "noDangerouslySetInnerHtml": "off" @@ -146,17 +150,6 @@ "includes": ["apps/sim/app/_styles/tailwind.css"], "linter": { "enabled": false }, "formatter": { "enabled": false } - }, - { - "includes": ["packages/**"], - "linter": { - "rules": { - "correctness": { - "noUnusedFunctionParameters": "error", - "noUnusedVariables": "error" - } - } - } } ], "javascript": { diff --git a/packages/testing/src/mocks/execution-limits.mock.ts b/packages/testing/src/mocks/execution-limits.mock.ts index 8cd4bf10ce9..6dd7e1d1d1c 100644 --- a/packages/testing/src/mocks/execution-limits.mock.ts +++ b/packages/testing/src/mocks/execution-limits.mock.ts @@ -155,7 +155,7 @@ export const executionLimitsMockFns = { } return false }), - mockGetTimeoutErrorMessage: vi.fn((_error: unknown, timeoutMs?: number): string => { + mockGetTimeoutErrorMessage: vi.fn((timeoutMs?: number): string => { if (timeoutMs) { const timeoutSeconds = Math.floor(timeoutMs / 1000) const timeoutMinutes = Math.floor(timeoutSeconds / 60) diff --git a/scripts/check-api-validation-contracts.ts b/scripts/check-api-validation-contracts.ts index 119815284d9..ade468ed30c 100644 --- a/scripts/check-api-validation-contracts.ts +++ b/scripts/check-api-validation-contracts.ts @@ -148,49 +148,6 @@ const INDIRECT_ZOD_ROUTES = new Set([ 'apps/sim/app/api/v1/copilot/chat/route.ts', ]) -/** - * Routes baseline-allowed to use `await request.json()` / `await req.json()` - * directly (without an inline `// boundary-raw-json:` annotation). - * - * These are legitimately partial: tolerant body parses (`.catch(() => ({}))`), - * JSON-RPC envelopes that need their own dispatch, multi-stage MCP routes that - * read pre-parsed bodies, and routes whose Zod-backed migration is queued - * behind a separate contract / schema authoring step. New routes must NOT - * introduce raw `await request.json()` reads — annotate the call with - * `// boundary-raw-json: ` instead. - */ -const RAW_JSON_BASELINE_ROUTES = new Set([ - 'apps/sim/app/api/billing/portal/route.ts', - 'apps/sim/app/api/copilot/api-keys/generate/route.ts', - 'apps/sim/app/api/copilot/api-keys/validate/route.ts', - 'apps/sim/app/api/copilot/chat/abort/route.ts', - 'apps/sim/app/api/folders/[id]/restore/route.ts', - 'apps/sim/app/api/invitations/[id]/accept/route.ts', - 'apps/sim/app/api/invitations/[id]/reject/route.ts', - 'apps/sim/app/api/invitations/[id]/route.ts', - 'apps/sim/app/api/knowledge/[id]/documents/route.ts', - 'apps/sim/app/api/knowledge/[id]/documents/[documentId]/chunks/route.ts', - 'apps/sim/app/api/mcp/serve/[serverId]/route.ts', - 'apps/sim/app/api/mcp/servers/route.ts', - 'apps/sim/app/api/mcp/servers/[id]/route.ts', - 'apps/sim/app/api/mcp/servers/test-connection/route.ts', - 'apps/sim/app/api/mcp/tools/discover/route.ts', - 'apps/sim/app/api/mcp/tools/execute/route.ts', - 'apps/sim/app/api/mcp/workflow-servers/route.ts', - 'apps/sim/app/api/mcp/workflow-servers/[id]/route.ts', - 'apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts', - 'apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts', - 'apps/sim/app/api/organizations/route.ts', - 'apps/sim/app/api/organizations/[id]/transfer-ownership/route.ts', - 'apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.ts', - 'apps/sim/app/api/speech/token/route.ts', - 'apps/sim/app/api/table/[tableId]/rows/route.ts', - 'apps/sim/app/api/tools/file/manage/route.ts', - 'apps/sim/app/api/workspaces/invitations/batch/route.ts', - 'apps/sim/app/api/workspaces/[id]/route.ts', - 'apps/sim/app/api/workspaces/[id]/files/[fileId]/content/route.ts', -]) - const CONTRACT_IMPORT_PATTERN = /\bfrom\s+['"]@\/lib\/api\/contracts(?:\/[^'"]*)?['"]/ const DECLARATIVE_ROUTE_BUILDER_IMPORT_PATTERN = /\bimport\s*\{[^}]*(?:\bdefineInternalJsonRoute\b|\bdefineV2JsonRoute\b|\bdefineInternalBinaryRoute\b|\bdefineV2BinaryRoute\b)[^}]*\}\s*from\s*['"]@\/lib\/api\/server\/routes['"]|\bimport\s*\{[^}]*\bdefineScimRoute\b[^}]*\}\s*from\s*['"]@\/ee\/scim\/lib\/route['"]/ @@ -585,13 +542,9 @@ function findDoubleCastFindings( /** * Inspect a route file for `await request.json()` / `await req.json()` reads. * - * Returns one finding per unannotated read. Routes in - * `RAW_JSON_BASELINE_ROUTES` are baseline-allowed: their reads still appear - * in `findings` so the `rawJsonReads` ratcheted metric counts them, but they - * are NOT required to carry per-line `// boundary-raw-json: ` - * annotations. The ratchet's enforcement is by file count - * (see `buildBoundaryPolicyMetrics`): adding a raw read in a route outside - * the baseline pushes the unique-file count above `BOUNDARY_POLICY_BASELINE.rawJsonReads`. + * Returns one finding per unannotated read. The ratchet's enforcement is by + * file count (see `buildBoundaryPolicyMetrics`): a raw read in a new route + * pushes the unique-file count above `BOUNDARY_POLICY_BASELINE.rawJsonReads`. * * Annotated reads (`// boundary-raw-json: ` on one of the three * preceding non-empty lines) are treated as exemptions and excluded from diff --git a/scripts/check-tool-request-boundary.ts b/scripts/check-tool-request-boundary.ts index 12da20a5eb9..881b489bc36 100644 --- a/scripts/check-tool-request-boundary.ts +++ b/scripts/check-tool-request-boundary.ts @@ -213,10 +213,6 @@ interface ImportedBinding { source: string } -function resolveIdentifier(name: string, resolver: SelfHopResolver): SyntaxNode | undefined { - return resolver.locals?.get(name) ?? resolver.bindings.get(name) -} - function resolveScopedIdentifier( name: string, resolver: SelfHopResolver diff --git a/scripts/create-single-release.ts b/scripts/create-single-release.ts index 162a6966196..e832824a9b8 100755 --- a/scripts/create-single-release.ts +++ b/scripts/create-single-release.ts @@ -163,7 +163,7 @@ async function fetchGitHubCommitDetails( githubUsername: 'unknown', prNumber, }) - } catch (fallbackError) { + } catch { console.error(`❌ Failed to get fallback data for ${hash.substring(0, 7)}`) } } diff --git a/scripts/generate-docs.test.ts b/scripts/generate-docs.test.ts index d4ce61cb899..933d4c4c5ec 100644 --- a/scripts/generate-docs.test.ts +++ b/scripts/generate-docs.test.ts @@ -64,7 +64,7 @@ describe('documentation tool metadata', () => { ], tools: { access: ['download_file', 'download_list'] }, outputs: { file: { type: 'file' }, content: { type: 'string' } }, - } as const) satisfies BlockConfig + } as const) satisfies BlockConfig export const DownloadV2Block: BlockConfig = { ...DownloadBlock, type: 'download_v2', name: 'Download', hideFromToolbar: false, diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 3df041056fc..9a38a90a40e 100755 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -4391,7 +4391,7 @@ async function generateBlockDoc(blockPath: string) { const oauthCredential = oauthServiceId ? { serviceId: oauthServiceId, environmentBound: isEnvironmentBoundCredential(fileContent) } : undefined - const markdown = await generateMarkdownForBlock(blockConfig, displayType, oauthCredential) + const markdown = await generateMarkdownForBlock(blockConfig, oauthCredential) let finalContent = markdown if (Object.keys(manualSections).length > 0) { @@ -4414,7 +4414,6 @@ async function generateBlockDoc(blockPath: string) { async function generateMarkdownForBlock( blockConfig: BlockConfig, - displayType?: string, oauthCredential?: OAuthCredentialSource ): Promise { const { @@ -4428,52 +4427,6 @@ async function generateMarkdownForBlock( userSettableParamIds = null, } = blockConfig - let outputsSection = '' - - if (outputs && Object.keys(outputs).length > 0) { - outputsSection = '## Outputs\n\n' - - outputsSection += '| Output | Type | Description |\n' - outputsSection += '| ------ | ---- | ----------- |\n' - - for (const outputKey in outputs) { - const output = outputs[outputKey] - - const escapedDescription = output.description - ? escapeMdxCell(output.description) - : `Output from ${outputKey}` - - if (typeof output.type === 'string') { - outputsSection += `| \`${outputKey}\` | ${output.type} | ${escapedDescription} |\n` - } else if (output.type && typeof output.type === 'object') { - outputsSection += `| \`${outputKey}\` | object | ${escapedDescription} |\n` - - for (const propName in output.type) { - const propType = output.type[propName] - const commentMatch = - propName && output.type[propName]._comment - ? output.type[propName]._comment - : `${propName} of the ${outputKey}` - - outputsSection += `| ↳ \`${propName}\` | ${propType} | ${commentMatch} |\n` - } - } else if (output.properties) { - outputsSection += `| \`${outputKey}\` | object | ${escapedDescription} |\n` - - for (const propName in output.properties) { - const prop = output.properties[propName] - const escapedPropertyDescription = prop.description - ? escapeMdxCell(prop.description) - : `The ${propName} of the ${outputKey}` - - outputsSection += `| ↳ \`${propName}\` | ${prop.type} | ${escapedPropertyDescription} |\n` - } - } - } - } else { - outputsSection = 'This block does not produce any outputs.' - } - let toolsSection = '' if (tools.access?.length) { toolsSection = '## Actions\n\n' @@ -4930,54 +4883,6 @@ export function escapeMdxCell(text: string): string { ) } -/** - * Resolve a module-level `const varName = { ... }` declaration. - * Handles nested spreads of other const variables (but not property-access values). - * Used to expand variable spreads inside builder function return bodies. - */ -function resolveConstVariable( - varName: string, - primaryContent: string, - utilsContent: string, - depth = 0 -): Record { - if (depth > 8) return {} - - const varRegex = new RegExp(`(? = {} - - // Resolve nested variable spreads within this const (no parens = variable reference) - const nestedSpreadRegex = /\.\.\.\s*([a-zA-Z_]\w*)\b(?!\s*\()/g - let nestedMatch: RegExpExecArray | null - while ((nestedMatch = nestedSpreadRegex.exec(varBody)) !== null) { - const nested = resolveConstVariable(nestedMatch[1], primaryContent, utilsContent, depth + 1) - Object.assign(result, nested) - } - - // Parse any inline `field: { type, description }` definitions - // (strip spread lines first; property-access values like `foo: bar.baz` are skipped by parser) - const bodyWithoutVarSpreads = varBody.replace(/\.\.\.\s*\w+\b(?!\s*\()\s*,?\s*/g, '') - const inlineOutputs = parseToolOutputsField(bodyWithoutVarSpreads) - Object.assign(result, inlineOutputs) - - return result - } - - return {} -} - /** Keys a `TriggerOutput` reserves for itself; everything else is a nested property. */ const TRIGGER_OUTPUT_RESERVED_KEYS = new Set([ 'type',