This commit is contained in:
Siddharth Ganesan
2026-04-09 21:02:01 -07:00
parent c74c4a915f
commit ca361a3115
2 changed files with 6 additions and 4 deletions

View File

@@ -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<ContentSegment, { type: 'text' } | { type: 'thinking' } | { type: 'workspace_resource' }>
type RenderGroup =
| { kind: 'inline'; markdown: string }
| { kind: 'block'; segment: ContentSegment; index: number }
| { kind: 'block'; segment: BlockSegment; index: number }
const groups: RenderGroup[] = []
let pendingMarkdown = ''

View File

@@ -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<MothershipResource | { error: string }> {
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) {