dsh-ppt 0.31.0 → 0.32.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/lib/tools.js CHANGED
@@ -149,6 +149,9 @@ function renderCreate(value) {
149
149
  const upgradeLine = up && (Number(up.promotedCount || 0) > 0 || Number(up.splitCount || 0) > 0 || Number(up.rescuedTitles || 0) > 0 || Number(up.brokenStreaks || 0) > 0 || Boolean(up.resequenced) || Number(sr?.fixedCount || 0) > 0)
150
150
  ? '\n智能升维补偿:版式升维 ' + (up.promotedCount ?? 0) + ' 页 · 拆分长文本墙 ' + (up.splitCount ?? 0) + ' 页 · 打断单调连页 ' + (up.brokenStreaks ?? 0) + ' 处 · 提炼结论标题 ' + (up.rescuedTitles ?? 0) + ' 页' + seqNote + srNote + (value.exemplar ? '(范本契约:' + value.exemplar + ')' : '')
151
151
  : (value.exemplar ? '\n标杆范本契约:' + value.exemplar : '');
152
+ const evidenceLine = typeof value.evidenceCount === 'number' && value.evidenceCount > 0
153
+ ? '\n事实溯源账本:已绑定 ' + value.evidenceCount + ' 条核验证据(SLOP-13 事实出处门禁已校验)'
154
+ : '';
152
155
  return oneText('dsh-ppt 已生成 ' + value.slideCount + ' 页' + (value.deliveryStatus === 'draft' ? '草稿(还有待填写内容,不能作为成品交付)' : '演示文稿') + '(主题 ' + value.theme + ',语言 ' + value.language + '):\n' +
153
156
  '打开演示文稿:' + value.htmlPath + '\n' +
154
157
  '可直接修改的 PPTX:' + value.pptxPath + '\n' +
@@ -156,6 +159,7 @@ function renderCreate(value) {
156
159
  (value.handoutPath ? '演讲讲义:' + value.handoutPath + '\n' : '') +
157
160
  'HTML 双击即可放映;可点击上一页/下一页、输入页码,以及“检查与导出”定位问题或下载 PPTX。PPTX 可用 PowerPoint / WPS / Keynote 直接编辑。' +
158
161
  upgradeLine +
162
+ evidenceLine +
159
163
  (value.revision !== undefined ? '\n修订号:' + value.revision + ';可撤销修改:' + value.undoAvailable + '。用 ppt_edit 修改指定页,ppt_undo 撤销。' : '') +
160
164
  (value.quality ? '\n\n' + qualityText(value.quality) : ''));
161
165
  }
@@ -345,6 +349,7 @@ const slideProperties = {
345
349
  title: { type: 'string' }, subtitle: { type: 'string' }, kicker: { type: 'string' },
346
350
  takeaway: { type: 'string', description: 'Bottom key-takeaway synthesis banner.' },
347
351
  source: { type: 'string', description: 'Bottom-left data/citation source line.' },
352
+ evidenceIds: { type: 'array', items: { type: 'string' }, description: 'Evidence ledger IDs cited on this slide (e.g. ["E1", "E2"]); automatically populates clean source footer & full speaker-notes provenance.' },
348
353
  text: { type: 'string' },
349
354
  formula: { type: 'string', description: 'LaTeX math expression rendered as native Office Math (<m:oMath>) in PPTX and MathML in HTML (e.g. on callout slides with variant: "formula").' },
350
355
  mermaid: { type: 'string', description: 'Mermaid flowchart or sequenceDiagram code compiled into native editable PowerPoint shapes & attached connectors in PPTX and SVG in HTML.' },
@@ -400,6 +405,21 @@ const metricProperties = {
400
405
  formula: { type: 'string', description: 'Metric IDs, + - * / % **, parentheses and min/max/sum/abs/floor/ceil/round only. No JS property access or I/O.' },
401
406
  format: { type: 'object', properties: { style: { type: 'string', enum: ['number', 'percent'] }, digits: { type: 'integer' }, unit: { type: 'string' } } },
402
407
  };
408
+ const evidenceEntrySchema = {
409
+ type: 'object',
410
+ properties: {
411
+ id: { type: 'string', description: 'Short uppercase evidence ID such as E1, E2, E3.' },
412
+ claim: { type: 'string', description: 'Verified factual claim or quantitative metric.' },
413
+ source: { type: 'string', description: 'Primary publisher, official report, filing, or paper name (never vague placeholders like "internet" or "网络整理").' },
414
+ date: { type: 'string', description: 'Publication date or reporting period (e.g. "2025-Q4", "2026-03").' },
415
+ scope: { type: 'string', description: 'Geographic/segment scope or statistical definition (e.g. "Global", "中国大陆", "乘用车口径").' },
416
+ url: { type: 'string', description: 'Optional verified http:// or https:// source URL (stored in speaker notes & handout).' },
417
+ confidence: { type: 'string', enum: ['verified', 'estimated', 'conflicting', 'unverified'], description: 'Fact-check verification status (default "verified").' },
418
+ note: { type: 'string', description: 'Optional methodology caveat or cross-check discrepancy note.' },
419
+ },
420
+ required: ['claim', 'source'],
421
+ additionalProperties: false,
422
+ };
403
423
  /** Assemble presentation schemas, rendering and the session-aware executors. */
404
424
  export function buildPptTools(config) {
405
425
  const executors = createPptExecutors(config);
@@ -440,7 +460,7 @@ export function buildPptTools(config) {
440
460
  },
441
461
  {
442
462
  name: 'ppt_create',
443
- description: 'Generate a standalone HTML slideshow, editable 16:9 PPTX and JSON project from prepared Markdown or structured slides. Supports 24 themes, 6 master chrome skeletons, 20 Curated Gold Exemplars (8 built-in + 12 distilled from Apache-2.0/MIT/CC-BY-4.0 open-source GitHub decks + exemplar: "auto" semantic routing + workspace absorbed exemplars), Deterministic Weak-LLM Compensator & Anti-Slop Upgrader (autoUpgrade), 35+ native editable layouts & pro diagrams (KPI, Bento, mockup, syntax-highlighted code, Magic Quadrant, radar, dumbbell, heatmap, Marimekko, Sankey, SWOT, Porter value chain, Gantt, architecture, Harvey balls, TAM, org, Mermaid, booktabs), and deep .pptx absorption. 中文:先按 20 套标杆范本(支持 exemplar: "auto" 自动匹配或指定 ID)槽位组织内容或传入粗纲,由确定性升维器自动打破纯文字墙与平庸标题,输出可直接放映与编辑的三件套。',
463
+ description: 'Generate a standalone HTML slideshow, editable 16:9 PPTX and JSON project from prepared Markdown or structured slides. Supports 24 themes, 6 master chrome skeletons, 20 Curated Gold Exemplars (8 built-in + 12 distilled from Apache-2.0/MIT/CC-BY-4.0 open-source GitHub decks + exemplar: "auto" semantic routing + workspace absorbed exemplars), Deterministic Weak-LLM Compensator & Anti-Slop Upgrader (autoUpgrade), Verified Evidence Ledger (evidence[] + evidenceAppendix + SLOP-13 fact-sourcing gate), 35+ native editable layouts & pro diagrams (KPI, Bento, mockup, syntax-highlighted code, Magic Quadrant, radar, dumbbell, heatmap, Marimekko, Sankey, SWOT, Porter value chain, Gantt, architecture, Harvey balls, TAM, org, Mermaid, booktabs), and deep .pptx absorption. 中文:先按 20 套标杆范本槽位组织内容或传入粗纲;零资料调研场景可附带交叉核验后的 evidence[] 证据账本与 evidenceAppendix,自动注入规范 source 脚注、演讲备注溯源卡、三线表附录页并通过 SLOP-13 事实出处门禁。',
444
464
  parameters: compileParameters({
445
465
  title: { type: 'string', required: true, description: 'Deck title (used for the cover and file names).' },
446
466
  content: { type: 'string', description: 'Markdown content: # cover title, ## slides, -/* bullets (supports **bold** lead-ins), | ... | tables, > quotes, > [!TAKEAWAY] bottom summary bar, ::: kpi|cards|comparison|process|matrix|callout|gantt|architecture|harvey|tam|org blocks, and <!-- 备注: ... --> speaker notes. Required unless slides or template is provided.' },
@@ -460,6 +480,8 @@ export function buildPptTools(config) {
460
480
  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.' },
461
481
  targetMinutes: { type: 'number', description: 'Optional target speaking duration in minutes for pace budgeting.' },
462
482
  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.' },
483
+ 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.' },
484
+ 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).' },
463
485
  outputDir: { type: 'string', description: 'Directory to write the files into. Default: session working directory (or the plugin outputDir config).' },
464
486
  fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: sanitized deck title.' },
465
487
  overwrite: { type: 'boolean', description: 'Replace an existing same-name HTML/PPTX/JSON trio. Default false: choose a unique numeric suffix instead.' },
@@ -472,15 +494,21 @@ export function buildPptTools(config) {
472
494
  },
473
495
  {
474
496
  name: 'ppt_templates',
475
- description: 'List all 20 industry scenario blueprints AND 20 Curated Gold Exemplars (8 built-in + 12 distilled from vetted Apache-2.0/MIT/CC-BY-4.0 open-source GitHub decks + any workspace-absorbed .pptx exemplars). Pass exemplarId to retrieve the exact per-slide Slot-Filling Contract, gold Action-Title examples, AND ready-to-mirror Few-Shot JSON slides so any model can deterministically fill a publication-grade deck without inventing layout design from scratch. 中文:查看 20 套行业蓝图与 20 套标杆范本(含 12 套开源 GitHub 优质 PPTX 蒸馏范本与工作区吸收范本);传入 exemplarId 直接获取逐页槽位契约、满分标题示范与 Few-Shot JSON 样板,显著提升中弱模型成稿稳定性。',
497
+ description: 'List all 20 industry scenario blueprints AND 20 Curated Gold Exemplars (8 built-in + 12 distilled from vetted Apache-2.0/MIT/CC-BY-4.0 open-source GitHub decks + any workspace-absorbed .pptx exemplars). Pass exemplarId for a per-slide Slot-Filling Contract & Few-Shot JSON, OR pass topic (with optional evidence[]) for Zero-Material Research & Storyboard Planning (matches Gold Exemplar, generates 3-round retrieval checklist, diagnoses missing quantitative data gaps, and outputs a user-ready planMarkdown storyboard). 中文:查看 20 套行业蓝图与 20 套标杆范本;传入 exemplarId 获取逐页槽位契约与 Few-Shot JSON,或传入 topic(配合可选 evidence[])一键生成「零资料 3 轮调研清单 + 证据缺口诊断 + 逐页分镜策划表」供用户确认后再成稿。',
476
498
  parameters: compileParameters({
477
499
  lang: { type: 'string', description: 'zh / en / bilingual, default zh.' },
478
500
  exemplarId: { type: 'string', description: 'Optional curated or workspace exemplar ID (20 built-in incl. mckinsey-strategy, sequoia-pitch, stripe-product-launch, quarterly-exec-review, tech-arch-rfc, academic-defense, enterprise-proposal, gov-institutional, mckinsey-evolution, luxury-budget-review, swiss-bauhaus-workshop, dark-stage-investor, blueprint-ai-factory, warm-brand-story, ted-storytelling-keynote, msft-enterprise-discovery, daylight-earnings-research, okr-performance-review, quiet-canvas-keynote, medical-clinical-course) to return its slot-filling contract, promptGuide & fewShotSlides.' },
501
+ topic: { type: 'string', description: 'Optional presentation topic for Zero-Material Research & Storyboard Planning: matches best Gold Exemplar, generates 3-round search & fact-check checklist, diagnoses missing quantitative evidence slots, and returns user-ready planMarkdown.' },
502
+ persona: { type: 'string', enum: ['auto', 'consulting', 'tech-pitch', 'academic', 'gov-exec', 'education', 'editorial'], description: 'Optional audience/scenario persona when planning with topic.' },
503
+ evidence: { type: 'array', items: evidenceEntrySchema, description: 'Optional already-collected Evidence Ledger entries when planning with topic, used to map [E#] bindings and detect remaining quantitative data gaps.' },
479
504
  }),
480
505
  output: {
481
506
  schema: { type: 'object', additionalProperties: true },
482
507
  render: (_args, value) => {
483
508
  const rec = (value && typeof value === 'object') ? value : {};
509
+ if (typeof rec.planMarkdown === 'string' && rec.planMarkdown.trim()) {
510
+ return oneText(rec.planMarkdown);
511
+ }
484
512
  if (typeof rec.promptGuide === 'string' && rec.promptGuide.trim()) {
485
513
  return oneText(rec.promptGuide + '\n\n' + JSON.stringify({ exemplar: rec.exemplar }, null, 2));
486
514
  }
package/lib/types.d.ts CHANGED
@@ -219,6 +219,16 @@ export interface PptDataModel {
219
219
  sources: PptDataSource[];
220
220
  metrics: PptDataMetric[];
221
221
  }
222
+ export interface PptEvidenceEntry {
223
+ id?: string;
224
+ claim: string;
225
+ source: string;
226
+ date?: string;
227
+ scope?: string;
228
+ url?: string;
229
+ confidence?: 'verified' | 'estimated' | 'conflicting' | 'unverified';
230
+ note?: string;
231
+ }
222
232
  export interface PptSlideSpec {
223
233
  id?: string;
224
234
  layout?: PptSlideLayout;
@@ -231,6 +241,7 @@ export interface PptSlideSpec {
231
241
  kicker?: string;
232
242
  takeaway?: string;
233
243
  source?: string;
244
+ evidenceIds?: string[];
234
245
  text?: string;
235
246
  formula?: string;
236
247
  mermaid?: string;
@@ -303,6 +314,10 @@ export interface PptCreateArgs {
303
314
  targetMinutes?: number;
304
315
  /** Optional explicit source facts, assumptions and safe arithmetic; bind slides with {{metricId}}. */
305
316
  dataModel?: PptDataModel;
317
+ /** Structured verified Evidence Ledger from external research & fact-checking; binds [E#] / evidenceIds to source footers, speaker notes & SLOP-13 audit. */
318
+ evidence?: PptEvidenceEntry[];
319
+ /** When evidence[] is supplied, automatically insert a booktabs Sources & Fact-Verification Ledger appendix slide before closing. */
320
+ evidenceAppendix?: boolean;
306
321
  }
307
322
  export interface PptThemeInfo {
308
323
  id: string;
@@ -495,6 +510,7 @@ export interface PptCreateResult {
495
510
  importedFrom?: string;
496
511
  syncedProject?: boolean;
497
512
  exemplar?: string;
513
+ evidenceCount?: number;
498
514
  upgradeReport?: Record<string, unknown>;
499
515
  quality?: PptQualityResult;
500
516
  verification?: PptVerification;
@@ -512,6 +528,7 @@ export interface DeckEngine {
512
528
  resolveExemplar?(idOrObj: unknown, workspaceExemplars?: Record<string, unknown>): PptExemplarSummary | null;
513
529
  renderExemplarPromptGuide?(exemplar: unknown, lang?: string): string;
514
530
  getExemplarFewShotSlides?(exemplarId: string, lang?: string): Array<Record<string, unknown>>;
531
+ buildResearchPlan?(options?: Record<string, unknown>): Record<string, unknown>;
515
532
  extractExemplarFromAbsorbed?(absorbed: unknown, options?: Record<string, unknown>): Record<string, unknown>;
516
533
  importPptxDeck(options: Record<string, unknown>): Promise<PptCreateResult>;
517
534
  importOfficeDeck?(options: Record<string, unknown>): Promise<PptCreateResult>;
package/lib/workbench.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /** Operator-only workbench. Paths come from successful tools, never browser input. */
2
2
  import { createHash, randomUUID } from 'node:crypto';
3
- import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { appendFileSync, existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync, openSync, fstatSync, readSync, closeSync } from 'node:fs';
4
4
  import { homedir } from 'node:os';
5
5
  import { basename, dirname, extname, join, resolve } from 'node:path';
6
6
  import { getEngine } from './execution.js';
@@ -486,9 +486,19 @@ export class PptWorkbench {
486
486
  ...(modelRoute ? { modelRoute } : {}),
487
487
  };
488
488
  mkdirSync(dirname(this.catalogPath), { recursive: true });
489
- if (existsSync(this.catalogPath) && lstatSync(this.catalogPath).size >= 8 * 1024 * 1024)
490
- throw new Error('项目索引已满,请备份后整理 projects.jsonl');
491
- appendFileSync(this.catalogPath, JSON.stringify(row) + '\n');
489
+ const descriptor = openSync(this.catalogPath, 'a+');
490
+ try {
491
+ const info = fstatSync(descriptor), tail = Buffer.alloc(1);
492
+ const prefix = info.size && readSync(descriptor, tail, 0, 1, info.size - 1) === 1 && tail[0] !== 10 ? '\n' : '';
493
+ const line = prefix + JSON.stringify(row) + '\n';
494
+ if (info.size + Buffer.byteLength(line) > 8 * 1024 * 1024)
495
+ throw new Error('项目索引已满,请备份后整理 projects.jsonl');
496
+ // Preserve any interrupted append and keep this complete record separate.
497
+ appendFileSync(descriptor, line);
498
+ }
499
+ finally {
500
+ closeSync(descriptor);
501
+ }
492
502
  }
493
503
  async project(id) {
494
504
  if (typeof id !== 'string' || !/^[0-9a-f]{64}$/.test(id))
@@ -1531,7 +1541,8 @@ export class PptWorkbench {
1531
1541
  return { ...view, selected };
1532
1542
  }
1533
1543
  if (body.operation === 'undo') {
1534
- await engine.undoDeck({ deckPath: entry.path, expectedRevision: body.expectedRevision, signal });
1544
+ const result = await engine.undoDeck({ deckPath: entry.path, expectedRevision: body.expectedRevision, signal });
1545
+ await this.remember(result, {});
1535
1546
  return this.view(entry.id);
1536
1547
  }
1537
1548
  throw new Error('不支持此操作');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-ppt",
3
- "version": "0.31.0",
4
- "description": "DeepSeek Harness 演示文稿生成与编辑工作台:输入材料即可导出离线 HTML 放映、可编辑 PPTX 与工程包,支持按页编辑、数据推演与预审演练,以及原生清透 / 米白纸感 / Claude 暖书卷 / 8-Bit 像素 / 晴空薄荷五套明亮工作台主题。欢迎提交 issues 和 PR。",
3
+ "version": "0.32.1",
4
+ "description": "DeepSeek Harness 大师级演示文稿引擎与工作台:支持零资料调研核验与 SLOP-13 事实溯源、20 套标杆范本与弱模型零调用自检修复、24 主题 / 35+ 原生可编辑图谱(Mermaid/公式/代码/魔力象限/雷达/哑铃/热力图)、Office 直吞与双屏提词台,导出离线 HTML + 100% 可编辑 PPTX。欢迎 PR 与 Issues。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -91,7 +91,7 @@
91
91
  "csv-parse": "6.1.0",
92
92
  "fflate": "0.8.3",
93
93
  "jsep": "1.4.0",
94
- "@stardustlc/dsh-updates": "0.2.7"
94
+ "@stardustlc/dsh-updates": "0.2.10"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "@deepseek-ai/libreoffice-kit": "0.1.5 || 0.2.3"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dsh-ppt
3
- description: "Turn one sentence, a Markdown document, structured slides, Office files (.xlsx/.csv/.docx), or a benchmark .pptx corpus into a world-class presentation deck: standalone HTML web slideshow (with Dual-Screen Presenter Console & Executive One-Pager) + 100% native-editable PPTX (with 8 Curated Gold Exemplars & Slot-Filling Contracts, Deterministic Weak-LLM Compensator & Anti-Slop Upgrader, 8 Curated Taste Recipes, 4 poster covers + Hero Photo Split + coverPattern, 61 native <a:custGeom> vector icons, glass/frameless/editorial materiality, device mockups, 9-language syntax-highlighted code terminals, Magic Quadrant, Radar, Dumbbell, Heatmap, native <m:oMath> formulas, Mermaid flowcharts/sequences, Marimekko, Sankey, Porter Value Chain, SWOT) + project manifest + Speaker Handout. Supports batch .pptx exemplar ingestion (.dsh-ppt/exemplars.json), Zero-Question Scenario Auto-Direction (theme: auto), 24 curated themes, 6 Master Chrome Skeletons, 35+ native-editable layouts, 20 industry blueprints, 13 publication-grade charts, and bilingual ZH/EN support. 中文:内置 8 套标杆范本槽位契约、确定性防退化升维器(专治中弱模型文字墙与平庸标题)与批量优质 .pptx 目录吸收引擎,让任意模型稳定输出麦肯锡/红杉/Stripe 级可编辑演示文稿。"
3
+ description: "Turn one sentence, a zero-material research topic, a Markdown document, structured slides, Office files (.xlsx/.csv/.docx), or a benchmark .pptx corpus into a world-class presentation deck: standalone HTML web slideshow (with Dual-Screen Presenter Console & Executive One-Pager) + 100% native-editable PPTX (with 20 Curated Gold Exemplars & Slot-Filling Contracts, Zero-Material Research-to-Deck Planner, Verified Evidence Ledger & SLOP-13 Fact-Grounding Gate, Deterministic Weak-LLM Compensator & Zero-LLM Self-Repair Loop, 8 Curated Taste Recipes, 4 poster covers + Hero Photo Split + coverPattern, 61 native <a:custGeom> vector icons, glass/frameless/editorial materiality, device mockups, 9-language syntax-highlighted code terminals, Magic Quadrant, Radar, Dumbbell, Heatmap, native <m:oMath> formulas, Mermaid flowcharts/sequences, Marimekko, Sankey, Porter Value Chain, SWOT) + project manifest + Speaker Handout. Supports batch .pptx exemplar ingestion (.dsh-ppt/exemplars.json), Zero-Question Scenario Auto-Direction (theme: auto), 24 curated themes, 6 Master Chrome Skeletons, 35+ native-editable layouts, 20 industry blueprints, 13 publication-grade charts, and bilingual ZH/EN support. 中文:内置 20 套标杆范本、零资料深度调研与事实核验协议(Evidence Ledger + SLOP-13 出处门禁)、确定性防退化升维器与零模型自检修复闭环,支持有资料直出与无资料先调研策划再出稿双模式。"
4
4
  compatibility: "Node ^22.19.0 or >=24.0.0. Images/charts/PPTX absorption use @office-kit/pptx@0.21.0; optional data models use jsep@1.4.0 and csv-parse@6.1.0. Optional PNG/PDF renderer: @deepseek-ai/libreoffice-kit@0.2.3 (bundled by DSH 0.2.2+; 0.1.5 also supported). Cross-harness: copy the full directory and run npm install --ignore-scripts there."
5
5
  allowed-tools: "Bash, Read, Write, Edit"
6
6
  ---
@@ -32,9 +32,12 @@ allowed-tools: "Bash, Read, Write, Edit"
32
32
  - **字体与跨平台零缺字**:正文最小字号硬底线 `13.5pt`,超长内容必须拆页而非强行缩字。若 `ppt_render` 报告 `missingFonts` 非空,必须替换为环境与接收方可用字体(Windows `Microsoft YaHei`、macOS `PingFang SC`/`Songti SC`、Linux `Noto Sans/Serif CJK SC`),重新生成并逐页复核;未解决前不得声称已验收。CLI 与工具报错信息统一为中文。
33
33
  - **语言分工**:`lang`(`zh | en | bilingual`)仅控制播放器界面与默认标签;正文与双语表达由你在写作阶段完成。
34
34
 
35
- ## 核心流水线
35
+ ## 核心流水线(双模路由)
36
36
 
37
- 1. **Probe & Auto-Direct 定调**:读入用户句子/文档/数据,静默判定听众与六大画像(见 `references/themes.md`)。若用户给了参考 `.pptx`,调 `ppt_absorb` 查看提取结果或在创建时传 `referencePptx`。一句话输入不反问,直接推断并生成完整成品。
37
+ - **Mode A(有资料直出)**:用户已给出文档、大纲、表格、数据或参考 `.pptx` 时,零追问自动定调并直接生成可交付三件套。
38
+ - **Mode B(零资料深研策划)**:用户**没有资料**、只给主题或明确要求「你去搜索资料、核验准确性、先策划 PPT 方案再生成」时,**严禁凭训练记忆编造具体统计数字**!必须先读 `references/research-plan.md`,按四步闭环执行:① 调 `ppt_templates({ topic })`(或 CLI `--plan`)获取标杆分镜与 3 轮检索指南 → ② 用宿主 Agent 联网搜索工具开展 3 轮一手源检索与双源交叉核验,沉淀 `evidence[]` 账本(冲突报区间、缺数改定性图示)→ ③ 向用户展示策划方案(含核验事实摘要与逐页分镜表)并获确认(除非用户明示跳过确认直出)→ ④ 带 `evidence[]` + `evidenceAppendix: true` + `slides[].evidenceIds` 调 `ppt_create` 出稿并通过 `SLOP-13` 事实出处门禁。
39
+
40
+ 1. **Probe & Auto-Direct 定调**:读入用户句子/文档/数据(或 Mode B 核验后的证据账本),静默判定听众与六大画像(见 `references/themes.md`)。若用户给了参考 `.pptx`,调 `ppt_absorb` 查看提取结果或在创建时传 `referencePptx`。Mode A 一句话输入不反问,直接推断并生成完整成品。
38
41
  2. **Storyline & Choreography 叙事与排布**:先读 `references/copywriting.md`。按金字塔原理 / SCQA 组织 5–16 页大纲,为每页撰写结论先行 Action Title、章节面包屑 `kicker`(如 `01 · 市场诊断`,禁止满屏重复「要点」)、底栏核心结论 `takeaway` 与数据出处 `source`,并规划多版式交替节奏。可调 `ppt_templates` 参考 **20 套行业结构蓝图**(`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`)。
39
42
  3. **Theme 选主题与骨架**:不确定时在 `ppt_create` 传 `theme: 'auto'`(自动路由至明亮高质感场景主题与匹配骨架),或从 **24 套内置主题**中精确指定(调 `ppt_themes` 查看),并可通过 `brand.chromeStyle` 或单页 `chrome` 覆盖 6 套母版骨架。
40
43
  - **重要 CLI 差异**:跨 harness 直接运行 `build-deck.mjs` 时,裸 CLI 缺省 `--theme` 为兼容旧脚本仍回退 `data`,因此 **CLI 调用请务必显式传 `--theme auto` 或具体场景主题 ID(如 `--theme consulting` / `--theme exec-jilan`)**!
@@ -49,7 +52,8 @@ allowed-tools: "Bash, Read, Write, Edit"
49
52
 
50
53
  | 何时必读 | 参考文件 | 核心内容 |
51
54
  | --- | --- | --- |
52
- | 按标杆范本槽位填空或批量投喂 `.pptx` 语料 | `references/exemplars.md` | 8 套标杆范本槽位契约、`ppt_templates(exemplarId)`、批量 `--ingest-exemplars` 与弱模型升维补偿器 |
55
+ | **零资料联网调研、核验准确性与先策划再出稿** | `references/research-plan.md` | 双模路由、3 轮定向检索法、Tier 1/2/3 交叉核验红线、`evidence[]` 账本、分镜策划确认与 `SLOP-13` 门禁 |
56
+ | 按标杆范本槽位填空或批量投喂 `.pptx` 语料 | `references/exemplars.md` | 20 套标杆范本槽位契约、`ppt_templates(exemplarId)`、批量 `--ingest-exemplars` 与弱模型升维补偿器 |
53
57
  | 写大纲、标题与正文前 | `references/copywriting.md` | 六大画像叙事骨架、Action Title 写法、字数预算、反空话与双语规范 |
54
58
  | 选主题、配色、骨架或吸收母版 | `references/themes.md` | 18 套大师主题色板(12 浅 6 深)、6 套母版骨架(Chrome)、18 语义 Token、六大画像选型树 |
55
59
  | 写结构化 `slides` 或扩展 Markdown | `references/syntax.md` | 24 套原生版式与专业图示 + `variant`、统一 `items` 结构、`:::` 容器指令、三线表与 `takeaway` |
@@ -57,7 +61,7 @@ allowed-tools: "Bash, Read, Write, Edit"
57
61
  | 数字溯源、公式与现场推演 | `references/data.md` | `dataModel` 源绑定、公式约束、全字段 `{{metricId}}` 联动与预览确认流 |
58
62
  | 遇到报错或渲染异常 | `references/troubleshooting.md` | 症状 → 根因与处理速查表 |
59
63
 
60
- ## 质量与反土味门禁(SLOP-01..10,交付前逐项核对)
64
+ ## 质量与反土味门禁(SLOP-01..13,交付前逐项核对)
61
65
 
62
66
  - [ ] **SLOP-01 结论标题**:内容页与图表页标题均为完整判断句(Action Title),无「项目背景 / 数据图表 / 总结」等纯名词短标题。
63
67
  - [ ] **SLOP-02 章节面包屑**:`kicker` 体现章节脉络(如 `01 · 增长引擎`),未连续多页硬编码重复「要点 / Point」。
@@ -69,6 +73,8 @@ allowed-tools: "Bash, Read, Write, Edit"
69
73
  - [ ] **SLOP-08 版式多样性**:≥ 6 页的文稿至少组合 4 种不同版式原型,封面与封底不误印页码。
70
74
  - [ ] **SLOP-09 可执行收尾**:`closing` 页包含明确的下一步行动号召(CTA / 里程碑 / 联络方式),绝不仅写两个字「谢谢」。
71
75
  - [ ] **SLOP-10 真实性与跨平台完备**:无未填占位草稿(除非用户明确要求空模板并标注 `draft`),全部产物为工作区绝对路径;若已运行渲染,确认 `missingFonts: []` 且收据匹配最新 PPTX。
76
+ - [ ] **SLOP-11/12 卡片材质节奏与图表聚光灯**:长篇文稿避免连续 ≥ 4 页等宽方框卡片;单系列 ≥ 5 项柱状/条形图须通过 `highlight` / `spotlight` / `referenceLine` 聚焦核心主角。
77
+ - [ ] **SLOP-13 事实出处与证据账本卫生**:严禁「数据来源:网络整理 / 公开资料 / 综合整理」等空洞假出处;零资料调研模式下所有量化数据页均须绑定已核验 `evidenceIds`(或一手 `source`),无悬空 `[E#]` 引用,`unverified` / `conflicting` 证据必须在画面可见文案中如实注明口径差异或区间。
72
78
 
73
79
  ## 跨 harness 安装
74
80
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ppt-skill",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "Standalone dsh-ppt skill dependencies for image/chart export",
@@ -0,0 +1,133 @@
1
+ # 零资料深度调研、事实核验与策划出稿协议(Zero-Material Research-to-Deck)
2
+
3
+ 当用户**没有现成文档、表格或数据**,只给出一个主题并要求「你去搜资料、核对准确性、先策划 PPT 方案再生成」时,必须走本协议的四阶段流水线。
4
+
5
+ > **架构红线**:`dsh-ppt` 引擎本身保持 100% 离线、零网络外联与零新增依赖;实时联网检索与一手网页阅读由**宿主 Agent 的联网搜索/浏览器工具**完成(学术场景可叠加 `dsh-cite`),校验后的结构化证据通过 `evidence[]` 证据账本交给 `dsh-ppt` 确定性绑定、审计(`SLOP-13`)并渲染成稿。
6
+
7
+ ---
8
+
9
+ ## 一、双模路由判定(Mode A vs Mode B)
10
+
11
+ | 模式 | 触发条件 | 动作 |
12
+ | --- | --- | --- |
13
+ | **Mode A:有资料直出** | 用户已提供大纲、文档、Excel/CSV/Word、参考 `.pptx` 或明确数字 | 零追问自动定调(`theme: 'auto'` / `exemplar: 'auto'`),直接出稿并做视觉验收 |
14
+ | **Mode B:零资料深研策划** | 用户只给主题且无资料,或明确要求「先搜索资料 / 查准数据 / 出方案再做 PPT」 | 严格执行下方 **4 步闭环**:定向检索 → 双源交叉核验 → 策划方案确认 → 证据溯源成稿 |
15
+
16
+ ---
17
+
18
+ ## 二、四阶段执行协议
19
+
20
+ ### Step 1:先调策划器定骨架 + 三轮定向检索(Research)
21
+
22
+ 1. 先调用 `ppt_templates({ topic: "<用户主题>", persona: "<可选画像>", lang: "zh" })`(或裸 CLI `--plan "<主题>"`),获取:
23
+ - 最佳匹配的 20 套内置标杆范本(`exemplar.id`、`theme`、`chromeStyle`);
24
+ - 三轮定向检索词建议(`researchRounds`);
25
+ - 逐页分镜蓝图与需要量化证据的槽位清单(`storyboard`、`evidenceAudit.gaps`)。
26
+ 2. 使用宿主 Agent 的联网搜索工具按**三轮递进法**采集一手资料(避免只搜一轮把营销软文当权威数据):
27
+ - **Round 1(权威基线)**:政府公报、监管机构、上市公司年报/财报、IEA/Gartner/IDC/麦肯锡/学术顶刊白皮书,确认核心规模、增速、年份与地域口径。
28
+ - **Round 2(竞品与实测)**:头部厂商官方发布、同口径市场份额、改造前后实测性能/成本数据。
29
+ - **Round 3(最新进展与反方风险)**:2025–2026 最新量产/政策节点、技术瓶颈、失败案例与机构预测分歧(避免一边倒的宣传稿)。
30
+
31
+ ### Step 2:一手优先与双源交叉核验(Fact-Check & Evidence Ledger)
32
+
33
+ 将搜集到的每条拟上屏事实整理为 `evidence[]` 账本,执行**三层信源分级与四条核验红线**:
34
+
35
+ - **信源可信度分级**:
36
+ - **Tier 1(直接采信)**:政府统计局/部委、央行/SEC/港交所财报、权威国际组织(IEA/IMF/WHO/ISO)、Peer-reviewed 学术期刊、厂商官方技术文档与财报。
37
+ - **Tier 2(须交叉验证)**:主流咨询/研究机构(Gartner/IDC/TrendForce/高工锂电等)报告、权威财经/科技媒体(FT/Reuters/Bloomberg/财新)转引。
38
+ - **Tier 3(禁止单独作为上屏数字依据)**:自媒体公众号、无原始出处二手榜单、匿名论坛贴、营销公关软文。
39
+ - **四条核验红线**:
40
+ 1. **关键大数字双源核验**:封面/KPI/核心图表中的决定性数字,须由至少 2 个独立可信来源相互印证,或直接定位至 Tier 1 原始发布文件;记清**时间窗口(`date`)与统计口径(`scope`)**,禁止把全球口径与中国口径、出货量与装机量混在同一张图里。
41
+ 2. **冲突不拍脑袋**:不同权威机构预测存在明显差异时,将 `confidence` 设为 `"conflicting"`,在 `note` 中写明双方口径,并在幻灯片展示**区间**(如 `18–25 GWh`)而非单点断言。
42
+ 3. **查不到就诚实降级**:某页规划为 `kpi` / `chart` 但检索后确实缺乏可靠量化数据时,**严禁凭训练记忆估算编造精确小数**!立刻将该页降级为定性图示(`comparison` / `architecture` / `process` / `matrix` / `cards`),或在 `evidence[]` 中明确标为 `estimated` / `unverified` 并在画面显眼处说明口径。
43
+ 4. **禁用空洞假出处**:绝对禁止写 `数据来源:网络整理` / `公开资料` / `综合整理` / `Internet`(会被 `SLOP-13` 自动拦截)。
44
+
45
+ ### Step 3:向用户展示策划方案并确认(Plan Gate)
46
+
47
+ 在搜集并核验完毕后,**先向用户输出结构化策划方案,再生成 PPT**(除非用户已明确指示「搜完直接出稿,不用问我」):
48
+
49
+ 1. **核心叙事主线与风格定位**:目标听众、推荐标杆范本(如 `daylight-earnings-research` / `mckinsey-strategy`)、主题色与预计页数/演讲时长;
50
+ 2. **核验后的核心事实账本摘要(`E1..En`)**:列出关键数字、一手出处、年份口径及核验状态(含任何已发现的口径分歧或待补项);
51
+ 3. **逐页分镜策划表(Storyboard)**:页码、叙事角色、结论先行标题(Action Title)、拟用版式、绑定证据 `[E#]`(可直接调用 `ppt_templates({ topic, evidence })` 自动生成 `planMarkdown` 并补齐真实标题)。
52
+
53
+ 等待用户确认或微调页数/口径/侧重点后,进入 Step 4。
54
+
55
+ ### Step 4:带证据账本成稿与 SLOP-13 门禁交付(Grounded Build)
56
+
57
+ 调用 `ppt_create`(或 CLI `build-deck.mjs`),一次性传入核验后的 `evidence[]`、`evidenceAppendix: true`、`exemplar`、`alignOrder: true` 与带 `evidenceIds: ["E1", ...]`(或内联 `[E1]`)的 `slides[]`:
58
+
59
+ ```json
60
+ {
61
+ "title": "2026 固态电池商业化进展与产业研报",
62
+ "exemplar": "daylight-earnings-research",
63
+ "alignOrder": true,
64
+ "evidenceAppendix": true,
65
+ "evidence": [
66
+ {
67
+ "id": "E1",
68
+ "claim": "2025 年全球半固态电池出货量突破 12 GWh,中国车企装车贡献超 75%",
69
+ "source": "GGII 高工产研《2025 固态电池产业蓝皮书》",
70
+ "date": "2026-01",
71
+ "scope": "全球出货口径",
72
+ "url": "https://example.org/ggii-solid-state-2025",
73
+ "confidence": "verified"
74
+ },
75
+ {
76
+ "id": "E2",
77
+ "claim": "全固态电芯小批量装车验证集中于 2027 年,规模化降本至 <0.6 元/Wh 预计需至 2030 年前后",
78
+ "source": "中汽协 & TrendForce 联合口径对比",
79
+ "date": "2026-02",
80
+ "scope": "全固态硫化物路线",
81
+ "confidence": "conflicting",
82
+ "note": "车企官方规划偏乐观(2027),供应链普遍预计量产平价在 2030 年"
83
+ }
84
+ ],
85
+ "slides": [
86
+ {
87
+ "layout": "kpi",
88
+ "kicker": "01 · 产业拐点",
89
+ "title": "半固态已跨越 12 GWh 商用门槛,全固态平价仍需 3–4 年攻坚",
90
+ "evidenceIds": ["E1", "E2"],
91
+ "items": [
92
+ { "tag": "2025 全球出货", "value": "12+ GWh", "delta": "中国占 >75% [E1]" },
93
+ { "tag": "全固态验证窗口", "value": "2027–2030", "delta": "多机构预测区间 [E2]" }
94
+ ],
95
+ "takeaway": "半固态率先贡献出货增量;全固态在车企与供应链口径间存在 2–3 年量产预期差。"
96
+ }
97
+ ]
98
+ }
99
+ ```
100
+
101
+ ### 引擎自动为你完成的 4 件事(零模型确定性保障)
102
+
103
+ 1. **清爽页面脚注自动注入**:凡带 `evidenceIds` 或内联 `[E#]` 的页面,若未手工写 `source`(或写了空洞占位词),引擎自动生成紧凑规范的 `source` 底栏(如 `GGII 高工产研 (2026-01) [E1];TrendForce (2026-02) [E2]`),不把冗长 URL 塞进正文污染排版。
104
+ 2. **演讲者备注完整溯源卡**:自动将完整 `claim`、发布方、年份、口径、核验状态与原文 `url` 写入对应页的 `notes`(在 HTML 按 `P` 进提词台或 PowerPoint 备注区答辩随时可查)。
105
+ 3. **封底前自动三线表附录页**:开启 `evidenceAppendix: true` 时,自动在 `closing` 页之前生成符合 `booktabs` 规范且零溢出(0 `table-density` 告警)的「核心论据溯源清单」页;若同步输出 `.handout.md`,末尾还会附带含可点击 Markdown 链接的完整《事实核验与证据账本》总表。
106
+ 4. **`SLOP-13` 事实出处门禁**:`ppt_check` 与生成阶段自动扫描 4 类事实卫生问题:
107
+ - `dangling-evidence-ref`:页面引用了 `evidence[]` 中不存在的 `[E99]`;
108
+ - `unverified-evidence-claim`:页面引用了 `unverified` 或 `conflicting` 证据,但未在页面可见文案中声明「待核实 / 口径差异 / 区间 / 估算」;
109
+ - `vague-placeholder-source`:出现「数据来源:网络整理 / 公开资料 / 综合整理 / Internet」等空洞假出处;
110
+ - `unsourced-research-numbers`:在启用 `evidence[]` 调研账本时,存在含数字的 `kpi / chart / chart-split / waterfall / marimekko / tam / dumbbell / heatmap` 页面既未绑定 `[E#]` 也无有效 `source` 出处。
111
+
112
+ ---
113
+
114
+ ## 三、裸 CLI 用法速查
115
+
116
+ ```bash
117
+ # 1. 先按主题生成 3 轮调研清单 + 逐页分镜策划表
118
+ node skills/dsh-ppt/scripts/build-deck.mjs --plan "2026 固态电池商业化进展与产业研报" --lang zh
119
+
120
+ # 2. 检索并核验后,带已核验 evidence.json 重新检查量化槽位缺口
121
+ node skills/dsh-ppt/scripts/build-deck.mjs --plan "2026 固态电池商业化进展与产业研报" --evidence @evidence.json --lang zh
122
+
123
+ # 3. 确认方案后,带证据账本 + 附录三线表 + 讲义一键出稿
124
+ node skills/dsh-ppt/scripts/build-deck.mjs \
125
+ --title "2026 固态电池商业化进展与产业研报" \
126
+ --slides @slides.json \
127
+ --exemplar daylight-earnings-research \
128
+ --align-order \
129
+ --evidence @evidence.json \
130
+ --evidence-appendix \
131
+ --handout \
132
+ --out dist
133
+ ```
@@ -17,7 +17,7 @@ import { resolve as resolvePath } from 'node:path'
17
17
  import { pathToFileURL } from 'node:url'
18
18
  import { listThemes, THEME_IDS, DEFAULT_THEME } from './deck-themes.mjs'
19
19
  import { CHROME_STYLE_IDS } from './deck-absorb.mjs'
20
- import { buildDeckAsync, listTemplates, editDeck, undoDeck, checkDeckAsync, renderDeck, absorbPptx, importPptxDeck, importOfficeDeck, listAllTasteRecipes, listCuratedExemplars, loadWorkspaceExemplars, ingestExemplarCorpus } from './deck-advanced.mjs'
20
+ import { buildDeckAsync, listTemplates, editDeck, undoDeck, checkDeckAsync, renderDeck, absorbPptx, importPptxDeck, importOfficeDeck, listAllTasteRecipes, listCuratedExemplars, loadWorkspaceExemplars, ingestExemplarCorpus, buildResearchPlan } from './deck-advanced.mjs'
21
21
 
22
22
  const HELP = `dsh-ppt —— 一句话 / 一篇文档 → HTML 放映 + PPTX 导出
23
23
 
@@ -34,8 +34,11 @@ const HELP = `dsh-ppt —— 一句话 / 一篇文档 → HTML 放映 + PPTX 导
34
34
  --clone-structure 配合 --reference-pptx 使用,克隆参考文稿的逐页版式骨架与母版 chrome
35
35
  --chrome <style> 母版骨架风格:${CHROME_STYLE_IDS.join(' / ')}
36
36
  --taste <id> 大师审美配方 ID(mckinsey-partner / apple-keynote-dark / apple-keynote-light / swiss-editorial / linear-craft / ft-data-journal / nature-academic / oriental-zen 或已吸收自定义 ID)
37
- --exemplar <id> 标杆范本槽位契约 ID(8 套内置满分范本或 .dsh-ppt/exemplars.json 已吸收范本,锁定叙事节奏与版式升维)
38
- --list-exemplars 列出内置 8 套满分标杆范本及工作区已吸收的标杆 .pptx 范本
37
+ --exemplar <id> 标杆范本槽位契约 ID(20 套内置满分范本、auto 或 .dsh-ppt/exemplars.json 已吸收范本,锁定叙事节奏与版式升维)
38
+ --list-exemplars 列出内置 20 套满分标杆范本及工作区已吸收的标杆 .pptx 范本
39
+ --plan <topic> 零资料调研策划器:按选题匹配标杆范本、生成 3 轮检索清单、证据缺口诊断与逐页分镜策划表
40
+ --evidence <json|@path> 外部调研并交叉核验后的结构化证据账本(自动注入 source 脚注、notes 溯源卡与 SLOP-13 核验)
41
+ --evidence-appendix 配合 --evidence 在封底前自动追加「事实核验与数据来源清单」三线表附录页
39
42
  --ingest-exemplars <dir> 批量吸收目录下所有优质 .pptx 语料并持久化至 .dsh-ppt/exemplars.json 与 taste-recipes.json
40
43
  --save-exemplar <id> 配合 --absorb 将单份标杆 .pptx 同步保存为可复用范本契约
41
44
  --no-auto-upgrade 关闭弱模型自动兜底升维与反文字墙拆分
@@ -102,6 +105,9 @@ export function parseArgv(argv) {
102
105
  else if (key === '--list-tastes') args.listTastes = true
103
106
  else if (key === '--list-exemplars') args.listExemplars = true
104
107
  else if (key === '--exemplar') args.exemplar = nextValue()
108
+ else if (key === '--plan') args.plan = nextValue()
109
+ else if (key === '--evidence') args.evidence = readJson(nextValue())
110
+ else if (key === '--evidence-appendix') args.evidenceAppendix = true
105
111
  else if (key === '--ingest-exemplars') args.ingestExemplars = nextValue()
106
112
  else if (key === '--save-exemplar') args.saveExemplar = nextValue()
107
113
  else if (key === '--align-order') args.alignOrder = true
@@ -179,6 +185,18 @@ export async function main(argv = process.argv.slice(2), io = {}) {
179
185
  if (args.listTemplates) { log(JSON.stringify({ templates: listTemplates(args.lang) }, null, 2)); return 0 }
180
186
  if (args.listTastes) { log(JSON.stringify({ tasteRecipes: listAllTasteRecipes(process.cwd()) }, null, 2)); return 0 }
181
187
  if (args.listExemplars) { log(JSON.stringify({ exemplars: listCuratedExemplars(loadWorkspaceExemplars(process.cwd())) }, null, 2)); return 0 }
188
+ if (args.plan) {
189
+ const plan = buildResearchPlan({
190
+ topic: args.plan,
191
+ persona: args.persona,
192
+ exemplarId: args.exemplar,
193
+ evidence: args.evidence,
194
+ lang: args.lang,
195
+ workspaceExemplars: loadWorkspaceExemplars(process.cwd()),
196
+ })
197
+ log(JSON.stringify(plan, null, 2))
198
+ return 0
199
+ }
182
200
  if (args.ingestExemplars) {
183
201
  const report = await ingestExemplarCorpus({ dirPath: args.ingestExemplars, cwd: process.cwd() })
184
202
  log(JSON.stringify(report, null, 2))
@@ -305,6 +323,8 @@ export async function main(argv = process.argv.slice(2), io = {}) {
305
323
  template: args.template,
306
324
  brand: effectiveBrand,
307
325
  dataModel: args.dataModel,
326
+ ...(args.evidence !== undefined ? { evidence: args.evidence } : {}),
327
+ ...(args.evidenceAppendix ? { evidenceAppendix: true } : {}),
308
328
  ...(args.handout ? { handout: true } : {}),
309
329
  ...(args.onePager ? { onePager: true } : {}),
310
330
  ...(args.targetMinutes !== undefined ? { targetMinutes: args.targetMinutes } : {}),
@@ -38,6 +38,7 @@ import {
38
38
  renderExemplarPromptGuide,
39
39
  } from './deck-exemplars.mjs'
40
40
  import { upgradeWeakDeck, resequenceSlidesToExemplar, selfRepairDeck, synthesizeActionTitle } from './deck-upgrader.mjs'
41
+ import { normalizeEvidenceLedger, applyEvidenceLedgerToSlides, auditEvidenceAndSourcing, buildResearchPlan } from './deck-evidence.mjs'
41
42
  export { readRenderReceipt } from './deck-render.mjs'
42
43
  export { dataNotes, dataReport } from './deck-data.mjs'
43
44
  export { buildDeck, resolveLanguage } from './deck-core.mjs'
@@ -63,6 +64,7 @@ export {
63
64
  renderExemplarPromptGuide,
64
65
  } from './deck-exemplars.mjs'
65
66
  export { upgradeWeakDeck, resequenceSlidesToExemplar, selfRepairDeck, synthesizeActionTitle } from './deck-upgrader.mjs'
67
+ export { normalizeEvidenceLedger, applyEvidenceLedgerToSlides, auditEvidenceAndSourcing, buildResearchPlan } from './deck-evidence.mjs'
66
68
 
67
69
  export async function ingestExemplarCorpus(options = {}) {
68
70
  return ingestExemplarDirectory({
@@ -269,7 +271,7 @@ function validateRawSlides(slides) {
269
271
  }
270
272
 
271
273
  function snapshot(manifest) {
272
- return clone(Object.fromEntries(['title', 'theme', 'language', 'motion', 'slides', 'brand', 'template', 'dataModel', 'targetMinutes', 'taste'].filter(k => manifest[k] !== undefined).map(k => [k, manifest[k]])))
274
+ return clone(Object.fromEntries(['title', 'theme', 'language', 'motion', 'slides', 'brand', 'template', 'dataModel', 'evidence', 'targetMinutes', 'taste'].filter(k => manifest[k] !== undefined).map(k => [k, manifest[k]])))
273
275
  }
274
276
 
275
277
  function collectAssets(manifest) {
@@ -373,10 +375,14 @@ export function checkManifest(manifest) {
373
375
  if (manifest.brand?.logoAssetId && !manifest.assets?.[manifest.brand.logoAssetId]) issue(0, 'missing-logo', '品牌 Logo 资产不存在', '重新提供 Logo', 'error')
374
376
  else if (manifest.brand?.logoAssetId && assetError(manifest.brand.logoAssetId)) issue(0, 'invalid-logo', assetError(manifest.brand.logoAssetId), '重新提供 Logo', 'error')
375
377
 
376
- // 追加 SLOP-01..10 审美反模式静态诊断
378
+ // 追加 SLOP-01..12 审美反模式静态诊断
377
379
  for (const aestheticIssue of auditSlideAesthetics(manifest, theme, textWidth)) {
378
380
  issues.push(aestheticIssue)
379
381
  }
382
+ // 追加 SLOP-13 事实出处与证据账本静态门禁
383
+ for (const evidenceIssue of auditEvidenceAndSourcing(manifest)) {
384
+ issues.push(evidenceIssue)
385
+ }
380
386
 
381
387
  return { ok: !issues.some(i => i.severity === 'error'), slideCount: manifest.slides.length,
382
388
  errorCount: issues.filter(i => i.severity === 'error').length, warningCount: issues.filter(i => i.severity === 'warning').length,
@@ -525,6 +531,7 @@ function result(manifest, paths, writeHandout = false, writeOnePager = false) {
525
531
  quality: manifest.quality, paceBudget, verification: { static: 'checked', pptxRender: 'not-verified', visual: 'not-verified' }, outputDir: dirname(paths.json),
526
532
  files: paths, htmlPath: paths.html, pptxPath: paths.pptx, jsonPath: paths.json,
527
533
  ...(manifest.exemplar ? { exemplar: manifest.exemplar } : {}),
534
+ ...(Array.isArray(manifest.evidence) && manifest.evidence.length > 0 ? { evidenceCount: manifest.evidence.length } : {}),
528
535
  ...(writeHandout ? { handoutPath } : {}),
529
536
  ...(writeOnePager ? { onePagerPath } : {}) }
530
537
  }
@@ -588,6 +595,7 @@ function validateSnapshot(value, assets) {
588
595
  }
589
596
  validateRawSlides(value.slides)
590
597
  validateDataSnapshot(value, normalizeSlides)
598
+ if (value.evidence !== undefined) normalizeEvidenceLedger(value.evidence)
591
599
  if (value.brand != null) {
592
600
  if (Object.hasOwn(value.brand, 'logo')) fail('工程品牌仅支持嵌入的 logoAssetId,不读取本地 logo 路径')
593
601
  for (const key of ['primaryColor', 'secondaryColor', 'backgroundColor', 'textColor', 'fontFamily', 'headingFont', 'coverMode', 'coverBg', 'name', 'footer', 'chromeStyle', 'cardMaterial', 'iconMode', 'taste']) {
@@ -773,6 +781,15 @@ export async function buildDeckAsync(options = {}) {
773
781
  normalized.deck.slides = optimizeVisualRhythm(normalized.deck.slides, resolvedTaste)
774
782
  }
775
783
 
784
+ const evidence = normalizeEvidenceLedger(options.evidence)
785
+ if (evidence.length > 0) {
786
+ const appliedEvidence = applyEvidenceLedgerToSlides(normalized.deck.slides, evidence, {
787
+ lang: langId,
788
+ evidenceAppendix: options.evidenceAppendix === true,
789
+ })
790
+ normalized.deck.slides = appliedEvidence.slides
791
+ }
792
+
776
793
  const assets = {}
777
794
  let brandInput = options.brand
778
795
  if (resolvedTaste && options.brand !== null) {
@@ -825,6 +842,7 @@ export async function buildDeckAsync(options = {}) {
825
842
  ...(scenario ? { template: scenario.id } : {}),
826
843
  ...(brand ? { brand } : {}),
827
844
  ...(dataModel ? { dataModel } : {}),
845
+ ...(evidence.length > 0 ? { evidence } : {}),
828
846
  assets,
829
847
  history: [],
830
848
  slides: embedSlides(normalized.deck.slides, assets, cwd).map(s => ({ ...s, id: randomUUID() })),
@@ -952,7 +970,7 @@ export async function editDeck(options = {}) {
952
970
  }
953
971
  const used = new Set()
954
972
  const allowed = new Set([
955
- 'layout', 'variant', 'chrome', 'cardMaterial', 'iconMode', 'coverPattern', 'title', 'subtitle', 'kicker', 'takeaway', 'source',
973
+ 'layout', 'variant', 'chrome', 'cardMaterial', 'iconMode', 'coverPattern', 'title', 'subtitle', 'kicker', 'takeaway', 'source', 'evidenceIds',
956
974
  'text', 'formula', 'mermaid', 'code', 'language', 'filename', 'url', 'xLabel', 'yLabel', 'activeIndex', 'tableStyle',
957
975
  'bullets', 'items', 'cards', 'metrics', 'columns', 'steps', 'quadrants', 'rows', 'notes', 'image', 'images', 'chart', 'visual',
958
976
  ])
@@ -1150,6 +1150,10 @@ function normalizeSlideContent(raw, index) {
1150
1150
  ?? (layout === 'sankey' && bullets.length > 0 ? bullets : undefined)
1151
1151
  const items = normalizeSlideItems(rawItemsInput, layout)
1152
1152
 
1153
+ const rawEvidenceIds = Array.isArray(source.evidenceIds)
1154
+ ? [...new Set(source.evidenceIds.map((id) => stripInlineMarkdown(id).trim().toUpperCase()).filter(Boolean))].slice(0, 12)
1155
+ : undefined
1156
+
1153
1157
  const commonExtras = {
1154
1158
  ...(variant !== '' ? { variant } : {}),
1155
1159
  ...(chrome ? { chrome } : {}),
@@ -1167,6 +1171,7 @@ function normalizeSlideContent(raw, index) {
1167
1171
  ...(quadrantLabels ? { quadrants: quadrantLabels } : {}),
1168
1172
  ...(takeaway !== '' ? { takeaway } : {}),
1169
1173
  ...(slideSource !== '' ? { source: slideSource } : {}),
1174
+ ...(rawEvidenceIds?.length ? { evidenceIds: rawEvidenceIds } : {}),
1170
1175
  ...(activeIndex !== undefined ? { activeIndex } : {}),
1171
1176
  ...(columns?.length ? { columns } : {}),
1172
1177
  ...(start !== undefined ? { start } : {}),
@@ -3,6 +3,7 @@ import { deriveBrandedTheme, resolveTheme, relativeLuminance } from './deck-them
3
3
  import { renderChartSvg } from './deck-media.mjs'
4
4
  import { renderMermaidHtml, MERMAID_CSS } from './deck-mermaid.mjs'
5
5
  import { latexToMathMl } from './deck-math.mjs'
6
+ import { renderEvidenceHandoutSection } from './deck-evidence.mjs'
6
7
 
7
8
  const escape = value => String(value ?? '').replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c])
8
9
 
@@ -301,6 +302,9 @@ export function renderHandoutMarkdown(manifest, language) {
301
302
  lines.push('')
302
303
  })
303
304
 
305
+ const evidenceSection = renderEvidenceHandoutSection(manifest, lang)
306
+ if (evidenceSection) lines.push(evidenceSection)
307
+
304
308
  return lines.join('\n')
305
309
  }
306
310