From ca361a311577676460c2467714b414f47c93e813 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Thu, 9 Apr 2026 21:02:01 -0700 Subject: [PATCH] Fix --- .../components/chat-content/chat-content.tsx | 4 +++- apps/sim/lib/copilot/tools/handlers/resources.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx index 56a7c7b5f6..cd8bf1a729 100644 --- a/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx +++ b/apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx @@ -13,6 +13,7 @@ import { CopyCodeButton } from '@/components/ui/copy-code-button' import { cn } from '@/lib/core/utils/cn' import { extractTextContent } from '@/lib/core/utils/react-node-text' import { + type ContentSegment, PendingTagIndicator, parseSpecialTags, SpecialTags, @@ -241,9 +242,10 @@ export function ChatContent({ const hasSpecialContent = parsed.hasPendingTag || parsed.segments.some((s) => s.type !== 'text') if (hasSpecialContent) { + type BlockSegment = Exclude type RenderGroup = | { kind: 'inline'; markdown: string } - | { kind: 'block'; segment: ContentSegment; index: number } + | { kind: 'block'; segment: BlockSegment; index: number } const groups: RenderGroup[] = [] let pendingMarkdown = '' diff --git a/apps/sim/lib/copilot/tools/handlers/resources.ts b/apps/sim/lib/copilot/tools/handlers/resources.ts index ea8d92cf81..1a77631e05 100644 --- a/apps/sim/lib/copilot/tools/handlers/resources.ts +++ b/apps/sim/lib/copilot/tools/handlers/resources.ts @@ -1,5 +1,5 @@ import type { ExecutionContext, ToolCallResult } from '@/lib/copilot/request/types' -import { MothershipResourceType } from '@/lib/copilot/resources/types' +import { type MothershipResource, MothershipResourceType } from '@/lib/copilot/resources/types' import { getKnowledgeBaseById } from '@/lib/knowledge/service' import { getTableById } from '@/lib/table/service' import { getWorkspaceFile } from '@/lib/uploads/contexts/workspace/workspace-file-manager' @@ -12,7 +12,7 @@ const VALID_OPEN_RESOURCE_TYPES = new Set(Object.values(MothershipResourceType)) async function resolveResource( item: ValidOpenResourceParams, context: ExecutionContext -): Promise<{ type: string; id: string; title: string } | { error: string }> { +): Promise { const resourceType = item.type let resourceId = item.id let title: string = resourceType @@ -68,7 +68,7 @@ export async function executeOpenResource( return { success: false, error: 'resources array is required' } } - const resources: Array<{ type: string; id: string; title: string }> = [] + const resources: MothershipResource[] = [] const errors: string[] = [] for (const item of items) {