Skip to content

Commit 0a860b3

Browse files
committed
fix(agent-tools): added special handling for workflow tool in agent tool input, added react grab
1 parent 468ec2e commit 0a860b3

File tree

5 files changed

+141
-11
lines changed

5 files changed

+141
-11
lines changed

apps/sim/app/layout.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Metadata, Viewport } from 'next'
2+
import Script from 'next/script'
23
import { PublicEnvScript } from 'next-runtime-env'
34
import { BrandedLayout } from '@/components/branded-layout'
45
import { generateThemeCSS } from '@/lib/branding/inject-theme'
56
import { generateBrandedMetadata, generateStructuredData } from '@/lib/branding/metadata'
67
import { PostHogProvider } from '@/app/_shell/providers/posthog-provider'
78
import '@/app/_styles/globals.css'
8-
99
import { OneDollarStats } from '@/components/analytics/onedollarstats'
1010
import { HydrationErrorHandler } from '@/app/_shell/hydration-error-handler'
1111
import { QueryProvider } from '@/app/_shell/providers/query-provider'
@@ -33,6 +33,19 @@ export default function RootLayout({ children }: { children: React.ReactNode })
3333
return (
3434
<html lang='en' suppressHydrationWarning>
3535
<head>
36+
{process.env.NODE_ENV === 'development' && (
37+
<Script
38+
src='//unpkg.com/react-grab/dist/index.global.js'
39+
crossOrigin='anonymous'
40+
strategy='beforeInteractive'
41+
/>
42+
)}
43+
{process.env.NODE_ENV === 'development' && (
44+
<Script
45+
src='//unpkg.com/@react-grab/cursor/dist/client.global.js'
46+
strategy='lazyOnload'
47+
/>
48+
)}
3649
{/* Structured Data for SEO */}
3750
<script
3851
type='application/ld+json'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,11 +2195,12 @@ export function ToolInput({
21952195
{/* Selected Tools List */}
21962196
{selectedTools.length > 0 &&
21972197
selectedTools.map((tool, toolIndex) => {
2198-
// Handle custom tools and MCP tools differently
2198+
// Handle custom tools, MCP tools, and workflow tools differently
21992199
const isCustomTool = tool.type === 'custom-tool'
22002200
const isMcpTool = tool.type === 'mcp'
2201+
const isWorkflowTool = tool.type === 'workflow'
22012202
const toolBlock =
2202-
!isCustomTool && !isMcpTool
2203+
!isCustomTool && !isMcpTool && !isWorkflowTool
22032204
? toolBlocks.find((block) => block.type === tool.type)
22042205
: null
22052206

@@ -2323,13 +2324,17 @@ export function ToolInput({
23232324
? '#3B82F6'
23242325
: isMcpTool
23252326
? mcpTool?.bgColor || '#6366F1'
2326-
: toolBlock?.bgColor,
2327+
: isWorkflowTool
2328+
? '#6366F1'
2329+
: toolBlock?.bgColor,
23272330
}}
23282331
>
23292332
{isCustomTool ? (
23302333
<WrenchIcon className='h-[10px] w-[10px] text-white' />
23312334
) : isMcpTool ? (
23322335
<IconComponent icon={McpIcon} className='h-[10px] w-[10px] text-white' />
2336+
) : isWorkflowTool ? (
2337+
<IconComponent icon={WorkflowIcon} className='h-[10px] w-[10px] text-white' />
23332338
) : (
23342339
<IconComponent
23352340
icon={toolBlock?.icon}

apps/sim/components/emcn/components/combobox/combobox.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
256256
customOnSelect()
257257
setOpen(false)
258258
setHighlightedIndex(-1)
259+
setSearchQuery('')
259260
return
260261
}
261262

@@ -269,6 +270,7 @@ const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
269270
onChange?.(selectedValue)
270271
setOpen(false)
271272
setHighlightedIndex(-1)
273+
setSearchQuery('')
272274
if (editable && inputRef.current) {
273275
inputRef.current.blur()
274276
}
@@ -312,6 +314,7 @@ const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
312314
if (!activeElement || (!isInContainer && !isInDropdown && !isSearchInput)) {
313315
setOpen(false)
314316
setHighlightedIndex(-1)
317+
setSearchQuery('')
315318
}
316319
}, 150)
317320
}, [])
@@ -326,6 +329,7 @@ const Combobox = forwardRef<HTMLDivElement, ComboboxProps>(
326329
if (e.key === 'Escape') {
327330
setOpen(false)
328331
setHighlightedIndex(-1)
332+
setSearchQuery('')
329333
if (editable && inputRef.current) {
330334
inputRef.current.blur()
331335
}

apps/sim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"node": ">=20.0.0"
99
},
1010
"scripts": {
11-
"dev": "next dev --port 3000",
11+
"dev": "bunx @react-grab/cursor@latest && next dev --port 3000",
1212
"dev:webpack": "next dev --webpack",
1313
"dev:sockets": "bun run socket/index.ts",
1414
"dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"bun run dev\" \"bun run dev:sockets\"",

0 commit comments

Comments
 (0)