Skip to content

Commit 6639871

Browse files
Sg312emir-karabeg
authored andcommitted
Fix lint
1 parent 0ba5ec6 commit 6639871

File tree

15 files changed

+86
-67
lines changed

15 files changed

+86
-67
lines changed

apps/sim/app/api/copilot/chat/update-messages/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function POST(req: NextRequest) {
6262
}
6363

6464
const body = await req.json()
65-
65+
6666
// Debug: Log what we received
6767
const lastMsg = body.messages?.[body.messages.length - 1]
6868
if (lastMsg?.role === 'assistant') {
@@ -74,7 +74,7 @@ export async function POST(req: NextRequest) {
7474
lastMsgContentBlockTypes: lastMsg.contentBlocks?.map((b: any) => b?.type) || [],
7575
})
7676
}
77-
77+
7878
const { chatId, messages, planArtifact, config } = UpdateMessagesSchema.parse(body)
7979

8080
// Verify that the chat belongs to the user

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/thinking-block.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export function ThinkingBlock({
246246
)}
247247
>
248248
{/* Render markdown during streaming with thinking text styling */}
249-
<div className='whitespace-pre-wrap font-[470] font-season text-[12px] text-[var(--text-muted)] leading-none [&_*]:!text-[var(--text-muted)] [&_*]:!text-[12px] [&_*]:!leading-none [&_*]:!m-0 [&_*]:!p-0 [&_*]:!mb-0 [&_*]:!mt-0 [&_p]:!m-0 [&_h1]:!text-[12px] [&_h1]:!font-semibold [&_h2]:!text-[12px] [&_h2]:!font-semibold [&_h3]:!text-[12px] [&_h3]:!font-semibold [&_code]:!text-[11px] [&_ul]:!pl-4 [&_ul]:!my-0 [&_ol]:!pl-4 [&_ol]:!my-0 [&_li]:!my-0 [&_li]:!py-0 [&_br]:!leading-[0.5]'>
249+
<div className='[&_*]:!text-[var(--text-muted)] [&_*]:!text-[12px] [&_*]:!leading-none [&_*]:!m-0 [&_*]:!p-0 [&_*]:!mb-0 [&_*]:!mt-0 [&_p]:!m-0 [&_h1]:!text-[12px] [&_h1]:!font-semibold [&_h2]:!text-[12px] [&_h2]:!font-semibold [&_h3]:!text-[12px] [&_h3]:!font-semibold [&_code]:!text-[11px] [&_ul]:!pl-4 [&_ul]:!my-0 [&_ol]:!pl-4 [&_ol]:!my-0 [&_li]:!my-0 [&_li]:!py-0 [&_br]:!leading-[0.5] whitespace-pre-wrap font-[470] font-season text-[12px] text-[var(--text-muted)] leading-none'>
250250
<CopilotMarkdownRenderer content={content} />
251251
<span className='ml-1 inline-block h-2 w-1 animate-pulse bg-[var(--text-muted)]' />
252252
</div>
@@ -286,7 +286,7 @@ export function ThinkingBlock({
286286
)}
287287
>
288288
{/* Use markdown renderer for completed content */}
289-
<div className='whitespace-pre-wrap font-[470] font-season text-[12px] text-[var(--text-muted)] leading-none [&_*]:!text-[var(--text-muted)] [&_*]:!text-[12px] [&_*]:!leading-none [&_*]:!m-0 [&_*]:!p-0 [&_*]:!mb-0 [&_*]:!mt-0 [&_p]:!m-0 [&_h1]:!text-[12px] [&_h1]:!font-semibold [&_h2]:!text-[12px] [&_h2]:!font-semibold [&_h3]:!text-[12px] [&_h3]:!font-semibold [&_code]:!text-[11px] [&_ul]:!pl-4 [&_ul]:!my-0 [&_ol]:!pl-4 [&_ol]:!my-0 [&_li]:!my-0 [&_li]:!py-0 [&_br]:!leading-[0.5]'>
289+
<div className='[&_*]:!text-[var(--text-muted)] [&_*]:!text-[12px] [&_*]:!leading-none [&_*]:!m-0 [&_*]:!p-0 [&_*]:!mb-0 [&_*]:!mt-0 [&_p]:!m-0 [&_h1]:!text-[12px] [&_h1]:!font-semibold [&_h2]:!text-[12px] [&_h2]:!font-semibold [&_h3]:!text-[12px] [&_h3]:!font-semibold [&_code]:!text-[11px] [&_ul]:!pl-4 [&_ul]:!my-0 [&_ol]:!pl-4 [&_ol]:!my-0 [&_li]:!my-0 [&_li]:!py-0 [&_br]:!leading-[0.5] whitespace-pre-wrap font-[470] font-season text-[12px] text-[var(--text-muted)] leading-none'>
290290
<CopilotMarkdownRenderer content={content} />
291291
</div>
292292
</div>

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,9 @@ const CopilotMessage: FC<CopilotMessageProps> = memo(
514514
options={parsedTags.options}
515515
onSelect={handleOptionSelect}
516516
disabled={isSendingMessage || isStreaming}
517-
enableKeyboardNav={isLastMessage && !isStreaming && parsedTags.optionsComplete === true}
517+
enableKeyboardNav={
518+
isLastMessage && !isStreaming && parsedTags.optionsComplete === true
519+
}
518520
streaming={isStreaming || !parsedTags.optionsComplete}
519521
/>
520522
)}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { getRegisteredTools } from '@/lib/copilot/tools/client/registry'
1010
// Initialize all tool UI configs
1111
import '@/lib/copilot/tools/client/init-tool-configs'
1212
import {
13-
getToolUIConfig,
14-
isSpecialTool as isSpecialToolFromConfig,
1513
getSubagentLabels as getSubagentLabelsFromConfig,
14+
getToolUIConfig,
1615
hasInterrupt as hasInterruptFromConfig,
16+
isSpecialTool as isSpecialToolFromConfig,
1717
} from '@/lib/copilot/tools/client/ui-config'
1818
import CopilotMarkdownRenderer from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/markdown-renderer'
1919
import { SmoothStreamingText } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/smooth-streaming'
@@ -357,19 +357,21 @@ export function OptionsSelector({
357357
disabled && 'cursor-not-allowed opacity-50',
358358
streaming && 'pointer-events-none',
359359
isLocked && 'cursor-default',
360-
isHovered && !streaming && 'is-hovered bg-[var(--surface-6)] dark:bg-[var(--surface-5)]'
360+
isHovered &&
361+
!streaming &&
362+
'is-hovered bg-[var(--surface-6)] dark:bg-[var(--surface-5)]'
361363
)}
362364
>
363365
<Button
364366
variant='3d'
365-
className='group-hover:-translate-y-0.5 group-[.is-hovered]:-translate-y-0.5 w-[22px] py-[2px] text-[11px] group-hover:text-[var(--text-primary)] group-[.is-hovered]:text-[var(--text-primary)] group-hover:shadow-[0_4px_0_0_rgba(48,48,48,1)] group-[.is-hovered]:shadow-[0_4px_0_0_rgba(48,48,48,1)]'
367+
className='group-hover:-translate-y-0.5 group-[.is-hovered]:-translate-y-0.5 w-[22px] py-[2px] text-[11px] group-hover:text-[var(--text-primary)] group-hover:shadow-[0_4px_0_0_rgba(48,48,48,1)] group-[.is-hovered]:text-[var(--text-primary)] group-[.is-hovered]:shadow-[0_4px_0_0_rgba(48,48,48,1)]'
366368
>
367369
{option.key}
368370
</Button>
369371

370372
<span
371373
className={clsx(
372-
'min-w-0 flex-1 pt-0.5 font-season text-[12px] leading-5 text-[var(--text-tertiary)] group-hover:text-[var(--text-primary)] group-[.is-hovered]:text-[var(--text-primary)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[11px] [&_p]:m-0 [&_p]:leading-5',
374+
'min-w-0 flex-1 pt-0.5 font-season text-[12px] text-[var(--text-tertiary)] leading-5 group-hover:text-[var(--text-primary)] group-[.is-hovered]:text-[var(--text-primary)] [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[11px] [&_p]:m-0 [&_p]:leading-5',
373375
isRejected && 'text-[var(--text-tertiary)] line-through opacity-50'
374376
)}
375377
>
@@ -1158,7 +1160,9 @@ function SubagentContentRenderer({
11581160
}, [isStreaming, shouldCollapse])
11591161

11601162
// Build segments: each segment is either text content or a tool call
1161-
const segments: Array<{ type: 'text'; content: string } | { type: 'tool'; block: SubAgentContentBlock }> = []
1163+
const segments: Array<
1164+
{ type: 'text'; content: string } | { type: 'tool'; block: SubAgentContentBlock }
1165+
> = []
11621166
let currentText = ''
11631167
let allRawText = ''
11641168

@@ -1916,20 +1920,21 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
19161920
'workflow',
19171921
]
19181922
const isSubagentTool = SUBAGENT_TOOLS.includes(toolCall.name)
1919-
1923+
19201924
// For ALL subagent tools, don't show anything until we have blocks with content
19211925
if (isSubagentTool) {
19221926
// Check if we have any meaningful content in blocks
1923-
const hasContent = toolCall.subAgentBlocks && toolCall.subAgentBlocks.some(block =>
1924-
(block.type === 'subagent_text' && block.content?.trim()) ||
1925-
(block.type === 'subagent_tool_call' && block.toolCall)
1927+
const hasContent = toolCall.subAgentBlocks?.some(
1928+
(block) =>
1929+
(block.type === 'subagent_text' && block.content?.trim()) ||
1930+
(block.type === 'subagent_tool_call' && block.toolCall)
19261931
)
1927-
1932+
19281933
if (!hasContent) {
19291934
return null
19301935
}
19311936
}
1932-
1937+
19331938
if (isSubagentTool && toolCall.subAgentBlocks && toolCall.subAgentBlocks.length > 0) {
19341939
// Render subagent content using the dedicated component
19351940
return (
@@ -1975,9 +1980,9 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
19751980
// Check UI config for secondary action
19761981
const toolUIConfig = getToolUIConfig(toolCall.name)
19771982
const secondaryAction = toolUIConfig?.secondaryAction
1978-
const showSecondaryAction =
1979-
secondaryAction &&
1980-
secondaryAction.showInStates.includes(toolCall.state as ClientToolCallState)
1983+
const showSecondaryAction = secondaryAction?.showInStates.includes(
1984+
toolCall.state as ClientToolCallState
1985+
)
19811986

19821987
// Legacy fallbacks for tools that haven't migrated to UI config
19831988
const showMoveToBackground =
@@ -2396,7 +2401,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
23962401
)}
23972402
{/* Render subagent content as thinking text */}
23982403
{toolCall.subAgentBlocks && toolCall.subAgentBlocks.length > 0 && (
2399-
<SubAgentThinkingContent blocks={toolCall.subAgentBlocks} isStreaming={toolCall.subAgentStreaming} />
2404+
<SubAgentThinkingContent
2405+
blocks={toolCall.subAgentBlocks}
2406+
isStreaming={toolCall.subAgentStreaming}
2407+
/>
24002408
)}
24012409
</div>
24022410
)
@@ -2455,7 +2463,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
24552463
)}
24562464
{/* Render subagent content as thinking text */}
24572465
{toolCall.subAgentBlocks && toolCall.subAgentBlocks.length > 0 && (
2458-
<SubAgentThinkingContent blocks={toolCall.subAgentBlocks} isStreaming={toolCall.subAgentStreaming} />
2466+
<SubAgentThinkingContent
2467+
blocks={toolCall.subAgentBlocks}
2468+
isStreaming={toolCall.subAgentStreaming}
2469+
/>
24592470
)}
24602471
</div>
24612472
)
@@ -2564,7 +2575,10 @@ export function ToolCall({ toolCall: toolCallProp, toolCallId, onStateChange }:
25642575

25652576
{/* Render subagent content as thinking text */}
25662577
{toolCall.subAgentBlocks && toolCall.subAgentBlocks.length > 0 && (
2567-
<SubAgentThinkingContent blocks={toolCall.subAgentBlocks} isStreaming={toolCall.subAgentStreaming} />
2578+
<SubAgentThinkingContent
2579+
blocks={toolCall.subAgentBlocks}
2580+
isStreaming={toolCall.subAgentStreaming}
2581+
/>
25682582
)}
25692583
</div>
25702584
)

apps/sim/lib/copilot/registry.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ export const ToolArgSchemas = {
121121
serverId: z
122122
.string()
123123
.describe('The MCP server ID to deploy to (get from list_workspace_mcp_servers)'),
124-
workflowId: z.string().optional().describe('Optional workflow ID (defaults to active workflow)'),
124+
workflowId: z
125+
.string()
126+
.optional()
127+
.describe('Optional workflow ID (defaults to active workflow)'),
125128
toolName: z.string().optional().describe('Custom tool name (defaults to workflow name)'),
126129
toolDescription: z.string().optional().describe('Custom tool description'),
127130
parameterDescriptions: z

apps/sim/lib/copilot/tools/client/base-subagent-tool.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
* Examples: edit, plan, debug, evaluate, research, etc.
99
*/
1010
import type { LucideIcon } from 'lucide-react'
11-
import {
12-
BaseClientTool,
13-
type BaseClientToolMetadata,
14-
ClientToolCallState,
15-
} from './base-tool'
11+
import { BaseClientTool, type BaseClientToolMetadata, ClientToolCallState } from './base-tool'
1612
import type { SubagentConfig, ToolUIConfig } from './ui-config'
1713
import { registerToolUIConfig } from './ui-config'
1814

@@ -122,4 +118,3 @@ export function createSubagentToolClass(config: SubagentToolConfig) {
122118
}
123119
}
124120
}
125-

apps/sim/lib/copilot/tools/client/init-tool-configs.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,14 @@ import './user/set-environment-variables'
3535

3636
// Re-export UI config utilities for convenience
3737
export {
38+
getSubagentLabels,
3839
getToolUIConfig,
39-
isSubagentTool,
40-
isSpecialTool,
4140
hasInterrupt,
42-
getSubagentLabels,
43-
type ToolUIConfig,
44-
type SubagentConfig,
4541
type InterruptConfig,
46-
type SecondaryActionConfig,
42+
isSpecialTool,
43+
isSubagentTool,
4744
type ParamsTableConfig,
45+
type SecondaryActionConfig,
46+
type SubagentConfig,
47+
type ToolUIConfig,
4848
} from './ui-config'
49-

apps/sim/lib/copilot/tools/client/ui-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,3 @@ export function getSubagentLabels(
236236
export function getAllToolUIConfigs(): Record<string, ToolUIConfig> {
237237
return { ...toolUIConfigs }
238238
}
239-

apps/sim/lib/copilot/tools/client/workflow/create-workspace-mcp-server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,3 @@ export class CreateWorkspaceMcpServerClientTool extends BaseClientTool {
153153
await this.handleAccept(args)
154154
}
155155
}
156-

apps/sim/lib/copilot/tools/client/workflow/deploy-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,3 @@ export class DeployApiClientTool extends BaseClientTool {
288288

289289
// Register UI config at module load
290290
registerToolUIConfig(DeployApiClientTool.id, DeployApiClientTool.metadata.uiConfig!)
291-

0 commit comments

Comments
 (0)