Skip to content

Commit ca361a3

Browse files
committed
Fix
1 parent c74c4a9 commit ca361a3

File tree

2 files changed

+6
-4
lines changed
  • apps/sim

2 files changed

+6
-4
lines changed

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { CopyCodeButton } from '@/components/ui/copy-code-button'
1313
import { cn } from '@/lib/core/utils/cn'
1414
import { extractTextContent } from '@/lib/core/utils/react-node-text'
1515
import {
16+
type ContentSegment,
1617
PendingTagIndicator,
1718
parseSpecialTags,
1819
SpecialTags,
@@ -241,9 +242,10 @@ export function ChatContent({
241242
const hasSpecialContent = parsed.hasPendingTag || parsed.segments.some((s) => s.type !== 'text')
242243

243244
if (hasSpecialContent) {
245+
type BlockSegment = Exclude<ContentSegment, { type: 'text' } | { type: 'thinking' } | { type: 'workspace_resource' }>
244246
type RenderGroup =
245247
| { kind: 'inline'; markdown: string }
246-
| { kind: 'block'; segment: ContentSegment; index: number }
248+
| { kind: 'block'; segment: BlockSegment; index: number }
247249

248250
const groups: RenderGroup[] = []
249251
let pendingMarkdown = ''

apps/sim/lib/copilot/tools/handlers/resources.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ExecutionContext, ToolCallResult } from '@/lib/copilot/request/types'
2-
import { MothershipResourceType } from '@/lib/copilot/resources/types'
2+
import { type MothershipResource, MothershipResourceType } from '@/lib/copilot/resources/types'
33
import { getKnowledgeBaseById } from '@/lib/knowledge/service'
44
import { getTableById } from '@/lib/table/service'
55
import { getWorkspaceFile } from '@/lib/uploads/contexts/workspace/workspace-file-manager'
@@ -12,7 +12,7 @@ const VALID_OPEN_RESOURCE_TYPES = new Set(Object.values(MothershipResourceType))
1212
async function resolveResource(
1313
item: ValidOpenResourceParams,
1414
context: ExecutionContext
15-
): Promise<{ type: string; id: string; title: string } | { error: string }> {
15+
): Promise<MothershipResource | { error: string }> {
1616
const resourceType = item.type
1717
let resourceId = item.id
1818
let title: string = resourceType
@@ -68,7 +68,7 @@ export async function executeOpenResource(
6868
return { success: false, error: 'resources array is required' }
6969
}
7070

71-
const resources: Array<{ type: string; id: string; title: string }> = []
71+
const resources: MothershipResource[] = []
7272
const errors: string[] = []
7373

7474
for (const item of items) {

0 commit comments

Comments
 (0)