dsh-plugin-office-fill-tool 0.2.0 → 0.2.2

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -45
  3. package/package.json +6 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 tenfeng
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,75 +1,73 @@
1
- # office fill tool(DSH 插件)
1
+ # dsh-plugin-office-fill-tool
2
2
 
3
- 在 DeepSeek Harness 中批量生成 Office 文件:传入模板、数据台账和输出目录,返回生成的文件列表。
3
+ DeepSeek Harness(DSH)插件:根据 Excel/Word 模板和数据台账批量生成文件,并向模型返回生成的文件列表。
4
4
 
5
- ## 形态
5
+ ## 功能
6
6
 
7
- - **bundle 插件**:`package.json` 声明 `dsh.bundle.patch`,由 `cordis.patch.yml` 插入插件行。
8
- - 入口 `index.js` 注册两个工具:
9
- - `batch_generate_files`:无界面批量生成,返回 `folder`、`count`、`files`。
10
- - `open_office_fill_tool`:打开图形界面,供手动操作。
11
- - `bin/office fill tool.exe` + `bin/_internal/`:PyInstaller onedir 程序,同时支持 GUI 和 `--cli` 模式。
7
+ - `batch_generate_files`:传入 `template`、`data`、`output_dir`、`mode`,后台生成并返回 `folder` / `count` / `files`。
8
+ - `open_office_fill_tool`:打开 Windows 图形界面,手动操作。
9
+ - 支持 Excel(`.xlsx`)和 Word(`.docx`)模板。
10
+ - 保留模板的单元格边框、行级格式、合并单元格等格式。
12
11
 
13
12
  ## 安装
14
13
 
15
- ```sh
16
- dsh plugin --profile desktop add "C:\Users\Administrator\Desktop\DSH工作区\office fill tool"
17
- dsh --profile desktop --dump-config
14
+ 要求:Windows、DSH 版本 `>= 0.2.1-rc.2`。
15
+
16
+ ```powershell
17
+ dsh plugin --profile desktop add github:ten-feng/dsh-plugin-office-fill-tool
18
18
  ```
19
19
 
20
- 发布给其他人:
20
+ 安装后重启 DSH,在插件页应看到 `office fill tool`。
21
21
 
22
- ```sh
23
- # npm(先 pnpm publish)
24
- dsh plugin --profile desktop add dsh-plugin-office-fill-tool
22
+ 也可以使用本地目录或 tarball 安装:
25
23
 
26
- # tarball
27
- pnpm pack
28
- dsh plugin --profile desktop add .\dsh-plugin-office-fill-tool-0.1.0.tgz
24
+ ```powershell
25
+ dsh plugin --profile desktop add "C:\path\to\dsh-plugin-office-fill-tool"
26
+ dsh plugin --profile desktop add .\dsh-plugin-office-fill-tool-0.2.0.tgz
29
27
  ```
30
28
 
31
- ## 工具参数
29
+ ## 使用示例
32
30
 
33
- `batch_generate_files`:
31
+ 在 DSH 对话中:
34
32
 
35
- | 参数 | 必填 | 说明 |
36
- |---|---|---|
37
- | `template` | 是 | Excel 模式用 `.xlsx` 模板;Word 模式用 `.docx` 模板 |
38
- | `data` | 是 | 数据台账 `.xlsx`,第一行为表头 |
39
- | `output_dir` | 是 | 输出目录(会在其下创建 `生成文件_YYYYMMDD`) |
40
- | `mode` | 否 | `excel`(默认)或 `word` |
33
+ > 用 batch_generate_files 生成文件:
34
+ > template = C:\...\模板.xlsx
35
+ > data = C:\...\台账.xlsx
36
+ > output_dir = C:\...\输出
37
+ > mode = excel
41
38
 
42
39
  返回:
43
40
 
44
41
  ```json
45
42
  {
46
- "folder": "输出目录\\生成文件_20261025",
43
+ "folder": "C:\\...\\输出\\生成文件_20261025",
47
44
  "count": 9,
48
- "files": ["...xlsx", "...xlsx"]
45
+ "files": ["C:\\...\\A区.xlsx", "C:\\...\\B区.xlsx"]
49
46
  }
50
47
  ```
51
48
 
52
- 当前 Agent 看到的文本形式:
49
+ ## 目录结构
53
50
 
54
51
  ```text
55
- 已生成 9 个文件
56
- 输出目录:...
57
- - ...\A区...xlsx
58
- - ...\B区...xlsx
52
+ .
53
+ ├─ package.json
54
+ ├─ index.js
55
+ ├─ cordis.patch.yml
56
+ ├─ README.md
57
+ ├─ LICENSE
58
+ └─ bin/
59
+ ├─ office fill tool.exe
60
+ └─ _internal/
59
61
  ```
60
62
 
61
- ## CLI 模式(exe 直接调用)
62
-
63
- ```bat
64
- "office fill tool.exe" --cli --mode excel ^
65
- --template "模板.xlsx" --data "台账.xlsx" ^
66
- --output "输出目录" --result-file "result.json"
67
- ```
63
+ ## 限制
68
64
 
69
- 结果 JSON 写入 `--result-file`,同时尽量打印到 stdout。`ok` 为 `false` 时附带 `error` 和 `messages`。
65
+ - 仅 Windows 可用(exe 为 Windows 程序)。
66
+ - 生成配置和日志写在 `bin/` 目录。
67
+ - 第一次调用时 DSH 需要能执行本机 exe,部分安全软件可能拦截。
70
68
 
71
- ## 限制
69
+ ## 卸载
72
70
 
73
- - 仅 Windows 可用。
74
- - 生成器会把配置/日志写在 `bin/` 目录;升级插件时可能丢失。
75
- - Word 模板中的页眉页脚、文本框等仍沿用 2.3 的替换范围。
71
+ ```powershell
72
+ dsh plugin --profile desktop remove dsh-plugin-office-fill-tool
73
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-office-fill-tool",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Batch-generate Office files from templates and data ledgers, returning the generated file list.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -28,5 +28,10 @@
28
28
  "peerDependencies": {
29
29
  "@deepseek-ai/dsh-tools": "*"
30
30
  },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/ten-feng/dsh-plugin-office-fill-tool.git"
34
+ },
35
+ "homepage": "https://github.com/ten-feng/dsh-plugin-office-fill-tool#readme",
31
36
  "license": "MIT"
32
37
  }