插件目录 / Developer / dsh-tool-somark
dsh-tool-somark
已验证 · 实测可装 saurtone
功能简介
SoMark文档解析器插件
可用 — 实测通过,早期项目
SoMark文档解析器插件 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-tool-somark
A DeepSeek Harness plugin that gives the model a somark_parse tool: parse PDFs, images, Word, and PowerPoint files into structure-preserving Markdown and JSON through the SoMark document-parsing API, with page and token counts.
The document read goes through ctx.fs, so any mounted filesystem policy applies to the read. Parsed content is returned as data and must never be executed.
Install
# from npm (once published)
dsh plugin --profile <name> add dsh-tool-somark
# from a tarball
dsh plugin --profile <name> add ./dsh-tool-somark-0.1.0.tgz
# from git (requires the package's `prepare` build; see the harness docs)
dsh plugin --profile <name> add github:you/dsh-tool-somark
Then boot the profile; the somark_parse tool registers automatically. The plugin is also usable as a plain library dependency for programmatic parsing (src/client.ts exports the API client).
Requirements
- A DeepSeek Harness profile with the base bundle (
@deepseek-ai/dsh-base), which providesctx.toolsandctx.fs. - A SoMark API key. Set
SOMARK_API_KEYin the environment or configureapiKeybelow. SoMark is an external paid service and receives the uploaded document contents.
Config
All fields optional; defaults apply when omitted.
| Field | Default | Meaning |
|---|---|---|
apiKey |
unset | SoMark API key $SOMARK_API_KEY Empty → the tool errors at execution. |
baseURL |
https://somark.tech/api/v1 |
API base; /parse/async and /parse/async_check append. |
outputFormats |
['markdown', 'json'] |
Formats requested when a call omits outputFormats. |
elementFormats |
{ image: 'url', formula: 'latex', table: 'html', cs: 'image' } |
Partial per-element rendering-format overrides. |
featureConfig |
cross-page off, inline image / table image / image understanding on, header-footer off | Partial feature-switch overrides. |
pollIntervalMs |
2000 |
Delay between status polls. |
maxPollAttempts |
1000 |
Maximum polls (≈ 33 minutes at the default interval). |
maxFileBytes |
209715200 |
Upload cap; SoMark documents a 200 MB limit. |
markdownCapChars |
200000 |
Inclusive cap on the markdown characters returned in one result. |
jsonCapChars |
200000 |
Inclusive cap on the stringified JSON characters returned in one result. |
Example profile patch (cordis.patch.yml in the profile, or a --patch overlay):
- id: tool-somark
config:
apiKey: 'sk-…'
Invalid element/feature/output-format values fail the plugin load with a CONFIG_INVALID error rather than being silently accepted.
The tool
somark_parse takes a required path (absolute path to the document) and an optional outputFormats array. It returns the parsed Markdown (capped by markdownCapChars, flagged truncated), the page/token counts, and the structured JSON when requested and within jsonCapChars (otherwise flagged jsonOmitted).
Failures carry machine-routable codes on the tool result: NO_API_KEY, DOCUMENT_NOT_FOUND, DOCUMENT_NOT_A_FILE, UNSUPPORTED_EXTENSION, FILE_TOO_LARGE, CONFIG_INVALID, SUBMIT_FAILED, TASK_FAILED, POLL_TIMEOUT, ABORTED, REQUEST_FAILED, INVALID_RESPONSE.
Development
pnpm install
pnpm test # vitest (79 tests, 100% src coverage)
pnpm build # tsc → lib/
pnpm pack # tarball for dsh plugin add
Known Limitations and Deferred Work
- No batch/directory parsing — one
pathper call; callers loop the tool. - Element and feature formats are deployment config, not per-call arguments.
- No artifact persistence — the result returns content; consumers can persist via
tool/result. - Oversized JSON is omitted (
jsonOmitted), not spilled.
License
MIT
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-tool-somark」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:saurtone/dsh-tool-somark Headless(CLI)profile:
dsh plugin --profile headless add github:saurtone/dsh-tool-somark 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。
使用场景
扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。
适合谁
想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。
二次开发建议
工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。