feat: add video OCR/ASR, DOCX/PDF export, input block and risk config updates

- Video pipeline: video file OCR via VLM plus audio track ASR, integrated
  into job_handlers with progress emit per phase. New media_utils.py for
  audio extraction from video files.
- Document export: richExport.js replaces inline docx builder; DOCX and PDF
  export buttons are now enabled in MilkdownEditor. File size limit raised to
  100 MB.
- Input block: new InputBlockCrepe.vue component with inputBlockPlugin.ts
  and inputBlock.js for custom user-input nodes in the editor.
- Risk config: added Vite dev server ports (5173) to CORS allowlist and
  increased OCR max input from 10 MB to 100 MB.
- TTS/ASR refactor: simplified tts_asr.py model loading and warmup logic.
- Test coverage: updated tests for llm, main endpoints, pro completions and
  web search modules.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
“ydy0615”
2026-06-18 16:32:31 +08:00
parent 4813196b0a
commit 356108e792
34 changed files with 1457 additions and 563 deletions
+11 -1
View File
@@ -18,6 +18,7 @@ function clipDocContext(content = '', limit = 0) {
}
const AUDIO_EXT_RE = /\.(wav|mp3|m4a|ogg|flac)$/i
const VIDEO_EXT_RE = /\.(mp4|webm|mov|avi|mkv|m4v|ogv)$/i
export function normalizeDocType(value = '') {
const lower = String(value || '').trim().toLowerCase()
@@ -61,6 +62,13 @@ export function isAudioFile(file) {
return AUDIO_EXT_RE.test(name) || type.startsWith('audio/')
}
export function isVideoFile(file) {
if (!file) return false
const name = String(file.name || '').toLowerCase()
const type = String(file.type || '').toLowerCase()
return VIDEO_EXT_RE.test(name) || type.startsWith('video/')
}
export function isSupportedDocFile(file) {
if (!file) return false
const name = String(file.name || '').toLowerCase()
@@ -75,6 +83,7 @@ export function isSupportedDocFile(file) {
name.endsWith('.pptx') ||
name.endsWith('.pdf') ||
AUDIO_EXT_RE.test(name) ||
VIDEO_EXT_RE.test(name) ||
type === 'text/plain' ||
type === 'application/json' ||
type === 'text/yaml' ||
@@ -83,7 +92,8 @@ export function isSupportedDocFile(file) {
type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ||
type === 'application/vnd.openxmlformats-officedocument.presentationml.presentation' ||
type === 'application/pdf' ||
type.startsWith('audio/')
type.startsWith('audio/') ||
type.startsWith('video/')
)
}