dsh-ppt 0.25.0 → 0.26.0

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 (43) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.en.md +13 -13
  3. package/README.md +13 -13
  4. package/docs/DATA.md +2 -2
  5. package/docs/REFERENCE.en.md +8 -8
  6. package/docs/REFERENCE.zh.md +8 -8
  7. package/docs/USAGE.en.md +11 -7
  8. package/docs/USAGE.md +11 -7
  9. package/docs/VALIDATION.md +4 -0
  10. package/docs/WORKBENCH.md +4 -4
  11. package/docs/assets/intro/workflow-en-dark.svg +1 -1
  12. package/docs/assets/intro/workflow-en-light.svg +1 -1
  13. package/docs/assets/intro/workflow-en-mobile-dark.svg +1 -1
  14. package/docs/assets/intro/workflow-en-mobile-light.svg +1 -1
  15. package/docs/assets/intro/workflow-zh-dark.svg +1 -1
  16. package/docs/assets/intro/workflow-zh-light.svg +1 -1
  17. package/docs/assets/intro/workflow-zh-mobile-dark.svg +1 -1
  18. package/docs/assets/intro/workflow-zh-mobile-light.svg +1 -1
  19. package/lib/client.js +230 -76
  20. package/lib/ecosystem.d.ts +73 -0
  21. package/lib/ecosystem.js +1352 -0
  22. package/lib/execution.d.ts +6 -1
  23. package/lib/execution.js +69 -0
  24. package/lib/tools.js +77 -0
  25. package/lib/types.d.ts +57 -1
  26. package/lib/workbench-language.js +4 -0
  27. package/lib/workbench.d.ts +2 -0
  28. package/lib/workbench.js +331 -8
  29. package/package.json +1 -1
  30. package/skills/dsh-ppt/SKILL.md +3 -3
  31. package/skills/dsh-ppt/package.json +1 -1
  32. package/skills/dsh-ppt/references/advanced.md +10 -5
  33. package/skills/dsh-ppt/references/syntax.md +1 -0
  34. package/skills/dsh-ppt/scripts/build-deck.mjs +39 -8
  35. package/skills/dsh-ppt/scripts/deck-advanced.mjs +50 -13
  36. package/skills/dsh-ppt/scripts/deck-chrome.mjs +1706 -0
  37. package/skills/dsh-ppt/scripts/deck-core.mjs +116 -6
  38. package/skills/dsh-ppt/scripts/deck-delivery.mjs +636 -41
  39. package/skills/dsh-ppt/scripts/deck-diagrams.mjs +2842 -0
  40. package/skills/dsh-ppt/scripts/deck-director.mjs +49 -3
  41. package/skills/dsh-ppt/scripts/deck-layouts.mjs +482 -5270
  42. package/skills/dsh-ppt/scripts/deck-mermaid.mjs +2737 -0
  43. package/skills/dsh-ppt/scripts/deck-office.mjs +1541 -0
package/lib/workbench.js CHANGED
@@ -2,8 +2,9 @@
2
2
  import { createHash, randomUUID } from 'node:crypto';
3
3
  import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
4
4
  import { homedir } from 'node:os';
5
- import { basename, dirname, join, resolve } from 'node:path';
5
+ import { basename, dirname, extname, join, resolve } from 'node:path';
6
6
  import { getEngine } from './execution.js';
7
+ import { buildRemotionBundleFiles, computePaceBudgetFallback, renderOnePagerHtmlFallback } from './ecosystem.js';
7
8
  import { bilingualQuality, englishWorkbenchMessage } from './workbench-language.js';
8
9
  import { zipSync, strToU8 } from 'fflate';
9
10
  import { PptCoaching } from './coaching.js';
@@ -21,6 +22,7 @@ const ALLOWED_LAYOUTS = new Set([
21
22
  'marimekko', 'sankey', 'swot',
22
23
  'table', 'closing', 'image', 'image-left', 'image-right', 'chart', 'chart-split',
23
24
  'waterfall', 'gallery', 'flywheel', 'chevron', 'value-chain',
25
+ 'mermaid', 'flowchart', 'sequence',
24
26
  ]);
25
27
  const ALLOWED_TABLE_STYLES = new Set(['consulting', 'booktabs', 'minimal', 'banded', 'harvey']);
26
28
  const ALLOWED_DENSITIES = new Set(['compact', 'balanced', 'airy']);
@@ -293,6 +295,26 @@ function starterSlide(archetype, language) {
293
295
  if (kind === 'closing') {
294
296
  return { layout: 'closing', title: en ? 'Thank You · Next Steps' : '感谢聆听 · 下一步行动', subtitle: en ? 'Confirm pilot scope this week and review initial metrics next Friday.' : '本周内确认试点范围,下周五同步首轮评估结果。' };
295
297
  }
298
+ if (kind === 'mermaid' || kind === 'flowchart') {
299
+ return {
300
+ layout: 'mermaid',
301
+ variant: 'flowchart',
302
+ title: en ? 'End-to-end automated pipeline flow' : '端到端自动化构建与流转架构',
303
+ mermaid: en
304
+ ? 'flowchart LR\n A([Inputs]) --> B{Auto-Director}\n B -->|Data| C[Sankey & KPI]\n B -->|Docs| D[24+ Layouts]\n C --> E[(HTML & PPTX)]\n D --> E'
305
+ : 'flowchart LR\n A([多源输入]) --> B{智能导演}\n B -->|数据表| C[桑基与指标卡]\n B -->|文稿| D[24+ 版式]\n C --> E[(同源交付)]\n D --> E',
306
+ };
307
+ }
308
+ if (kind === 'sequence') {
309
+ return {
310
+ layout: 'mermaid',
311
+ variant: 'sequence',
312
+ title: en ? 'Agent & workbench synchronization sequence' : '智能编排与工作台协同交互时序',
313
+ mermaid: en
314
+ ? 'sequenceDiagram\n participant User\n participant Studio\n participant Engine\n User->>Studio: Upload .xlsx / .docx\n Studio->>Engine: Profile & choreograph\n Engine-->>User: HTML + Native PPTX'
315
+ : 'sequenceDiagram\n participant 用户\n participant 工作台\n participant 引擎\n 用户->>工作台: 上传 .xlsx / .docx\n 工作台->>引擎: 智能剖析与编排\n 引擎-->>用户: HTML + 原生 PPTX',
316
+ };
317
+ }
296
318
  return {
297
319
  layout: 'bullets',
298
320
  title: en ? 'New slide key takeaway' : '请填写本页核心结论句',
@@ -420,8 +442,31 @@ export class PptWorkbench {
420
442
  const langCode = manifest.language === 'en' ? 'en' : 'zh';
421
443
  const themes = typeof engine.listThemes === 'function' ? engine.listThemes(langCode) : [];
422
444
  const presets = typeof engine.listMasterPresets === 'function' ? engine.listMasterPresets(langCode) : [];
445
+ const rawPace = typeof engine.computePaceBudget === 'function'
446
+ ? engine.computePaceBudget(manifest, manifest.targetMinutes)
447
+ : computePaceBudgetFallback(manifest, manifest.targetMinutes);
448
+ const overrunSlides = Array.isArray(rawPace?.overrunSlides)
449
+ ? rawPace.overrunSlides
450
+ : Array.isArray(rawPace?.overBudgetSlides)
451
+ ? rawPace.overBudgetSlides
452
+ : [];
453
+ const overBudget = typeof rawPace?.overBudget === 'boolean'
454
+ ? rawPace.overBudget
455
+ : rawPace?.status === 'over-budget' || overrunSlides.length > 0;
456
+ const deltaMinutes = typeof rawPace?.deltaMinutes === 'number'
457
+ ? rawPace.deltaMinutes
458
+ : typeof rawPace?.deltaSeconds === 'number'
459
+ ? Math.round((rawPace.deltaSeconds / 60) * 10) / 10
460
+ : 0;
461
+ const paceBudget = {
462
+ ...rawPace,
463
+ slideCount: typeof rawPace?.slideCount === 'number' ? rawPace.slideCount : (Array.isArray(manifest.slides) ? manifest.slides.length : 0),
464
+ overBudget,
465
+ overrunSlides,
466
+ deltaMinutes,
467
+ };
423
468
  return { ok: true, project: { ...entry, deckId: manifest.deckId, revision: manifest.revision, theme: manifest.theme ?? 'data',
424
- brand: manifest.brand ?? null, themes, presets, slides: manifest.slides,
469
+ brand: manifest.brand ?? null, targetMinutes: manifest.targetMinutes ?? null, paceBudget, themes, presets, slides: manifest.slides,
425
470
  undoAvailable: manifest.history.length, quality: check, html, dataModel: manifest.dataModel ?? null,
426
471
  assets: Object.fromEntries(Object.entries(manifest.assets ?? {}).map(([key, value]) => [key, { data: value.data, mime: value.mime }])),
427
472
  render: currentRender ? { pageCount: currentRender.pngPaths.length, missingFonts: currentRender.missingFonts ?? [] } : null } };
@@ -586,6 +631,11 @@ export class PptWorkbench {
586
631
  throw new Error('文字字段过长或无效');
587
632
  result[key] = item;
588
633
  }
634
+ else if (key === 'mermaid') {
635
+ if (typeof item !== 'string' || item.length > 16000)
636
+ throw new Error('Mermaid 代码无效或超过 16,000 字符');
637
+ result.mermaid = item;
638
+ }
589
639
  else if (key === 'bullets') {
590
640
  if (!Array.isArray(item) || item.length > 50 || item.some(v => typeof v !== 'string' || v.length > 2000))
591
641
  throw new Error('要点内容无效');
@@ -698,6 +748,144 @@ export class PptWorkbench {
698
748
  }
699
749
  return new Uint8Array(bytes);
700
750
  }
751
+ officeBytes(raw, fileName) {
752
+ const name = typeof fileName === 'string' ? fileName.trim() : '';
753
+ const match = /\.(xlsx|csv|tsv|docx)$/i.exec(name);
754
+ if (!match || typeof raw !== 'string' || raw.length < 4) {
755
+ throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .docx 文件');
756
+ }
757
+ const ext = '.' + match[1].toLowerCase();
758
+ const clean = raw.replace(/^data:[^;,]+(?:;[^;,]+)*;base64,/, '').replace(/\s+/g, '');
759
+ if (!clean || clean.length > 34_000_000 || clean.length % 4 === 1 || !/^[A-Za-z0-9+/]+={0,2}$/.test(clean)) {
760
+ throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .docx 文件');
761
+ }
762
+ const bytes = Buffer.from(clean, 'base64');
763
+ if (bytes.byteLength === 0 || bytes.byteLength > ABSORB_PPTX_LIMIT) {
764
+ throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .docx 文件');
765
+ }
766
+ if ((ext === '.xlsx' || ext === '.docx') && (bytes.byteLength < 100 || bytes[0] !== 0x50 || bytes[1] !== 0x4b)) {
767
+ throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .docx 文件');
768
+ }
769
+ return { bytes: new Uint8Array(bytes), ext };
770
+ }
771
+ flagshipDemoSlides(lang, includeMermaid) {
772
+ const en = lang === 'en';
773
+ const slides = [
774
+ {
775
+ layout: 'cover',
776
+ kicker: en ? 'FLAGSHIP SHOWCASE · 0.25' : '旗舰功能全景示例 · 0.25',
777
+ title: en ? 'Enterprise AI Delivery & Financial Telemetry' : '企业级智能交付平台:效能跃迁与经营全景',
778
+ subtitle: en ? 'Native PPTX + Interactive HTML + Verified Data & Diagrams' : '同源构建可编辑 PPTX · 交互放映 · 原生公式与专业图示',
779
+ notes: en
780
+ ? 'Welcome everyone. In the next eight minutes we will walk through our flagship delivery telemetry, system architecture, quarterly roadmap, and capital efficiency.'
781
+ : '各位领导同事好,接下来用八分钟为大家汇报本季度企业级智能交付平台的核心成效、系统架构、路线图与资金流向全景。',
782
+ },
783
+ {
784
+ layout: 'kpi',
785
+ variant: 'grid',
786
+ kicker: 'EXECUTIVE SUMMARY',
787
+ title: en ? 'Headline metrics surpassed annual targets ahead of schedule' : '三大核心指标提前达成全年基准并实现正向复利',
788
+ items: [
789
+ { tag: 'ARR', value: '1.85', unit: en ? 'B' : '亿', delta: en ? '+42% YoY' : '同比 +42%', title: en ? 'Annual Recurring Revenue' : '年度经常性收入', status: 'positive' },
790
+ { tag: 'NRR', value: '118%', delta: en ? '+6 pts' : '提升 6 pct', title: en ? 'Net Dollar Retention' : '核心客户净收入留存', status: 'accent' },
791
+ { tag: 'CYCLE', value: '5', unit: en ? 'days' : '天', delta: en ? '-64% lead time' : '交付周期缩短 64%', title: en ? 'End-to-End Delivery' : '端到端平均交付周期', status: 'positive' },
792
+ ],
793
+ takeaway: en ? 'Platform standardization drove 42% revenue expansion while cutting deployment lead time by 64%.' : '标准化工程底座驱动营收同比增长 42%,同时将客户上线周期从 14 天压缩至 5 天。',
794
+ source: en ? 'Source: Q4 Audited Financial & Ops Ledger' : '数据来源:Q4 经核验财务与交付运营台账',
795
+ notes: en ? 'First, look at our headline KPIs: ARR reached 1.85 billion with 42 percent year-over-year growth and 118 percent net retention.' : '首先看核心经营指标:年度经常性收入突破 1.85 亿,同比增长 42%,净收入留存达 118%。',
796
+ },
797
+ {
798
+ layout: 'architecture',
799
+ variant: 'layered',
800
+ kicker: 'SYSTEM ARCHITECTURE',
801
+ title: en ? 'Three-tier deterministic engine guarantees zero-drift multi-format output' : '三层确定性构建架构保障多端同源交付零漂移',
802
+ items: [
803
+ { tag: en ? 'Experience' : '交互与工作台', title: en ? 'Studio & Presenter Console' : '工作台预览与双屏提词台', bullets: en ? ['Click-to-focus editing', 'Dual-screen P / Laser L'] : ['点击画布直达编辑', 'P 键双屏提词 / L 激光笔'] },
804
+ { tag: en ? 'Orchestration' : '智能编排层', title: en ? 'Director, Mermaid & Office Bridge' : '导演引擎 · Office 直吞 · 文献桥接', bullets: en ? ['XLSX/DOCX profiling', 'dsh-cite & Remotion'] : ['Excel/Word 自动成稿', 'dsh-cite 文献与视频分镜'] },
805
+ { tag: en ? 'Foundation' : '原生底层', title: en ? 'Dual-Target OOXML & HTML Compiler' : 'OOXML 原生图形与离线 HTML 编译器', bullets: en ? ['Native <m:oMath> & charts', 'WCAG >= 4.5:1 guard'] : ['原生公式与可编辑图表', 'WCAG >= 4.5:1 对比度门禁'] },
806
+ { tag: en ? 'Cross-cutting' : '安全合规', title: en ? 'Zero-Exfiltration & Atomic Undo' : '离线安全沙箱与 20 步原子撤销', status: 'accent', bullets: en ? ['Zero external network', 'Revision-guarded store'] : ['零外链纯净交付', '修订号防并发覆盖'] },
807
+ ],
808
+ notes: en ? 'Our architecture separates experience, orchestration, and deterministic OOXML emission so edits stay synchronized across HTML and PowerPoint.' : '系统采用交互层、编排层与原生编译器三层解耦设计,任何微调均可原子级同步至 HTML 与 PPTX。',
809
+ },
810
+ {
811
+ layout: 'gantt',
812
+ variant: 'quarters',
813
+ kicker: 'DELIVERY ROADMAP',
814
+ title: en ? 'Four-quarter rollout moves from core engine to full ecosystem' : '全年四季度路线图:从底层双模引擎迈向全生态闭环',
815
+ columns: ['Q1', 'Q2', 'Q3', 'Q4'],
816
+ items: [
817
+ { tag: en ? 'Core' : '核心底座', title: en ? 'Native charts & 24 curated themes' : '原生可编辑图表与 24 套大师主题', start: 0, span: 1.5, status: 'accent' },
818
+ { tag: en ? 'Import' : '文档翻新', title: en ? 'Round-trip .pptx & Excel/Word ingestion' : 'PPTX 双向导回与 Excel/Word 直吞', start: 1, span: 1.5, status: 'positive' },
819
+ { tag: en ? 'Ecosystem' : '生态协同', title: en ? 'dsh-cite bibliography & Remotion video pack' : 'dsh-cite 学术文献与 Remotion 视频分镜', start: 2, span: 1.5, status: 'accent' },
820
+ { tag: en ? 'GA' : '全量验收', title: en ? 'v0.25 Enterprise Flagship Release' : 'v0.25 旗舰版全面验收发布', start: 3, span: 0, milestone: true, status: 'warning' },
821
+ ],
822
+ notes: en ? 'On the timeline, Q1 and Q2 established native charts and Office ingestion, while Q3 and Q4 completed ecosystem bridges.' : '从推进节奏看,上半年夯实了原生图表与文档解析能力,下半年打通了文献与视频分镜全生态。',
823
+ },
824
+ {
825
+ layout: 'sankey',
826
+ kicker: 'CAPITAL FLOW',
827
+ title: en ? 'Revenue-to-operating-income flow shows 34.5% operating leverage' : '总营收至营业利润全链路流向拆解展现 34.5% 经营杠杆',
828
+ items: en
829
+ ? [
830
+ { tag: 'Total Revenue', title: 'Gross Profit', value: '68.5', unit: 'M', status: 'positive' },
831
+ { tag: 'Total Revenue', title: 'Cost of Revenue', value: '31.5', unit: 'M', status: 'neutral' },
832
+ { tag: 'Gross Profit', title: 'R&D Investment', value: '22.0', unit: 'M', status: 'accent' },
833
+ { tag: 'Gross Profit', title: 'Sales & Ops', value: '12.0', unit: 'M', status: 'warning' },
834
+ { tag: 'Gross Profit', title: 'Operating Income', value: '34.5', unit: 'M', status: 'positive' },
835
+ ]
836
+ : [
837
+ { tag: '总营收', title: '毛利润', value: '68.5', unit: '百万', status: 'positive' },
838
+ { tag: '总营收', title: '交付成本', value: '31.5', unit: '百万', status: 'neutral' },
839
+ { tag: '毛利润', title: '研发投入', value: '22.0', unit: '百万', status: 'accent' },
840
+ { tag: '毛利润', title: '市场与运营', value: '12.0', unit: '百万', status: 'warning' },
841
+ { tag: '毛利润', title: '营业利润', value: '34.5', unit: '百万', status: 'positive' },
842
+ ],
843
+ takeaway: en ? 'Strong gross margin (68.5%) funds sustained R&D while yielding 34.5% operating profit.' : '68.5% 的高毛利空间支撑了 22% 的研发强度,并沉淀出 34.5% 的健康营业利润。',
844
+ notes: en ? 'This Sankey diagram traces every dollar from top-line revenue through gross profit into R&D, operations, and operating income.' : '这张桑基图清晰展示了从总营收扣除交付成本后,毛利润在研发、运营与营业利润之间的精确分配。',
845
+ },
846
+ {
847
+ layout: 'marimekko',
848
+ kicker: 'MARKET LANDSCAPE',
849
+ title: en ? 'Segment sizing & share show leadership across high-value verticals' : '细分市场规模与份额矩阵凸显高价值赛道领先身位',
850
+ rows: en
851
+ ? [['Vendor / Segment', 'Enterprise (45B)', 'Financial (32B)', 'Industrial (23B)'], ['Flagship', '44%', '38%', '31%'], ['Vendor B', '32%', '36%', '34%'], ['Others', '24%', '26%', '35%']]
852
+ : [['厂商 / 赛道', '政企数字化 (450亿)', '金融信创 (320亿)', '工业智造 (230亿)'], ['本平台', '44%', '38%', '31%'], ['厂商 B', '32%', '36%', '34%'], ['其他', '24%', '26%', '35%']],
853
+ notes: en ? 'Across the three major verticals sized proportionally by column width, we lead in both Enterprise and Financial sectors.' : '不等宽市场图按各赛道体量比例切分列宽,我们在政企数字化与金融信创两大核心市场份额稳居第一。',
854
+ },
855
+ {
856
+ layout: 'callout',
857
+ variant: 'formula',
858
+ kicker: 'QUANTITATIVE OBJECTIVE',
859
+ title: en ? 'Regularized scoring objective balances accuracy and visual sparsity' : '量化目标函数:以原生 Office 公式精确表达准确率与稀疏正则项',
860
+ formula: '\\mathcal{L}(\\theta) = \\frac{1}{N}\\sum_{i=1}^{N} \\left(y_i - \\hat{y}_i(\\theta)\\right)^2 + \\lambda \\|\\theta\\|_2^2',
861
+ text: en
862
+ ? 'Compiled into native PowerPoint Office Math (OMML) equations and HTML MathML — directly editable in Word/PowerPoint equation tools.'
863
+ : '同时编译为 PowerPoint 原生 Office Math (OMML) 公式对象与 HTML MathML,在 Office 公式编辑器中可直接双击修改。',
864
+ notes: en ? 'Notice the equation is rendered natively as Office Math rather than a static bitmap.' : '页面中的公式为原生 Office Math 对象,而非静态截图,导出后可无损放大与二次编辑。',
865
+ },
866
+ ];
867
+ if (includeMermaid) {
868
+ slides.push({
869
+ layout: 'mermaid',
870
+ variant: 'flowchart',
871
+ kicker: 'NATIVE MERMAID FLOW',
872
+ title: en ? 'Mermaid diagram compiles into editable PowerPoint shapes & connectors' : 'Mermaid 流程图直接编译为可拖拽连接的原生 PPT 矢量形状',
873
+ mermaid: en
874
+ ? 'flowchart LR\n A([Raw Sources]) --> B{Auto-Director}\n B -->|Excel / CSV| C[Charts & Sankey]\n B -->|Markdown / DOCX| D[24+ Layouts]\n C --> E[(Editable PPTX)]\n D --> E'
875
+ : 'flowchart LR\n A([多源材料输入]) --> B{智能导演引擎}\n B -->|Excel / CSV| C[桑基与原生图表]\n B -->|Word / 大纲| D[24+ 专业版式]\n C --> E[(原生可编辑 PPTX)]\n D --> E',
876
+ takeaway: en ? 'Moving any node box in PowerPoint automatically keeps attached <p:cxnSp> connectors linked.' : '在 PowerPoint 中拖动任意节点方框,相连的矢量连接线会自动跟随联动。',
877
+ notes: en ? 'This flowchart is generated directly from Mermaid syntax into native PowerPoint shapes and attached connectors.' : '该流程图由 Mermaid 语法直接编译为原生 PPT 形状与绑定连接器,非静态贴图。',
878
+ });
879
+ }
880
+ slides.push({
881
+ layout: 'closing',
882
+ kicker: 'NEXT STEPS',
883
+ title: en ? 'Ready to customize, export One-Pager, or render Video Storyboard' : '即刻体验:编辑本页、导出高管一页纸或生成 Remotion 视频分镜',
884
+ subtitle: en ? 'Try clicking any text on the canvas, switching themes in Style Studio, or pressing P in standalone HTML.' : '点击左侧画布文字即可定位修改,也可前往“风格与母版”一键换肤,或点击“下载成品”导出多种交付物。',
885
+ notes: en ? 'Thank you! Feel free to explore editing, Style Studio, One-Pager HTML, and Remotion video export.' : '感谢体验旗舰示例工程!欢迎继续试用页面编辑、换肤、高管一页纸与 Remotion 视频导出。',
886
+ });
887
+ return slides;
888
+ }
701
889
  async action(body, signal) {
702
890
  signal?.throwIfAborted();
703
891
  if (body.operation === 'list')
@@ -792,6 +980,85 @@ export class PptWorkbench {
792
980
  rmSync(tmpRefPath, { force: true });
793
981
  }
794
982
  }
983
+ if (body.operation === 'create-demo') {
984
+ if (['referencePptx', 'pptxPath', 'path', 'outputDir', 'filePath'].some(k => Object.hasOwn(body, k))) {
985
+ throw new Error('图片必须从面板上传,不能读取其他本地文件');
986
+ }
987
+ const lang = body.lang === 'en' || body.lang === 'bilingual' ? body.lang : 'zh';
988
+ const theme = typeof body.theme === 'string' && body.theme.trim() ? this.themeId(body.theme) : 'consulting';
989
+ const engine = await this.loadEngine();
990
+ signal?.throwIfAborted();
991
+ const decksDir = join(dirname(this.catalogPath), 'workbench-decks');
992
+ mkdirSync(decksDir, { recursive: true });
993
+ const hasMermaidModule = existsSync(new URL('../skills/dsh-ppt/scripts/deck-mermaid.mjs', import.meta.url));
994
+ const demoSlides = this.flagshipDemoSlides(lang, hasMermaidModule);
995
+ const demoTitle = lang === 'en' ? 'DSH-PPT Flagship Showcase Deck' : 'DSH-PPT 旗舰能力全景示例';
996
+ const created = await (engine.buildDeckAsync ?? engine.buildDeck)({
997
+ title: demoTitle,
998
+ slides: demoSlides,
999
+ theme,
1000
+ lang,
1001
+ targetMinutes: 8,
1002
+ outputDir: decksDir,
1003
+ cwd: decksDir,
1004
+ signal,
1005
+ });
1006
+ await this.remember(created, {});
1007
+ return { ...await this.view(digest(created.jsonPath)), created: true, demo: true };
1008
+ }
1009
+ if (body.operation === 'import-office') {
1010
+ if (['filePath', 'pptxPath', 'path', 'outputDir', 'targetProjectDir', 'referencePptx'].some(k => Object.hasOwn(body, k))) {
1011
+ throw new Error('图片必须从面板上传,不能读取其他本地文件');
1012
+ }
1013
+ const { bytes, ext } = this.officeBytes(body.data, body.fileName);
1014
+ const engine = await this.loadEngine();
1015
+ signal?.throwIfAborted();
1016
+ if (typeof engine.importOfficeDeck !== 'function') {
1017
+ throw new Error('当前引擎版本暂不支持导入 Excel / Word 文档');
1018
+ }
1019
+ const theme = typeof body.theme === 'string' && body.theme.trim() ? (body.theme.trim() === 'auto' ? 'auto' : this.themeId(body.theme)) : 'auto';
1020
+ const lang = body.lang === 'en' || body.lang === 'bilingual' ? body.lang : 'zh';
1021
+ let chromeStyle;
1022
+ if (body.chromeStyle !== undefined && body.chromeStyle !== null && body.chromeStyle !== '') {
1023
+ if (typeof body.chromeStyle !== 'string' || !ALLOWED_CHROME_STYLES.has(body.chromeStyle)) {
1024
+ throw new Error('母版骨架名称无效 / Invalid chrome skeleton style');
1025
+ }
1026
+ chromeStyle = body.chromeStyle;
1027
+ }
1028
+ let targetMinutes;
1029
+ if (body.targetMinutes !== undefined && body.targetMinutes !== null && body.targetMinutes !== '') {
1030
+ const mins = Number(body.targetMinutes);
1031
+ if (!Number.isFinite(mins) || mins < 1 || mins > 240)
1032
+ throw new Error('目标演讲时长需为 1–240 分钟的数字');
1033
+ targetMinutes = mins;
1034
+ }
1035
+ const decksDir = join(dirname(this.catalogPath), 'workbench-decks');
1036
+ mkdirSync(decksDir, { recursive: true });
1037
+ const tmpOfficePath = join(decksDir, '.office-' + randomUUID() + ext);
1038
+ writeFileSync(tmpOfficePath, bytes);
1039
+ try {
1040
+ const cleanBase = typeof body.fileName === 'string'
1041
+ ? basename(body.fileName.trim(), extname(body.fileName.trim())).replace(/[^\p{L}\p{N}._-]+/gu, '-').replace(/^-+|-+$/g, '').slice(0, 80)
1042
+ : '';
1043
+ const imported = await engine.importOfficeDeck({
1044
+ filePath: tmpOfficePath,
1045
+ cwd: decksDir,
1046
+ outDir: decksDir,
1047
+ outputDir: decksDir,
1048
+ ...(cleanBase ? { fileName: cleanBase } : {}),
1049
+ theme,
1050
+ lang,
1051
+ ...(chromeStyle ? { chromeStyle } : {}),
1052
+ ...(targetMinutes !== undefined ? { targetMinutes } : {}),
1053
+ signal,
1054
+ });
1055
+ await this.remember(imported, {});
1056
+ return { ...await this.view(digest(imported.jsonPath)), imported: true, created: true };
1057
+ }
1058
+ finally {
1059
+ rmSync(tmpOfficePath, { force: true });
1060
+ }
1061
+ }
795
1062
  if (body.operation === 'import-pptx') {
796
1063
  if (['pptxPath', 'path', 'outputDir', 'targetProjectDir', 'referencePptx'].some(k => Object.hasOwn(body, k))) {
797
1064
  throw new Error('图片必须从面板上传,不能读取其他本地文件');
@@ -920,7 +1187,7 @@ export class PptWorkbench {
920
1187
  };
921
1188
  }
922
1189
  if (body.operation === 'download') {
923
- if (!['html', 'pptx', 'json', 'handout'].includes(String(body.kind)))
1190
+ if (!['html', 'pptx', 'json', 'handout', 'onepager', 'remotion'].includes(String(body.kind)))
924
1191
  throw new Error('不支持此文件类型');
925
1192
  if (body.kind === 'handout') {
926
1193
  const handoutPath = files.json.slice(0, -5) + '.handout.md';
@@ -929,6 +1196,27 @@ export class PptWorkbench {
929
1196
  const md = typeof engine.renderHandoutMarkdown === 'function' ? engine.renderHandoutMarkdown(manifest, manifest.language) : speakerNotes(manifest);
930
1197
  return { ok: true, name: basename(entry.path, '.json') + '.handout.md', data: Buffer.from(md, 'utf8').toString('base64') };
931
1198
  }
1199
+ if (body.kind === 'onepager') {
1200
+ const html = typeof engine.renderOnePagerHtml === 'function'
1201
+ ? engine.renderOnePagerHtml(manifest, manifest.language)
1202
+ : renderOnePagerHtmlFallback(manifest, manifest.language);
1203
+ return { ok: true, name: basename(entry.path, '.json') + '-onepager.html', data: Buffer.from(html, 'utf8').toString('base64') };
1204
+ }
1205
+ if (body.kind === 'remotion') {
1206
+ const themeObj = typeof engine.resolveTheme === 'function' ? engine.resolveTheme(manifest.theme) : undefined;
1207
+ const pace = typeof engine.computePaceBudget === 'function'
1208
+ ? engine.computePaceBudget(manifest, manifest.targetMinutes)
1209
+ : computePaceBudgetFallback(manifest, manifest.targetMinutes);
1210
+ const bundle = buildRemotionBundleFiles(manifest, {
1211
+ fps: 30,
1212
+ format: 'landscape',
1213
+ themeTokens: (themeObj?.palette ?? {}),
1214
+ paceBudget: pace,
1215
+ });
1216
+ const zipEntries = Object.fromEntries(Object.entries(bundle.files).map(([k, v]) => [k, strToU8(v)]));
1217
+ const zipped = zipSync(zipEntries, { level: 0 });
1218
+ return { ok: true, name: basename(entry.path, '.json') + '-remotion.zip', data: Buffer.from(zipped).toString('base64') };
1219
+ }
932
1220
  const path = files[body.kind];
933
1221
  return { ok: true, name: basename(path), data: ordinaryFile(path).toString('base64') };
934
1222
  }
@@ -1001,12 +1289,25 @@ export class PptWorkbench {
1001
1289
  throw new Error('页面不存在');
1002
1290
  if (Object.hasOwn(body, 'referencePptx'))
1003
1291
  throw new Error('图片必须从面板上传,不能读取其他本地文件');
1292
+ let targetMinutesPatch = {};
1293
+ if (body.targetMinutes !== undefined) {
1294
+ if (body.targetMinutes === null || body.targetMinutes === '') {
1295
+ targetMinutesPatch = { targetMinutes: null };
1296
+ }
1297
+ else {
1298
+ const mins = Number(body.targetMinutes);
1299
+ if (!Number.isFinite(mins) || mins < 1 || mins > 240)
1300
+ throw new Error('目标演讲时长需为 1–240 分钟的数字');
1301
+ targetMinutesPatch = { targetMinutes: mins };
1302
+ }
1303
+ }
1004
1304
  const args = { deckPath: entry.path, expectedRevision: body.expectedRevision, signal,
1005
1305
  saveAs: body.saveAs === true,
1006
1306
  ...(body.slide === undefined ? {} : { edits: [{ slide: body.slide, patch: this.patch(body.patch) }] }),
1007
1307
  ...(body.order === undefined ? {} : { order: body.order }),
1008
1308
  ...(body.theme === undefined ? {} : { theme: this.themeId(body.theme) }),
1009
- ...(body.brand === undefined ? {} : { brand: this.brandPatch(body.brand) }) };
1309
+ ...(body.brand === undefined ? {} : { brand: this.brandPatch(body.brand) }),
1310
+ ...targetMinutesPatch };
1010
1311
  const result = await engine.editDeck(args);
1011
1312
  await this.remember(result, args);
1012
1313
  return { ...await this.view(digest(result.jsonPath)), changed: result.changed };
@@ -1046,7 +1347,7 @@ export class PptWorkbench {
1046
1347
  return denied;
1047
1348
  try {
1048
1349
  const params = new URL(request.url).searchParams, kind = params.get('kind');
1049
- if (!['html', 'pptx', 'json', 'bundle', 'share', 'notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind)))
1350
+ if (!['html', 'pptx', 'json', 'bundle', 'share', 'notes', 'handout', 'onepager', 'remotion', 'coaching', 'data', 'visual'].includes(String(kind)))
1050
1351
  return fail(400, '不支持此文件类型');
1051
1352
  const { entry, manifest, files, engine } = await this.project(params.get('id'));
1052
1353
  if (String(manifest.revision) !== params.get('revision'))
@@ -1081,6 +1382,28 @@ export class PptWorkbench {
1081
1382
  name = basename(entry.path, '.json') + '.handout.md';
1082
1383
  }
1083
1384
  }
1385
+ else if (kind === 'onepager') {
1386
+ const html = typeof engine.renderOnePagerHtml === 'function'
1387
+ ? engine.renderOnePagerHtml(manifest, manifest.language)
1388
+ : renderOnePagerHtmlFallback(manifest, manifest.language);
1389
+ bytes = strToU8(html);
1390
+ name = basename(entry.path, '.json') + '-onepager.html';
1391
+ }
1392
+ else if (kind === 'remotion') {
1393
+ const themeObj = typeof engine.resolveTheme === 'function' ? engine.resolveTheme(manifest.theme) : undefined;
1394
+ const pace = typeof engine.computePaceBudget === 'function'
1395
+ ? engine.computePaceBudget(manifest, manifest.targetMinutes)
1396
+ : computePaceBudgetFallback(manifest, manifest.targetMinutes);
1397
+ const bundle = buildRemotionBundleFiles(manifest, {
1398
+ fps: 30,
1399
+ format: 'landscape',
1400
+ themeTokens: (themeObj?.palette ?? {}),
1401
+ paceBudget: pace,
1402
+ });
1403
+ const zipEntries = Object.fromEntries(Object.entries(bundle.files).map(([k, v]) => [k, strToU8(v)]));
1404
+ bytes = zipSync(zipEntries, { level: 0 });
1405
+ name = basename(entry.path, '.json') + '-remotion.zip';
1406
+ }
1084
1407
  else if (kind === 'bundle' || kind === 'share') {
1085
1408
  const entries = {};
1086
1409
  let total = 0;
@@ -1118,11 +1441,11 @@ export class PptWorkbench {
1118
1441
  request.signal.throwIfAborted();
1119
1442
  if ((await this.project(entry.id)).manifest.revision !== manifest.revision)
1120
1443
  return fail(409, '项目已被修改,请重新打开后下载');
1121
- const archive = kind === 'bundle' || kind === 'share';
1122
- const type = ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind)) ? 'text/markdown; charset=utf-8' : archive ? 'application/zip' : kind === 'pptx' ? 'application/vnd.openxmlformats-officedocument.presentationml.presentation' : kind === 'html' ? 'text/html; charset=utf-8' : 'application/json; charset=utf-8';
1444
+ const archive = kind === 'bundle' || kind === 'share' || kind === 'remotion';
1445
+ const type = ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind)) ? 'text/markdown; charset=utf-8' : archive ? 'application/zip' : kind === 'pptx' ? 'application/vnd.openxmlformats-officedocument.presentationml.presentation' : (kind === 'html' || kind === 'onepager') ? 'text/html; charset=utf-8' : 'application/json; charset=utf-8';
1123
1446
  return new Response(new Uint8Array(bytes), { headers: {
1124
1447
  'content-type': type, 'cache-control': 'no-store', 'x-content-type-options': 'nosniff',
1125
- 'content-disposition': `attachment; filename="presentation.${archive ? 'zip' : ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind)) ? 'md' : kind}"; filename*=UTF-8''${encodeURIComponent(name)}`,
1448
+ 'content-disposition': `attachment; filename="presentation.${archive ? 'zip' : ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind)) ? 'md' : kind === 'onepager' ? 'html' : kind}"; filename*=UTF-8''${encodeURIComponent(name)}`,
1126
1449
  } });
1127
1450
  }
1128
1451
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ppt",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "DeepSeek Harness 演示文稿生成与编辑工作台:输入材料即可导出离线 HTML 放映、可编辑 PPTX 与工程包,支持按页编辑、数据推演与预审演练,以及原生清透 / 米白纸感 / Claude 暖书卷 / 8-Bit 像素 / 晴空薄荷五套明亮工作台主题。欢迎提交 issues 和 PR。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -39,10 +39,10 @@ allowed-tools: "Bash, Read, Write, Edit"
39
39
  - **重要 CLI 差异**:跨 harness 直接运行 `build-deck.mjs` 时,裸 CLI 缺省 `--theme` 为兼容旧脚本仍回退 `data`,因此 **CLI 调用请务必显式传 `--theme auto` 或具体场景主题 ID(如 `--theme consulting` / `--theme exec-jilan`)**!
40
40
  4. **Build 生成**:先读 `references/syntax.md`(用到图表/多图/外源母版/编辑时读 `references/advanced.md`)。
41
41
  - **推荐方式(DSH 内)**:调 `ppt_create`,优先传结构化 `slides`(精确控制 **24 种原生版式**含 `gantt / architecture / harvey / tam / org / kpi / cards / comparison / matrix / process / chart-split / table[booktabs] / callout`),或传带 `:::` 指令与 `**加粗引导词**:说明` 的 Markdown `content`。
42
- - **跨 harness CLI**:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --slides @slides.json --theme auto --lang zh --out dist`(吸收参考模板并克隆结构可加 `--reference-pptx ref.pptx --clone-structure`;显式骨架用 `--chrome academic-minimal`;仅提取风格用 `--absorb ref.pptx`)。
42
+ - **跨 harness CLI**:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --slides @slides.json --theme auto --lang zh --out dist`(直吞 Excel/CSV/Word 可用 `--from-office report.xlsx --theme auto --target-minutes 10 --one-pager --out dist`;吸收参考模板并克隆结构可加 `--reference-pptx ref.pptx --clone-structure`;显式骨架用 `--chrome academic-minimal`;仅提取风格用 `--absorb ref.pptx`)。
43
43
  - 动效默认 `motion: 'on'`(HTML 页间淡入 + PPTX 要点点击逐条出现);严肃政企公文、学术打印或归档传 `motion: 'off'`。
44
- 5. **Verify 校验与看图修正**:调 `ppt_check` 检查结构、字数密度、WCAG 对比度与 `SLOP-01..10` 审美告警。若安装了 `@deepseek-ai/libreoffice-kit`,调 `ppt_render` 生成逐页 PNG/PDF 并附 `renderReceipt` 复检,逐张用看图工具核查画面(0 缺字、0 溢出、0 遮挡、0 冗余图例)。微调文字、切换主题或版式用 `ppt_edit`(带 `expectedRevision`),需要时 `ppt_undo`。静态估算、渲染成功与视觉验收必须分开如实陈述。
45
- 6. **Deliver 交付**:向用户提供 `.html`、`.pptx`、`.json`(以及可选 `--handout` 生成的 `.handout.md`)绝对路径,说明 HTML 快捷键(`← →` 翻页 · **`P` 开启双屏演讲者提词台** · **`L` 开启虚拟激光笔** · `F` 全屏 · `G` 总览 · `S` 顶部备注 · `Ctrl/Cmd+P` 打印)及检查面板内置「下载讲义 (.md)」离线导出;说明 PPTX 100% 原生可编辑特性(含 `<m:oMath>` 原生公式、Marimekko、桑基流向图、波特价值链、SWOT、三线表与图表工作簿),以及支持 `ppt_import` / `--sync-pptx` 从 Office 改稿回导同步工程。
44
+ 5. **Verify 校验与看图修正**:调 `ppt_check` 检查结构、字数密度、WCAG 对比度与 `SLOP-01..10` 审美告警。若安装了 `@deepseek-ai/libreoffice-kit`,调 `ppt_render` 生成逐页 PNG/PDF 并附 `renderReceipt` 复检,逐张用看图工具核查画面(0 缺字、0 溢出、0 遮挡、0 冗余图例)。微调文字、切换主题、更新 `mermaid` 或调整 `targetMinutes` 配速预算用 `ppt_edit`(带 `expectedRevision`),需要时 `ppt_undo`。静态估算、渲染成功与视觉验收必须分开如实陈述。
45
+ 6. **Deliver 交付**:向用户提供 `.html`、`.pptx`、`.json`(默认严格保持三件套,仅在传 `--handout` / `--one-pager` 时同步落盘 `.handout.md` / `.onepager.html`)绝对路径,说明 HTML 快捷键(`← →` 翻页 · **`P` 开启双屏演讲者提词台含逐页配速预算** · **`L` 开启虚拟激光笔** · `F` 全屏 · `G` 总览 · `S` 顶部备注 · `Ctrl/Cmd+P` 打印)及检查面板内置「下载讲义 (.md)」与「下载一页纸战报 (.html)」(支持 A4 打印与长图战报切换)离线导出;说明 PPTX 100% 原生可编辑特性(含 `<m:oMath>` 原生公式、Marimekko、桑基流向图、波特价值链、SWOT、Mermaid 原生流程图/时序图、三线表与图表工作簿),以及支持 `ppt_import` / `--sync-pptx` 从 Office 改稿回导同步工程、`ppt_from_office` / `--from-office` 直吞 `.xlsx/.csv/.tsv/.docx`。
46
46
 
47
47
  ## 按需装载索引
48
48
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ppt-skill",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Standalone dsh-ppt skill dependencies for image/chart export",
@@ -83,15 +83,16 @@ Agent 先提炼真实内容与数据结论,再通过结构化参数生成可
83
83
 
84
84
  ---
85
85
 
86
- ## 五、双屏演讲者提词台、演讲讲义、按页编辑与撤销
86
+ ## 五、双屏演讲者提词台、配速预算、高管一页纸战报与按页编辑
87
87
 
88
- - **双屏演讲者提词台(独立 HTML 放映内置)**:按 **`P`** 或点击 `#presenter-toggle` 打开双屏控制窗口(通过 `BroadcastChannel` + `postMessage` 双向实时同步),支持当前页与下一页预览、大字号提词器(`A+ / A-` 缩放,无手写备注时自动回退为 `takeaway` 与要点提示)、正计时与目标配速倒计时、缩略图条快速跳页,以及按 **`L`** 在观众主屏同步投射虚拟激光笔!
89
- - **演讲讲义导出(`<slug>.handout.md`)**:HTML 检查面板内置「下载讲义 (.md)」按钮(客户端离线生成下载);CLI 传 `--handout`(或 API `handout: true`)可同时落盘 `<slug>.handout.md`,包含演示概览、预计总时长、每页核心指标/表格/要点与逐页演讲手稿。
88
+ - **双屏演讲者提词台与配速预算(`computePaceBudget`)**:按 **`P`** 或点击 `#presenter-toggle` 打开双屏控制窗口(通过 `BroadcastChannel` + `postMessage` 双向实时同步),支持当前页与下一页预览、大字号提词器(`A+ / A-` 缩放,无手写备注时自动回退为 `takeaway` 与要点提示)、正计时与目标配速倒计时、逐页演讲预算徽章(按中文 `220 字/分`、英文 `145 词/分` + 图表/图示 `+12s` 理解缓冲测算,超 `1.45x` 目标切片或 `>150s` 自动标红 `over-budget`),以及按 **`L`** 在观众主屏同步投射虚拟激光笔!
89
+ - **演讲讲义与高管一页纸战报(`.handout.md` / `.onepager.html`)**:HTML 检查面板内置「下载讲义 (.md)」与「下载一页纸战报 (.html)」离线 `Blob` 下载按钮(默认仍严格保持 3 件套落盘不变);CLI 传 `--handout` / `--one-pager`(或 API `handout: true` / `onePager: true`)可同步落盘,其中高管一页纸支持 **A4 打印版 ↔ 移动端长图战报(Mobile Long-Card)** 一键切换,浓缩展示核心结论、KPI 条、关键图表/表格/流程图摘要、支柱行动与逐页配速预算。
90
+ - **Office 文件直吞引擎(`ppt_from_office` / `--from-office`)**:零新增依赖直读 `.xlsx` / `.csv` / `.tsv`(自动识别 `[Source, Target, Amount]` 桑基图、任务排期甘特图、市场份额 Marimekko、增减桥瀑布图、>10x 量纲差双轴组合图、通用 `chart-split` + 明细附录表)与 `.docx` Word 报告(标题/中文编号标题、加粗导语、Word 表格、嵌入图片、Mermaid 代码块与 `$...$` 公式),直出完整 5–20 页演示工程。
90
91
 
91
92
  1. **先查后改**:调 `ppt_check { deckPath: "report.json" }` 获取当前 `revision` 与稳定页面 `id`。
92
93
  2. **原子编辑(`ppt_edit`)**:
93
- - **单页局部补丁 `edits`**:支持修改 `title, subtitle, kicker, takeaway, source, formula, layout, variant, chrome, tableStyle, bullets, items, columns, rows, image, images, chart, notes, visual`(`slide` 传 1 起始页码或稳定 ID)。
94
- - **整套换肤与品牌更新**:顶层可传 `theme: "exec-jilan"`、`referencePptx: "ref.pptx"` 或 `brand`(`brand: null` 清空品牌,`logo: null` 清空 Logo)。
94
+ - **单页局部补丁 `edits`**:支持修改 `title, subtitle, kicker, takeaway, source, formula, mermaid, layout, variant, chrome, tableStyle, bullets, items, columns, rows, image, images, chart, notes, visual`(`slide` 传 1 起始页码或稳定 ID)。
95
+ - **整套换肤、目标时长与品牌更新**:顶层可传 `theme: "exec-jilan"`、`targetMinutes: 12`、`referencePptx: "ref.pptx"` 或 `brand`(`brand: null` 清空品牌,`logo: null` 清空 Logo)。
95
96
  - **追加、复制、排序与删除**:`append: [slide1, ...]`(单次追加 1–5 页新页面)、`duplicate: [2]`、`remove: [4]`、`order: [id1, id2, ...]`(包含全部原始页面 ID 各一次;执行顺序:先编辑/排序,再复制/删除/追加,最终保留 1–120 页)。
96
97
  - 每次修改原子重写 HTML / PPTX / JSON,失败自动回滚,保留最近 20 步历史。
97
98
  3. **一键撤销(`ppt_undo`)**:`ppt_undo { deckPath: "report.json", expectedRevision: 1 }` 完整恢复上一状态(含主题、页面结构、图表、图片与数据模型),`revision` 单调递增。
@@ -126,6 +127,10 @@ node scripts/build-deck.mjs --absorb corp.pptx
126
127
  # 全量导入旧 PPTX 并一键翻新(支持 --preserve-theme 与 --handout)
127
128
  node scripts/build-deck.mjs --import-pptx legacy.pptx --theme auto --handout --out dist
128
129
 
130
+ # 直吞 Excel/CSV/TSV/Word 生成全套演示文稿(可选 --target-minutes 与 --one-pager)
131
+ node scripts/build-deck.mjs --from-office financials.xlsx --theme auto --target-minutes 10 --one-pager --out dist
132
+ node scripts/build-deck.mjs --from-office annual-report.docx --theme consulting --handout --out dist
133
+
129
134
  # 将 Office 修改后的 PPTX 导回已有工程(自动快照至 .history/ 支持撤销)
130
135
  node scripts/build-deck.mjs --sync-pptx dist/deck.pptx --edit dist/deck.json
131
136
 
@@ -32,6 +32,7 @@
32
32
  | **`harvey`** | `matrix` | `kicker, title, rows[][]`(支持 `● ◕ ◑ ◔ ○ ✓ ✗` 或 `100%/75%/50%/25%/0%`) | **麦肯锡式哈维球竞品/能力矩阵**:自动高亮「本方案 / Ours」列并将符号渲染为精确矢量圆球 |
33
33
  | **`tam`** | `concentric` | `kicker, title, items[]`(3 项 TAM/SAM/SOM,含 `value, title, text`) | **同心圆市场空间测算图**:左侧 3 个底切原生同心椭圆 + 右侧 3 张规模与口径说明卡 |
34
34
  | **`org`** | `tree \| team` | `kicker, title, items[]`(`tree` 首项为根节点,2–5 项为子节点;`team` 2–4 人) | **组织架构树 / 核心管理团队介绍**:`tree` 带正交直角连接线;`team` 带圆标首字母头像与履历标签 |
35
+ | **`mermaid`** | `flowchart \| sequence`(亦支持顶层别名) | `kicker, title, mermaid`(Mermaid 代码串), `takeaway` | **原生可编辑 Mermaid 流程图与时序图**:Markdown 中 ```` ```mermaid ```` 自动识别,PPTX 编译为带附着连接点(`stCxn`/`endCxn`)的原生矢量图形与箭头 |
35
36
  | `closing` | `standard \| cta-cards \| inverted` | `kicker, title, subtitle, items / bullets` | 结束与行动号召页(自动隐藏页码;支持下一步行动卡片,拒绝孤立「谢谢」) |
36
37
 
37
38
  ### B. 5 套媒体与出版级图表版式(`@office-kit/pptx` 增强)