feat(agent): support 3D degree comments, markup annotations, and config3d in read_asset (#473)

* feat(agent): support AI embedding, autofill, and read_asset for 3D assets

* feat(agent): support 3D degree comments, markup annotations, and config3d in read_asset

* fix(agent): resolve 3D session annotations to turntable degree frame time
This commit is contained in:
Yiling-J
2026-10-13 00:03:21 +08:00
committed by GitHub
parent 0f9d213b1d
commit fe8d404a44
26 changed files with 1687 additions and 21 deletions
+3 -2
View File
@@ -47,7 +47,7 @@ export const shumaiAssetContextSchema = z.object({
id: z.string(),
name: z.string(),
type: z.string(),
mediaType: z.enum(['image', 'video', 'pdf', 'audio', 'other']).optional(),
mediaType: z.enum(['image', 'video', 'pdf', 'audio', '3d', 'other']).optional(),
mimeType: z.string().optional(),
parentId: z.string().optional(),
path: z.string().optional(),
@@ -64,7 +64,7 @@ export const shumaiAttachedFileContextSchema = z.object({
id: z.string(),
name: z.string(),
type: z.string(),
mediaType: z.enum(['image', 'video', 'pdf', 'audio', 'other']).optional(),
mediaType: z.enum(['image', 'video', 'pdf', 'audio', '3d', 'other']).optional(),
mimeType: z.string().optional(),
path: z.string().optional(),
url: z.string().optional(),
@@ -75,6 +75,7 @@ export type ShumaiAttachedFileContext = z.infer<typeof shumaiAttachedFileContext
export const shumaiMediaPositionSchema = z.discriminatedUnion('type', [
z.object({ type: z.literal('time'), seconds: z.number() }),
z.object({ type: z.literal('page'), page: z.number() }),
z.object({ type: z.literal('degree'), degree: z.number().int() }),
])
export type ShumaiMediaPosition = z.infer<typeof shumaiMediaPositionSchema>
+2
View File
@@ -104,6 +104,8 @@ export function serializeContextToXml(context?: ShumaiMessageContext | null): st
lines.push(` <position type="time" seconds="${context.position.seconds.toFixed(4)}" />`)
} else if (context.position.type === 'page') {
lines.push(` <position type="page" page="${Math.round(context.position.page)}" />`)
} else if (context.position.type === 'degree') {
lines.push(` <position type="degree" degree="${Math.round(context.position.degree)}" />`)
}
}