File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
app/workspace/[workspaceId]/home/components/message-content/components/chat-content
lib/copilot/tools/handlers Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { CopyCodeButton } from '@/components/ui/copy-code-button'
1313import { cn } from '@/lib/core/utils/cn'
1414import { extractTextContent } from '@/lib/core/utils/react-node-text'
1515import {
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 = ''
Original file line number Diff line number Diff line change 11import 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'
33import { getKnowledgeBaseById } from '@/lib/knowledge/service'
44import { getTableById } from '@/lib/table/service'
55import { getWorkspaceFile } from '@/lib/uploads/contexts/workspace/workspace-file-manager'
@@ -12,7 +12,7 @@ const VALID_OPEN_RESOURCE_TYPES = new Set(Object.values(MothershipResourceType))
1212async 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 ) {
You can’t perform that action at this time.
0 commit comments