Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat(parse): add support for legacy .doc and .xls file formats (#652)

Lam Ngoc Nguyen559eef38c900
diff --git a/openviking/parse/parsers/excel.py b/openviking/parse/parsers/excel.py
index 086dcc1c5..2da44ce30 100644
--- a/openviking/parse/parsers/excel.py
+++ b/openviking/parse/parsers/excel.py
@@ -51,9 +51,13 @@ class ExcelParser(BaseParser):
path = Path(source)
if path.exists():
- import openpyxl
+ # Use xlrd for legacy .xls, openpyxl for .xlsx/.xlsm
+ if path.suffix.lower() == ".xls":
+ markdown_content = self._convert_xls_to_markdown(path)
+ else:
+ import openpyxl
- markdown_content = self._convert_to_markdown(path, openpyxl)
+ markdown_content = self._convert_to_markdown(path, openpyxl)
result = await self._md_parser.parse_content(
markdown_content, source_path=str(path), instruction=instruction, **kwargs
)
@@ -61,7 +65,7 @@ class ExcelParser(BaseParser):
result = await self._md_parser.parse_content(
str(source), instruction=instruction, **kwargs
)
- result.source_format = "xlsx"
+ result.source_format = path.suffix.lstrip(".") if path.exists() else "xlsx"
result.parser_name = "ExcelParser"
return result
@@ -74,6 +78,91 @@ class ExcelParser(BaseParser):
result.parser_name = "ExcelParser"
return result
+ def _convert_xls_to_markdown(self, path: Path) -> str:
+ """Convert legacy .xls spreadsheet to Markdown using xlrd."""
+ import xlrd
+
+ # formatting_info=True enables xlrd to detect date cells via XL_CELL_DATE
+ # instead of reporting them as XL_CELL_NUMBER with raw float serials
+ wb = xlrd.open_workbook(str(path), formatting_info=True, on_demand=True)
+ try:
+ return self._build_xls_markdown(wb, path, xlrd)
+ finally:
+ wb.release_resources()
+
+ def _build_xls_markdown(self, wb, path: Path, xlrd) -> str:
+ """Build markdown from xlrd workbook."""
+ markdown_parts = []
+ markdown_parts.append(f"# {path.stem}")
+ markdown_parts.append(f"**Sheets:** {wb.nsheets}")
+
+ for sheet_idx in range(wb.nsheets):
+ sheet = wb.sheet_by_index(sheet_idx)
+ parts = [f"## Sheet: {sheet.name}"]
+
+ if sheet.nrows == 0 or sheet.ncols == 0:
+ parts.append("*Empty sheet*")
+ markdown_parts.append("\n\n".join(parts))
+ continue
+
+ parts.append(f"**Dimensions:** {sheet.nrows} rows × {sheet.ncols} columns")
+
+ rows_to_process = sheet.nrows
+ if self.max_rows_per_sheet > 0:
+ rows_to_process = min(sheet.nrows, self.max_rows_per_sheet)
+
+ rows = []
+ for row_idx in range(rows_to_process):
+ row_data = []
+ for col_idx in range(sheet.ncols):
+ row_data.append(self._format_xls_cell(sheet.cell(row_idx, col_idx), wb, xlrd))
+ rows.append(row_data)
+
+ if rows:
+ from openviking.parse.base import format_table_to_markdown
+
+ parts.append(format_table_to_markdown(rows, has_header=True))
+
+ if self.max_rows_per_sheet > 0 and sheet.nrows > self.max_rows_per_sheet:
+ parts.append(
+ f"\n*... {sheet.nrows - self.max_rows_per_sheet} more rows truncated ...*"
+ )
+
+ markdown_parts.append("\n\n".join(parts))
+
+ return "\n\n".join(markdown_parts)
+
+ @staticmethod
+ def _format_xls_cell(cell, wb, xlrd) -> str:
+ """Format a single xlrd cell value with proper type handling."""
+ if cell.ctype == xlrd.XL_CELL_EMPTY or cell.ctype == xlrd.XL_CELL_BLANK:
+ return ""
+ if cell.ctype == xlrd.XL_CELL_DATE:
+ try:
+ dt = xlrd.xldate_as_tuple(cell.value, wb.datemode)
+ # Include time component if non-zero
+ if dt[3] or dt[4] or dt[5]:
+ return f"{dt[0]:04d}-{dt[1]:02d}-{dt[2]:02d} {dt[3]:02d}:{dt[4]:02d}:{dt[5]:02d}"
+ return f"{dt[0]:04d}-{dt[1]:02d}-{dt[2]:02d}"
+ except Exception:
+ return str(cell.value)
+ if cell.ctype == xlrd.XL_CELL_BOOLEAN:
+ return "TRUE" if cell.value else "FALSE"
+ if cell.ctype == xlrd.XL_CELL_ERROR:
+ # xlrd error code map
+ error_map = {
+ 0x00: "#NULL!", 0x07: "#DIV/0!", 0x0F: "#VALUE!",
+ 0x17: "#REF!", 0x1D: "#NAME?", 0x24: "#NUM!", 0x2A: "#N/A",
+ }
+ return error_map.get(cell.value, f"#ERR({cell.value})")
+ if cell.ctype == xlrd.XL_CELL_NUMBER:
+ # Display integers without trailing .0
+ if cell.value == int(cell.value):
+ return str(int(cell.value))
+ return str(cell.value)
+ # XL_CELL_TEXT or fallback
+ return str(cell.value) if cell.value is not None else ""
+
def _convert_to_markdown(self, path: Path, openpyxl) -> str:
"""Convert Excel spreadsheet to Markdown string."""
wb = openpyxl.load_workbook(path, data_only=True)
diff --git a/openviking/parse/parsers/legacy_doc.py b/openviking/parse/parsers/legacy_doc.py
new file mode 100644
index 000000000..95b770ae8
--- /dev/null
+++ b/openviking/parse/parsers/legacy_doc.py
@@ -0,0 +1,355 @@
+# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
+# SPDX-License-Identifier: Apache-2.0
+"""
+Legacy Word document (.doc) parser for OpenViking.
+
+Extracts text from OLE2 compound binary .doc files using olefile,
+then delegates to MarkdownParser for tree structure creation.
+"""
+
+import struct
+from pathlib import Path
+from typing import List, Optional, Union
+
+from openviking.parse.base import ParseResult
+from openviking.parse.parsers.base_parser import BaseParser
+from openviking_cli.utils.config.parser_config import ParserConfig
+from openviking_cli.utils.logger import get_logger
+
+logger = get_logger(__name__)
+
+
+ # Max stream size to read (50MB) — prevents DoS from crafted files
+_MAX_STREAM_SIZE = 50 * 1024 * 1024
+# Max character count sanity cap for ccpText
+_MAX_CCP_TEXT = 10_000_000
+
+
+class LegacyDocParser(BaseParser):
+ """
+ Legacy .doc (OLE2 binary) parser.
+
+ Extracts text content from Word 97-2003 (.doc) files using olefile
+ to read the WordDocument and table streams, then delegates to
+ MarkdownParser for tree structure.
+ """
+
+ def __init__(self, config: Optional[ParserConfig] = None):
+ from openviking.parse.parsers.markdown import MarkdownParser
+
+ self._md_parser = MarkdownParser(config=config)
+ self.config = config or ParserConfig()
+
+ @property
+ def supported_extensions(self) -> List[str]:
+ return [".doc"]
+
+ async def parse(self, source: Union[str, Path], instruction: str = "", **kwargs) -> ParseResult:
+ """Parse legacy .doc file."""
+ path = Path(source)
+
+ if path.exists():
+ text = self._extract_text(path)
+ result = await self._md_parser.parse_content(
+ text, source_path=str(path), instruction=instruction, **kwargs
+ )
+ else:
+ result = await self._md_parser.parse_content(
+ str(source), instruction=instruction, **kwargs
+ )
+ result.source_format = "doc"
+ result.parser_name = "LegacyDocParser"
+ return result
+
+ async def parse_content(
+ self, content: str, source_path: Optional[str] = None, instruction: str = "", **kwargs
+ ) -> ParseResult:
+ """Parse content string — delegates to MarkdownParser."""
+ result = await self._md_parser.parse_content(
+ content, source_path, instruction=instruction, **kwargs
+ )
+ result.source_format = "doc"
+ result.parser_name = "LegacyDocParser"
+ return result
+
+ def _extract_text(self, path: Path) -> str:
+ """
+ Extract text from a legacy .doc OLE2 file.
+
+ Reads the WordDocument stream and uses the FIB (File Information Block)
+ to locate text in the document body. Falls back to raw byte scanning
+ if structured extraction fails.
+ """
+ import olefile
+
+ try:
+ ole = olefile.OleFileIO(str(path))
+ except Exception as e:
+ logger.warning(f"Failed to open .doc as OLE file: {e}")
+ return self._fallback_extract(path)
+
+ try:
+ return self._extract_from_ole(ole)
+ except Exception as e:
+ logger.warning(f"Structured OLE extraction failed, using fallback: {e}")
+ return self._fallback_extract(path)
+ finally:
+ ole.close()
+
+ @staticmethod
+ def _read_ole_stream(ole, stream_name: str) -> bytes:
+ """Read an OLE stream with size cap to prevent DoS."""
+ stream = ole.openstream(stream_name)
+ data = stream.read(_MAX_STREAM_SIZE + 1)
+ if len(data) > _MAX_STREAM_SIZE:
+ raise ValueError(f"OLE stream '{stream_name}' exceeds {_MAX_STREAM_SIZE} bytes")
+ return data
+
+ def _extract_from_ole(self, ole) -> str:
+ """
+ Extract text from OLE streams using the Word Binary File Format.
+
+ Reads the FIB to determine if text is stored as UTF-16 or compressed
+ (CP1252), then extracts the document body text from the appropriate
+ stream (WordDocument or table stream).
+ """
+ if not ole.exists("WordDocument"):
+ raise ValueError("No WordDocument stream found")
+
+ word_doc = self._read_ole_stream(ole, "WordDocument")
+
+ # Minimum FIB size: need at least 0x01A8 bytes for Word 97+ FIB fields
+ if len(word_doc) < 0x01A8:
+ raise ValueError(f"WordDocument stream too small ({len(word_doc)} bytes)")
+
+ # Check FIB version (nFib at offset 0x0002) — require Word 97+ (0x00C1+)
+ nfib = struct.unpack_from("<H", word_doc, 0x0002)[0]
+ if nfib < 0x00C1:
+ raise ValueError(f"Unsupported Word version (nFib=0x{nfib:04X}), need Word 97+")
+
+ # Read FIB flags at offset 0x000A
+ # Bit 9: table stream selector (0Table vs 1Table)
+ # Bit 8: fComplex (complex fast-saved format — does not affect encoding)
+ flags = struct.unpack_from("<H", word_doc, 0x000A)[0]
+ is_1table = bool(flags & 0x0200)
+ table_stream_name = "1Table" if is_1table else "0Table"
+
+ # Read ccpText (character count of main document text) at FIB offset 0x004C
+ ccp_text = struct.unpack_from("<i", word_doc, 0x004C)[0]
+
+ if ccp_text <= 0:
+ raise ValueError("ccpText is zero or negative")
+ # Cap ccpText to prevent memory exhaustion from crafted files
+ ccp_text = min(ccp_text, _MAX_CCP_TEXT)
+
+ # Read the Clx from the table stream to find text positions
+ if not ole.exists(table_stream_name):
+ raise ValueError(f"Table stream '{table_stream_name}' not found")
+ table_data = self._read_ole_stream(ole, table_stream_name)
+
+ # fcClx offset in FIB (Word 97+ standard location)
+ fc_clx = struct.unpack_from("<i", word_doc, 0x01A2)[0]
+ lcb_clx = struct.unpack_from("<i", word_doc, 0x01A6)[0]
+
+ if fc_clx <= 0 or lcb_clx <= 0 or fc_clx + lcb_clx > len(table_data):
+ return self._simple_text_extract(word_doc, ccp_text)
+
+ return self._extract_via_clx(
+ word_doc, table_data, fc_clx, lcb_clx, ccp_text
+ )
+
+ def _simple_text_extract(self, word_doc: bytes, ccp_text: int) -> str:
+ """
+ Simple text extraction using FIB text offset.
+
+ The main document text starts at offset 0x0800 in the WordDocument stream
+ for most Word 97+ files. Tries UTF-16LE first; falls back to CP1252 if
+ the stream is too small for UTF-16.
+ """
+ text_start = 0x0800 # Standard text start offset
+
+ if text_start >= len(word_doc):
+ raise ValueError("WordDocument stream too small for text extraction")
+
+ # Try UTF-16LE first (2 bytes per char)
+ if ccp_text * 2 + text_start <= len(word_doc):
+ end = text_start + ccp_text * 2
+ raw = word_doc[text_start:end]
+ text = raw.decode("utf-16-le", errors="replace")
+ # Sanity: if mostly printable, it's likely correct
+ if sum(1 for c in text[:200] if c.isprintable() or c in "\n\r\t") > len(text[:200]) * 0.5:
+ return self._clean_word_text(text)
+
+ # Fall back to CP1252 single-byte
+ end = min(text_start + ccp_text, len(word_doc))
+ raw = word_doc[text_start:end]
+ return self._clean_word_text(self._decode_cp1252(raw))
+
+ def _extract_via_clx(
+ self,
+ word_doc: bytes,
+ table_data: bytes,
+ fc_clx: int,
+ lcb_clx: int,
+ ccp_text: int,
+ ) -> str:
+ """
+ Extract text using the Clx (piece table) structure.
+
+ The Clx contains a PiecePLC that maps character positions to file offsets,
+ allowing reconstruction of the document text even when pieces are scattered.
+ """
+ clx = table_data[fc_clx : fc_clx + lcb_clx]
+ pos = 0
+ text_parts = []
+ chars_extracted = 0
+
+ # Skip any Grpprl (type 0x01) entries in the Clx
+ while pos < len(clx) and clx[pos] == 0x01:
+ if pos + 3 > len(clx):
+ break
+ cb = struct.unpack_from("<H", clx, pos + 1)[0]
+ advance = 3 + cb
+ if advance <= 0:
+ break # Prevent infinite loop on zero-length Grpprl
+ pos += advance
+
+ # Now we should be at the Pcdt (type 0x02)
+ if pos >= len(clx) or clx[pos] != 0x02:
+ return self._simple_text_extract(word_doc, ccp_text)
+
+ pos += 1 # skip type byte
+ if pos + 4 > len(clx):
+ return self._simple_text_extract(word_doc, ccp_text)
+
+ lcb_pcd = struct.unpack_from("<I", clx, pos)[0]
+ pos += 4
+
+ # PLC structure: (n+1) CPs followed by n PCDs (each 8 bytes)
+ pcd_start = pos
+ pcd_end = pos + lcb_pcd
+
+ if pcd_end > len(clx):
+ return self._simple_text_extract(word_doc, ccp_text)
+
+ # Calculate number of pieces: (lcb_pcd - 4) / (4 + 8) per piece,
+ # but CPs are (n+1)*4 bytes + n*8 bytes = lcb_pcd
+ # So: 4*(n+1) + 8*n = lcb_pcd → 12n + 4 = lcb_pcd → n = (lcb_pcd - 4) / 12
+ n_pieces = (lcb_pcd - 4) // 12
+ if n_pieces <= 0:
+ return self._simple_text_extract(word_doc, ccp_text)
+
+ # Read character positions (n+1 values)
+ cps = []
+ for i in range(n_pieces + 1):
+ offset = pcd_start + i * 4
+ if offset + 4 > len(clx):
+ break
+ cps.append(struct.unpack_from("<I", clx, offset)[0])
+
+ # Read piece descriptors (start after the CPs)
+ pcd_array_start = pcd_start + (n_pieces + 1) * 4
+
+ for i in range(min(n_pieces, len(cps) - 1)):
+ if chars_extracted >= ccp_text:
+ break
+
+ pcd_offset = pcd_array_start + i * 8
+ if pcd_offset + 8 > len(clx):
+ break
+
+ # PCD: 2 bytes flags, 4 bytes fc, 2 bytes prm
+ fc_value = struct.unpack_from("<I", clx, pcd_offset + 2)[0]
+
+ piece_cp_start = cps[i]
+ piece_cp_end = cps[i + 1]
+ piece_char_count = piece_cp_end - piece_cp_start
+
+ # Bit 30 of fc indicates compressed (CP1252) text
+ is_compressed = bool(fc_value & 0x40000000)
+ fc_real = fc_value & 0x3FFFFFFF
+
+ if is_compressed:
+ # CP1252: fc_real / 2 is the byte offset
+ byte_offset = fc_real // 2
+ byte_end = byte_offset + piece_char_count
+ if byte_end <= len(word_doc):
+ raw = word_doc[byte_offset:byte_end]
+ text_parts.append(self._decode_cp1252(raw))
+ else:
+ logger.warning(f"Piece {i} extends beyond stream ({byte_end} > {len(word_doc)})")
+ else:
+ # UTF-16LE
+ byte_offset = fc_real
+ byte_end = byte_offset + piece_char_count * 2
+ if byte_end <= len(word_doc):
+ raw = word_doc[byte_offset:byte_end]
+ text_parts.append(raw.decode("utf-16-le", errors="replace"))
+ else:
+ logger.warning(f"Piece {i} extends beyond stream ({byte_end} > {len(word_doc)})")
+
+ chars_extracted += piece_char_count
+
+ result = self._clean_word_text("".join(text_parts))
+ if not result.strip():
+ return self._simple_text_extract(word_doc, ccp_text)
+ return result
+
+ @staticmethod
+ def _decode_cp1252(data: bytes) -> str:
+ """Decode CP1252 bytes to string."""
+ return data.decode("cp1252", errors="replace")
+
+ @staticmethod
+ def _clean_word_text(text: str) -> str:
+ """Normalize Word control characters to readable equivalents."""
+ text = text.replace("\r\n", "\n").replace("\r", "\n")
+ # \x07 = cell/row end, \x0B = soft line break, \x0C = section break
+ text = text.replace("\x07", "\t").replace("\x0B", "\n").replace("\x0C", "\n\n")
+ return text
+
+ def _fallback_extract(self, path: Path) -> str:
+ """
+ Last-resort text extraction by scanning raw bytes for readable text runs.
+
+ Tries UTF-16LE decoding first (common in .doc), then falls back to CP1252.
+ """
+ # Cap read size to prevent DoS from large files
+ with open(path, "rb") as f:
+ raw = f.read(_MAX_STREAM_SIZE)
+
+ # Try to find UTF-16LE text (every other byte is often 0x00 for ASCII)
+ try:
+ decoded = raw.decode("utf-16-le", errors="ignore")
+ # Filter to printable text runs
+ lines = []
+ current = []
+ for ch in decoded:
+ if ch.isprintable() or ch in "\n\t":
+ current.append(ch)
+ else:
+ if len(current) > 3:
+ lines.append("".join(current))
+ current = []
+ if current and len(current) > 3:
+ lines.append("".join(current))
+ text = "\n".join(lines)
+ if len(text) > 50:
+ return text
+ except Exception:
+ pass
+
+ # Fall back to CP1252
+ text = raw.decode("cp1252", errors="replace")
+ lines = []
+ current = []
+ for ch in text:
+ if ch.isprintable() or ch in "\n\t":
+ current.append(ch)
+ else:
+ if len(current) > 3:
+ lines.append("".join(current))
+ current = []
+ if current and len(current) > 3:
+ lines.append("".join(current))
+ return "\n".join(lines)
diff --git a/openviking/parse/registry.py b/openviking/parse/registry.py
index 77a90395a..4c6b3e4a0 100644
--- a/openviking/parse/registry.py
+++ b/openviking/parse/registry.py
@@ -26,6 +26,7 @@ from openviking.parse.parsers.powerpoint import PowerPointParser
from openviking.parse.parsers.text import TextParser
# Import markitdown-inspired parsers
+from openviking.parse.parsers.legacy_doc import LegacyDocParser
from openviking.parse.parsers.word import WordParser
from openviking.parse.parsers.zip_parser import ZipParser
@@ -62,6 +63,7 @@ class ParserRegistry:
# Register markitdown-inspired parsers (built-in)
self.register("word", WordParser())
+ self.register("legacy_doc", LegacyDocParser())
self.register("powerpoint", PowerPointParser())
self.register("excel", ExcelParser())
self.register("epub", EPubParser())
diff --git a/pyproject.toml b/pyproject.toml
index 638228c43..63b19c283 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,6 +40,8 @@ dependencies = [
"openai>=1.0.0",
"requests>=2.31.0",
"python-docx>=1.0.0",
+ "olefile>=0.47",
+ "xlrd>=2.0.1",
"python-pptx>=1.0.0",
"openpyxl>=3.0.0",
"ebooklib>=0.18.0",
diff --git a/uv.lock b/uv.lock
index 0a30e9705..59e6638e3 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1,5 +1,5 @@
version = 1
-revision = 3
+revision = 2
requires-python = ">=3.10"
resolution-markers = [
"python_full_version >= '3.14' and sys_platform == 'win32'",
@@ -1454,6 +1454,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/38/3f/9859f655d11901e7b2996c6e3d33e0caa9a1d4572c3bc61ed0faa64b2f4c/greenlet-3.3.2-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9bc885b89709d901859cf95179ec9f6bb67a3d2bb1f0e88456461bd4b7f8fd0d", size = 277747, upload-time = "2026-02-20T20:16:21.325Z" },
{ url = "https://files.pythonhosted.org/packages/fb/07/cb284a8b5c6498dbd7cba35d31380bb123d7dceaa7907f606c8ff5993cbf/greenlet-3.3.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b568183cf65b94919be4438dc28416b234b678c608cafac8874dfeeb2a9bbe13", size = 579202, upload-time = "2026-02-20T20:47:28.955Z" },
{ url = "https://files.pythonhosted.org/packages/ed/45/67922992b3a152f726163b19f890a85129a992f39607a2a53155de3448b8/greenlet-3.3.2-cp310-cp310-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:527fec58dc9f90efd594b9b700662ed3fb2493c2122067ac9c740d98080a620e", size = 590620, upload-time = "2026-02-20T20:55:55.581Z" },
+ { url = "https://files.pythonhosted.org/packages/03/5f/6e2a7d80c353587751ef3d44bb947f0565ec008a2e0927821c007e96d3a7/greenlet-3.3.2-cp310-cp310-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:508c7f01f1791fbc8e011bd508f6794cb95397fdb198a46cb6635eb5b78d85a7", size = 602132, upload-time = "2026-02-20T21:02:43.261Z" },
{ url = "https://files.pythonhosted.org/packages/ad/55/9f1ebb5a825215fadcc0f7d5073f6e79e3007e3282b14b22d6aba7ca6cb8/greenlet-3.3.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ad0c8917dd42a819fe77e6bdfcb84e3379c0de956469301d9fd36427a1ca501f", size = 591729, upload-time = "2026-02-20T20:20:58.395Z" },
{ url = "https://files.pythonhosted.org/packages/24/b4/21f5455773d37f94b866eb3cf5caed88d6cea6dd2c6e1f9c34f463cba3ec/greenlet-3.3.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:97245cc10e5515dbc8c3104b2928f7f02b6813002770cfaffaf9a6e0fc2b94ef", size = 1551946, upload-time = "2026-02-20T20:49:31.102Z" },
{ url = "https://files.pythonhosted.org/packages/00/68/91f061a926abead128fe1a87f0b453ccf07368666bd59ffa46016627a930/greenlet-3.3.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8c1fdd7d1b309ff0da81d60a9688a8bd044ac4e18b250320a96fc68d31c209ca", size = 1618494, upload-time = "2026-02-20T20:21:06.541Z" },
@@ -1461,6 +1462,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/f3/47/16400cb42d18d7a6bb46f0626852c1718612e35dcb0dffa16bbaffdf5dd2/greenlet-3.3.2-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:c56692189a7d1c7606cb794be0a8381470d95c57ce5be03fb3d0ef57c7853b86", size = 278890, upload-time = "2026-02-20T20:19:39.263Z" },
{ url = "https://files.pythonhosted.org/packages/a3/90/42762b77a5b6aa96cd8c0e80612663d39211e8ae8a6cd47c7f1249a66262/greenlet-3.3.2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1ebd458fa8285960f382841da585e02201b53a5ec2bac6b156fc623b5ce4499f", size = 581120, upload-time = "2026-02-20T20:47:30.161Z" },
{ url = "https://files.pythonhosted.org/packages/bf/6f/f3d64f4fa0a9c7b5c5b3c810ff1df614540d5aa7d519261b53fba55d4df9/greenlet-3.3.2-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a443358b33c4ec7b05b79a7c8b466f5d275025e750298be7340f8fc63dff2a55", size = 594363, upload-time = "2026-02-20T20:55:56.965Z" },
+ { url = "https://files.pythonhosted.org/packages/9c/8b/1430a04657735a3f23116c2e0d5eb10220928846e4537a938a41b350bed6/greenlet-3.3.2-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4375a58e49522698d3e70cc0b801c19433021b5c37686f7ce9c65b0d5c8677d2", size = 605046, upload-time = "2026-02-20T21:02:45.234Z" },
{ url = "https://files.pythonhosted.org/packages/72/83/3e06a52aca8128bdd4dcd67e932b809e76a96ab8c232a8b025b2850264c5/greenlet-3.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e2cd90d413acbf5e77ae41e5d3c9b3ac1d011a756d7284d7f3f2b806bbd6358", size = 594156, upload-time = "2026-02-20T20:20:59.955Z" },
{ url = "https://files.pythonhosted.org/packages/70/79/0de5e62b873e08fe3cef7dbe84e5c4bc0e8ed0c7ff131bccb8405cd107c8/greenlet-3.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:442b6057453c8cb29b4fb36a2ac689382fc71112273726e2423f7f17dc73bf99", size = 1554649, upload-time = "2026-02-20T20:49:32.293Z" },
{ url = "https://files.pythonhosted.org/packages/5a/00/32d30dee8389dc36d42170a9c66217757289e2afb0de59a3565260f38373/greenlet-3.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:45abe8eb6339518180d5a7fa47fa01945414d7cca5ecb745346fc6a87d2750be", size = 1619472, upload-time = "2026-02-20T20:21:07.966Z" },
@@ -1469,6 +1471,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ea/ab/1608e5a7578e62113506740b88066bf09888322a311cff602105e619bd87/greenlet-3.3.2-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:ac8d61d4343b799d1e526db579833d72f23759c71e07181c2d2944e429eb09cd", size = 280358, upload-time = "2026-02-20T20:17:43.971Z" },
{ url = "https://files.pythonhosted.org/packages/a5/23/0eae412a4ade4e6623ff7626e38998cb9b11e9ff1ebacaa021e4e108ec15/greenlet-3.3.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3ceec72030dae6ac0c8ed7591b96b70410a8be370b6a477b1dbc072856ad02bd", size = 601217, upload-time = "2026-02-20T20:47:31.462Z" },
{ url = "https://files.pythonhosted.org/packages/f8/16/5b1678a9c07098ecb9ab2dd159fafaf12e963293e61ee8d10ecb55273e5e/greenlet-3.3.2-cp312-cp312-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a2a5be83a45ce6188c045bcc44b0ee037d6a518978de9a5d97438548b953a1ac", size = 611792, upload-time = "2026-02-20T20:55:58.423Z" },
+ { url = "https://files.pythonhosted.org/packages/5c/c5/cc09412a29e43406eba18d61c70baa936e299bc27e074e2be3806ed29098/greenlet-3.3.2-cp312-cp312-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ae9e21c84035c490506c17002f5c8ab25f980205c3e61ddb3a2a2a2e6c411fcb", size = 626250, upload-time = "2026-02-20T21:02:46.596Z" },
{ url = "https://files.pythonhosted.org/packages/50/1f/5155f55bd71cabd03765a4aac9ac446be129895271f73872c36ebd4b04b6/greenlet-3.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:43e99d1749147ac21dde49b99c9abffcbc1e2d55c67501465ef0930d6e78e070", size = 613875, upload-time = "2026-02-20T20:21:01.102Z" },
{ url = "https://files.pythonhosted.org/packages/fc/dd/845f249c3fcd69e32df80cdab059b4be8b766ef5830a3d0aa9d6cad55beb/greenlet-3.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4c956a19350e2c37f2c48b336a3afb4bff120b36076d9d7fb68cb44e05d95b79", size = 1571467, upload-time = "2026-02-20T20:49:33.495Z" },
{ url = "https://files.pythonhosted.org/packages/2a/50/2649fe21fcc2b56659a452868e695634722a6655ba245d9f77f5656010bf/greenlet-3.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6c6f8ba97d17a1e7d664151284cb3315fc5f8353e75221ed4324f84eb162b395", size = 1640001, upload-time = "2026-02-20T20:21:09.154Z" },
@@ -1477,6 +1480,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/ac/48/f8b875fa7dea7dd9b33245e37f065af59df6a25af2f9561efa8d822fde51/greenlet-3.3.2-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:aa6ac98bdfd716a749b84d4034486863fd81c3abde9aa3cf8eff9127981a4ae4", size = 279120, upload-time = "2026-02-20T20:19:01.9Z" },
{ url = "https://files.pythonhosted.org/packages/49/8d/9771d03e7a8b1ee456511961e1b97a6d77ae1dea4a34a5b98eee706689d3/greenlet-3.3.2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ab0c7e7901a00bc0a7284907273dc165b32e0d109a6713babd04471327ff7986", size = 603238, upload-time = "2026-02-20T20:47:32.873Z" },
{ url = "https://files.pythonhosted.org/packages/59/0e/4223c2bbb63cd5c97f28ffb2a8aee71bdfb30b323c35d409450f51b91e3e/greenlet-3.3.2-cp313-cp313-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d248d8c23c67d2291ffd47af766e2a3aa9fa1c6703155c099feb11f526c63a92", size = 614219, upload-time = "2026-02-20T20:55:59.817Z" },
+ { url = "https://files.pythonhosted.org/packages/94/2b/4d012a69759ac9d77210b8bfb128bc621125f5b20fc398bce3940d036b1c/greenlet-3.3.2-cp313-cp313-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ccd21bb86944ca9be6d967cf7691e658e43417782bce90b5d2faeda0ff78a7dd", size = 628268, upload-time = "2026-02-20T21:02:48.024Z" },
{ url = "https://files.pythonhosted.org/packages/7a/34/259b28ea7a2a0c904b11cd36c79b8cef8019b26ee5dbe24e73b469dea347/greenlet-3.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b6997d360a4e6a4e936c0f9625b1c20416b8a0ea18a8e19cabbefc712e7397ab", size = 616774, upload-time = "2026-02-20T20:21:02.454Z" },
{ url = "https://files.pythonhosted.org/packages/0a/03/996c2d1689d486a6e199cb0f1cf9e4aa940c500e01bdf201299d7d61fa69/greenlet-3.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:64970c33a50551c7c50491671265d8954046cb6e8e2999aacdd60e439b70418a", size = 1571277, upload-time = "2026-02-20T20:49:34.795Z" },
{ url = "https://files.pythonhosted.org/packages/d9/c4/2570fc07f34a39f2caf0bf9f24b0a1a0a47bc2e8e465b2c2424821389dfc/greenlet-3.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1a9172f5bf6bd88e6ba5a84e0a68afeac9dc7b6b412b245dd64f52d83c81e55b", size = 1640455, upload-time = "2026-02-20T20:21:10.261Z" },
@@ -1485,6 +1489,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/3f/ae/8bffcbd373b57a5992cd077cbe8858fff39110480a9d50697091faea6f39/greenlet-3.3.2-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:8d1658d7291f9859beed69a776c10822a0a799bc4bfe1bd4272bb60e62507dab", size = 279650, upload-time = "2026-02-20T20:18:00.783Z" },
{ url = "https://files.pythonhosted.org/packages/d1/c0/45f93f348fa49abf32ac8439938726c480bd96b2a3c6f4d949ec0124b69f/greenlet-3.3.2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:18cb1b7337bca281915b3c5d5ae19f4e76d35e1df80f4ad3c1a7be91fadf1082", size = 650295, upload-time = "2026-02-20T20:47:34.036Z" },
{ url = "https://files.pythonhosted.org/packages/b3/de/dd7589b3f2b8372069ab3e4763ea5329940fc7ad9dcd3e272a37516d7c9b/greenlet-3.3.2-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c2e47408e8ce1c6f1ceea0dffcdf6ebb85cc09e55c7af407c99f1112016e45e9", size = 662163, upload-time = "2026-02-20T20:56:01.295Z" },
+ { url = "https://files.pythonhosted.org/packages/cd/ac/85804f74f1ccea31ba518dcc8ee6f14c79f73fe36fa1beba38930806df09/greenlet-3.3.2-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e3cb43ce200f59483eb82949bf1835a99cf43d7571e900d7c8d5c62cdf25d2f9", size = 675371, upload-time = "2026-02-20T21:02:49.664Z" },
{ url = "https://files.pythonhosted.org/packages/d2/d8/09bfa816572a4d83bccd6750df1926f79158b1c36c5f73786e26dbe4ee38/greenlet-3.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:63d10328839d1973e5ba35e98cccbca71b232b14051fd957b6f8b6e8e80d0506", size = 664160, upload-time = "2026-02-20T20:21:04.015Z" },
{ url = "https://files.pythonhosted.org/packages/48/cf/56832f0c8255d27f6c35d41b5ec91168d74ec721d85f01a12131eec6b93c/greenlet-3.3.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8e4ab3cfb02993c8cc248ea73d7dae6cec0253e9afa311c9b37e603ca9fad2ce", size = 1619181, upload-time = "2026-02-20T20:49:36.052Z" },
{ url = "https://files.pythonhosted.org/packages/0a/23/b90b60a4aabb4cec0796e55f25ffbfb579a907c3898cd2905c8918acaa16/greenlet-3.3.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:94ad81f0fd3c0c0681a018a976e5c2bd2ca2d9d94895f23e7bb1af4e8af4e2d5", size = 1687713, upload-time = "2026-02-20T20:21:11.684Z" },
@@ -1493,6 +1498,7 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/98/6d/8f2ef704e614bcf58ed43cfb8d87afa1c285e98194ab2cfad351bf04f81e/greenlet-3.3.2-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:e26e72bec7ab387ac80caa7496e0f908ff954f31065b0ffc1f8ecb1338b11b54", size = 286617, upload-time = "2026-02-20T20:19:29.856Z" },
{ url = "https://files.pythonhosted.org/packages/5e/0d/93894161d307c6ea237a43988f27eba0947b360b99ac5239ad3fe09f0b47/greenlet-3.3.2-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b466dff7a4ffda6ca975979bab80bdadde979e29fc947ac3be4451428d8b0e4", size = 655189, upload-time = "2026-02-20T20:47:35.742Z" },
{ url = "https://files.pythonhosted.org/packages/f5/2c/d2d506ebd8abcb57386ec4f7ba20f4030cbe56eae541bc6fd6ef399c0b41/greenlet-3.3.2-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b8bddc5b73c9720bea487b3bffdb1840fe4e3656fba3bd40aa1489e9f37877ff", size = 658225, upload-time = "2026-02-20T20:56:02.527Z" },
+ { url = "https://files.pythonhosted.org/packages/d1/67/8197b7e7e602150938049d8e7f30de1660cfb87e4c8ee349b42b67bdb2e1/greenlet-3.3.2-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:59b3e2c40f6706b05a9cd299c836c6aa2378cabe25d021acd80f13abf81181cf", size = 666581, upload-time = "2026-02-20T21:02:51.526Z" },
{ url = "https://files.pythonhosted.org/packages/8e/30/3a09155fbf728673a1dea713572d2d31159f824a37c22da82127056c44e4/greenlet-3.3.2-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b26b0f4428b871a751968285a1ac9648944cea09807177ac639b030bddebcea4", size = 657907, upload-time = "2026-02-20T20:21:05.259Z" },
{ url = "https://files.pythonhosted.org/packages/f3/fd/d05a4b7acd0154ed758797f0a43b4c0962a843bedfe980115e842c5b2d08/greenlet-3.3.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:1fb39a11ee2e4d94be9a76671482be9398560955c9e568550de0224e41104727", size = 1618857, upload-time = "2026-02-20T20:49:37.309Z" },
{ url = "https://files.pythonhosted.org/packages/6f/e1/50ee92a5db521de8f35075b5eff060dd43d39ebd46c2181a2042f7070385/greenlet-3.3.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:20154044d9085151bc309e7689d6f7ba10027f8f5a8c0676ad398b951913d89e", size = 1680010, upload-time = "2026-02-20T20:21:13.427Z" },
@@ -3059,6 +3065,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/be/9c/92789c596b8df838baa98fa71844d84283302f7604ed565dafe5a6b5041a/oauthlib-3.3.1-py3-none-any.whl", hash = "sha256:88119c938d2b8fb88561af5f6ee0eec8cc8d552b7bb1f712743136eb7523b7a1", size = 160065, upload-time = "2025-06-19T22:48:06.508Z" },
]
+[[package]]
+name = "olefile"
+version = "0.47"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/69/1b/077b508e3e500e1629d366249c3ccb32f95e50258b231705c09e3c7a4366/olefile-0.47.zip", hash = "sha256:599383381a0bf3dfbd932ca0ca6515acd174ed48870cbf7fee123d698c192c1c", size = 112240, upload-time = "2023-12-01T16:22:53.025Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/17/d3/b64c356a907242d719fc668b71befd73324e47ab46c8ebbbede252c154b2/olefile-0.47-py2.py3-none-any.whl", hash = "sha256:543c7da2a7adadf21214938bb79c83ea12b473a4b6ee4ad4bf854e7715e13d1f", size = 114565, upload-time = "2023-12-01T16:22:51.518Z" },
+]
+
[[package]]
name = "openai"
version = "2.26.0"
@@ -3237,6 +3252,7 @@ dependencies = [
{ name = "litellm" },
{ name = "loguru" },
{ name = "markdownify" },
+ { name = "olefile" },
{ name = "openai" },
{ name = "openpyxl" },
{ name = "pdfminer-six" },
@@ -3265,6 +3281,7 @@ dependencies = [
{ name = "uvicorn" },
{ name = "volcengine" },
{ name = "volcengine-python-sdk", extra = ["ark"] },
+ { name = "xlrd" },
{ name = "xxhash" },
]
@@ -3421,6 +3438,7 @@ requires-dist = [
{ name = "msgpack", marker = "extra == 'bot'", specifier = ">=1.0.8" },
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.0.0" },
{ name = "myst-parser", marker = "extra == 'doc'", specifier = ">=2.0.0" },
+ { name = "olefile", specifier = ">=0.47" },
{ name = "openai", specifier = ">=1.0.0" },
{ name = "opencode-ai", marker = "extra == 'bot-opencode'", specifier = ">=0.1.0a0" },
{ name = "openpyxl", specifier = ">=3.0.0" },
@@ -3481,6 +3499,7 @@ requires-dist = [
{ name = "websocket-client", marker = "extra == 'bot'", specifier = ">=1.6.0" },
{ name = "websockets", marker = "extra == 'bot'", specifier = ">=12.0" },
{ name = "wheel", marker = "extra == 'build'" },
+ { name = "xlrd", specifier = ">=2.0.1" },
{ name = "xxhash", specifier = ">=3.0.0" },
]
provides-extras = ["test", "dev", "doc", "eval", "build", "bot", "bot-langfuse", "bot-telegram", "bot-feishu", "bot-dingtalk", "bot-slack", "bot-qq", "bot-sandbox", "bot-fuse", "bot-opencode", "bot-full"]
@@ -6222,6 +6241,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a4/f5/10b68b7b1544245097b2a1b8238f66f2fc6dcaeb24ba5d917f52bd2eed4f/wsproto-1.3.2-py3-none-any.whl", hash = "sha256:61eea322cdf56e8cc904bd3ad7573359a242ba65688716b0710a5eb12beab584", size = 24405, upload-time = "2025-11-20T18:18:00.454Z" },
]
+[[package]]
+name = "xlrd"
+version = "2.0.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/07/5a/377161c2d3538d1990d7af382c79f3b2372e880b65de21b01b1a2b78691e/xlrd-2.0.2.tar.gz", hash = "sha256:08b5e25de58f21ce71dc7db3b3b8106c1fa776f3024c54e45b45b374e89234c9", size = 100167, upload-time = "2025-06-14T08:46:39.039Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/1a/62/c8d562e7766786ba6587d09c5a8ba9f718ed3fa8af7f4553e8f91c36f302/xlrd-2.0.2-py2.py3-none-any.whl", hash = "sha256:ea762c3d29f4cca48d82df517b6d89fbce4db3107f9d78713e48cd321d5c9aa9", size = 96555, upload-time = "2025-06-14T08:46:37.766Z" },
+]
+
[[package]]
name = "xlsxwriter"
version = "3.2.9"