-
Notifications
You must be signed in to change notification settings - Fork 4
Document Conversion
Language: English · 简体中文
LWC can adapt Microsoft MarkItDown or Firecrawl Anydoc into a controlled local conversion step. It turns one authorized non-Markdown file into a new reviewable UTF-8 Markdown file.
Conversion is optional, disabled by default, and separate from ingestion. A converted file does not enter Wiki memory until you explicitly add and integrate it as a Source.
Use conversion when a task needs reviewable Markdown from a local PDF, Office document, EPUB, or another format supported by the selected adapter.
Skip it when:
- the input is already Markdown or plain text;
- the source can be reviewed safely without a derived file;
- ordinary recall already answers the task;
- the adapter cannot preserve information needed for the decision.
Format support belongs to the selected adapter and its installed extras. LWC does not claim that every format has lossless conversion.
Inspect effective configuration first:
lwc --scope project config showInstall and select exactly one adapter only after explaining local file access and receiving consent.
Firecrawl Anydoc:
npm install --global @firecrawl/anydoc
lwc --scope project config set --trans anydocMicrosoft MarkItDown with all optional format extras:
python3 -m pip install 'markitdown[all]'
lwc --scope project config set --trans markitdownLWC never installs either adapter, silently switches engines, or falls back from one engine to the other. The selected executable must be available on PATH.
The default timeout is 120 seconds and the accepted range is 1–900 seconds. Configuration can replace the selected engine's argument list:
lwc --scope project config set \
--trans markitdown \
--trans-timeout 300 \
--trans-arg --keep-data-urisLWC applies an engine-specific allowlist again at execution time. Extra positional inputs, output flags, -- injection, and unsupported options are rejected. This prevents configuration from replacing LWC's input or output paths.
Credentials never belong in --trans-arg, config files, logs, or generated Markdown. If an adapter feature requires credentials, provide them through that adapter's documented environment mechanism and keep them outside durable output.
lwc --scope project trans docs/report.docx --output converted/report.mdThe input must be an existing regular file no larger than 64 MiB. In project scope, a path outside the active project root requires explicit acknowledgement for that invocation:
lwc --scope project trans ../shared/report.pdf \
--output converted/report.md \
--allow-external-sourceUse that flag only after confirming the exact external file belongs in the current authorized task. Symlink resolution cannot be used to bypass the project boundary.
The output path must:
- name a new file;
- differ from the input;
- have an available real parent directory;
- remain no larger than 64 MiB;
- contain non-empty valid UTF-8.
LWC writes adapter output to private temporary files, applies the configured timeout to the process tree, validates the result, and publishes with create-new semantics. It never overwrites an existing destination. A concurrent output creation is reported instead of replaced.
The receipt reports:
- selected engine;
- canonical input path;
- output path;
- output byte count;
- SHA-256 output digest.
The receipt proves which bytes were published. It does not prove conversion completeness or source ingestion.
Inspect the complete Markdown for:
- missing pages, sheets, slides, images, tables, or footnotes;
- damaged heading hierarchy or reading order;
- OCR errors and lost characters;
- accidental credentials or private data;
- adapter warnings that change meaning.
Only then, if the derived document belongs in persistent memory, start the normal and separate ingestion workflow:
lwc source add converted/report.mdThat command creates its own immutable Source receipt, ingest job, citations, and review obligations. Conversion alone creates none of them and does not write an LWC operation-log entry.
Lifecycle readiness reports:
- the effective
md_transsetting and origin; - adapters detected on
PATH; - whether the selected executable is available;
- the configuration command for each supported adapter.
Hooks may explain a missing or unselected adapter only when conversion is relevant. They must never install or enable one automatically.
Conversion is complete when:
- configuration identifies one selected adapter, timeout, and reviewed arguments;
- the exact input path was authorized;
- a new in-scope UTF-8 Markdown file was published without overwrite;
- byte count and SHA-256 receipt match the output;
- the full Markdown was reviewed for completeness and sensitive data;
- any requested ingestion has its own Source and citation lifecycle.
LWC Wiki
- Home · 首页
- Project overview · 项目简介
- Basic concepts · 基本概念
- Use cases · 应用场景
- Installation and upgrades · 安装与升级
- Quick start · 快速开始
- Persistent memory · 持久记忆体系
- Agent workflow and memory policy · Agent 工作流与主动记忆策略
- Sources and ingestion · 来源与知识整合
- Wiki pages and provenance · Wiki 页面与来源证明
- Search and context · 搜索与上下文载入
- Document knowledge graph · 文档知识图(记忆图网)
- Code graph · 代码图
- Word graph · 词图
- Tags and strong context · 标签与强上下文
- Document conversion · 文档转换
-
MCP server and
lwc_explore· MCP 服务与lwc_explore - Skills, Hooks, and Instructions · Skills、Hooks 与 Instructions
- AgentTarget installation · AgentTarget 安装与集成
- Changesets · Changeset 原子变更
- Work system · Work 任务系统
- Checkpoints and rollback · Checkpoint、恢复与回滚
- Read-only Viewer · 只读可视化界面
- Architecture overview · 总体架构
- Storage and data model · 存储与数据模型
- Retrieval and indexing · 检索与索引设计
- Graph projection and performance · 图投影与性能设计
- MCP, Hooks, and AgentTarget design · MCP、Hook 与 AgentTarget 设计
- Safety and trust boundaries · 安全模型与信任边界
- Maintenance and diagnostics · 维护与诊断
- Troubleshooting and FAQ · 故障排查与常见问题
- Migration and compatibility · 迁移与版本兼容
- Support and issue reporting · 获取帮助与问题反馈
- CLI and configuration reference · CLI 与配置参考
- JSON output and error contract · JSON 输出与错误契约
- Limits and glossary · 系统限制与术语表
- Contributing and development · 贡献与开发指南
- Testing and release process · 测试与发布流程
- Wiki style guide · Wiki 编写规范