Bundle
dsh-plugin-web-ppt
DeepSeek Harness 插件:让 agent 读懂 .pptx / .ppt —— 提纲 / 正文 / 备注,并导出自包含 SVG 与可打印 HTML
- Source
- unStone
- stars
- 1 stars
- License
- MIT
- Updated
- Updated 5 days ago
Readme
# dsh-plugin-web-ppt
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 插件:让 agent 直接读懂并导出 `.pptx` / `.ppt`。
解析与渲染全部走 [web-ppt](https://github.com/unStone/web-ppt),**纯 JS**——不装 PowerPoint、不起 LibreOffice、不转格式、不联网。
## 安装
```bash
dsh plugin --profile <你的 profile> add dsh-plugin-web-ppt
```
装完 `dsh --profile <name> --dump-config` 里会多出一层 `# == dsh-plugin-web-ppt`,启动即生效。
## 工具
| 工具 | 干什么 | 关键参数 |
|---|---|---|
| `ppt_read` | 逐页返回标题 / 正文 / 演讲者备注,agent 认识一份 PPT 的入口 | `path`、`pages`、`password`、`include_hidden` |
| `ppt_render_svg` | 每页导出一个自包含 SVG(图片内联为 data URI) | `path`、`out_dir`、`pages` |
| `ppt_export_html` | 整份导出成一份可打印 HTML,浏览器「打印为 PDF」即得 PDF | `path`、`out_file`、`animation_steps` |
`pages` 一律是 **1 基**选择串,形如 `1-3,7`;不传表示全部。隐藏页默认不参与,与 PowerPoint 放映一致。
文件读写全部经 Harness 的 `fs` 服务,因此 workspace 归属、沙箱策略与写入审批都照常生效。
## 配置
在 profile 的 `cordis.patch.yml` 里按 id 覆盖(注意 patch 会整体替换 `config`,要把键写全):
```yaml
- id: web-ppt
name: dsh-plugin-web-ppt
config:
maxFileBytes: 134217728
maxTextChars: 40000
includeHidden: false
```
| 键 | 默认 | 说明 |
|---|---|---|
| `maxFileBytes` | `67108864`(64 MB) | 单文件读取上限,超出直接失败 |
| `maxTextChars` | `20000` | `ppt_read` 的文本预算,超出截断并置 `truncated` |
| `includeHidden` | `false` | 是否默认把隐藏页算进来 |
## 边界
| 能 | 不能 |
|---|---|
| `.pptx`(Zip+OOXML)与 `.ppt`(CFB+Escher) | 导出 PNG——需要 canvas,Node 里没有 |
| 加密文件(传 `password`) | 写入 / 编辑 PPT,本插件只读 |
| 图表、SmartArt、公式、EMF/WMF 图元 | 播放动画,只能按终态或按点击批次展开成多页 |
导出的 SVG 固定走原生 `<text>` 而不是 `foreignObject`:后者只有浏览器认,Inkscape / librsvg / 设计工具打开会整块丢失文本。文件是要交出去的,必须自包含。
## 开发
```bash
npm install && npm test
```
改完代码跑 `npm run check && npm test`,两条都绿才算完成。
本地挂进 DSH 验证:
```bash
dsh plugin --profile dev add /path/to/dsh-plugin-web-ppt
```
## 发布
版本号改完打 tag 即可,`release.yml` 走 npm Trusted Publishing(OIDC),Secrets 里不存凭据:
```bash
git tag -a v0.1.0 -m "v0.1.0" && git push origin v0.1.0
```
⚠️ **第一版走不了 OIDC**:npm 要求包已存在才能配置 Trusted Publishing,而包要先发布才会存在。首发先在本地 `npm publish` 一次,再去 npm 包设置里配好 trusted publisher。
## License
MIT
Install
dsh plugin --profile web add github:unStone/dsh-plugin-web-ppt
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-plugin-web-ppt from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.