Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
- V0.9.1
workflow_dispatch:
inputs:
target:
Expand Down
23 changes: 23 additions & 0 deletions docs/ppt-personal-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 个人 PPT 模板

用户在 PPT 模式的“我的模板”中上传 PPTX,逐页预览后保存为当前 Desktop 配置目录中的个人模板。新模板显示在创建卡片旁并自动选中;后续会话可选择同一模板。模板卡片名称单行省略,悬停显示全文。卡片的编辑与删除入口在悬停或键盘聚焦时出现,编辑通过弹窗修改名称和描述。

## 导入与复用

1. `template/prepare` 接收文件名和 Base64 内容,验证 PPTX、上传数据和页数(默认最多 40 页),在 Host 侧完成转换和审计。文件大小沿用 Host 通用传输与解压资源限制。
2. PPTX 通过 OOXML 关系解析为 PPTD 页面、图片和图表。组合对象先合成完整坐标变换再展开;图片资源支持安全 SVG、常见位图,以及受限的 EMF 矢量路径与裁剪。
3. 生成最长边 1920px 的逐页预览,以及三张最长边 720px 的目录缩略图。大图片在预览时生成符合显示尺寸的临时副本,保持透明度和裁切,模板与导出保留原图。弹窗用于翻页、命名、保存和取消。
4. `template/save` 校验后将草稿原子移入已保存目录。原稿 SHA-256 用于重复文件识别;同一配置目录最多保存 100 套模板。草稿属于创建它的会话,过期草稿按限额清理。
5. 用户选择模板后,`ppt_template_create_project` 通过现有工作区路径策略与审计创建独立副本。Agent 读取实际页面、替换业务示例,再使用现有 PPTD 工具检查和导出可编辑 PPTX。

模板库位于 `<Host root>/personal-templates`;它随当前 Desktop 配置目录保存。组织共享、跨设备同步和账号级云端模板库尚未实现。上传资料和模板示例属于不可信内容,Agent 应按当前用户任务处理示例文字与数据。

## 转换与验证

Host 与 CLI 共用转换模块。内部对象 ID 由遍历顺序生成,独立于可能重复的显示名称。直线连接符映射为原生线条。字体、富文本字号和自动适配尽量沿用源对象;原对象内容指纹区分已存在的布局问题和改写后的严格检查。缺失资源、非法结构和未支持的绘图操作会中止导入,并保留逐页、逐对象的诊断。

EMF 仅接收已实现的二维绘图记录,支持路径、贝塞尔曲线、实色画刷、线条和裁剪。文件大小、记录数量、路径点数、状态栈和裁剪层级均有上限。EMF+、未支持的绘图记录和组合倾斜变换返回明确错误。复杂文字变形、自定义几何和部分 OOXML 样式仍走标准化流程,视觉保真需要核对实际原稿。

个人模板 PPTX 上限为 64 MiB。审查预览按页读取,目录缩略图仍为每套 3 张 720px 图。自动化覆盖超过 16 MB 且不超过 64 MiB 的真实图片 PPTX 导入、超限拒绝、保存与复用、格式及数据校验、会话与路径隔离、重复文件、保存/取消、编辑/删除、选择持久化、独立工程复制、原生导出、异步状态、弹窗、长名称、富文本、字体、图表、安全 SVG、EMF 和嵌套组合。仓库合成测试不包含用户原稿。

开发验证另外使用了两份企业原稿(共 53 页)和 56 份已有本地样本。企业原稿在实际包内 Host 完成导入、高清预览、保存、重载、复制和导出;此前样本通过批量转换检查。原稿、客户资源和本地安装包作为开发机证据保存。
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified packages/ppt-bundles/dsh-ppt-0.1.1-rc.2-desktop-20260906.tgz
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions packages/ppt-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ The legacy on-disk `kimi-ppt` directory is deliberately retained to preserve ses

PPT remains preinstalled. Its automatic instructions are scoped to sessions where the user enabled the PPT button.

### Personal PPT templates

The chooser's **My templates** tab accepts PPTX files with the configured slide limit (40 by default). Uploads use the Host's shared transport and archive resource limits. They produce page previews and conversion diagnostics. **Save template** registers the reviewed file in the current Desktop profile; new sessions and restarts read the same library. Identical source bytes resolve to the saved template. Users can rename or remove entries; generated task projects stay available.

The host stores source PPTX, editable PPTD pages, assets, previews and conversion records under `personal-templates/` inside the configured PPT data root. Drafts belong to their initiating session. Registered templates belong to this local Desktop profile, including remote connections to that profile. Account-based sharing and cross-device synchronization require a separate identity integration.

`ppt_template_create_project` copies the selected personal template into a new confined workspace directory. The model then adapts that copy with the existing PPTD tools and exports through `pptd_render`. The saved source remains separate from generated task files. All conversion and copy operations use the existing bounded parser/compiler and host audit. Company template fidelity requires review of actual imported pages, particularly master elements and advanced Office objects. Product rules and evidence: [Personal PPT templates](../../docs/ppt-personal-templates.md).

For runtime-only changes, `node scripts/build-ppt-runtime.mjs --reuse-previews` validates all built-in source decks and packages their existing reviewed previews. A full `npm run ppt:build` regenerates the built-in assets.

Validation evidence and temporary exports live under ignored `doc/ppt-remediation/`. Windows packaging and native Windows PowerPoint require their own runner/device validation.

### Layout refinement
Expand Down
95 changes: 84 additions & 11 deletions packages/ppt-runtime/adapter/lib/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/ppt-runtime/artifacts.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"core": {
"file": "dsh-ppt-0.1.1-rc.2-desktop-20260906.tgz",
"sha256": "18901b871ca4166d1693e8042c0d7c2a31ffddd59b75719773c05bb0342a7a5f",
"integrity": "sha512-uvn5Ewf13MVm2HDPQ76wEld/GNvS6gHi0IzBS5HOuwRZqCp4sC8agP3HcDqeF5kHTwykiFAMihXsQezzwXkVLA=="
"sha256": "15e2e7c94e15936c91d3ff4ac5c54e6ec66e4518207ccad5e02672a63dd45786",
"integrity": "sha512-Pz+X4yaV9p8sbBuqVctgvElOi+zyvcgc0Ax24vjzWPGwvul95CK6QastsVooKfCkspXJf11Bri0Kv+h+ptL+2g=="
},
"adapter": {
"file": "dsh-ppt-composer-0.1.1-rc.2-desktop-20260906.tgz",
"sha256": "b314fc207b12ca81da58b227c1c261bd6f7d24b5f6e015c7e150e196bf57efde",
"integrity": "sha512-IareIoEjxUP8DmQWocwUmjpLqc+utvbOTa5R6qfLUC4gCDBO9npZTQujBBCVExxeXNsVG+UFTDhFoNw/jEgL0g=="
"sha256": "5c97d812dd65820ed8e33e873a214766f9405fa8d19ad683d128c0be11d9316b",
"integrity": "sha512-eyKe0SZ9bvfFLozTYxSPM9JTQs7cu/z9+dbWnrnwvyhNt7NikshniNNC+EsaS+GXKRnTjTbLPO1vngYEk7fPVQ=="
}
}
Loading
Loading