dsh-office-tools 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -71
- package/README.zh.md +29 -70
- package/lib/index.js +56 -49
- package/package.json +17 -8
package/README.md
CHANGED
|
@@ -1,108 +1,66 @@
|
|
|
1
1
|
# dsh-office-tools
|
|
2
2
|
|
|
3
|
-
Eight model-facing Office file tools for DeepSeek Harness, running entirely in the plugin host half.
|
|
4
|
-
|
|
5
3
|
[](https://www.npmjs.com/package/dsh-office-tools) [](https://github.com/kw78/dsh-office-tools/actions/workflows/ci.yml) [](LICENSE) [](https://awesome-dsh-plugin.com)
|
|
6
4
|
|
|
7
|
-
>
|
|
5
|
+
> **If you find this project useful, please give it a ⭐ Star — it helps others find it.**
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
Eight model-facing Office file tools for DeepSeek Harness: create, read, and update Word (`.docx`), Excel (`.xlsx`), and PowerPoint (`.pptx`) files inside the session workspace. Zero runtime dependencies — every package is generated and parsed by the plugin's own OOXML engine, and every byte crosses the official `ctx.fs` service.
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
## Tools
|
|
12
10
|
|
|
13
11
|
| Tool | Purpose |
|
|
14
12
|
|---|---|
|
|
15
13
|
| `word_create` | Create `.docx` (title, paragraphs, bullets, one table) |
|
|
16
|
-
| `word_read` | Extract text
|
|
17
|
-
| `word_update` | Append paragraphs, bullets, and/or a table
|
|
18
|
-
| `excel_create` | Create
|
|
19
|
-
| `excel_read` | Read
|
|
20
|
-
| `excel_update` | Replace/create
|
|
21
|
-
| `ppt_create` | Create
|
|
22
|
-
| `ppt_read` | Extract
|
|
14
|
+
| `word_read` | Extract text; `format: "markdown"` renders structure |
|
|
15
|
+
| `word_update` | Append paragraphs, bullets, and/or a table |
|
|
16
|
+
| `excel_create` | Create multi-sheet `.xlsx` from cell grids |
|
|
17
|
+
| `excel_read` | Read sheets as rows; formulas return cached values or `'=…'` |
|
|
18
|
+
| `excel_update` | Replace/create sheets, or write cells by A1 address |
|
|
19
|
+
| `ppt_create` | Create 16:9 `.pptx` (slides, bullets, notes, linked images) |
|
|
20
|
+
| `ppt_read` | Extract text, notes, tables, and per-shape geometry |
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
Strings starting with `=` become real Excel formulas.
|
|
25
23
|
|
|
26
24
|
## Demo
|
|
27
25
|
|
|
28
|
-
One prompt, a quarterly-report trio
|
|
26
|
+
One prompt, a quarterly-report trio:
|
|
29
27
|
|
|
30
28
|
<img src="docs/demo/session.svg" alt="One prompt generating report.docx, budget.xlsx, and deck.pptx" width="780">
|
|
31
29
|
|
|
32
|
-
The prompt behind that session:
|
|
33
|
-
|
|
34
|
-
> Generate the Q3 quarterly-report trio: `report.docx` (title, two summary paragraphs, three highlights, a metrics table), `budget.xlsx` (a Budget sheet with `=SUM` totals and plan-vs-actual variance formulas, plus a Summary sheet), and `deck.pptx` (title slide + three content slides with speaker notes).
|
|
35
|
-
|
|
36
|
-
The model turns it into `word_create` → `excel_create` → `ppt_create` (reads come back through `word_read` / `excel_read` / `ppt_read`; freshly written formulas read back as `'=…'` strings until Excel caches values). The whole flow is pinned by `tests/demo-trio.spec.ts`, so the demo cannot drift from the tools. The file sizes in the image come from a real run of that test scenario.
|
|
37
|
-
|
|
38
|
-
## Harness integration
|
|
39
|
-
|
|
40
|
-
The plugin follows the standard DSH host-plugin contract:
|
|
41
|
-
|
|
42
|
-
- It exports `name` / `inject` / `apply` / `Config`; `inject = ['tools', 'fs']` — the official tool registry and the official filesystem service (`@deepseek-ai/dsh-tools`, `@deepseek-ai/dsh-fs`) are its only runtime service dependencies.
|
|
43
|
-
- `apply(ctx)` wraps every `ctx.tools.register(defineTool({...}))` in `ctx.effect(...)` so Cordis disposes the registrations with the plugin fiber.
|
|
44
|
-
- `defineTool` declares model-visible `parameters`, a validated canonical `output.schema`, and a pure `output.render` text projection.
|
|
45
|
-
- `execute(args, exec)` resolves every path against `exec.agent.session.header.cwd`; relative paths stay in the session workspace and absolute paths are accepted only when still inside it. Containment and symlink resolution are enforced by the `ctx.fs` backend (plus a lexical pre-check here).
|
|
46
|
-
- All reads arrive as raw bytes via `ctx.fs.readBytes`; all writes leave as UTF-8 text via `ctx.fs.writeText` — published atomically by the backend; `overwrite` defaults to `false`.
|
|
47
|
-
- Generated packages are pure ASCII by construction (an ASCII-safe STORE zip planner pads each XML part and aligns offsets so every CRC/size/offset field stays byte-safe), which is exactly what lets real `.docx`/`.xlsx`/`.pptx` files travel through the text channel byte-identically. Non-ASCII text encodes as XML character references; every Office suite opens the result.
|
|
48
|
-
- Reads accept any real-world package (STORE and DEFLATE entries, bounded by the zip-bomb guard).
|
|
49
|
-
- `word_update` / `excel_update` re-publish through the text channel, so they work on packages whose every part is text (always true for files these tools write, and for OOXML packages without binary media); packages carrying binary media are refused with a clear error instead of being corrupted.
|
|
50
|
-
- Images are LINKED, not embedded: the model controls placement fully (`x/y/w/h` inches, `contain`/`cover` cropping, alt text; PNG/JPG/GIF headers are sniffed so omitted dimensions default to natural size), and the deck references the workspace image file. Keep the image files next to the deck when moving it — that is the trade-off of a dependency-free, binary-free package.
|
|
51
|
-
- `ppt_create` echoes the full layout (every element's box in inches + the canvas size + a text wireframe sketch per slide); `ppt_read` returns the same geometry for any deck, so the model can see and re-author compositions.
|
|
52
|
-
|
|
53
|
-
## Build
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
pnpm install
|
|
57
|
-
pnpm run check # typecheck + tests + build
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Artifacts: `lib/index.js` (ESM host bundle of this plugin's own code only — ~116 kB, zero runtime dependencies) and `lib/types/**/*.d.ts`. Every `@deepseek-ai/*` package (cordis, the dsh services, schemastery) stays external and is provided by the profile's node_modules.
|
|
61
|
-
|
|
62
30
|
## Install
|
|
63
31
|
|
|
64
32
|
```bash
|
|
65
|
-
# npm (recommended)
|
|
66
|
-
dsh plugin --profile web add dsh-office-tools
|
|
67
|
-
|
|
68
|
-
# GitHub source
|
|
69
|
-
dsh plugin --profile web add github:kw78/dsh-office-tools
|
|
70
|
-
|
|
71
|
-
# local checkout
|
|
72
|
-
dsh plugin --profile web add /path/to/dsh-office-tools
|
|
33
|
+
dsh plugin --profile web add dsh-office-tools # npm (recommended)
|
|
34
|
+
dsh plugin --profile web add github:kw78/dsh-office-tools # from source
|
|
73
35
|
```
|
|
74
36
|
|
|
75
|
-
Restart
|
|
37
|
+
Restart DSH after installing. Requires a profile that provides the `fs` service (every profile with built-in read/write tools does).
|
|
76
38
|
|
|
77
|
-
##
|
|
39
|
+
## Notes
|
|
78
40
|
|
|
79
|
-
|
|
41
|
+
- All paths are confined to the session workspace; `overwrite` defaults to `false`.
|
|
42
|
+
- Reads accept any real package (STORE/DEFLATE) with zip-bomb guards; updates refuse packages with binary parts instead of corrupting them.
|
|
43
|
+
- PPT images are **linked, not embedded**: the sanctioned `ctx.fs` write channel is UTF-8 text only, so a package cannot carry binary image parts. Keep image files next to the deck when moving it, and note that PowerPoint blocks external content by default — a linked picture renders as a "blocked automatic download" placeholder until you enable external content (File → Info → Enable Content, or add the folder under Trust Center → Trusted Locations). This is a PowerPoint security policy, not a package defect.
|
|
44
|
+
- `ppt_create` echoes every element's landing position; `ppt_read` returns the same geometry for any deck.
|
|
80
45
|
|
|
81
|
-
|
|
82
|
-
|---|---|---|---|
|
|
83
|
-
| `enablePptTools` | boolean | `true` | Register `ppt_create` / `ppt_read`. Set to `false` to load this plugin for Word/Excel only. |
|
|
46
|
+
## Configuration
|
|
84
47
|
|
|
85
|
-
|
|
48
|
+
One option: `enablePptTools` (default `true`) — set it to `false` to coexist with a dedicated presentation plugin such as dsh-ppt:
|
|
86
49
|
|
|
87
50
|
```yaml
|
|
88
|
-
# profile cordis.patch.yml
|
|
89
51
|
- insert:
|
|
90
52
|
- id: dsh-office-tools
|
|
91
53
|
config:
|
|
92
54
|
enablePptTools: false
|
|
93
55
|
```
|
|
94
56
|
|
|
95
|
-
##
|
|
57
|
+
## Development
|
|
96
58
|
|
|
97
|
-
|
|
98
|
-
|
|
59
|
+
```bash
|
|
60
|
+
pnpm install && pnpm run check # typecheck + tests + build
|
|
61
|
+
pnpm run test:e2e # real-composition E2E (sandbox-policy + fs-sandbox + tools)
|
|
62
|
+
```
|
|
99
63
|
|
|
100
|
-
|
|
64
|
+
Compatibility: DSH `>=0.1.0-rc.6`; exact per-release records live in `package.json` (`dsh.compatibility.dshReleases`).
|
|
101
65
|
|
|
102
|
-
|
|
103
|
-
- Reads are capped at 50 MiB compressed; before anything is inflated, the archive's own declared sizes are checked against budgets (256 MiB per entry, 512 MiB per archive, 100 000 entries), so zip bombs are refused rather than decompressed. XML parts carrying DOCTYPE/ENTITY declarations are refused outright.
|
|
104
|
-
- Text/cell results are bounded and mark `truncated`.
|
|
105
|
-
- Creates/updates are bounded by row and cell limits and refuse overwrites by default.
|
|
106
|
-
- No LibreOffice/PowerPoint/Word subprocess is spawned and no third-party library is shipped: formats are generated and parsed by this plugin's own ASCII-safe OOXML engine over `node:zlib`.
|
|
107
|
-
- The plugin's own code never touches the file system directly — there is no `node:fs` import anywhere in `src/`; every byte flows through the official, user-visible `ctx.fs` service. This is what lets third-party store automation verify the whole runtime source deterministically (DSH Store issue #334: 1.0.0 passes the complete automatic low-risk policy — zero runtime dependencies, zero file/network/commands/credentials signals, bounded source, exact per-release compatibility declarations).
|
|
108
|
-
- Roadmap: [docs/ROADMAP.md](docs/ROADMAP.md).
|
|
66
|
+
Further reading: [DEVELOPMENT.md](docs/DEVELOPMENT.md) · [ROADMAP.md](docs/ROADMAP.md) · [hub-registration.md](docs/hub-registration.md) · MIT [License](LICENSE)
|
package/README.zh.md
CHANGED
|
@@ -2,106 +2,65 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/dsh-office-tools) [](https://github.com/kw78/dsh-office-tools/actions/workflows/ci.yml) [](LICENSE) [](https://awesome-dsh-plugin.com)
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> **如果你觉得本项目好用的话,请给个 ⭐ Star —— 谢谢!**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
为 DeepSeek Harness 提供 8 个模型可调用的 Office 文件工具:在会话工作区内创建、读取、更新 Word(`.docx`)、Excel(`.xlsx`)、PowerPoint(`.pptx`)。零运行时依赖 —— 文件由插件自带的 OOXML 引擎生成与解析,所有字节都经官方 `ctx.fs` 服务传输。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 工具
|
|
10
10
|
|
|
11
11
|
| 工具 | 作用 |
|
|
12
12
|
|---|---|
|
|
13
13
|
| `word_create` | 创建 `.docx`(标题、段落、项目符号、一个表格) |
|
|
14
|
-
| `word_read` |
|
|
15
|
-
| `word_update` |
|
|
16
|
-
| `excel_create` | 创建多 sheet 的 `.xlsx
|
|
17
|
-
| `excel_read` |
|
|
18
|
-
| `excel_update` |
|
|
19
|
-
| `ppt_create` | 创建 16:9 `.pptx
|
|
20
|
-
| `ppt_read` |
|
|
14
|
+
| `word_read` | 提取文本;`format: "markdown"` 结构化渲染 |
|
|
15
|
+
| `word_update` | 向现有文档追加段落、项目符号和/或表格 |
|
|
16
|
+
| `excel_create` | 创建多 sheet 的 `.xlsx` |
|
|
17
|
+
| `excel_read` | 读取 sheet 为行;公式返回缓存值或 `'=…'` 串 |
|
|
18
|
+
| `excel_update` | 替换/新建整张 sheet,或按 A1 地址写单元格 |
|
|
19
|
+
| `ppt_create` | 创建 16:9 `.pptx`(幻灯片、要点、备注、链接式图片) |
|
|
20
|
+
| `ppt_read` | 提取文本、备注、表格与每个形状的几何信息 |
|
|
21
21
|
|
|
22
|
-
以 `=` 开头的字符串单元格会写成真正的 Excel
|
|
22
|
+
以 `=` 开头的字符串单元格会写成真正的 Excel 公式。
|
|
23
23
|
|
|
24
24
|
## 演示
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
一句话,季度报告三件套:
|
|
27
27
|
|
|
28
28
|
<img src="docs/demo/session.svg" alt="一句话生成 report.docx、budget.xlsx、deck.pptx" width="780">
|
|
29
29
|
|
|
30
|
-
上图会话用的提示词:
|
|
31
|
-
|
|
32
|
-
> 生成 Q3 季度报告三件套:`report.docx`(标题、两段摘要、三个要点、一张指标表)、`budget.xlsx`(Budget sheet 含 `=SUM` 合计与计划/实际差异公式,再加一个 Summary sheet)、`deck.pptx`(标题页 + 3 页正文,含演讲者备注)。
|
|
33
|
-
|
|
34
|
-
模型会把它拆成 `word_create` → `excel_create` → `ppt_create`(回读走 `word_read` / `excel_read` / `ppt_read`;新写入的公式在被 Excel 计算缓存前以 `'=…'` 串回读)。整个流程由 `tests/demo-trio.spec.ts` 钉死,演示不会与工具行为漂移;图中的体积数字来自该测试场景的一次真实运行。
|
|
35
|
-
|
|
36
|
-
## 框架接入方式
|
|
37
|
-
|
|
38
|
-
插件遵循 DSH 标准 host 插件契约:
|
|
39
|
-
|
|
40
|
-
- 模块导出 `name` / `inject` / `apply` / `Config`;本插件 `inject = ['tools', 'fs']`——官方工具注册表与官方文件服务(`@deepseek-ai/dsh-tools`、`@deepseek-ai/dsh-fs`)是仅有的运行时服务依赖。
|
|
41
|
-
- `apply(ctx)` 中用 `ctx.effect(() => ...)` 包裹 `ctx.tools.register(defineTool({...}))`,Cordis fiber 卸载时自动 dispose。
|
|
42
|
-
- `defineTool` 统一声明 `parameters`(模型可见 JSON Schema)、`output.schema`(强制校验的规范 JSON 值)与 `output.render`(模型看到的文本投影)。
|
|
43
|
-
- 每个 `execute(args, exec)` 从 `exec.agent.session.header.cwd` 取会话工作目录;相对路径按该目录解析,绝对路径只接受仍位于工作目录内的路径。containment 与符号链接解析由 `ctx.fs` 后端权威执行(本插件再做一道词法预检)。
|
|
44
|
-
- 读经 `ctx.fs.readBytes` 以原始字节到达;写经 `ctx.fs.writeText` 以 UTF-8 文本离开(后端原子落盘);`overwrite` 默认 `false`,防止误覆盖。
|
|
45
|
-
- 生成的包是纯 ASCII 的 STORE 型 zip:规划器为每个 XML 部件做尾部换行填充并做 1 KiB 槽位对齐(跳过每 64 KiB 页的不安全偏移带),使 CRC/大小/偏移字段全部字节安全——这正是真实 Office 文件能以字节一致方式通过官方文本通道的原因。非 ASCII 文本编码为 XML 字符引用。
|
|
46
|
-
- 读取接受任意真实包(STORE/DEFLATE,含 zip 炸弹防御);`word_update`/`excel_update` 适用于全文本部件的包,携带二进制媒体的包会被明确拒绝。
|
|
47
|
-
- 图片为链接式:模型完全掌控摆放(x/y/w/h 英寸、contain/cover、alt;PNG/JPG/GIF 头部嗅探出原图尺寸),deck 引用 workspace 图片文件;`ppt_create` 结果回显全部元素落点(英寸坐标 + 画布尺寸 + 每页文本线框图),`ppt_read` 对任意 deck 返回同样的几何信息。
|
|
48
|
-
|
|
49
|
-
## 构建
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
pnpm install
|
|
53
|
-
pnpm run check # typecheck + tests + build
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
构建产物:`lib/index.js`(ESM host bundle,仅打包本插件自有代码——约 116 kB,零运行时依赖)与 `lib/types/**/*.d.ts`;所有 `@deepseek-ai/*`(cordis、dsh 服务、schemastery)保持 external,由 profile 的 node_modules 提供。
|
|
57
|
-
|
|
58
30
|
## 安装
|
|
59
31
|
|
|
60
32
|
```bash
|
|
61
|
-
# npm(推荐)
|
|
62
|
-
dsh plugin --profile web add dsh-office-tools
|
|
63
|
-
|
|
64
|
-
# GitHub 源码
|
|
65
|
-
dsh plugin --profile web add github:kw78/dsh-office-tools
|
|
66
|
-
|
|
67
|
-
# 本地目录
|
|
68
|
-
dsh plugin --profile web add /path/to/dsh-office-tools
|
|
33
|
+
dsh plugin --profile web add dsh-office-tools # npm(推荐)
|
|
34
|
+
dsh plugin --profile web add github:kw78/dsh-office-tools # 源码
|
|
69
35
|
```
|
|
70
36
|
|
|
71
|
-
安装后重启 DSH
|
|
37
|
+
安装后重启 DSH。宿主需提供 `fs` 服务(凡带内置 read/write 工具的 profile 都有)。
|
|
72
38
|
|
|
73
|
-
##
|
|
39
|
+
## 注意事项
|
|
74
40
|
|
|
75
|
-
|
|
41
|
+
- 所有路径限制在会话工作目录内;`overwrite` 默认 `false`。
|
|
42
|
+
- 读取接受任意真实包(STORE/DEFLATE),带 zip 炸弹防御;更新遇到含二进制部件的包会明确拒绝而非损坏它。
|
|
43
|
+
- PPT 图片为**链接式**(非内嵌):官方 `ctx.fs` 写入通道只支持 UTF-8 文本,包内无法携带二进制图片部件。移动 deck 时请连同图片文件;另注意 PowerPoint 默认阻止外部内容——链接图片会显示为"已阻止自动下载此图片"占位符,需手动启用外部内容(文件 → 信息 → 启用内容,或把目录加入信任中心的可信位置)后才会显示。这是 PowerPoint 的安全策略,不是包结构缺陷。
|
|
44
|
+
- `ppt_create` 回显每个元素的落点坐标;`ppt_read` 对任意 deck 返回同样的几何信息。
|
|
76
45
|
|
|
77
|
-
|
|
78
|
-
|---|---|---|---|
|
|
79
|
-
| `enablePptTools` | boolean | `true` | 注册 `ppt_create` / `ppt_read`。设为 `false` 时本插件只提供 Word/Excel 工具。 |
|
|
46
|
+
## 配置
|
|
80
47
|
|
|
81
|
-
|
|
48
|
+
只有一个选项:`enablePptTools`(默认 `true`)——与 dsh-ppt 等专用演示插件共存时设为 `false`:
|
|
82
49
|
|
|
83
50
|
```yaml
|
|
84
|
-
# profile 的 cordis.patch.yml
|
|
85
51
|
- insert:
|
|
86
52
|
- id: dsh-office-tools
|
|
87
53
|
config:
|
|
88
54
|
enablePptTools: false
|
|
89
55
|
```
|
|
90
56
|
|
|
91
|
-
##
|
|
57
|
+
## 开发
|
|
92
58
|
|
|
93
|
-
|
|
94
|
-
|
|
59
|
+
```bash
|
|
60
|
+
pnpm install && pnpm run check # typecheck + tests + build
|
|
61
|
+
pnpm run test:e2e # 真实组合 E2E(sandbox-policy + fs-sandbox + tools)
|
|
62
|
+
```
|
|
95
63
|
|
|
96
|
-
|
|
64
|
+
兼容性:DSH `>=0.1.0-rc.6`;逐版本的精确兼容记录见 `package.json`(`dsh.compatibility.dshReleases`)。
|
|
97
65
|
|
|
98
|
-
-
|
|
99
|
-
- 读取文件上限 50 MiB(压缩后体积);解压前先校验压缩包自身声明的大小预算(单条目 ≤256 MiB、整包 ≤512 MiB、条目数 ≤100 000),zip 炸弹会被直接拒绝而不是解压;携带 DOCTYPE/ENTITY 声明的 XML 部件一律拒绝。
|
|
100
|
-
- 文本/单元格结果有上限并标记 `truncated`。
|
|
101
|
-
- 创建/更新有行数、单元格数上限,且默认不覆盖已有文件。
|
|
102
|
-
- 不调用 LibreOffice / PowerPoint / Word 等外部进程,所有格式均通过纯 JS 库生成/解析。
|
|
103
|
-
- 插件自身代码零文件系统直接访问——`src/` 中没有任何 `node:fs` 导入,所有字节经官方、用户可见的 `ctx.fs` 服务流动。这让第三方商店自动化可以确定性核验全部运行时源码(DSH Store #334:1.0.0 通过完整的自动低风险策略——零运行时依赖、零文件/网络/命令/凭据信号、有界源码、逐版本精确兼容声明)。
|
|
104
|
-
- 生成的包是纯 ASCII 的 STORE 型 zip(规划器为每个 XML 部件做尾部填充并做槽位对齐,让 CRC/大小/偏移字段全部字节安全),因此能以字节一致的方式通过官方 UTF-8 文本通道落盘;非 ASCII 文本编码为 XML 字符引用,各 Office 套件均可正常打开。
|
|
105
|
-
- `word_update`/`excel_update` 经文本通道重发布:适用于全部部件均为文本的包(本插件生成的文件必然满足;不含二进制媒体的 OOXML 包也满足),携带二进制媒体(内嵌图片/字体)的包会被明确拒绝而非损坏。
|
|
106
|
-
- 图片为链接式(非内嵌):模型完全掌控摆放(英寸坐标 x/y/w/h、contain/cover 裁剪、alt 文本;PNG/JPG/GIF 文件头会被嗅探,省略尺寸时按原图大小),deck 引用 workspace 中的图片文件——移动 deck 时请连同图片文件,这是零二进制包的取舍。
|
|
107
|
-
- 版本路线见 [docs/ROADMAP.md](docs/ROADMAP.md)。
|
|
66
|
+
更多文档:[DEVELOPMENT.md](docs/DEVELOPMENT.md) · [ROADMAP.md](docs/ROADMAP.md) · [hub-registration.md](docs/hub-registration.md) · MIT [License](LICENSE)
|
package/lib/index.js
CHANGED
|
@@ -52,11 +52,17 @@ var DOS_DATE = 2026 - 1980 << 9 | 1 << 5 | 1;
|
|
|
52
52
|
var LOCAL_HEADER_BYTES = 30;
|
|
53
53
|
var CENTRAL_HEADER_BYTES = 46;
|
|
54
54
|
var EOCD_BYTES = 22;
|
|
55
|
-
var
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
var MAX_PLAN_PAD = 65536;
|
|
56
|
+
function extraField(total) {
|
|
57
|
+
if (total === 0) return "";
|
|
58
|
+
return u16(0) + u16(total - 4) + "\0".repeat(total - 4);
|
|
59
|
+
}
|
|
60
|
+
function feasibleExtraLength(end) {
|
|
61
|
+
if (safeField(end)) return 0;
|
|
62
|
+
for (let total = 4; total <= 127; total += 1) {
|
|
63
|
+
if (safeField(end + total)) return total;
|
|
64
|
+
}
|
|
65
|
+
return void 0;
|
|
60
66
|
}
|
|
61
67
|
function planEntries(parts) {
|
|
62
68
|
const planned = [];
|
|
@@ -66,27 +72,19 @@ function planEntries(parts) {
|
|
|
66
72
|
const nameLength = part.name.length;
|
|
67
73
|
const headerSize = LOCAL_HEADER_BYTES + nameLength;
|
|
68
74
|
const baseLength = part.content.length;
|
|
69
|
-
|
|
75
|
+
const minEnd = offset + headerSize + baseLength;
|
|
70
76
|
let chosen;
|
|
71
|
-
let
|
|
72
|
-
for (let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!safeField(length)) continue;
|
|
83
|
-
if (!safeField((state ^ 4294967295) >>> 0)) continue;
|
|
84
|
-
const content = pad === 0 ? part.content : part.content + "\n".repeat(pad);
|
|
85
|
-
chosen = { content, crc: (state ^ 4294967295) >>> 0 };
|
|
86
|
-
entryNext = skipUnsafeBand(offset + slots * SLOT_BYTES);
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
if (chosen === void 0) slots += 1;
|
|
77
|
+
let state = contentCrcState(part.content);
|
|
78
|
+
for (let pad = 0; pad <= MAX_PLAN_PAD && chosen === void 0; pad += 1) {
|
|
79
|
+
if (pad > 0) state = crcFold(state, 10);
|
|
80
|
+
const length = baseLength + pad;
|
|
81
|
+
if (!safeField(length)) continue;
|
|
82
|
+
const crc = (state ^ 4294967295) >>> 0;
|
|
83
|
+
if (!safeField(crc)) continue;
|
|
84
|
+
const extraLength = feasibleExtraLength(minEnd + pad);
|
|
85
|
+
if (extraLength === void 0) continue;
|
|
86
|
+
const content = pad === 0 ? part.content : part.content + "\n".repeat(pad);
|
|
87
|
+
chosen = { content, crc, extraLength, end: minEnd + pad + extraLength };
|
|
90
88
|
}
|
|
91
89
|
if (chosen === void 0) {
|
|
92
90
|
throw new Error(`cannot lay out an ASCII-safe zip entry for "${part.name}" (offset=${offset})`);
|
|
@@ -96,24 +94,27 @@ function planEntries(parts) {
|
|
|
96
94
|
content: chosen.content,
|
|
97
95
|
crc: chosen.crc,
|
|
98
96
|
offset,
|
|
99
|
-
localExtraLength:
|
|
97
|
+
localExtraLength: chosen.extraLength,
|
|
100
98
|
commentLength: 0,
|
|
101
99
|
centralExtraLength: 0
|
|
102
100
|
});
|
|
103
|
-
offset =
|
|
101
|
+
offset = chosen.end;
|
|
104
102
|
}
|
|
105
103
|
const baseDirectorySize = planned.reduce((sum, entry) => sum + CENTRAL_HEADER_BYTES + entry.name.length, 0);
|
|
104
|
+
const extraCandidates = [0];
|
|
105
|
+
for (let total = 4; total <= 127; total += 1) extraCandidates.push(total);
|
|
106
106
|
let commentLength = -1;
|
|
107
|
-
let centralExtraLength =
|
|
108
|
-
for (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
let centralExtraLength = -1;
|
|
108
|
+
outer: for (const extra of extraCandidates) {
|
|
109
|
+
for (let comment = 0; comment <= 127; comment += 1) {
|
|
110
|
+
if (safeField(baseDirectorySize + extra + comment)) {
|
|
111
|
+
centralExtraLength = extra;
|
|
112
|
+
commentLength = comment;
|
|
113
|
+
break outer;
|
|
114
|
+
}
|
|
113
115
|
}
|
|
114
|
-
if (commentLength <= 127) break;
|
|
115
116
|
}
|
|
116
|
-
if (
|
|
117
|
+
if (commentLength < 0 || centralExtraLength < 0) {
|
|
117
118
|
throw new Error("cannot lay out an ASCII-safe central directory size");
|
|
118
119
|
}
|
|
119
120
|
if (planned.length > 0) {
|
|
@@ -135,7 +136,9 @@ function buildAsciiZip(parts) {
|
|
|
135
136
|
for (const entry of planned) {
|
|
136
137
|
const nameLength = entry.name.length;
|
|
137
138
|
const length = entry.content.length;
|
|
138
|
-
if (entry.offset
|
|
139
|
+
if (entry.offset !== cursor) {
|
|
140
|
+
throw new Error(`internal error: zip entry "${entry.name}" is not contiguous (planned ${entry.offset}, actual ${cursor})`);
|
|
141
|
+
}
|
|
139
142
|
local.push(
|
|
140
143
|
"PK",
|
|
141
144
|
u16(20),
|
|
@@ -149,7 +152,7 @@ function buildAsciiZip(parts) {
|
|
|
149
152
|
u16(nameLength),
|
|
150
153
|
u16(entry.localExtraLength),
|
|
151
154
|
entry.name,
|
|
152
|
-
|
|
155
|
+
extraField(entry.localExtraLength),
|
|
153
156
|
entry.content
|
|
154
157
|
);
|
|
155
158
|
central.push(
|
|
@@ -171,17 +174,19 @@ function buildAsciiZip(parts) {
|
|
|
171
174
|
u32(0),
|
|
172
175
|
u32(entry.offset),
|
|
173
176
|
entry.name,
|
|
174
|
-
|
|
177
|
+
extraField(entry.centralExtraLength),
|
|
175
178
|
"d".repeat(entry.commentLength)
|
|
176
179
|
);
|
|
177
180
|
cursor = entry.offset + LOCAL_HEADER_BYTES + nameLength + entry.localExtraLength + length;
|
|
178
181
|
}
|
|
179
182
|
const directorySize = central.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
180
183
|
const directoryOffset = plan.directoryOffset;
|
|
184
|
+
if (directoryOffset !== cursor) {
|
|
185
|
+
throw new Error(`internal error: the central directory does not follow the last entry (planned ${directoryOffset}, actual ${cursor})`);
|
|
186
|
+
}
|
|
181
187
|
if (!safeField(directorySize) || !safeField(directoryOffset)) {
|
|
182
188
|
throw new Error("internal error: the planned central directory fields are not ASCII-safe");
|
|
183
189
|
}
|
|
184
|
-
const directoryGap = directoryOffset > cursor ? "\0".repeat(directoryOffset - cursor) : "";
|
|
185
190
|
const eocd = [
|
|
186
191
|
"PK",
|
|
187
192
|
u16(0),
|
|
@@ -192,7 +197,7 @@ function buildAsciiZip(parts) {
|
|
|
192
197
|
u32(directoryOffset),
|
|
193
198
|
u16(0)
|
|
194
199
|
].join("");
|
|
195
|
-
const output = [...local,
|
|
200
|
+
const output = [...local, central.join(""), eocd].join("");
|
|
196
201
|
assertAscii(output, "zip output");
|
|
197
202
|
return output;
|
|
198
203
|
}
|
|
@@ -1179,13 +1184,13 @@ function slideXml(shapes) {
|
|
|
1179
1184
|
function notesSlideXml(notes) {
|
|
1180
1185
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><p:notes ${A_NS} ${R_NS} ${P_NS}><p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id="1" name=""/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/><a:chOff x="0" y="0"/><a:chExt cx="0" cy="0"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id="2" name="Notes Placeholder 1"/><p:cNvSpPr><a:spLocks noGrp="1"/></p:cNvSpPr><p:nvPr><p:ph type="body" idx="1"/></p:nvPr></p:nvSpPr><p:spPr><a:xfrm><a:off x="685800" y="1143000"/><a:ext cx="5486400" cy="5029200"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></p:spPr><p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr lang="en-US" dirty="0"/><a:t xml:space="preserve">${encodeXmlText(notes)}</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>`;
|
|
1181
1186
|
}
|
|
1182
|
-
var THEME_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a:theme ${A_NS} name="Office"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="
|
|
1187
|
+
var THEME_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a:theme ${A_NS} name="Office"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light"/><a:ea typeface=""/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="12700"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln><a:ln w="19050"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"/></a:solidFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements></a:theme>`;
|
|
1183
1188
|
var SLIDE_MASTER_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><p:sldMaster ${A_NS} ${R_NS} ${P_NS}><p:cSld name="Office">${shapeTree("")}</p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/><p:sldLayoutIdLst><p:sldLayoutId id="2147483649" r:id="rId1"/></p:sldLayoutIdLst><p:txStyles><p:titleStyle><a:lvl1pPr><a:defRPr sz="4400"/></a:lvl1pPr></p:titleStyle><p:bodyStyle><a:lvl1pPr><a:defRPr sz="2400"/></a:lvl1pPr></p:bodyStyle><p:otherStyle><a:lvl1pPr><a:defRPr sz="1800"/></a:lvl1pPr></p:otherStyle></p:txStyles></p:sldMaster>`;
|
|
1184
1189
|
var SLIDE_LAYOUT_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><p:sldLayout ${A_NS} ${R_NS} ${P_NS} type="blank" preserve="1"><p:cSld name="Blank">${shapeTree("")}</p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:sldLayout>`;
|
|
1185
1190
|
var NOTES_MASTER_XML = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><p:notesMaster ${A_NS} ${R_NS} ${P_NS}><p:cSld name="Notes">${shapeTree("")}</p:cSld><p:clrMap bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2" accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink" folHlink="folHlink"/></p:notesMaster>`;
|
|
1186
|
-
function contentTypesXml(slideCount,
|
|
1191
|
+
function contentTypesXml(slideCount, notesNumbers) {
|
|
1187
1192
|
const slides = Array.from({ length: slideCount }, (_, index) => `<Override PartName="/ppt/slides/slide${index + 1}.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/>`).join("");
|
|
1188
|
-
const notes =
|
|
1193
|
+
const notes = notesNumbers.map((number) => `<Override PartName="/ppt/notesSlides/notesSlide${number}.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"/>`).join("");
|
|
1189
1194
|
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types ${CT_NS}><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/ppt/presentation.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"/><Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"/><Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"/><Override PartName="/ppt/notesMasters/notesMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml"/><Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/ppt/theme/theme2.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>` + slides + notes + '<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>';
|
|
1190
1195
|
}
|
|
1191
1196
|
function presentationXml(slideCount) {
|
|
@@ -1240,13 +1245,15 @@ function validateSlideSpecs(slides) {
|
|
|
1240
1245
|
}
|
|
1241
1246
|
}
|
|
1242
1247
|
function imageLinkTarget(deck, image) {
|
|
1243
|
-
const
|
|
1244
|
-
const
|
|
1248
|
+
const deckPath = deck.absolute.replace(/\\/g, "/");
|
|
1249
|
+
const imagePath = image.absolute.replace(/\\/g, "/");
|
|
1250
|
+
const deckParts = deckPath.split("/").filter(Boolean).slice(0, -1);
|
|
1251
|
+
const imageParts = imagePath.split("/").filter(Boolean);
|
|
1245
1252
|
let common = 0;
|
|
1246
1253
|
while (common < deckParts.length && common < imageParts.length - 1 && deckParts[common] === imageParts[common]) common += 1;
|
|
1247
1254
|
const up = deckParts.length - common;
|
|
1248
1255
|
const relative2 = [...Array.from({ length: up }, () => ".."), ...imageParts.slice(common)].join("/");
|
|
1249
|
-
return relative2.startsWith("../") || relative2 === "" ?
|
|
1256
|
+
return relative2.startsWith("../") || relative2 === "" ? imagePath : relative2;
|
|
1250
1257
|
}
|
|
1251
1258
|
async function placeImage(exec, ctx, deck, image, slideIndex, imageIndex) {
|
|
1252
1259
|
const resolved = await resolveOfficePath(exec, ctx, image.path, IMAGE_EXTENSIONS, true);
|
|
@@ -1254,7 +1261,7 @@ async function placeImage(exec, ctx, deck, image, slideIndex, imageIndex) {
|
|
|
1254
1261
|
if (info !== void 0 && (info.size ?? 0) > MAX_IMAGE_BYTES) {
|
|
1255
1262
|
throw new Error(`slide ${slideIndex + 1} image ${imageIndex + 1} "${image.path}" is ${info.size} bytes; maximum linked image size is ${MAX_IMAGE_BYTES} bytes`);
|
|
1256
1263
|
}
|
|
1257
|
-
const head = await ctx.fs.readBytes(resolved.target, exec.signal,
|
|
1264
|
+
const head = await ctx.fs.readBytes(resolved.target, exec.signal, Math.max(1024, info?.size ?? 0));
|
|
1258
1265
|
const intrinsic = sniffImageSize(head.subarray(0, Math.min(head.byteLength, 1024)));
|
|
1259
1266
|
const target = imageLinkTarget(deck, resolved);
|
|
1260
1267
|
const naturalW = intrinsic === void 0 ? void 0 : intrinsic.width * EMU_PER_PIXEL / EMU_PER_INCH;
|
|
@@ -1391,10 +1398,10 @@ async function buildPptxText(args, exec, ctx, deck) {
|
|
|
1391
1398
|
build.images.push(await placeImage(exec, ctx, deck, image, slideIndex, imageIndex));
|
|
1392
1399
|
}
|
|
1393
1400
|
}
|
|
1394
|
-
const
|
|
1401
|
+
const notesNumbers = builds.map((build, index) => build.spec.notes !== void 0 && build.spec.notes.trim() !== "" ? index + 1 : 0).filter((number) => number > 0);
|
|
1395
1402
|
const layout = [];
|
|
1396
1403
|
const parts = [
|
|
1397
|
-
{ name: "[Content_Types].xml", content: contentTypesXml(slideCount,
|
|
1404
|
+
{ name: "[Content_Types].xml", content: contentTypesXml(slideCount, notesNumbers) },
|
|
1398
1405
|
{ name: "_rels/.rels", content: ROOT_RELS_XML },
|
|
1399
1406
|
{ name: "ppt/presentation.xml", content: presentationXml(slideCount) },
|
|
1400
1407
|
{ name: "ppt/_rels/presentation.xml.rels", content: presentationRelsXml(slideCount) },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-office-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "DSH model-facing Office tools: create, read, and update Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files inside the session workspace, entirely through the official DSH filesystem service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"0.1.1-rc.2": "compatible",
|
|
24
24
|
"0.1.2-alpha.4": "compatible",
|
|
25
25
|
"0.1.2-alpha.5": "compatible",
|
|
26
|
-
"0.1.2-rc.1": "compatible"
|
|
26
|
+
"0.1.2-rc.1": "compatible",
|
|
27
|
+
"0.1.5-rc.1": "compatible",
|
|
28
|
+
"0.1.5-rc.2": "compatible"
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
},
|
|
@@ -41,15 +43,16 @@
|
|
|
41
43
|
"types": "tsc -p tsconfig.json",
|
|
42
44
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
43
45
|
"test": "vitest run",
|
|
46
|
+
"test:e2e": "node tests/real-composition.mjs",
|
|
44
47
|
"check": "pnpm run typecheck && pnpm run types && pnpm run test && pnpm run build"
|
|
45
48
|
},
|
|
46
49
|
"peerDependencies": {
|
|
47
50
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
48
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0",
|
|
49
|
-
"@deepseek-ai/dsh-fs": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0",
|
|
50
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0",
|
|
51
|
-
"@deepseek-ai/dsh-session": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0",
|
|
52
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0"
|
|
51
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.5-alpha.0",
|
|
52
|
+
"@deepseek-ai/dsh-fs": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.5-alpha.0",
|
|
53
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.5-alpha.0",
|
|
54
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.5-alpha.0",
|
|
55
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.0 || ^0.1.2-alpha.0 || ^0.1.5-alpha.0"
|
|
53
56
|
},
|
|
54
57
|
"peerDependenciesMeta": {
|
|
55
58
|
"@deepseek-ai/cordis": {
|
|
@@ -75,8 +78,12 @@
|
|
|
75
78
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
76
79
|
"@deepseek-ai/dsh-agent": "0.1.2-rc.1",
|
|
77
80
|
"@deepseek-ai/dsh-fs": "0.1.2-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-fs-sandbox": "0.1.2-rc.1",
|
|
78
82
|
"@deepseek-ai/dsh-llm": "0.1.2-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-sandbox": "0.1.2-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.1.2-rc.1",
|
|
79
85
|
"@deepseek-ai/dsh-session": "0.1.2-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-session-projection": "0.1.2-rc.1",
|
|
80
87
|
"@deepseek-ai/dsh-tools": "0.1.2-rc.1",
|
|
81
88
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
82
89
|
"@types/node": "^24.0.0",
|
|
@@ -141,7 +148,9 @@
|
|
|
141
148
|
"0.1.1-rc.2",
|
|
142
149
|
"0.1.2-alpha.4",
|
|
143
150
|
"0.1.2-alpha.5",
|
|
144
|
-
"0.1.2-rc.1"
|
|
151
|
+
"0.1.2-rc.1",
|
|
152
|
+
"0.1.5-rc.1",
|
|
153
|
+
"0.1.5-rc.2"
|
|
145
154
|
]
|
|
146
155
|
},
|
|
147
156
|
"capability": {
|