dsh-ppt 0.33.0 → 0.35.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 (33) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.en.md +8 -10
  3. package/README.md +8 -10
  4. package/docs/USAGE.en.md +44 -35
  5. package/docs/USAGE.md +45 -36
  6. package/docs/VALIDATION.md +8 -0
  7. package/lib/client.js +116 -17
  8. package/lib/ecosystem.js +10 -0
  9. package/lib/execution.js +36 -5
  10. package/lib/tools.js +74 -4
  11. package/lib/types.d.ts +79 -1
  12. package/lib/workbench.js +255 -14
  13. package/package.json +2 -2
  14. package/skills/dsh-ppt/SKILL.md +34 -31
  15. package/skills/dsh-ppt/package.json +1 -1
  16. package/skills/dsh-ppt/references/office-pack.md +124 -0
  17. package/skills/dsh-ppt/references/research-plan.md +93 -62
  18. package/skills/dsh-ppt/scripts/build-deck.mjs +109 -3
  19. package/skills/dsh-ppt/scripts/deck-absorb.mjs +21 -0
  20. package/skills/dsh-ppt/scripts/deck-advanced.mjs +330 -37
  21. package/skills/dsh-ppt/scripts/deck-brand-kit.mjs +257 -0
  22. package/skills/dsh-ppt/scripts/deck-charts-exec.mjs +805 -0
  23. package/skills/dsh-ppt/scripts/deck-chrome.mjs +47 -1
  24. package/skills/dsh-ppt/scripts/deck-compose.mjs +386 -0
  25. package/skills/dsh-ppt/scripts/deck-core.mjs +136 -16
  26. package/skills/dsh-ppt/scripts/deck-delivery.mjs +750 -17
  27. package/skills/dsh-ppt/scripts/deck-evidence.mjs +811 -118
  28. package/skills/dsh-ppt/scripts/deck-export.mjs +652 -0
  29. package/skills/dsh-ppt/scripts/deck-i18n.mjs +170 -0
  30. package/skills/dsh-ppt/scripts/deck-layouts.mjs +72 -8
  31. package/skills/dsh-ppt/scripts/deck-media.mjs +22 -0
  32. package/skills/dsh-ppt/scripts/deck-office.mjs +1455 -14
  33. package/skills/dsh-ppt/scripts/deck-remix.mjs +471 -0
package/lib/execution.js CHANGED
@@ -71,8 +71,9 @@ export function createPptExecutors(config, loadEngine = getEngine) {
71
71
  throw new Error('dsh-ppt:title 不能为空');
72
72
  const hasContent = typeof args.content === 'string' && args.content.trim() !== '';
73
73
  const hasSlides = Array.isArray(args.slides) && args.slides.length > 0;
74
- if (!hasContent && !hasSlides && !args.template)
75
- throw new Error('dsh-ppt:content 不能为空(或用 slides / template 传结构化幻灯片)');
74
+ const hasMerge = Array.isArray(args.mergeSources) && args.mergeSources.length > 0;
75
+ if (!hasContent && !hasSlides && !args.template && !hasMerge)
76
+ throw new Error('dsh-ppt:content 不能为空(或用 slides / template / mergeSources 传结构化幻灯片)');
76
77
  const engine = await loadEngine();
77
78
  // Check cancellation after loading and before artifact commit inside the async engine.
78
79
  exec?.signal?.throwIfAborted();
@@ -82,6 +83,7 @@ export function createPptExecutors(config, loadEngine = getEngine) {
82
83
  title: args.title.trim(),
83
84
  content: typeof args.content === 'string' ? args.content : '',
84
85
  slides: hasSlides ? args.slides : undefined,
86
+ ...(hasMerge ? { mergeSources: args.mergeSources } : {}),
85
87
  theme: typeof args.theme === 'string' && args.theme.trim() !== '' ? args.theme.trim() : ((args.taste || args.exemplar) ? undefined : (config.defaultTheme || (typeof engine.absorbPptx === 'function' ? 'auto' : undefined))),
86
88
  ...(args.taste ? { taste: args.taste } : {}),
87
89
  ...(typeof args.exemplar === 'string' && args.exemplar.trim() !== '' ? { exemplar: args.exemplar.trim() } : {}),
@@ -93,6 +95,8 @@ export function createPptExecutors(config, loadEngine = getEngine) {
93
95
  smartLayout: typeof args.smartLayout === 'boolean' ? args.smartLayout : undefined,
94
96
  lang: typeof args.lang === 'string' && args.lang.trim() !== '' ? args.lang.trim() : (config.defaultLang || undefined),
95
97
  motion: args.motion,
98
+ ...(typeof args.motionProfile === 'string' && args.motionProfile.trim() ? { motionProfile: args.motionProfile.trim() } : {}),
99
+ ...(Array.isArray(args.exports) && args.exports.length > 0 ? { exports: args.exports } : {}),
96
100
  outputDir: resolve(cwd, outputDir || '.'),
97
101
  fileName: typeof args.fileName === 'string' && args.fileName.trim() !== '' ? args.fileName.trim() : undefined,
98
102
  overwrite: args.overwrite === true,
@@ -103,6 +107,7 @@ export function createPptExecutors(config, loadEngine = getEngine) {
103
107
  dataModel: args.dataModel,
104
108
  ...(Array.isArray(args.evidence) ? { evidence: args.evidence } : {}),
105
109
  ...(args.evidenceAppendix === true ? { evidenceAppendix: true } : {}),
110
+ ...(typeof args.useBrandKit === 'boolean' ? { useBrandKit: args.useBrandKit } : {}),
106
111
  cwd,
107
112
  signal: exec?.signal,
108
113
  });
@@ -145,6 +150,12 @@ export function createPptExecutors(config, loadEngine = getEngine) {
145
150
  ...(typeof args.tasteName === 'string' && args.tasteName.trim() ? { tasteName: args.tasteName.trim() } : {}),
146
151
  ...(typeof args.saveExemplarAs === 'string' && args.saveExemplarAs.trim() ? { saveExemplarAs: args.saveExemplarAs.trim() } : {}),
147
152
  ...(typeof args.exemplarName === 'string' && args.exemplarName.trim() ? { exemplarName: args.exemplarName.trim() } : {}),
153
+ ...(args.saveBrandKit === true ? { saveBrandKit: true } : {}),
154
+ ...(typeof args.brandKitName === 'string' && args.brandKitName.trim() ? { brandKitName: args.brandKitName.trim() } : {}),
155
+ ...(typeof args.watermark === 'string' && args.watermark.trim() ? { watermark: args.watermark.trim() } : {}),
156
+ ...(Array.isArray(args.forbiddenTerms) ? { forbiddenTerms: args.forbiddenTerms } : {}),
157
+ ...(Array.isArray(args.preferredSources) ? { preferredSources: args.preferredSources } : {}),
158
+ ...(Array.isArray(args.blockedDomains) ? { blockedDomains: args.blockedDomains } : {}),
148
159
  cwd,
149
160
  signal: exec?.signal,
150
161
  });
@@ -162,6 +173,7 @@ export function createPptExecutors(config, loadEngine = getEngine) {
162
173
  const exemplarId = typeof args.exemplarId === 'string' ? args.exemplarId.trim() : '';
163
174
  const topic = typeof args.topic === 'string' ? args.topic.trim() : '';
164
175
  if (topic && typeof engine.buildResearchPlan === 'function') {
176
+ const kit = typeof engine.loadWorkspaceBrandKit === 'function' ? engine.loadWorkspaceBrandKit(cwd) : null;
165
177
  const researchPlan = engine.buildResearchPlan({
166
178
  topic,
167
179
  persona: typeof args.persona === 'string' ? args.persona.trim() : undefined,
@@ -169,6 +181,8 @@ export function createPptExecutors(config, loadEngine = getEngine) {
169
181
  evidence: Array.isArray(args.evidence) ? args.evidence : undefined,
170
182
  lang,
171
183
  workspaceExemplars,
184
+ ...(Array.isArray(kit?.preferredSources) ? { preferredSources: kit.preferredSources } : {}),
185
+ ...(Array.isArray(kit?.blockedDomains) ? { blockedDomains: kit.blockedDomains } : {}),
172
186
  });
173
187
  return {
174
188
  ok: true,
@@ -257,19 +271,36 @@ export function createPptExecutors(config, loadEngine = getEngine) {
257
271
  async fromOffice(rawArgs, exec) {
258
272
  exec?.signal?.throwIfAborted();
259
273
  const args = asRecord(rawArgs);
260
- if (typeof args.filePath !== 'string' || args.filePath.trim() === '') {
274
+ const rawFilePath = typeof args.filePath === 'string' ? args.filePath.trim() : '';
275
+ const rawFilePaths = Array.isArray(args.filePaths)
276
+ ? args.filePaths.map((p) => String(p ?? '').trim()).filter(Boolean)
277
+ : [];
278
+ if (!rawFilePath && rawFilePaths.length === 0) {
261
279
  throw new Error('dsh-ppt:filePath 不能为空');
262
280
  }
263
281
  const engine = await loadEngine();
264
282
  exec?.signal?.throwIfAborted();
265
283
  if (typeof engine.importOfficeDeck !== 'function') {
266
- throw new Error('dsh-ppt:当前引擎版本暂不支持导入 Excel / Word 文档');
284
+ throw new Error('dsh-ppt:当前引擎版本暂不支持导入 Excel / Word / PDF 文档');
267
285
  }
268
286
  const cwd = exec?.agent?.session.header.cwd ?? process.cwd();
269
287
  const rawOut = typeof args.outputDir === 'string' && args.outputDir.trim() !== '' ? args.outputDir.trim() : config.outputDir;
270
288
  const resolvedOut = resolve(cwd, rawOut || '.');
289
+ const mergedPaths = rawFilePaths.length > 0
290
+ ? [...new Set([rawFilePath, ...rawFilePaths].filter(Boolean))]
291
+ : undefined;
271
292
  return engine.importOfficeDeck({
272
- filePath: args.filePath.trim(),
293
+ filePath: rawFilePath,
294
+ ...(mergedPaths ? { filePaths: mergedPaths } : {}),
295
+ ...(args.inspectOnly === true ? { inspectOnly: true } : {}),
296
+ ...(typeof args.instructions === 'string' && args.instructions.trim() !== '' ? { instructions: args.instructions.trim() } : {}),
297
+ ...(typeof args.maxSlides === 'number' && Number.isInteger(args.maxSlides) ? { maxSlides: args.maxSlides } : {}),
298
+ ...(Array.isArray(args.includeSheets) ? { includeSheets: args.includeSheets } : {}),
299
+ ...(args.photoRoles && typeof args.photoRoles === 'object' && !Array.isArray(args.photoRoles) ? { photoRoles: args.photoRoles } : {}),
300
+ ...(args.bindDataModel === true ? { bindDataModel: true } : {}),
301
+ ...(Array.isArray(args.evidence) ? { evidence: args.evidence } : {}),
302
+ ...(Array.isArray(args.exports) && args.exports.length > 0 ? { exports: args.exports } : {}),
303
+ ...(typeof args.motionProfile === 'string' && args.motionProfile.trim() ? { motionProfile: args.motionProfile.trim() } : {}),
273
304
  cwd,
274
305
  outDir: resolvedOut,
275
306
  outputDir: resolvedOut,
package/lib/tools.js CHANGED
@@ -39,10 +39,12 @@ function compileParameters(spec) {
39
39
  node.description = prop.description;
40
40
  if (Array.isArray(prop?.enum))
41
41
  node.enum = prop.enum;
42
- if (prop?.type === 'array' && prop.items !== null && typeof prop.items === 'object')
42
+ if ((prop?.type === 'array' || (Array.isArray(prop?.type) && prop.type.includes('array'))) && prop.items !== null && typeof prop.items === 'object')
43
43
  node.items = prop.items;
44
44
  if (prop.properties)
45
45
  node.properties = prop.properties;
46
+ if (Array.isArray(prop?.required))
47
+ node.required = [...prop.required];
46
48
  if (prop.additionalProperties !== undefined)
47
49
  node.additionalProperties = prop.additionalProperties;
48
50
  properties[key] = compileNode(node);
@@ -140,6 +142,9 @@ function renderAbsorb(value) {
140
142
  return oneText(parts.join('\n'));
141
143
  }
142
144
  function renderCreate(value) {
145
+ if (value.inspectOnly === true && typeof value.dossierMarkdown === 'string') {
146
+ return oneText(value.dossierMarkdown);
147
+ }
143
148
  const up = value.upgradeReport;
144
149
  const sr = (up?.selfRepair && typeof up.selfRepair === 'object') ? up.selfRepair : undefined;
145
150
  const srNote = sr && Number(sr.fixedCount || 0) > 0
@@ -157,7 +162,12 @@ function renderCreate(value) {
157
162
  '可直接修改的 PPTX:' + value.pptxPath + '\n' +
158
163
  '可继续编辑的项目:' + value.jsonPath + '\n' +
159
164
  (value.handoutPath ? '演讲讲义:' + value.handoutPath + '\n' : '') +
160
- 'HTML 双击即可放映;可点击上一页/下一页、输入页码,以及“检查与导出”定位问题或下载 PPTX。PPTX 可用 PowerPoint / WPS / Keynote 直接编辑。' +
165
+ (value.xlsxPath ? '配套 Excel 数据簿:' + value.xlsxPath + '\n' : '') +
166
+ (value.docxPath ? '配套 Word 文档:' + value.docxPath + '\n' : '') +
167
+ (value.memoPath ? '高管阅读备忘录:' + value.memoPath + '\n' : '') +
168
+ (value.qaPrepPath ? '会前高管质询预案:' + value.qaPrepPath + '\n' : '') +
169
+ (value.i18nPath ? '无损翻译槽位包:' + value.i18nPath + '\n' : '') +
170
+ 'HTML 双击即可放映;可点击上一页/下一页、输入页码,按 R 离线审阅批注,以及“检查与导出”定位问题或下载 PPTX。PPTX 可用 PowerPoint / WPS / Keynote 直接编辑。' +
161
171
  upgradeLine +
162
172
  evidenceLine +
163
173
  (value.revision !== undefined ? '\n修订号:' + value.revision + ';可撤销修改:' + value.undoAvailable + '。用 ppt_edit 修改指定页,ppt_undo 撤销。' : '') +
@@ -283,6 +293,7 @@ const brandProperties = {
283
293
  coverMode: { type: 'string', enum: ['standard', 'inverted-accent'], description: 'Optional cover polarity override.' },
284
294
  coverBg: { type: 'string', description: 'Optional #RRGGBB cover background color when coverMode is inverted-accent.' },
285
295
  logo: { type: ['string', 'null'], description: 'Local PNG/JPEG logo path or data URI; null clears logo during edit.' }, footer: { type: 'string' },
296
+ watermark: { type: 'string', description: 'Optional subtle corporate classification stamp rendered on content slides (e.g. "CONFIDENTIAL · 内部资料", max 48 chars).' },
286
297
  chromeStyle: {
287
298
  description: 'Master chrome skeleton override: ' + ALLOWED_CHROME_STYLES.join(' | ') + ' (or null to clear during edit).',
288
299
  oneOf: [
@@ -334,11 +345,15 @@ const slideItemSchema = {
334
345
  size: { type: 'number', description: 'Relative bubble size weight for quadrant/bubble-matrix items.' },
335
346
  before: { type: 'number', description: 'Baseline/before numeric value for dumbbell/slope comparison items.' },
336
347
  after: { type: 'number', description: 'Target/after numeric value for dumbbell/slope comparison items.' },
348
+ actual: { type: 'number', description: 'Actual numeric progress value for gauge/bullet-chart items.' },
349
+ target: { type: 'number', description: 'Target threshold numeric value for gauge/bullet-chart items.' },
350
+ max: { type: 'number', description: 'Maximum scale ceiling for gauge/bullet-chart items.' },
337
351
  status: { type: 'string', enum: ['positive', 'negative', 'warning', 'neutral', 'accent'] },
338
352
  tone: { type: 'string', enum: ['positive', 'negative', 'warning', 'neutral', 'accent'] },
339
353
  },
340
354
  additionalProperties: false,
341
355
  };
356
+ const exportKinds = ['xlsx', 'docx', 'qa-prep', 'memo', 'social-carousel', 'subtitles', 'handout', 'one-pager', 'i18n'];
342
357
  const slideLayouts = [
343
358
  'cover', 'agenda', 'section', 'bullets', 'statement', 'quote',
344
359
  'kpi', 'cards', 'comparison', 'matrix', 'process', 'callout',
@@ -347,6 +362,7 @@ const slideLayouts = [
347
362
  'mockup', 'code', 'quadrant', 'radar', 'dumbbell', 'heatmap',
348
363
  'device', 'browser', 'mobile', 'snippet', 'bubble-matrix', 'magic-quadrant', 'spider', 'slope', 'heat-matrix',
349
364
  'map', 'world-map', 'china-map', 'geo-map', 'isometric', 'iso-stack', 'iso-layers', '3d-stack', 'iso-pillars',
365
+ 'issue-tree', 'mece', 'logic-tree', 'treemap', 'rect-map', 'budget-map', 'gauge', 'bullet-chart', 'okr-gauge', 'pricing', 'tiers', 'packages',
350
366
  'table', 'closing', 'image', 'image-left', 'image-right',
351
367
  'chart', 'chart-split', 'gallery', 'waterfall', 'flywheel',
352
368
  'bento', 'pillars', 'exec-summary', 'timeline', 'steps', 'layers', 'funnel', 'chevron', 'value-chain',
@@ -368,6 +384,7 @@ const slideProperties = {
368
384
  chrome: { type: 'string', enum: ALLOWED_CHROME_STYLES, description: 'Optional per-slide master chrome skeleton override.' },
369
385
  cardMaterial: { type: 'string', enum: ['solid', 'frameless', 'glass', 'editorial-rule'], description: 'Optional per-slide card surface materiality.' },
370
386
  iconMode: { type: 'string', enum: ['off', 'explicit', 'auto'], description: 'Optional per-slide native vector icon badge mode.' },
387
+ reveal: { type: 'string', enum: ['step', 'all'], description: 'Progressive step-by-step click reveal choreography ("step") on kpi/cards/comparison/process/isometric/matrix/issue-tree/pricing/gauge slides.' },
371
388
  title: { type: 'string' }, subtitle: { type: 'string' }, kicker: { type: 'string' },
372
389
  takeaway: { type: 'string', description: 'Bottom key-takeaway synthesis banner.' },
373
390
  source: { type: 'string', description: 'Bottom-left data/citation source line.' },
@@ -438,6 +455,9 @@ const evidenceEntrySchema = {
438
455
  scope: { type: 'string', description: 'Geographic/segment scope or statistical definition (e.g. "Global", "中国大陆", "乘用车口径").' },
439
456
  url: { type: 'string', description: 'Optional verified http:// or https:// source URL (stored in speaker notes & handout).' },
440
457
  confidence: { type: 'string', enum: ['verified', 'estimated', 'conflicting', 'unverified'], description: 'Fact-check verification status (default "verified").' },
458
+ origin: { type: 'string', enum: ['local-file', 'web-research'], description: 'Provenance origin separating user local materials ("local-file") from external authoritative research ("web-research").' },
459
+ tier: { type: 'integer', description: 'Authoritative source credibility tier: 1 (Official/Gov/Filing/Peer-Reviewed), 2 (Analyst/Research Institute), 3 (Media/UGC).' },
460
+ claimType: { type: 'string', enum: ['actual', 'forecast', 'policy', 'benchmark'], description: 'Distinguishes realized actuals from forward projections ("forecast") or policy/benchmark figures.' },
441
461
  note: { type: 'string', description: 'Optional methodology caveat or cross-check discrepancy note.' },
442
462
  },
443
463
  required: ['claim', 'source'],
@@ -474,6 +494,12 @@ export function buildPptTools(config) {
474
494
  tasteName: { type: 'string', description: 'Optional display name when saving the absorbed StyleRecipe.' },
475
495
  saveExemplarAs: { type: 'string', description: 'Optional ID to save the absorbed slide skeleton & brand DNA as a reusable Slot-Filling Exemplar in workspace .dsh-ppt/exemplars.json (reusable via exemplar).' },
476
496
  exemplarName: { type: 'string', description: 'Optional display name when saving the absorbed Exemplar.' },
497
+ saveBrandKit: { type: 'boolean', description: 'Persist the absorbed corporate palette, fonts, logo & chrome as workspace locked .dsh-ppt/brand-kit.json (SLOP-14 compliance lock).' },
498
+ brandKitName: { type: 'string', description: 'Optional corporate brand kit display name when saveBrandKit is true.' },
499
+ watermark: { type: 'string', description: 'Optional subtle content-slide classification watermark locked into the brand kit (e.g. "CONFIDENTIAL · 内部资料").' },
500
+ forbiddenTerms: { type: 'array', items: { type: 'string' }, description: 'Optional corporate compliance forbidden terms scanned automatically by SLOP-14.' },
501
+ preferredSources: { type: 'array', items: { type: 'string' }, description: 'Optional corporate/industry trusted authoritative domains or publisher names promoted to Tier 1 in research query packs and SLOP-13.' },
502
+ blockedDomains: { type: 'array', items: { type: 'string' }, description: 'Optional domains blacklisted as low-authority noise sources in research queries and SLOP-13.' },
477
503
  }),
478
504
  output: {
479
505
  schema: { type: 'object', additionalProperties: true },
@@ -498,6 +524,21 @@ export function buildPptTools(config) {
498
524
  smartLayout: { type: 'boolean', description: 'Enable or disable automatic multi-archetype Markdown layout promotion on >=4-section decks. Default true in async tool mode.' },
499
525
  lang: { type: 'string', description: 'UI language of the generated player: zh (default), en, or bilingual. Content language is whatever you write.' },
500
526
  motion: { type: 'string', enum: ['on', 'off'], description: 'Slide transitions plus bullet entrance animations: on (default) or off for a fully static deck.' },
527
+ motionProfile: { type: 'string', enum: ['subtle', 'executive', 'keynote'], description: 'Optional native PPTX transition profile: subtle (fast fade), executive (med fade), or keynote (push).' },
528
+ exports: { type: 'array', items: { type: 'string', enum: exportKinds }, description: 'Optional extra companion deliverables written alongside the 3-file core trio: xlsx (reverse Excel workbook), docx (Word report), qa-prep (executive Q&A defense sheet), memo (narrative memo), i18n (lossless translation bundle), handout, one-pager, social-carousel, subtitles.' },
529
+ mergeSources: {
530
+ type: 'array',
531
+ items: {
532
+ type: 'object',
533
+ properties: {
534
+ deckPath: { type: 'string', description: 'Path to an existing dsh-ppt .json project to cherry-pick slides from.' },
535
+ slides: { type: 'array', items: { oneOf: [{ type: 'integer' }, { type: 'string' }] }, description: 'Optional 1-based slide numbers or slide IDs to pick from deckPath.' },
536
+ bankIds: { type: 'array', items: { type: 'string' }, description: 'Optional slide bank entry IDs from .dsh-ppt/slide-bank.json.' },
537
+ },
538
+ additionalProperties: false,
539
+ },
540
+ description: 'Compose a unified new deck from 2+ existing .json projects and/or workspace slide-bank entries with SHA-256 asset dedup and collision-free [E#] evidence remapping.',
541
+ },
501
542
  slides: { type: 'array', items: { type: 'object', properties: slideProperties, additionalProperties: true }, description: 'Structured slides across 30+ native layouts & pro diagrams (cover, agenda, section, bullets, kpi, cards, comparison, matrix, process, callout, gantt, architecture, harvey, tam, org, marimekko, sankey, swot, value-chain, mockup, code, quadrant, radar, dumbbell, heatmap, mermaid, statement, quote, table, chart, chart-split, waterfall, image, image-left, image-right, closing) with items[], columns[], takeaway, source, chrome, tableStyle (consulting|booktabs|minimal|banded|harvey), local images, and 13 chart kinds.' },
502
543
  template: { type: 'string', enum: templateIds, description: 'Industry blueprint from ppt_templates (20 blueprints). Provide finished content/slides following its outline; template alone creates an unfilled draft.' },
503
544
  brand: { type: 'object', properties: brandProperties, additionalProperties: false, description: 'Shared brand: #RRGGBB primary/background/text colors, fontFamily, logo, footer, and chromeStyle (' + ALLOWED_CHROME_STYLES.join('|') + '). Applied to HTML and PPTX.' },
@@ -505,6 +546,7 @@ export function buildPptTools(config) {
505
546
  dataModel: { type: 'object', properties: { schemaVersion: { type: 'integer', enum: [1] }, sources: { type: 'array', items: { type: 'object', properties: sourceProperties, required: ['id'] } }, metrics: { type: 'array', items: { type: 'object', properties: metricProperties, required: ['id', 'kind'] } } }, additionalProperties: false, description: 'Optional explicit lineage and what-if model. Use with structured slides containing {{metricId}} in text/items/takeaway/tables or an exact token as chart values. Source facts reference a real cell or text line; assumptions require value/min/max/step. Formulas compute derived metrics. HTML offers live sliders; PPTX includes confirmed static values, formulas and assumptions in speaker notes. Leave absent for ordinary finished decks.' },
506
547
  evidence: { type: 'array', items: evidenceEntrySchema, description: 'Structured verified Evidence Ledger collected via external search & fact-checking. Automatically binds [E#] / evidenceIds to clean slide source footers, detailed speaker-notes provenance blocks, handout ledger table, and SLOP-13 fact-hygiene auditing.' },
507
548
  evidenceAppendix: { type: 'boolean', description: 'When evidence[] is provided, automatically insert a clean booktabs "Sources & Fact-Verification Ledger" appendix slide before the closing slide (default false).' },
549
+ useBrandKit: { type: 'boolean', description: 'Automatically apply workspace .dsh-ppt/brand-kit.json corporate brand lock & SLOP-14 compliance gate when present (default true; pass false to opt out).' },
508
550
  outputDir: { type: 'string', description: 'Directory to write the files into. Default: session working directory (or the plugin outputDir config).' },
509
551
  fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: sanitized deck title.' },
510
552
  overwrite: { type: 'boolean', description: 'Replace an existing same-name HTML/PPTX/JSON trio. Default false: choose a unique numeric suffix instead.' },
@@ -558,6 +600,24 @@ export function buildPptTools(config) {
558
600
  referencePptx: { type: 'string', description: 'Optional local reference .pptx path to absorb sanitized palette/fonts/logo and chrome skeleton onto this project (undoable).' },
559
601
  brand: { type: ['object', 'null'], properties: brandProperties, additionalProperties: false, description: 'Merge shared branding. null clears all branding. Empty footer clears footer; logo:null clears logo.' },
560
602
  targetMinutes: { type: ['number', 'null'], description: 'Optional target speaking duration in minutes for pace budgeting (null clears).' },
603
+ remixPreset: { type: 'string', enum: ['exec-5min', 'board-brief', 'sales-pitch'], description: 'Multi-audience compression remix preset (exec-5min: 6 slides / board-brief: 8 slides / sales-pitch: 7 slides). Preserves omitted takeaways in speaker notes and defaults saveAs to true.' },
604
+ motionProfile: { type: ['string', 'null'], description: 'Optional native PPTX transition profile (subtle | executive | keynote, or null to clear).' },
605
+ exports: { type: 'array', items: { type: 'string', enum: exportKinds }, description: 'Optional extra companion exports to write: xlsx, docx, qa-prep, memo, i18n, handout, one-pager, social-carousel, subtitles.' },
606
+ saveToBank: {
607
+ type: 'object',
608
+ properties: {
609
+ slide: { oneOf: [{ type: 'integer' }, { type: 'string' }], description: '1-based slide number or slide ID to save into .dsh-ppt/slide-bank.json.' },
610
+ bankId: { type: 'string' },
611
+ name: { type: 'string' },
612
+ tags: { type: 'array', items: { type: 'string' } },
613
+ },
614
+ required: ['slide'],
615
+ additionalProperties: false,
616
+ description: 'Bookmark a golden slide (with its embedded assets & evidence) into workspace .dsh-ppt/slide-bank.json for cross-deck reuse.',
617
+ },
618
+ translations: { type: ['object', 'array'], items: { type: 'object', additionalProperties: true }, additionalProperties: true, description: 'Lossless translation bundle (from exports:["i18n"] or per-slide array) applied in-place while preserving 100% of layouts, charts, images, and evidence.' },
619
+ bilingualMode: { type: 'boolean', description: 'When applying translations, keep original + translated copy side-by-side in bilingual mode instead of replacing.' },
620
+ targetLang: { type: 'string', enum: ['zh', 'en', 'bilingual'], description: 'Optional target UI language when applying translations.' },
561
621
  }),
562
622
  output: { schema: createResultSchema, render: (_args, value) => renderCreate(value) },
563
623
  execute: executors.edit,
@@ -587,6 +647,7 @@ export function buildPptTools(config) {
587
647
  description: 'Inspect a dsh-ppt JSON project without rewriting artifacts. Report revision, slide IDs, page-specific errors and warnings for dense text, estimated overflow, small table fonts, missing/low-resolution images, chart labels, contrast and unfilled template slots. Static estimates require final visual review in browser and PowerPoint/WPS. 中文:交付前检查工程,定位具体页的问题并给出修改建议,不改文件。',
588
648
  parameters: compileParameters({ deckPath: projectParameters.deckPath,
589
649
  renderReceipt: { type: 'string', description: 'Optional receiptPath returned by ppt_render. Rechecks current PPTX hash and every rendered output; never implies a visual pass.' },
650
+ feedbackPath: { type: 'string', description: 'Optional path to review-feedback.json exported offline from the HTML player (R key); surfaces every stakeholder comment as actionable slide-level issues.' },
590
651
  }),
591
652
  output: { schema: { type: 'object', additionalProperties: true }, render: (_args, value) => renderCheck(value) },
592
653
  execute: executors.check,
@@ -625,9 +686,18 @@ export function buildPptTools(config) {
625
686
  },
626
687
  {
627
688
  name: 'ppt_from_office',
628
- description: 'Import an Excel workbook (.xlsx), CSV/TSV dataset, or Word document (.docx) directly into a polished, multi-slide dsh-ppt presentation (HTML, editable PPTX, and JSON project) using deterministic data-to-visual profiling (Sankey, Gantt, Marimekko, Waterfall, combo charts, tables, and structured narrative slides). 中文:直吞本地 .xlsx / .csv / .tsv / .docx 文档并智能拆分为高颜值多页演示文稿三件套。',
689
+ description: 'Import an Excel workbook (.xlsx), CSV/TSV dataset, Word document (.docx), local PDF (.pdf), OR a whole multi-source pack (local directory path or filePaths[] combining docs + tables + PDFs + images) directly into a polished, multi-slide dsh-ppt presentation (HTML, editable PPTX, JSON project, and auto-generated [E1..En] Evidence Ledger for multi-source packs). 中文:直吞本地 .xlsx / .csv / .tsv / .docx / .pdf 单文件或整个混合素材目录,自动完成数据视觉画像、多源融合与 [E1..En] 证据溯源台账绑定。',
629
690
  parameters: compileParameters({
630
- filePath: { type: 'string', required: true, description: 'Local .xlsx, .csv, .tsv, or .docx file path, relative to session cwd or absolute.' },
691
+ filePath: { type: 'string', required: true, description: 'Local .xlsx, .csv, .tsv, .docx, .pdf file path OR a local directory containing mixed source files (relative to session cwd or absolute).' },
692
+ filePaths: { type: 'array', items: { type: 'string' }, description: 'Optional additional local file paths (.xlsx/.csv/.tsv/.docx/.pdf/.png/.jpg/.webp) to fuse together with filePath into one deck with automatic [E1..En] source provenance.' },
693
+ inspectOnly: { type: 'boolean', description: 'Return a compact, token-efficient Material Dossier (Excel sheet profiles/charts, Word/PDF sections, photo pixel dimensions/orientation/focal-point tips, local [E1..Ek] ledger, AND Mode C Authoritative External Enrichment queries) without writing files yet — ideal when following custom user presentation instructions or enriching with web research.' },
694
+ instructions: { type: 'string', description: 'Natural-language presentation requirements (e.g. "控制 8 页,跳过目录,product.png 放封面,重点讲毛利变化") applied deterministically during direct build.' },
695
+ maxSlides: { type: 'integer', description: 'Optional maximum slide budget for direct build.' },
696
+ includeSheets: { type: 'array', items: { type: 'string' }, description: 'Optional list of Excel worksheet names (or substrings) to include.' },
697
+ photoRoles: { type: 'object', additionalProperties: true, description: 'Optional explicit filename-to-role map overriding smart photo choreography (e.g. {"hero.png":"cover","app.png":"mockup-mobile","site1.jpg":"gallery"}).' },
698
+ bindDataModel: { type: 'boolean', description: 'Automatically bind Excel/CSV numeric tables & KPI cards into live dataModel {{metricId}} placeholders so future ppt_data updates refresh the deck live.' },
699
+ evidence: { type: 'array', items: evidenceEntrySchema, description: 'Optional external authoritative web-research evidence[] (origin:"web-research", tier:1|2) merged collision-free after local file evidence [E1..Ek] (Mode C Hybrid).' },
700
+ exports: { type: 'array', items: { type: 'string', enum: exportKinds }, description: 'Optional extra companion exports: xlsx, docx, qa-prep, memo, i18n, handout, one-pager, social-carousel, subtitles.' },
631
701
  outputDir: { type: 'string', description: 'Directory to write the generated files into. Default: session working directory (or the plugin outputDir config).' },
632
702
  fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: derived from source file or title.' },
633
703
  theme: { type: 'string', description: 'Target built-in theme id (or "auto", default "auto").' },
package/lib/types.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface PptTasteRecipe {
35
35
  }
36
36
  export type PptPersonaId = 'auto' | 'consulting' | 'tech-pitch' | 'academic' | 'gov-exec' | 'education' | 'editorial';
37
37
  export type PptLanguage = 'zh' | 'en' | 'bilingual';
38
- export type PptSlideLayout = 'cover' | 'agenda' | 'section' | 'bullets' | 'statement' | 'quote' | 'kpi' | 'cards' | 'comparison' | 'matrix' | 'process' | 'callout' | 'gantt' | 'architecture' | 'harvey' | 'tam' | 'org' | 'marimekko' | 'sankey' | 'swot' | 'table' | 'closing' | 'image' | 'image-left' | 'image-right' | 'chart' | 'chart-split' | 'gallery' | 'waterfall' | 'flywheel' | 'bento' | 'pillars' | 'exec-summary' | 'timeline' | 'steps' | 'layers' | 'funnel' | 'chevron' | 'value-chain' | 'issue-action' | 'before-after' | 'matrix-2x2' | 'kpi-grid' | 'scorecard' | 'formula-callout' | 'takeaways' | 'gallery-grid' | 'ablation-compare' | 'roadmap' | 'swimlane' | 'team' | 'mermaid' | 'flowchart' | 'sequence' | 'map' | 'world-map' | 'china-map' | 'geo-map' | 'isometric' | 'iso-stack' | 'iso-layers' | '3d-stack' | 'iso-pillars';
38
+ export type PptSlideLayout = 'cover' | 'agenda' | 'section' | 'bullets' | 'statement' | 'quote' | 'kpi' | 'cards' | 'comparison' | 'matrix' | 'process' | 'callout' | 'gantt' | 'architecture' | 'harvey' | 'tam' | 'org' | 'marimekko' | 'sankey' | 'swot' | 'table' | 'closing' | 'image' | 'image-left' | 'image-right' | 'chart' | 'chart-split' | 'gallery' | 'waterfall' | 'flywheel' | 'bento' | 'pillars' | 'exec-summary' | 'timeline' | 'steps' | 'layers' | 'funnel' | 'chevron' | 'value-chain' | 'issue-action' | 'before-after' | 'matrix-2x2' | 'kpi-grid' | 'scorecard' | 'formula-callout' | 'takeaways' | 'gallery-grid' | 'ablation-compare' | 'roadmap' | 'swimlane' | 'team' | 'mermaid' | 'flowchart' | 'sequence' | 'map' | 'world-map' | 'china-map' | 'geo-map' | 'isometric' | 'iso-stack' | 'iso-layers' | '3d-stack' | 'iso-pillars' | 'issue-tree' | 'mece' | 'logic-tree' | 'treemap' | 'rect-map' | 'budget-map' | 'gauge' | 'bullet-chart' | 'okr-gauge' | 'pricing' | 'tiers' | 'packages';
39
39
  export type PptTemplateId = 'weekly' | 'defense' | 'project' | 'pitch' | 'consulting' | 'keynote' | 'gov-report' | 'workshop' | 'architecture-review' | 'financial-earnings' | 'medical-case' | 'postmortem' | 'marketing-campaign' | 'promotion-review' | 'legal-compliance' | 'creative-lookbook' | 'quarterly-okr' | 'product-prd' | 'vc-daylight' | 'industry-research';
40
40
  export type PptTableStyle = 'consulting' | 'booktabs' | 'minimal' | 'banded' | 'harvey';
41
41
  export interface PptImageSpec {
@@ -69,6 +69,9 @@ export interface PptSlideItem {
69
69
  role?: string;
70
70
  conversion?: string;
71
71
  icon?: string;
72
+ actual?: number;
73
+ target?: number;
74
+ max?: number;
72
75
  status?: 'positive' | 'negative' | 'warning' | 'neutral' | 'accent';
73
76
  tone?: 'positive' | 'negative' | 'warning' | 'neutral' | 'accent';
74
77
  }
@@ -113,6 +116,7 @@ export interface PptBrand {
113
116
  coverBg?: string;
114
117
  logo?: string | null;
115
118
  footer?: string;
119
+ watermark?: string;
116
120
  chromeStyle?: PptChromeStyle | string | null;
117
121
  cardMaterial?: PptCardMaterial | null;
118
122
  iconMode?: PptIconMode | null;
@@ -168,6 +172,13 @@ export interface PptCheckResult extends PptQualityResult {
168
172
  verification: PptVerification;
169
173
  render?: PptRenderResult;
170
174
  }
175
+ export type PptExportKind = 'xlsx' | 'docx' | 'qa-prep' | 'memo' | 'social-carousel' | 'subtitles' | 'handout' | 'one-pager' | 'i18n';
176
+ export type PptMotionProfile = 'subtle' | 'executive' | 'keynote';
177
+ export interface PptMergeSource {
178
+ deckPath?: string;
179
+ slides?: Array<number | string>;
180
+ bankIds?: string[];
181
+ }
171
182
  export interface PptEditArgs {
172
183
  deckPath: string;
173
184
  edits?: Array<{
@@ -183,6 +194,18 @@ export interface PptEditArgs {
183
194
  referencePptx?: string;
184
195
  brand?: PptBrand | null;
185
196
  targetMinutes?: number | null;
197
+ remixPreset?: 'exec-5min' | 'board-brief' | 'sales-pitch';
198
+ motionProfile?: PptMotionProfile | null;
199
+ exports?: PptExportKind[];
200
+ saveToBank?: {
201
+ slide: number | string;
202
+ bankId?: string;
203
+ name?: string;
204
+ tags?: string[];
205
+ };
206
+ translations?: Record<string, unknown> | Array<Record<string, unknown>>;
207
+ bilingualMode?: boolean | 'replace' | 'bilingual';
208
+ targetLang?: PptLanguage;
186
209
  expectedRevision?: number;
187
210
  saveAs?: boolean;
188
211
  }
@@ -235,6 +258,9 @@ export interface PptEvidenceEntry {
235
258
  scope?: string;
236
259
  url?: string;
237
260
  confidence?: 'verified' | 'estimated' | 'conflicting' | 'unverified';
261
+ origin?: 'local-file' | 'web-research';
262
+ tier?: 1 | 2 | 3;
263
+ claimType?: 'actual' | 'forecast' | 'policy' | 'benchmark';
238
264
  note?: string;
239
265
  }
240
266
  export interface PptSlideSpec {
@@ -244,6 +270,7 @@ export interface PptSlideSpec {
244
270
  chrome?: PptChromeStyle | string;
245
271
  cardMaterial?: PptCardMaterial;
246
272
  iconMode?: PptIconMode;
273
+ reveal?: 'step' | 'all';
247
274
  title?: string;
248
275
  subtitle?: string;
249
276
  kicker?: string;
@@ -313,6 +340,9 @@ export interface PptCreateArgs {
313
340
  lang?: string;
314
341
  /** 页间转场与要点入场动画:on(默认)/ off。 */
315
342
  motion?: 'on' | 'off';
343
+ motionProfile?: PptMotionProfile;
344
+ exports?: PptExportKind[];
345
+ mergeSources?: PptMergeSource[];
316
346
  outputDir?: string;
317
347
  fileName?: string;
318
348
  /** 是否覆盖同名三件套;默认 false,同名时自动选择唯一后缀。 */
@@ -327,6 +357,8 @@ export interface PptCreateArgs {
327
357
  evidence?: PptEvidenceEntry[];
328
358
  /** When evidence[] is supplied, automatically insert a booktabs Sources & Fact-Verification Ledger appendix slide before closing. */
329
359
  evidenceAppendix?: boolean;
360
+ /** Whether to apply workspace locked .dsh-ppt/brand-kit.json automatically (default true). */
361
+ useBrandKit?: boolean;
330
362
  }
331
363
  export interface PptThemeInfo {
332
364
  id: string;
@@ -369,6 +401,12 @@ export interface PptAbsorbArgs {
369
401
  tasteName?: string;
370
402
  saveExemplarAs?: string;
371
403
  exemplarName?: string;
404
+ saveBrandKit?: boolean;
405
+ brandKitName?: string;
406
+ watermark?: string;
407
+ forbiddenTerms?: string[];
408
+ preferredSources?: string[];
409
+ blockedDomains?: string[];
372
410
  signal?: AbortSignal;
373
411
  }
374
412
  export interface PptExemplarSummary {
@@ -432,6 +470,8 @@ export interface PptAbsorbResult {
432
470
  styleRecipe?: PptTasteRecipe;
433
471
  savedTastePath?: string;
434
472
  savedExemplarPath?: string;
473
+ savedBrandKitPath?: string;
474
+ brandKit?: Record<string, unknown>;
435
475
  exemplar?: PptExemplarSummary;
436
476
  slideSkeleton?: PptAbsorbSlideSkeleton[];
437
477
  layoutSummary?: Record<string, unknown>;
@@ -448,6 +488,15 @@ export interface PptImportArgs {
448
488
  }
449
489
  export interface PptFromOfficeArgs {
450
490
  filePath: string;
491
+ filePaths?: string[];
492
+ inspectOnly?: boolean;
493
+ instructions?: string;
494
+ maxSlides?: number;
495
+ includeSheets?: string[];
496
+ photoRoles?: Record<string, string>;
497
+ bindDataModel?: boolean;
498
+ evidence?: PptEvidenceEntry[];
499
+ exports?: PptExportKind[];
451
500
  outputDir?: string;
452
501
  fileName?: string;
453
502
  theme?: string;
@@ -512,6 +561,17 @@ export interface PptCreateResult {
512
561
  pptxPath: string;
513
562
  jsonPath: string;
514
563
  handoutPath?: string;
564
+ onePagerPath?: string;
565
+ carouselPath?: string;
566
+ subtitlesPath?: string;
567
+ xlsxPath?: string;
568
+ docxPath?: string;
569
+ memoPath?: string;
570
+ qaPrepPath?: string;
571
+ i18nPath?: string;
572
+ inspectOnly?: boolean;
573
+ dossierMarkdown?: string;
574
+ enrichmentPlan?: Record<string, unknown>;
515
575
  deckId?: string;
516
576
  revision?: number;
517
577
  undoAvailable?: number;
@@ -549,6 +609,24 @@ export interface DeckEngine {
549
609
  dataNotes(manifest: any, slide: any): string;
550
610
  renderHandoutMarkdown?(manifest: any, lang?: string): string;
551
611
  renderOnePagerHtml?(manifest: any, lang?: string): string;
612
+ renderSocialCarouselHtml?(manifest: any, options?: Record<string, unknown>): string;
613
+ renderSubtitlesSrt?(manifest: any, lang?: string): string;
614
+ renderSubtitlesVtt?(manifest: any, lang?: string): string;
615
+ renderDeckWorkbookXlsx?(manifest: any): Buffer;
616
+ renderDeckReportDocx?(manifest: any, lang?: string): Buffer;
617
+ renderDeckMemoMarkdown?(manifest: any, lang?: string): string;
618
+ renderQaPrepMarkdown?(manifest: any, lang?: string): string;
619
+ extractTranslationBundle?(manifest: any): Record<string, unknown>;
620
+ applyTranslationBundle?(manifest: any, translations: unknown, options?: Record<string, unknown>): Record<string, unknown>;
621
+ listSlideBank?(cwd?: string, tag?: string): Record<string, unknown>;
622
+ mergeDecks?(options?: Record<string, unknown>): Promise<PptCreateResult>;
623
+ remixDeck?(options: Record<string, unknown>): Promise<PptCreateResult>;
624
+ loadWorkspaceBrandKit?(cwd?: string): Record<string, unknown> | null;
625
+ saveWorkspaceBrandKit?(cwd: string, rawKit: Record<string, unknown>): {
626
+ ok: boolean;
627
+ path: string;
628
+ brandKit: Record<string, unknown>;
629
+ };
552
630
  computePaceBudget?(manifest: any, targetMinutes?: number): Record<string, any>;
553
631
  buildDeckAsync?(options: Record<string, unknown>): Promise<PptCreateResult>;
554
632
  listTemplates(lang?: string): unknown[];