dsh-ppt 0.1.1 → 0.2.1
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/CHANGELOG.md +6 -0
- package/README.en.md +18 -1
- package/README.md +17 -2
- package/cordis.patch.yml +2 -0
- package/lib/config.d.ts +2 -0
- package/lib/config.js +7 -0
- package/lib/index.js +2 -2
- package/lib/types.d.ts +4 -0
- package/package.json +3 -4
- package/skills/dsh-ppt/scripts/deck-core.mjs +2 -1
package/CHANGELOG.md
CHANGED
package/README.en.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# dsh-ppt
|
|
2
2
|
|
|
3
|
+
   
|
|
4
|
+
|
|
3
5
|
[](https://awesome-dsh-plugin.com)
|
|
4
6
|
|
|
5
7
|
> **One sentence or one document → a complete presentation**: HTML web slideshow + PPTX export, 5 visual themes, bilingual Chinese/English.
|
|
@@ -22,6 +24,10 @@ Example:
|
|
|
22
24
|
>
|
|
23
25
|
> Turn `docs/quarterly-review.md` into a bilingual presentation and export PPTX.
|
|
24
26
|
|
|
27
|
+
## Compatibility
|
|
28
|
+
|
|
29
|
+
Verified against `@deepseek-ai/dsh@0.1.2-alpha.2` on 2026-08-31. Built for the cordis patch-bundle plugin model (`cordis.patch.yml` + `dsh.bundle.patch`). No runtime imports of `@deepseek-ai/*` internals.
|
|
30
|
+
|
|
25
31
|
## Installation
|
|
26
32
|
|
|
27
33
|
```bash
|
|
@@ -30,6 +36,15 @@ dsh plugin --profile web add dsh-ppt
|
|
|
30
36
|
|
|
31
37
|
After restart, the `ppt_create` / `ppt_themes` tools and the `dsh-ppt` skill are available. The plugin ships with an empty config and **won't crash startup**.
|
|
32
38
|
|
|
39
|
+
## Uninstall
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
dsh plugin --profile web remove dsh-ppt
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then restart the web service. To clean up fully, also remove the plugin entry from your profile `cordis.patch.yml` if you overrode it.
|
|
46
|
+
|
|
47
|
+
|
|
33
48
|
## Quick start
|
|
34
49
|
|
|
35
50
|
### Inside DSH (recommended)
|
|
@@ -95,9 +110,11 @@ No required configuration. Optional:
|
|
|
95
110
|
config:
|
|
96
111
|
outputDir: E:\decks # optional; defaults to the session working directory
|
|
97
112
|
maxSlides: 40 # optional; default 60 (3–120)
|
|
113
|
+
defaultTheme: data # optional; used when ppt_create has no theme
|
|
114
|
+
defaultLang: en # optional; used when ppt_create has no lang (zh/en/bilingual)
|
|
98
115
|
```
|
|
99
116
|
|
|
100
|
-
The `DSH_PPT_OUTPUT_DIR` env var can also set the default output directory; the `ppt_create` `outputDir`
|
|
117
|
+
The `DSH_PPT_OUTPUT_DIR` env var can also set the default output directory; the `ppt_create` `outputDir`/`theme`/`lang` arguments have the highest priority.
|
|
101
118
|
|
|
102
119
|
## Bilingual support
|
|
103
120
|
|
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@ DSH(DeepSeek Harness)演示文稿技能 + 工具插件:把一句话、一
|
|
|
26
26
|
>
|
|
27
27
|
> 把 `docs/季度汇报.md` 做成双语演示文稿,导出 PPTX。
|
|
28
28
|
|
|
29
|
+
## 兼容性
|
|
30
|
+
|
|
31
|
+
在 `@deepseek-ai/dsh@0.1.2-alpha.2` 上验证(2026-08-31)。遵循 cordis 组合包补丁模型(`cordis.patch.yml` + `dsh.bundle.patch`),运行时不 import 任何 `@deepseek-ai/*` 内部模块。
|
|
32
|
+
|
|
29
33
|
## 安装
|
|
30
34
|
|
|
31
35
|
```bash
|
|
@@ -99,9 +103,20 @@ node <skill-dir>/scripts/build-deck.mjs \
|
|
|
99
103
|
config:
|
|
100
104
|
outputDir: E:\decks # 可选;默认会话工作目录
|
|
101
105
|
maxSlides: 40 # 可选;默认 60(3–120)
|
|
106
|
+
defaultTheme: data # 可选;ppt_create 未指定 theme 时使用
|
|
107
|
+
defaultLang: zh # 可选;ppt_create 未指定 lang 时使用(zh/en/bilingual)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
也可用环境变量 `DSH_PPT_OUTPUT_DIR` 指定默认输出目录;`ppt_create` 的 `outputDir`/`theme`/`lang` 参数优先级最高。
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## 卸载
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
dsh plugin --profile web remove dsh-ppt
|
|
102
117
|
```
|
|
103
118
|
|
|
104
|
-
|
|
119
|
+
卸载后重启 Web 服务。如需彻底清理,可再手动删除自己 profile `cordis.patch.yml` 中的对应插件行。
|
|
105
120
|
|
|
106
121
|
## 中英双语
|
|
107
122
|
|
|
@@ -140,4 +155,4 @@ MIT。社区插件,与 DeepSeek 官方无关;`@deepseek-ai/*` 为官方保
|
|
|
140
155
|
|
|
141
156
|
- [dsh-hyperframes](https://github.com/STARDUSTLC666/dsh-hyperframes) — HTML 视频创作技能(本插件视觉风格来源)
|
|
142
157
|
- [dsh-remotion](https://github.com/STARDUSTLC666/dsh-remotion) — React 编程式视频技能
|
|
143
|
-
- [dsh-email](https://github.com/STARDUSTLC666/dsh-email) — 邮件六件套
|
|
158
|
+
- [dsh-email](https://github.com/STARDUSTLC666/dsh-email) — 邮件六件套
|
package/cordis.patch.yml
CHANGED
package/lib/config.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export declare const DEFAULT_MAX_SLIDES = 60;
|
|
|
4
4
|
export interface ResolvedPptConfig {
|
|
5
5
|
outputDir: string;
|
|
6
6
|
maxSlides: number;
|
|
7
|
+
defaultTheme: string;
|
|
8
|
+
defaultLang: string;
|
|
7
9
|
}
|
|
8
10
|
/** 解析并校验插件行配置。本插件无必填项,空配置永远可用。 */
|
|
9
11
|
export declare function resolvePptConfig(config: PptConfig | undefined | null): ResolvedPptConfig;
|
package/lib/config.js
CHANGED
|
@@ -5,9 +5,16 @@ export function resolvePptConfig(config) {
|
|
|
5
5
|
const raw = config ?? {};
|
|
6
6
|
const outputDir = (typeof raw.outputDir === 'string' ? raw.outputDir : '').trim()
|
|
7
7
|
|| (process.env[PPT_OUTPUT_DIR_ENV] ?? '').trim();
|
|
8
|
+
const defaultTheme = (typeof raw.defaultTheme === 'string' ? raw.defaultTheme : '').trim();
|
|
9
|
+
const defaultLang = (typeof raw.defaultLang === 'string' ? raw.defaultLang : '').trim();
|
|
10
|
+
if (defaultLang !== '' && defaultLang !== 'zh' && defaultLang !== 'en' && defaultLang !== 'bilingual') {
|
|
11
|
+
throw new Error('defaultLang 只支持 zh / en / bilingual。');
|
|
12
|
+
}
|
|
8
13
|
return {
|
|
9
14
|
outputDir,
|
|
10
15
|
maxSlides: clampInt(raw.maxSlides, DEFAULT_MAX_SLIDES, 3, 120),
|
|
16
|
+
defaultTheme,
|
|
17
|
+
defaultLang,
|
|
11
18
|
};
|
|
12
19
|
}
|
|
13
20
|
export function clampInt(value, fallback, min, max) {
|
package/lib/index.js
CHANGED
|
@@ -181,8 +181,8 @@ export function apply(ctx, config = {}) {
|
|
|
181
181
|
title: args.title.trim(),
|
|
182
182
|
content: typeof args.content === 'string' ? args.content : '',
|
|
183
183
|
slides: hasSlides ? args.slides : undefined,
|
|
184
|
-
theme: typeof args.theme === 'string' && args.theme.trim() !== '' ? args.theme.trim() : undefined,
|
|
185
|
-
lang: typeof args.lang === 'string' && args.lang.trim() !== '' ? args.lang.trim() : undefined,
|
|
184
|
+
theme: typeof args.theme === 'string' && args.theme.trim() !== '' ? args.theme.trim() : (resolved.defaultTheme || undefined),
|
|
185
|
+
lang: typeof args.lang === 'string' && args.lang.trim() !== '' ? args.lang.trim() : (resolved.defaultLang || undefined),
|
|
186
186
|
outputDir: typeof args.outputDir === 'string' && args.outputDir.trim() !== '' ? args.outputDir.trim() : (resolved.outputDir || undefined),
|
|
187
187
|
fileName: typeof args.fileName === 'string' && args.fileName.trim() !== '' ? args.fileName.trim() : undefined,
|
|
188
188
|
maxSlides: resolved.maxSlides,
|
package/lib/types.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export interface PptConfig {
|
|
|
15
15
|
outputDir?: string;
|
|
16
16
|
/** 单次生成幻灯片上限,默认 60(3–120)。 */
|
|
17
17
|
maxSlides?: number;
|
|
18
|
+
/** 默认视觉主题 id,调用 ppt_create 时可用 theme 覆盖。 */
|
|
19
|
+
defaultTheme?: string;
|
|
20
|
+
/** 默认播放器界面语言,调用 ppt_create 时可用 lang 覆盖。 */
|
|
21
|
+
defaultLang?: string;
|
|
18
22
|
}
|
|
19
23
|
export interface PptCreateArgs {
|
|
20
24
|
title: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ppt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DSH 演示文稿技能 + 工具插件:一句话或一篇 Markdown 文档 → 完整演示文稿(独立 HTML 网页放映 + 可编辑 PPTX 导出),内置 5
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "DSH 演示文稿技能 + 工具插件:一句话或一篇 Markdown 文档 → 完整演示文稿(独立 HTML 网页放映 + 可编辑 PPTX 导出),内置 5 套视觉主题,可配置默认主题/语言,中英双语,SKILL.md 双格式跨 harness。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc -p tsconfig.json",
|
|
30
|
-
"prepare": "tsc -p tsconfig.json",
|
|
31
30
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
32
31
|
"test": "pnpm run build && node --test \"test/*.test.mjs\"",
|
|
33
32
|
"test:core": "node --test \"test/*.test.mjs\"",
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
],
|
|
53
52
|
"license": "MIT",
|
|
54
53
|
"engines": {
|
|
55
|
-
"node": ">=
|
|
54
|
+
"node": ">=22"
|
|
56
55
|
},
|
|
57
56
|
"devDependencies": {
|
|
58
57
|
"@types/node": "^24.0.0",
|
|
@@ -1121,6 +1121,7 @@ function buildZip(entries) {
|
|
|
1121
1121
|
let offset = 0
|
|
1122
1122
|
|
|
1123
1123
|
for (const entry of entries) {
|
|
1124
|
+
const entryOffset = offset
|
|
1124
1125
|
const name = Buffer.from(entry.name, 'utf8')
|
|
1125
1126
|
const data = Buffer.isBuffer(entry.data) ? entry.data : Buffer.from(String(entry.data), 'utf8')
|
|
1126
1127
|
const crc = crc32(data)
|
|
@@ -1160,7 +1161,7 @@ function buildZip(entries) {
|
|
|
1160
1161
|
centralHeader.writeUInt16LE(0, 34)
|
|
1161
1162
|
centralHeader.writeUInt16LE(0, 36)
|
|
1162
1163
|
centralHeader.writeUInt32LE(0, 38)
|
|
1163
|
-
centralHeader.writeUInt32LE(
|
|
1164
|
+
centralHeader.writeUInt32LE(entryOffset, 42)
|
|
1164
1165
|
central.push(centralHeader, name)
|
|
1165
1166
|
}
|
|
1166
1167
|
|