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.
- package/CHANGELOG.md +42 -0
- package/README.en.md +8 -10
- package/README.md +8 -10
- package/docs/USAGE.en.md +44 -35
- package/docs/USAGE.md +45 -36
- package/docs/VALIDATION.md +8 -0
- package/lib/client.js +116 -17
- package/lib/ecosystem.js +10 -0
- package/lib/execution.js +36 -5
- package/lib/tools.js +74 -4
- package/lib/types.d.ts +79 -1
- package/lib/workbench.js +255 -14
- package/package.json +2 -2
- package/skills/dsh-ppt/SKILL.md +34 -31
- package/skills/dsh-ppt/package.json +1 -1
- package/skills/dsh-ppt/references/office-pack.md +124 -0
- package/skills/dsh-ppt/references/research-plan.md +93 -62
- package/skills/dsh-ppt/scripts/build-deck.mjs +109 -3
- package/skills/dsh-ppt/scripts/deck-absorb.mjs +21 -0
- package/skills/dsh-ppt/scripts/deck-advanced.mjs +330 -37
- package/skills/dsh-ppt/scripts/deck-brand-kit.mjs +257 -0
- package/skills/dsh-ppt/scripts/deck-charts-exec.mjs +805 -0
- package/skills/dsh-ppt/scripts/deck-chrome.mjs +47 -1
- package/skills/dsh-ppt/scripts/deck-compose.mjs +386 -0
- package/skills/dsh-ppt/scripts/deck-core.mjs +136 -16
- package/skills/dsh-ppt/scripts/deck-delivery.mjs +750 -17
- package/skills/dsh-ppt/scripts/deck-evidence.mjs +811 -118
- package/skills/dsh-ppt/scripts/deck-export.mjs +652 -0
- package/skills/dsh-ppt/scripts/deck-i18n.mjs +170 -0
- package/skills/dsh-ppt/scripts/deck-layouts.mjs +72 -8
- package/skills/dsh-ppt/scripts/deck-media.mjs +22 -0
- package/skills/dsh-ppt/scripts/deck-office.mjs +1455 -14
- package/skills/dsh-ppt/scripts/deck-remix.mjs +471 -0
package/lib/workbench.js
CHANGED
|
@@ -21,6 +21,8 @@ const ALLOWED_LAYOUTS = new Set([
|
|
|
21
21
|
'gantt', 'architecture', 'harvey', 'tam', 'org',
|
|
22
22
|
'marimekko', 'sankey', 'swot',
|
|
23
23
|
'mockup', 'code', 'quadrant', 'radar', 'dumbbell', 'heatmap',
|
|
24
|
+
'map', 'isometric',
|
|
25
|
+
'issue-tree', 'treemap', 'gauge', 'pricing',
|
|
24
26
|
'table', 'closing', 'image', 'image-left', 'image-right', 'chart', 'chart-split',
|
|
25
27
|
'waterfall', 'gallery', 'flywheel', 'chevron', 'value-chain',
|
|
26
28
|
'mermaid', 'flowchart', 'sequence',
|
|
@@ -31,9 +33,11 @@ const ALLOWED_ITEM_STATUS = new Set(['neutral', 'accent', 'positive', 'negative'
|
|
|
31
33
|
const ALLOWED_CHROME_STYLES = new Set(['consulting-classic', 'keynote-spatial', 'editorial-folio', 'saas-bento', 'academic-minimal', 'gov-ceremonial']);
|
|
32
34
|
const ALLOWED_CARD_MATERIALS = new Set(['solid', 'frameless', 'glass', 'editorial-rule']);
|
|
33
35
|
const ALLOWED_ICON_MODES = new Set(['off', 'explicit', 'auto']);
|
|
34
|
-
const ALLOWED_COVER_PATTERNS = new Set(['dots', 'grid', 'rings']);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
36
|
+
const ALLOWED_COVER_PATTERNS = new Set(['dots', 'grid', 'rings', 'waves', 'isometric-mesh', 'editorial-arcs']);
|
|
37
|
+
const ALLOWED_FOCAL_POINTS = new Set(['center', 'top', 'bottom', 'left', 'right']);
|
|
38
|
+
const ALLOWED_REMIX_PRESETS = new Set(['exec-5min', 'board-brief', 'sales-pitch']);
|
|
39
|
+
const ITEM_KEYS = new Set(['tag', 'badge', 'title', 'text', 'body', 'value', 'unit', 'delta', 'start', 'span', 'milestone', 'role', 'conversion', 'icon', 'avatar', 'x', 'y', 'size', 'before', 'after', 'actual', 'target', 'max', 'status', 'tone', 'bullets']);
|
|
40
|
+
const BRAND_KEYS = new Set(['name', 'primaryColor', 'secondaryColor', 'backgroundColor', 'textColor', 'fontFamily', 'headingFont', 'coverMode', 'coverBg', 'logo', 'footer', 'watermark', 'chromeStyle', 'cardMaterial', 'iconMode', 'taste']);
|
|
37
41
|
const VISUAL_KEYS = new Set(['titleSize', 'bodySize', 'chartLabelSize', 'density', 'tableStyle', 'chrome']);
|
|
38
42
|
/** Sharing keeps the offline deck, but omits the control for a project not in the ZIP. */
|
|
39
43
|
function shareHtml(bytes) {
|
|
@@ -389,6 +393,48 @@ function starterSlide(archetype, language) {
|
|
|
389
393
|
: [['区域 \\ 季度', 'Q1', 'Q2', 'Q3', 'Q4'], ['华东大区', 78, 84, 91, 97], ['华南大区', 68, 75, 83, 90], ['华北大区', 62, 69, 77, 85], ['海外新兴', 44, 56, 71, 88]],
|
|
390
394
|
};
|
|
391
395
|
}
|
|
396
|
+
if (kind === 'map') {
|
|
397
|
+
return {
|
|
398
|
+
layout: 'map',
|
|
399
|
+
variant: en ? 'world' : 'china',
|
|
400
|
+
kicker: en ? 'REGIONAL FOOTPRINT' : '区域业务版图',
|
|
401
|
+
title: en ? 'Global regional hubs drive balanced revenue expansion' : '核心区域集群协同发力,华东与华南贡献主要增长',
|
|
402
|
+
items: en
|
|
403
|
+
? [
|
|
404
|
+
{ tag: 'NA', title: 'North America', value: '$42M', delta: '+28%', status: 'accent' },
|
|
405
|
+
{ tag: 'EU', title: 'Europe', value: '$29M', delta: '+22%', status: 'positive' },
|
|
406
|
+
{ tag: 'APAC', title: 'Asia-Pacific', value: '$36M', delta: '+41%', status: 'positive' },
|
|
407
|
+
{ tag: 'MEA', title: 'Middle East', value: '$12M', delta: '+54%', status: 'warning' },
|
|
408
|
+
]
|
|
409
|
+
: [
|
|
410
|
+
{ tag: '华东', title: '华东大区', value: '¥4.2亿', delta: '+34%', status: 'accent' },
|
|
411
|
+
{ tag: '华南', title: '华南大区', value: '¥3.1亿', delta: '+29%', status: 'positive' },
|
|
412
|
+
{ tag: '华北', title: '华北大区', value: '¥2.4亿', delta: '+18%', status: 'positive' },
|
|
413
|
+
{ tag: '西南', title: '西南大区', value: '¥1.5亿', delta: '+46%', status: 'warning' },
|
|
414
|
+
],
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
if (kind === 'isometric') {
|
|
418
|
+
return {
|
|
419
|
+
layout: 'isometric',
|
|
420
|
+
variant: 'stack',
|
|
421
|
+
kicker: en ? 'PLATFORM STACK' : '立体技术栈',
|
|
422
|
+
title: en ? 'Four-layer 2.5D platform architecture unifies data to delivery' : '四层 2.5D 立体架构打通从底层算力到智能应用的完整闭环',
|
|
423
|
+
items: en
|
|
424
|
+
? [
|
|
425
|
+
{ tag: 'L4', title: 'Agent Applications', text: 'Executive studio, automation & interactive delivery', status: 'accent' },
|
|
426
|
+
{ tag: 'L3', title: 'Orchestration Engine', text: 'Deterministic layout compiler & compliance gates', status: 'positive' },
|
|
427
|
+
{ tag: 'L2', title: 'Evidence & Knowledge Graph', text: 'Verified provenance ledger & brand charter lock', status: 'neutral' },
|
|
428
|
+
{ tag: 'L1', title: 'Zero-Dep Core Runtime', text: 'Native OOXML, SVG & offline HTML bundler', status: 'neutral' },
|
|
429
|
+
]
|
|
430
|
+
: [
|
|
431
|
+
{ tag: 'L4', title: '业务应用与交互层', text: '多端工作台、演讲提词台与社媒长图交付', status: 'accent' },
|
|
432
|
+
{ tag: 'L3', title: '智能编排与治理层', text: '确定性版式编译器、审美升维与 SLOP 合规门禁', status: 'positive' },
|
|
433
|
+
{ tag: 'L2', title: '证据账本与知识层', text: '多源资料融合溯源与企业品牌宪章锁', status: 'neutral' },
|
|
434
|
+
{ tag: 'L1', title: '零依赖核心引擎层', text: '原生可编辑 OOXML、矢量图示与离线 HTML', status: 'neutral' },
|
|
435
|
+
],
|
|
436
|
+
};
|
|
437
|
+
}
|
|
392
438
|
return {
|
|
393
439
|
layout: 'bullets',
|
|
394
440
|
title: en ? 'New slide key takeaway' : '请填写本页核心结论句',
|
|
@@ -416,6 +462,66 @@ function originVerdict(request) {
|
|
|
416
462
|
}
|
|
417
463
|
}
|
|
418
464
|
}
|
|
465
|
+
function computeRevisionDiff(manifest) {
|
|
466
|
+
const history = Array.isArray(manifest?.history) ? manifest.history : [];
|
|
467
|
+
if (history.length === 0)
|
|
468
|
+
return null;
|
|
469
|
+
const prev = history[history.length - 1];
|
|
470
|
+
const prevSlides = Array.isArray(prev?.slides) ? prev.slides : [];
|
|
471
|
+
const currSlides = Array.isArray(manifest?.slides) ? manifest.slides : [];
|
|
472
|
+
const prevById = new Map();
|
|
473
|
+
prevSlides.forEach((s, idx) => { if (s?.id)
|
|
474
|
+
prevById.set(s.id, { idx, slide: s }); });
|
|
475
|
+
const currById = new Map();
|
|
476
|
+
currSlides.forEach((s, idx) => { if (s?.id)
|
|
477
|
+
currById.set(s.id, { idx, slide: s }); });
|
|
478
|
+
const added = [];
|
|
479
|
+
const removed = [];
|
|
480
|
+
const modified = [];
|
|
481
|
+
currSlides.forEach((s, idx) => {
|
|
482
|
+
const prior = s?.id ? prevById.get(s.id) : undefined;
|
|
483
|
+
if (!prior) {
|
|
484
|
+
added.push({ slide: idx + 1, id: String(s?.id || ''), title: String(s?.title || ''), layout: String(s?.layout || '') });
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
const fields = [];
|
|
488
|
+
for (const key of ['layout', 'variant', 'title', 'subtitle', 'kicker', 'takeaway', 'source', 'notes', 'bullets', 'items', 'rows', 'chart', 'image', 'coverPattern', 'chrome']) {
|
|
489
|
+
if (JSON.stringify(prior.slide?.[key]) !== JSON.stringify(s?.[key]))
|
|
490
|
+
fields.push(key);
|
|
491
|
+
}
|
|
492
|
+
if (fields.length > 0) {
|
|
493
|
+
modified.push({
|
|
494
|
+
slide: idx + 1,
|
|
495
|
+
id: String(s.id),
|
|
496
|
+
title: String(s.title || ''),
|
|
497
|
+
prevTitle: String(prior.slide?.title || ''),
|
|
498
|
+
layout: String(s.layout || ''),
|
|
499
|
+
prevLayout: String(prior.slide?.layout || ''),
|
|
500
|
+
fields,
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
prevSlides.forEach((s, idx) => {
|
|
505
|
+
if (s?.id && !currById.has(s.id)) {
|
|
506
|
+
removed.push({ prevSlide: idx + 1, id: String(s.id), title: String(s.title || ''), layout: String(s.layout || '') });
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
const commonPrevOrder = prevSlides.filter(s => s?.id && currById.has(s.id)).map(s => s.id);
|
|
510
|
+
const commonCurrOrder = currSlides.filter(s => s?.id && prevById.has(s.id)).map(s => s.id);
|
|
511
|
+
const reordered = JSON.stringify(commonPrevOrder) !== JSON.stringify(commonCurrOrder);
|
|
512
|
+
const themeChanged = prev?.theme !== manifest?.theme ? { from: prev?.theme || '', to: manifest?.theme || '' } : null;
|
|
513
|
+
return {
|
|
514
|
+
fromRevision: Math.max(0, (manifest?.revision ?? 1) - 1),
|
|
515
|
+
toRevision: manifest?.revision ?? 0,
|
|
516
|
+
prevSlideCount: prevSlides.length,
|
|
517
|
+
currSlideCount: currSlides.length,
|
|
518
|
+
added,
|
|
519
|
+
removed,
|
|
520
|
+
modified,
|
|
521
|
+
reordered,
|
|
522
|
+
themeChanged,
|
|
523
|
+
};
|
|
524
|
+
}
|
|
419
525
|
export class PptWorkbench {
|
|
420
526
|
catalogPath;
|
|
421
527
|
coaching;
|
|
@@ -552,7 +658,9 @@ export class PptWorkbench {
|
|
|
552
658
|
};
|
|
553
659
|
return { ok: true, project: { ...entry, deckId: manifest.deckId, revision: manifest.revision, theme: manifest.theme ?? 'data',
|
|
554
660
|
taste: manifest.taste ?? null,
|
|
555
|
-
brand: manifest.brand ?? null,
|
|
661
|
+
brand: manifest.brand ?? null, brandKit: manifest.brandKit ?? null, evidence: Array.isArray(manifest.evidence) ? manifest.evidence : [],
|
|
662
|
+
revisionDiff: computeRevisionDiff(manifest),
|
|
663
|
+
targetMinutes: manifest.targetMinutes ?? null, paceBudget, themes, presets, tasteRecipes, slides: manifest.slides,
|
|
556
664
|
undoAvailable: manifest.history.length, quality: check, html, dataModel: manifest.dataModel ?? null,
|
|
557
665
|
assets: Object.fromEntries(Object.entries(manifest.assets ?? {}).map(([key, value]) => [key, { data: value.data, mime: value.mime }])),
|
|
558
666
|
render: currentRender ? { pageCount: currentRender.pngPaths.length, missingFonts: currentRender.missingFonts ?? [] } : null } };
|
|
@@ -603,6 +711,15 @@ export class PptWorkbench {
|
|
|
603
711
|
throw new Error('品牌设置无效:请检查 #RRGGBB 颜色、安全字体名称、页脚长度或面板上传的 PNG/JPEG Logo');
|
|
604
712
|
out[key] = item;
|
|
605
713
|
}
|
|
714
|
+
else if (key === 'watermark') {
|
|
715
|
+
if (item === null || item === '') {
|
|
716
|
+
out.watermark = '';
|
|
717
|
+
continue;
|
|
718
|
+
}
|
|
719
|
+
if (typeof item !== 'string' || item.trim().length > 48 || /[\x00-\x08\x0b\x0c\x0e-\x1f]/.test(item))
|
|
720
|
+
throw new Error('保密水印最多 48 字符且不能包含控制字符');
|
|
721
|
+
out.watermark = item.trim();
|
|
722
|
+
}
|
|
606
723
|
else if (key === 'logo') {
|
|
607
724
|
if (item === null)
|
|
608
725
|
out.logo = null;
|
|
@@ -879,14 +996,47 @@ export class PptWorkbench {
|
|
|
879
996
|
throw new Error('甘特图列头无效');
|
|
880
997
|
result.columns = item;
|
|
881
998
|
}
|
|
999
|
+
else if (key === 'evidenceIds') {
|
|
1000
|
+
if (item === null) {
|
|
1001
|
+
result.evidenceIds = undefined;
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
if (!Array.isArray(item) || item.length > 16 || item.some(id => typeof id !== 'string' || !/^[A-Za-z0-9_-]{1,24}$/.test(id.trim())))
|
|
1005
|
+
throw new Error('证据编号 evidenceIds 格式无效');
|
|
1006
|
+
result.evidenceIds = item.map(id => String(id).trim().toUpperCase());
|
|
1007
|
+
}
|
|
1008
|
+
else if (key === 'imageBrief') {
|
|
1009
|
+
if (item === null || item === '') {
|
|
1010
|
+
result.imageBrief = null;
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
if (typeof item === 'string' && item.length <= 1000) {
|
|
1014
|
+
result.imageBrief = item.trim();
|
|
1015
|
+
}
|
|
1016
|
+
else if (item && typeof item === 'object' && !Array.isArray(item)) {
|
|
1017
|
+
const b = item;
|
|
1018
|
+
if (Object.keys(b).some(k => !['prompt', 'aspect', 'mood', 'safeZone', 'style'].includes(k)))
|
|
1019
|
+
throw new Error('智能配图需求字段无效');
|
|
1020
|
+
result.imageBrief = b;
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
throw new Error('智能配图需求格式无效');
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
882
1026
|
else if (key === 'image') {
|
|
883
1027
|
if (!item || typeof item !== 'object' || Array.isArray(item))
|
|
884
1028
|
throw new Error('请选择 PNG 或 JPEG 图片');
|
|
885
1029
|
const image = item;
|
|
886
|
-
if (Object.keys(image).some(k => !['src', 'alt', 'fit', 'caption'].includes(k))
|
|
1030
|
+
if (Object.keys(image).some(k => !['src', 'assetId', 'alt', 'fit', 'focalPoint', 'caption'].includes(k)))
|
|
1031
|
+
throw new Error('图片必须从面板上传,不能读取其他本地文件');
|
|
1032
|
+
const hasValidSrc = typeof image.src === 'string' && /^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/=]+$/.test(image.src);
|
|
1033
|
+
const hasValidAsset = image.src === undefined && typeof image.assetId === 'string' && /^img-[0-9a-f]{64}$/.test(image.assetId);
|
|
1034
|
+
if (!hasValidSrc && !hasValidAsset)
|
|
887
1035
|
throw new Error('图片必须从面板上传,不能读取其他本地文件');
|
|
888
1036
|
if (['alt', 'caption'].some(k => image[k] !== undefined && (typeof image[k] !== 'string' || image[k].length > 2000)) || (image.fit !== undefined && !['contain', 'cover'].includes(String(image.fit))))
|
|
889
1037
|
throw new Error('图片说明或适应方式无效');
|
|
1038
|
+
if (image.focalPoint !== undefined && !ALLOWED_FOCAL_POINTS.has(String(image.focalPoint)))
|
|
1039
|
+
throw new Error('图片裁切焦点仅支持 center / top / bottom / left / right');
|
|
890
1040
|
result.image = item;
|
|
891
1041
|
}
|
|
892
1042
|
else
|
|
@@ -909,21 +1059,24 @@ export class PptWorkbench {
|
|
|
909
1059
|
}
|
|
910
1060
|
officeBytes(raw, fileName) {
|
|
911
1061
|
const name = typeof fileName === 'string' ? fileName.trim() : '';
|
|
912
|
-
const match = /\.(xlsx|csv|tsv|docx)$/i.exec(name);
|
|
1062
|
+
const match = /\.(xlsx|csv|tsv|docx|pdf)$/i.exec(name);
|
|
913
1063
|
if (!match || typeof raw !== 'string' || raw.length < 4) {
|
|
914
|
-
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .
|
|
1064
|
+
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv、.docx 或 .pdf 文件');
|
|
915
1065
|
}
|
|
916
1066
|
const ext = '.' + match[1].toLowerCase();
|
|
917
1067
|
const clean = raw.replace(/^data:[^;,]+(?:;[^;,]+)*;base64,/, '').replace(/\s+/g, '');
|
|
918
1068
|
if (!clean || clean.length > 34_000_000 || clean.length % 4 === 1 || !/^[A-Za-z0-9+/]+={0,2}$/.test(clean)) {
|
|
919
|
-
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .
|
|
1069
|
+
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv、.docx 或 .pdf 文件');
|
|
920
1070
|
}
|
|
921
1071
|
const bytes = Buffer.from(clean, 'base64');
|
|
922
1072
|
if (bytes.byteLength === 0 || bytes.byteLength > ABSORB_PPTX_LIMIT) {
|
|
923
|
-
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .
|
|
1073
|
+
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv、.docx 或 .pdf 文件');
|
|
924
1074
|
}
|
|
925
1075
|
if ((ext === '.xlsx' || ext === '.docx') && (bytes.byteLength < 100 || bytes[0] !== 0x50 || bytes[1] !== 0x4b)) {
|
|
926
|
-
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .
|
|
1076
|
+
throw new Error('请选择 24 MiB 以内的 .xlsx、.csv、.tsv、.docx 或 .pdf 文件');
|
|
1077
|
+
}
|
|
1078
|
+
if (ext === '.pdf' && !bytes.subarray(0, Math.min(1024, bytes.byteLength)).toString('latin1').includes('%PDF-')) {
|
|
1079
|
+
throw new Error('请选择有效的 PDF 文件');
|
|
927
1080
|
}
|
|
928
1081
|
return { bytes: new Uint8Array(bytes), ext };
|
|
929
1082
|
}
|
|
@@ -1378,8 +1531,23 @@ export class PptWorkbench {
|
|
|
1378
1531
|
};
|
|
1379
1532
|
}
|
|
1380
1533
|
if (body.operation === 'download') {
|
|
1381
|
-
if (!['html', 'pptx', 'json', 'handout', 'onepager', 'remotion'].includes(String(body.kind)))
|
|
1534
|
+
if (!['html', 'pptx', 'json', 'handout', 'onepager', 'social-carousel', 'subtitles', 'remotion', 'xlsx', 'docx', 'qa-prep'].includes(String(body.kind)))
|
|
1382
1535
|
throw new Error('不支持此文件类型');
|
|
1536
|
+
if (body.kind === 'xlsx') {
|
|
1537
|
+
if (typeof engine.renderDeckWorkbookXlsx !== 'function')
|
|
1538
|
+
throw new Error('当前引擎版本暂不支持 Excel 工作簿导出');
|
|
1539
|
+
return { ok: true, name: basename(entry.path, '.json') + '.xlsx', data: engine.renderDeckWorkbookXlsx(manifest).toString('base64') };
|
|
1540
|
+
}
|
|
1541
|
+
if (body.kind === 'docx') {
|
|
1542
|
+
if (typeof engine.renderDeckReportDocx !== 'function')
|
|
1543
|
+
throw new Error('当前引擎版本暂不支持 Word 文档导出');
|
|
1544
|
+
return { ok: true, name: basename(entry.path, '.json') + '.docx', data: engine.renderDeckReportDocx(manifest, manifest.language).toString('base64') };
|
|
1545
|
+
}
|
|
1546
|
+
if (body.kind === 'qa-prep') {
|
|
1547
|
+
if (typeof engine.renderQaPrepMarkdown !== 'function')
|
|
1548
|
+
throw new Error('当前引擎版本暂不支持会前质询预案导出');
|
|
1549
|
+
return { ok: true, name: basename(entry.path, '.json') + '.qa-prep.md', data: Buffer.from(engine.renderQaPrepMarkdown(manifest, manifest.language), 'utf8').toString('base64') };
|
|
1550
|
+
}
|
|
1383
1551
|
if (body.kind === 'handout') {
|
|
1384
1552
|
const handoutPath = files.json.slice(0, -5) + '.handout.md';
|
|
1385
1553
|
if (existsSync(handoutPath))
|
|
@@ -1393,6 +1561,22 @@ export class PptWorkbench {
|
|
|
1393
1561
|
: renderOnePagerHtmlFallback(manifest, manifest.language);
|
|
1394
1562
|
return { ok: true, name: basename(entry.path, '.json') + '-onepager.html', data: Buffer.from(html, 'utf8').toString('base64') };
|
|
1395
1563
|
}
|
|
1564
|
+
if (body.kind === 'social-carousel') {
|
|
1565
|
+
if (typeof engine.renderSocialCarouselHtml !== 'function')
|
|
1566
|
+
throw new Error('当前引擎版本暂不支持社媒长图卡片导出');
|
|
1567
|
+
const ratio = body.ratio === '1:1' ? '1:1' : '4:5';
|
|
1568
|
+
const html = engine.renderSocialCarouselHtml(manifest, { ratio, lang: manifest.language });
|
|
1569
|
+
return { ok: true, name: basename(entry.path, '.json') + '-carousel.html', data: Buffer.from(html, 'utf8').toString('base64') };
|
|
1570
|
+
}
|
|
1571
|
+
if (body.kind === 'subtitles') {
|
|
1572
|
+
const fmt = body.format === 'vtt' ? 'vtt' : 'srt';
|
|
1573
|
+
const text = fmt === 'vtt'
|
|
1574
|
+
? (typeof engine.renderSubtitlesVtt === 'function' ? engine.renderSubtitlesVtt(manifest, manifest.language) : '')
|
|
1575
|
+
: (typeof engine.renderSubtitlesSrt === 'function' ? engine.renderSubtitlesSrt(manifest, manifest.language) : '');
|
|
1576
|
+
if (!text)
|
|
1577
|
+
throw new Error('当前引擎版本暂不支持配音字幕导出');
|
|
1578
|
+
return { ok: true, name: basename(entry.path, '.json') + '.' + fmt, data: Buffer.from(text, 'utf8').toString('base64') };
|
|
1579
|
+
}
|
|
1396
1580
|
if (body.kind === 'remotion') {
|
|
1397
1581
|
const themeObj = typeof engine.resolveTheme === 'function' ? engine.resolveTheme(manifest.theme) : undefined;
|
|
1398
1582
|
const pace = typeof engine.computePaceBudget === 'function'
|
|
@@ -1404,6 +1588,10 @@ export class PptWorkbench {
|
|
|
1404
1588
|
themeTokens: (themeObj?.palette ?? {}),
|
|
1405
1589
|
paceBudget: pace,
|
|
1406
1590
|
});
|
|
1591
|
+
if (typeof engine.renderSubtitlesSrt === 'function')
|
|
1592
|
+
bundle.files['captions.srt'] = engine.renderSubtitlesSrt(manifest, manifest.language);
|
|
1593
|
+
if (typeof engine.renderSubtitlesVtt === 'function')
|
|
1594
|
+
bundle.files['captions.vtt'] = engine.renderSubtitlesVtt(manifest, manifest.language);
|
|
1407
1595
|
const zipEntries = Object.fromEntries(Object.entries(bundle.files).map(([k, v]) => [k, strToU8(v)]));
|
|
1408
1596
|
const zipped = zipSync(zipEntries, { level: 0 });
|
|
1409
1597
|
return { ok: true, name: basename(entry.path, '.json') + '-remotion.zip', data: Buffer.from(zipped).toString('base64') };
|
|
@@ -1540,6 +1728,16 @@ export class PptWorkbench {
|
|
|
1540
1728
|
const selected = view.project.slides[Math.min(originalIndex + (body.operation === 'duplicate' ? 1 : 0), view.project.slides.length - 1)].id;
|
|
1541
1729
|
return { ...view, selected };
|
|
1542
1730
|
}
|
|
1731
|
+
if (body.operation === 'remix') {
|
|
1732
|
+
const preset = typeof body.preset === 'string' ? body.preset.trim().toLowerCase() : 'exec-5min';
|
|
1733
|
+
if (!ALLOWED_REMIX_PRESETS.has(preset))
|
|
1734
|
+
throw new Error('改编预设仅支持 exec-5min / board-brief / sales-pitch');
|
|
1735
|
+
const result = typeof engine.remixDeck === 'function'
|
|
1736
|
+
? await engine.remixDeck({ deckPath: entry.path, preset, expectedRevision: body.expectedRevision, saveAs: body.saveAs !== false, signal })
|
|
1737
|
+
: await engine.editDeck({ deckPath: entry.path, remixPreset: preset, expectedRevision: body.expectedRevision, saveAs: body.saveAs !== false, signal });
|
|
1738
|
+
await this.remember(result, { remixPreset: preset });
|
|
1739
|
+
return { ...await this.view(digest(result.jsonPath)), originalId: entry.id, remixReport: result.remixReport ?? null };
|
|
1740
|
+
}
|
|
1543
1741
|
if (body.operation === 'undo') {
|
|
1544
1742
|
const result = await engine.undoDeck({ deckPath: entry.path, expectedRevision: body.expectedRevision, signal });
|
|
1545
1743
|
await this.remember(result, {});
|
|
@@ -1555,7 +1753,7 @@ export class PptWorkbench {
|
|
|
1555
1753
|
return denied;
|
|
1556
1754
|
try {
|
|
1557
1755
|
const params = new URL(request.url).searchParams, kind = params.get('kind');
|
|
1558
|
-
if (!['html', 'pptx', 'json', 'bundle', 'share', 'notes', 'handout', 'onepager', 'remotion', 'pdf', 'png-zip', 'coaching', 'data', 'visual'].includes(String(kind)))
|
|
1756
|
+
if (!['html', 'pptx', 'json', 'bundle', 'share', 'notes', 'handout', 'onepager', 'social-carousel', 'subtitles', 'remotion', 'pdf', 'png-zip', 'coaching', 'data', 'visual'].includes(String(kind)))
|
|
1559
1757
|
return fail(400, '不支持此文件类型');
|
|
1560
1758
|
const { entry, manifest, files, engine } = await this.project(params.get('id'));
|
|
1561
1759
|
if (String(manifest.revision) !== params.get('revision'))
|
|
@@ -1597,6 +1795,24 @@ export class PptWorkbench {
|
|
|
1597
1795
|
bytes = strToU8(html);
|
|
1598
1796
|
name = basename(entry.path, '.json') + '-onepager.html';
|
|
1599
1797
|
}
|
|
1798
|
+
else if (kind === 'social-carousel') {
|
|
1799
|
+
if (typeof engine.renderSocialCarouselHtml !== 'function')
|
|
1800
|
+
return fail(400, '当前引擎版本暂不支持社媒长图卡片导出');
|
|
1801
|
+
const ratio = params.get('ratio') === '1:1' ? '1:1' : '4:5';
|
|
1802
|
+
const html = engine.renderSocialCarouselHtml(manifest, { ratio, lang: manifest.language });
|
|
1803
|
+
bytes = strToU8(html);
|
|
1804
|
+
name = basename(entry.path, '.json') + '-carousel.html';
|
|
1805
|
+
}
|
|
1806
|
+
else if (kind === 'subtitles') {
|
|
1807
|
+
const fmt = params.get('format') === 'vtt' ? 'vtt' : 'srt';
|
|
1808
|
+
const text = fmt === 'vtt'
|
|
1809
|
+
? (typeof engine.renderSubtitlesVtt === 'function' ? engine.renderSubtitlesVtt(manifest, manifest.language) : '')
|
|
1810
|
+
: (typeof engine.renderSubtitlesSrt === 'function' ? engine.renderSubtitlesSrt(manifest, manifest.language) : '');
|
|
1811
|
+
if (!text)
|
|
1812
|
+
return fail(400, '当前引擎版本暂不支持配音字幕导出');
|
|
1813
|
+
bytes = strToU8(text);
|
|
1814
|
+
name = basename(entry.path, '.json') + '.' + fmt;
|
|
1815
|
+
}
|
|
1600
1816
|
else if (kind === 'remotion') {
|
|
1601
1817
|
const themeObj = typeof engine.resolveTheme === 'function' ? engine.resolveTheme(manifest.theme) : undefined;
|
|
1602
1818
|
const pace = typeof engine.computePaceBudget === 'function'
|
|
@@ -1608,6 +1824,10 @@ export class PptWorkbench {
|
|
|
1608
1824
|
themeTokens: (themeObj?.palette ?? {}),
|
|
1609
1825
|
paceBudget: pace,
|
|
1610
1826
|
});
|
|
1827
|
+
if (typeof engine.renderSubtitlesSrt === 'function')
|
|
1828
|
+
bundle.files['captions.srt'] = engine.renderSubtitlesSrt(manifest, manifest.language);
|
|
1829
|
+
if (typeof engine.renderSubtitlesVtt === 'function')
|
|
1830
|
+
bundle.files['captions.vtt'] = engine.renderSubtitlesVtt(manifest, manifest.language);
|
|
1611
1831
|
const zipEntries = Object.fromEntries(Object.entries(bundle.files).map(([k, v]) => [k, strToU8(v)]));
|
|
1612
1832
|
bytes = zipSync(zipEntries, { level: 0 });
|
|
1613
1833
|
name = basename(entry.path, '.json') + '-remotion.zip';
|
|
@@ -1695,10 +1915,31 @@ export class PptWorkbench {
|
|
|
1695
1915
|
if ((await this.project(entry.id)).manifest.revision !== manifest.revision)
|
|
1696
1916
|
return fail(409, '项目已被修改,请重新打开后下载');
|
|
1697
1917
|
const archive = kind === 'bundle' || kind === 'share' || kind === 'remotion' || kind === 'png-zip';
|
|
1698
|
-
const type = ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind))
|
|
1918
|
+
const type = ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind))
|
|
1919
|
+
? 'text/markdown; charset=utf-8'
|
|
1920
|
+
: kind === 'subtitles'
|
|
1921
|
+
? 'text/plain; charset=utf-8'
|
|
1922
|
+
: archive
|
|
1923
|
+
? 'application/zip'
|
|
1924
|
+
: kind === 'pdf'
|
|
1925
|
+
? 'application/pdf'
|
|
1926
|
+
: kind === 'pptx'
|
|
1927
|
+
? 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
|
1928
|
+
: (kind === 'html' || kind === 'onepager' || kind === 'social-carousel')
|
|
1929
|
+
? 'text/html; charset=utf-8'
|
|
1930
|
+
: 'application/json; charset=utf-8';
|
|
1931
|
+
const fallbackExt = archive
|
|
1932
|
+
? 'zip'
|
|
1933
|
+
: ['notes', 'handout', 'coaching', 'data', 'visual'].includes(String(kind))
|
|
1934
|
+
? 'md'
|
|
1935
|
+
: (kind === 'onepager' || kind === 'social-carousel')
|
|
1936
|
+
? 'html'
|
|
1937
|
+
: kind === 'subtitles'
|
|
1938
|
+
? (params.get('format') === 'vtt' ? 'vtt' : 'srt')
|
|
1939
|
+
: kind;
|
|
1699
1940
|
return new Response(new Uint8Array(bytes), { headers: {
|
|
1700
1941
|
'content-type': type, 'cache-control': 'no-store', 'x-content-type-options': 'nosniff',
|
|
1701
|
-
'content-disposition': `attachment; filename="presentation.${
|
|
1942
|
+
'content-disposition': `attachment; filename="presentation.${fallbackExt}"; filename*=UTF-8''${encodeURIComponent(name)}`,
|
|
1702
1943
|
} });
|
|
1703
1944
|
}
|
|
1704
1945
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ppt",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DeepSeek Harness
|
|
3
|
+
"version": "0.35.0",
|
|
4
|
+
"description": "DeepSeek Harness 大师级演示文稿引擎与工作台:支持三模路由(有资料直出 / 零资料 8 域权威深研 / Mode C 本地多源融合+外源对标)、企业品牌宪章锁(SLOP-13/14)、41 种原生可编辑图谱(MECE 议题树/Treemap/OKR 子弹仪/三档报价/点阵地图/2.5D 等轴测/Mermaid/公式/代码)、24 主题 / 20 标杆范本、逆向导出 Excel/Word/备忘录/答辩预案/无损翻译包、企业金页库拼装与离线 R 键审阅回流。欢迎 PR 与 Issues。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
package/skills/dsh-ppt/SKILL.md
CHANGED
|
@@ -1,84 +1,87 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dsh-ppt
|
|
3
|
-
description: "Turn one sentence, a zero-material research topic, a Markdown document, structured slides, Office
|
|
3
|
+
description: "Turn one sentence, a zero-material research topic, a Markdown document, structured slides, mixed Office/photo packs (.xlsx/.csv/.docx/.pdf/.png), or a benchmark .pptx corpus into a world-class presentation deck: standalone HTML web slideshow (with Dual-Screen Presenter Console, Executive One-Pager, Ctrl+K Jump, D Pen, T Timer, A Auto-Tour & R Offline Review Feedback) + 100% native-editable PPTX (with Tri-Mode Routing A/B/C, 8-Domain Authoritative Research Query Engine & SLOP-13/14 Compliance Gates, 20 Curated Gold Exemplars & Zero-LLM Self-Repair Loop, 41 canonical native-editable layouts + 53 aliases including MECE issue-tree, squarified treemap, Stephen Few OKR gauge, Good/Better/Best pricing, World/China dotted maps, 2.5D isometric stack/pillars, Mermaid connectors, native <m:oMath> formulas, 9-language code terminals, device mockups, Magic Quadrant, Radar, Dumbbell, Heatmap, Marimekko, Sankey, Value Chain & SWOT) + project manifest + reverse companion exports (.xlsx/.docx/.qa-prep.md/.memo.md/.i18n.json), Workspace Slide Bank & Multi-Deck Composer, and 100% layout-lossless i18n. Supports 13 tools, 24 themes, 6 Master Chrome Skeletons, 8 Taste Recipes, 20 industry blueprints, 13 publication-grade charts, and 61 native <a:custGeom> vector icons. 中文:支持三模路由(直出 / 零资料 8 域权威深研 / Mode C 本地多源+外源对标)、41 种原生可编辑图谱、企业品牌宪章锁(SLOP-13/14)、逆向导出 Excel/Word/答辩预案/无损翻译包与离线 R 键审阅回流。"
|
|
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
|
---
|
|
7
7
|
|
|
8
8
|
# dsh-ppt
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
一句话、一篇文档、一组混合 Office/照片素材包或一份参考 `.pptx` → **大师级可交付演示文稿(独立 HTML 网页放映 + 100% 原生可编辑 PPTX + 工程 JSON + 可选配套 `.xlsx`/`.docx`/`.qa-prep.md`/`.memo.md`/`.i18n.json`)**。本文件负责审美总纲、三模路由与交付纪律;具体语法与专项 SOP 按需读取 `references/`。
|
|
11
11
|
|
|
12
12
|
## 触发条件
|
|
13
13
|
|
|
14
|
-
用户要做 PPT / 幻灯片 / 演示文稿 / deck / keynote / 汇报 / 述职 / 提案 / 路演 / 答辩 / 课件 /
|
|
14
|
+
用户要做 PPT / 幻灯片 / 演示文稿 / deck / keynote / 汇报 / 述职 / 提案 / 路演 / 答辩 / 课件 / 培训材料,或希望融合本地 Word/Excel/PDF/照片、结合外部权威资料对标,或吸收参考 `.pptx` 风格来制作新文稿。
|
|
15
15
|
|
|
16
16
|
## 核心审美哲学:品味内建(零品味负担)
|
|
17
17
|
|
|
18
18
|
普通用户无法分辨底层版式栅格、对比度或图表噪音——**你就是首席艺术总监,默认输出必须直接达到麦肯锡咨询 / Apple 发布会 / Nature 学术答辩 / 现代故宫霁蓝政务水准**:
|
|
19
19
|
|
|
20
|
-
1. **零追问场景定调(Zero-Question Auto-Director)**:用户说“帮我做个汇报 PPT”时,**不要反问一堆设计参数**。直接根据内容语义识别六大画像(商业咨询、政务述职、学术答辩、科技路演、教育讲义、人文品牌),传 `theme: 'auto'` 或显式匹配 24
|
|
20
|
+
1. **零追问场景定调(Zero-Question Auto-Director)**:用户说“帮我做个汇报 PPT”时,**不要反问一堆设计参数**。直接根据内容语义识别六大画像(商业咨询、政务述职、学术答辩、科技路演、教育讲义、人文品牌),传 `theme: 'auto'` 或显式匹配 **24 套大师主题(16 浅 8 深**,含 `bcg-emerald`、`economist-brief`、`venture-daylight`、`stripe-craft`、`aurora-stage`、`obsidian-amber`、`keynote-light`、`financial-ft`、`medical-clean`、`luxury-noir`)。**明亮投影优先**:会议室汇报、政企述职、学术答辩、教学课件一律优先选用 16 套浅底主题(通用默认 `consulting` 蔚蓝战略),绝不在常规办公场景盲目套用纯黑赛博风 `data`!并按场景自动匹配 **6 套差异化母版骨架(`chromeStyle`:`consulting-classic` / `keynote-spatial` / `editorial-folio` / `saas-bento` / `academic-minimal` / `gov-ceremonial`)**,彻底告别「一套模板换颜色」。
|
|
21
21
|
2. **结论先行(Action Titles)**:除封面、目录与章节页外,每页标题必须是**完整的结论判断句**(如「异步评审将工程师周均例会耗时压缩 75%」),严禁使用「项目背景」「数据分析」「周末到馆人次」等空洞名词标签。
|
|
22
|
-
3. **版式节奏与反要点墙(Anti-Bullet-Wall)**:优先传**结构化 `slides`**(或使用
|
|
23
|
-
4.
|
|
24
|
-
5. **20 套标杆范本槽位填空 + 标杆弧线重排(`alignOrder: true`)+ 零模型自检修复闭环**:不要从零发明排版!直接传 `exemplar: 'auto'` 智能匹配或从内置 **20 套标杆范本**(8 套核心场景 + 12 套源自 Apache-2.0 / MIT / CC-BY-4.0 开源 GitHub 优质 `.pptx`
|
|
25
|
-
6. **8 套大师品味配方(Taste Recipes
|
|
22
|
+
3. **版式节奏与反要点墙(Anti-Bullet-Wall)**:优先传**结构化 `slides`**(或使用 `:::` 容器指令)充分利用 **41 种原生可编辑版式(36 核心 + 5 媒体,含 53 别名)**。**整套文稿严禁连续超过 2 页使用普通 `bullets` 要点列表**;8 页以上文稿须有节奏地交替视觉密度(拆解战略因果用 **`issue-tree`** MECE 逻辑议题树、预算/营收占比用 **`treemap`** 矩形树图、OKR/实绩达标用 **`gauge`** 水平子弹仪、商业套餐选型用 **`pricing`** 三档报价矩阵、地理分布用 `map`、3D 架构用 `isometric`、指标用 `kpi`、排期用 `gantt`、系统分层用 `architecture`、竞品能力用 `harvey`、市场空间用 `tam`、组织用 `org`、并列支柱用 `cards[pillars/bento]`、痛点整改用 `comparison[issue-action]`、演进闭环用 `process[timeline/steps/flywheel/funnel]`、四象限用 `matrix`/`quadrant`、数据配洞察用 `chart-split`、学术对比用 `table[booktabs]` 三线表)。
|
|
23
|
+
4. **出版级图表与三线表**:支持 **13 类出版级原生图表**,单系列图表自动隐藏冗余图例,使用 `spotlight: true` / `highlight: 'max' | 'last'` 突出焦点色柱、其余灰阶退后,按需叠加 `referenceLine` 基准虚线与 `showGrowthCallout: true` 麦肯锡增长飞线批注,左下角附 `source` 数据来源;学术与严谨数据对比使用无竖线的 `booktabs` 三线表。
|
|
24
|
+
5. **20 套标杆范本槽位填空 + 标杆弧线重排(`alignOrder: true`)+ 零模型自检修复闭环**:不要从零发明排版!直接传 `exemplar: 'auto'` 智能匹配或从内置 **20 套标杆范本**(8 套核心场景 + 12 套源自 Apache-2.0 / MIT / CC-BY-4.0 开源 GitHub 优质 `.pptx` 经实机渲染甄选蒸馏的标杆)中择一,先调 `ppt_templates({ exemplarId })` 获取逐页槽位契约与 **Few-Shot JSON 样板**,再按槽位调用 `ppt_create({ exemplar, alignOrder: true, ... })`;引擎内置 **确定性弱模型补偿器 + 落盘前两轮 `checkManifest`/`SLOP-01..14` 零模型自检修复闭环(`autoUpgrade`,默认开启)**,即使输入为乱序粗糙 `bullets` / 碎块饼图 / 超载指标 / 刺眼配色也能以 0 额外模型开销 100% 无损升维修复。用户手头有优质 `.pptx` 目录时,调 `ppt_absorb({ pptxPath: "<目录路径>" })`(或 CLI `--ingest-exemplars <dir>`)批量沉淀至 `.dsh-ppt/exemplars.json` 与 `.dsh-ppt/taste-recipes.json`。
|
|
25
|
+
6. **8 套大师品味配方(Taste Recipes)、61 枚原生矢量图标与单份母版吸收**:可独立选用 `taste: 'mckinsey-partner' | 'apple-keynote-dark' | 'apple-keynote-light' | 'swiss-editorial' | 'linear-craft' | 'ft-data-journal' | 'nature-academic' | 'oriental-zen'` 驱动 4 套海报封面、4 种卡片材质与 **61 枚原生 `<a:custGeom>` 矢量图标**;单份标杆 `.pptx` 用 `ppt_absorb`(`saveTasteAs` / `saveExemplarAs` / `saveBrandKit`)或 `referencePptx` + `cloneStructure: true` 吸收。
|
|
26
26
|
|
|
27
27
|
## 执行纪律(每次都要遵守)
|
|
28
28
|
|
|
29
29
|
- **默认零额外模型开销直接交付**:不自动触发 AI 预审、模拟答辩或视觉看图修复。用户可在 DSH 设置页主动开启可选 AI 预审/答辩或「视觉检查与修复」(支持最高 24 页全量审查与 12 种无损版式/字号修复);AI 演练不等于事实核验,不编造实验、数据或引用;采纳建议默认另存副本,原件保留。模型失败、截断、停止或未检查页面必须如实说明,不能声称视觉通过。
|
|
30
|
-
- **数字溯源与推演纪律**:需要解释数字来源或现场滑块推演时,提供 `dataModel`
|
|
30
|
+
- **数字溯源与推演纪律**:需要解释数字来源或现场滑块推演时,提供 `dataModel`(或在 `ppt_from_office` 中传 `bindDataModel: true` 自动绑定 Excel 数值表)并在 `slides` 绑定 `{{metricId}}`;先读 `references/data.md`。`source` 必须对应真实材料行或单元格,假设用 `kind: 'input'` 标注,禁止虚构来源。修改数据先 `ppt_data(action: 'preview')`,展示差异并获确认后带凭证 `apply`(默认 `saveAs: true`)。
|
|
31
31
|
- **工程安全与版本锁**:修改已有工程先 `ppt_check` 获取当前 `revision` 与页面 ID。外部手工改过的 HTML/PPTX 或缺少校验记录的旧工程不可被 `ppt_edit` 静默覆盖;若用户在 PowerPoint / WPS 中修改了 `.pptx` 并希望同步回工程,请使用 **`ppt_import`(传 `projectId`)或 CLI `--sync-pptx`**,自动在 `.history/` 留存快照并用 `ppt_undo` 可逆回导;需要全新翻新外部 `.pptx` 时使用 `ppt_import`(CLI `--import-pptx`)。风格提取仍可使用只读 `ppt_absorb` / `referencePptx`。
|
|
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`)控制播放器界面与默认标签;跨语种或中英双语化现有工程时,先导出 `exports: ['i18n']` 翻译槽位再用 `ppt_edit({ translations, bilingualMode, targetLang })` 无损回填,避免重写整份 JSON 破坏图表与配图。
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## 核心流水线(三模路由:Mode A / Mode B / Mode C)
|
|
36
36
|
|
|
37
|
-
- **Mode A
|
|
38
|
-
- **Mode B
|
|
37
|
+
- **Mode A(有资料直出)**:用户已给出完整文档、大纲、表格、数据或参考 `.pptx` 且无需外源对标时,零追问自动定调并直接生成可交付三件套。
|
|
38
|
+
- **Mode B(零资料 8 域权威深研策划)**:用户**没有资料**、只给主题或明确要求「先去搜资料、核验准确性、先策划 PPT 方案再生成」时,**严禁凭训练记忆编造具体统计数字**!必须先读 `references/research-plan.md`,按四步闭环执行:① 调 `ppt_templates({ topic })`(或 CLI `--plan`)获取 8 大领域专属 `site:` + `filetype:pdf` + `-site:` 3 轮权威检索包与标杆分镜 → ② 用宿主 Agent 联网搜索工具开展 3 轮一手源检索与双源交叉核验,沉淀带 `origin` / `tier` / `claimType` / `date` 的 `evidence[]` 账本 → ③ 向用户展示策划方案并获确认(除非用户明示跳过确认直出)→ ④ 带 `evidence[]` + `evidenceAppendix: true` 调 `ppt_create` 出稿并通过 `SLOP-13` 代码级信源审计。
|
|
39
|
+
- **Mode C(本地混合素材包 × 权威外源对标 + 定制编排)**:用户给了本地 `.docx`/`.xlsx`/`.pdf`/照片,并附带具体编排要求或需要补充行业规模、竞品财报、官方政策等外部权威数据时,先读 `references/office-pack.md`:① 调 `ppt_from_office({ filePath, inspectOnly: true, instructions })` 获取低 Token 的 **Material Dossier(精炼素材档案)** 与 **`enrichmentPlan`**(含本地 `[E1..Ek]` 与顺延外部起始编号 `nextEvidenceId`)→ ② 按需跑 Tier 1/2 权威外源检索补齐外部 `evidence[]`(标注 `origin: 'web-research'`, `tier: 1 | 2`)→ ③ 调 `ppt_create` 或 `ppt_from_office({ evidence, instructions, maxSlides, includeSheets, photoRoles, bindDataModel: true })` 双轨融合成稿。
|
|
39
40
|
|
|
40
|
-
1. **Probe & Auto-Direct
|
|
41
|
+
1. **Probe & Auto-Direct 定调**:读入用户资料(或 Mode B/C 核验后的证据账本与素材档案),静默判定听众与六大画像(见 `references/themes.md`)。若用户给了参考 `.pptx`,调 `ppt_absorb` 查看提取结果或在创建时传 `referencePptx`。Mode A 一句话输入不反问,直接推断并生成完整成品。
|
|
41
42
|
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`)。
|
|
42
|
-
3. **Theme 选主题与骨架**:不确定时在 `ppt_create` 传 `theme: 'auto'`(自动路由至明亮高质感场景主题与匹配骨架),或从 **24 套内置主题**中精确指定(调 `ppt_themes` 查看),并可通过 `brand.chromeStyle` 或单页 `chrome` 覆盖 6
|
|
43
|
+
3. **Theme 选主题与骨架**:不确定时在 `ppt_create` 传 `theme: 'auto'`(自动路由至明亮高质感场景主题与匹配骨架),或从 **24 套内置主题**中精确指定(调 `ppt_themes` 查看),并可通过 `brand.chromeStyle` 或单页 `chrome` 覆盖 **6 套母版骨架**。
|
|
43
44
|
- **重要 CLI 差异**:跨 harness 直接运行 `build-deck.mjs` 时,裸 CLI 缺省 `--theme` 为兼容旧脚本仍回退 `data`,因此 **CLI 调用请务必显式传 `--theme auto` 或具体场景主题 ID(如 `--theme consulting` / `--theme exec-jilan`)**!
|
|
44
|
-
4. **Build 生成**:先读 `references/syntax.md`(用到图表/多图/外源母版/编辑时读 `references/advanced.md`)。
|
|
45
|
-
- **推荐方式(DSH 内)**:调 `ppt_create`,优先传结构化 `slides`(精确控制 **
|
|
46
|
-
- **跨 harness CLI**:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --slides @slides.json --theme auto --lang zh --out dist
|
|
47
|
-
- 动效默认 `motion: 'on'
|
|
48
|
-
5. **Verify
|
|
49
|
-
6. **Deliver 交付**:向用户提供 `.html`、`.pptx`、`.json`(默认严格保持三件套,仅在传 `--handout` / `--one-pager`
|
|
45
|
+
4. **Build 生成**:先读 `references/syntax.md`(用到图表/多图/外源母版/编辑时读 `references/advanced.md`,用到本地多源包/导出/拼装/翻译时读 `references/office-pack.md`)。
|
|
46
|
+
- **推荐方式(DSH 内)**:调 `ppt_create`,优先传结构化 `slides`(精确控制 **41 种原生可编辑版式**,含 `issue-tree / treemap / gauge / pricing / map / isometric / gantt / architecture / harvey / tam / org / quadrant / radar / dumbbell / heatmap / mockup / code / mermaid / kpi / cards / comparison / matrix / process / chart-split / table[booktabs] / callout`),或传带 `:::` 指令的 Markdown `content`;跨工程复用金页用 `mergeSources`(配合 `ppt_edit({ saveToBank })`)。
|
|
47
|
+
- **跨 harness CLI**:`node <skill-dir>/scripts/build-deck.mjs --title "标题" --slides @slides.json --theme auto --lang zh --out dist`(直吞混合素材包用 `--from-office ./pack --inspect-only` 或 `--instructions "..." --bind-data`;配套逆向导出用 `--export xlsx,docx,qa-prep,memo,i18n`;跨工程拼装用 `--merge @sources.json`;无损翻译用 `--edit deck.json --translate @en.json --bilingual`;吸收参考模板用 `--reference-pptx ref.pptx --clone-structure`)。
|
|
48
|
+
- 动效默认 `motion: 'on'`,可用 `motionProfile: 'subtle' | 'executive' | 'keynote'` 与单页 `reveal: 'step'` 控制分步点击显现(HTML + PPTX 原生 `<p:timing>` 同构);严肃政企公文、学术打印或归档传 `motion: 'off'`。
|
|
49
|
+
5. **Verify 校验、看图修正与离线 `R` 键审阅回流**:调 `ppt_check` 检查结构、字数密度、WCAG 对比度与 `SLOP-01..14` 审美/合规告警;若收到审阅人从独立 HTML 按 **`R`** 键导出的 `review-feedback.json`,传 `ppt_check({ deckPath, feedbackPath })`(CLI `--check deck.json --feedback review-feedback.json`)直接定位逐页 `stakeholder-feedback` 批注并用 `ppt_edit` 修订。若安装了 `@deepseek-ai/libreoffice-kit`,调 `ppt_render` 生成逐页 PNG/PDF 并附 `renderReceipt` 复检,逐张用看图工具核查画面(0 缺字、0 溢出、0 遮挡、0 冗余图例)。微调文字、切换主题、收藏金页或无损翻译用 `ppt_edit`(带 `expectedRevision`),需要时 `ppt_undo`。静态估算、渲染成功与视觉验收必须分开如实陈述。
|
|
50
|
+
6. **Deliver 交付**:向用户提供 `.html`、`.pptx`、`.json`(默认严格保持三件套,仅在传 `exports: [...]` 或 `--export` / `--handout` / `--one-pager` 时同步落盘配套 `.xlsx` 数据工作簿、`.docx` Word 文档、`.qa-prep.md` 会前质询预案、`.memo.md` 高管备忘录、`.i18n.json` 翻译槽位包、`.handout.md`、`.onepager.html`、`.carousel.html`、`.srt`)绝对路径;说明 HTML 快捷键(`← →` 翻页/分步步进 · **`P` 双屏提词台** · **`R` 离线审阅批注并导出 JSON 给 AI 修订** · **`Ctrl/Cmd+K` 全局速搜** · **`D` 白板画笔** · **`T` Q&A 倒计时** · **`A` 自动字幕导览** · **`L` 激光笔** · `F` 全屏 · `G` 总览 · `S` 备注);说明 PPTX 100% 原生可编辑特性及 `ppt_import` / `--sync-pptx` 双向导回能力。
|
|
50
51
|
|
|
51
52
|
## 按需装载索引
|
|
52
53
|
|
|
53
54
|
| 何时必读 | 参考文件 | 核心内容 |
|
|
54
55
|
| --- | --- | --- |
|
|
55
|
-
|
|
|
56
|
+
| **本地混合素材包、Mode C 混源深研、逆向导出/拼装/无损翻译/R 键回流** | `references/office-pack.md` | `inspectOnly` 素材档案与 `enrichmentPlan`、需求驱动 Office/照片编排与防裁歪、`exports[]`(`xlsx/docx/qa-prep/memo/i18n`)、Slide Bank + `mergeSources`、无损双语、`reveal: 'step'` 与 `R` 键反馈闭环 |
|
|
57
|
+
| **零资料/混源联网调研、8 域权威检索与 `SLOP-13` 核验** | `references/research-plan.md` | 三模路由(Mode A/B/C)、8 大领域 `site:` + `filetype:pdf` + `-site:` 检索包、`classifySourceAuthority` T1/T2/T3、`SLOP-13` 9 项门禁与 `brand-kit.json` `preferredSources`/`blockedDomains` |
|
|
56
58
|
| 按标杆范本槽位填空或批量投喂 `.pptx` 语料 | `references/exemplars.md` | 20 套标杆范本槽位契约、`ppt_templates(exemplarId)`、批量 `--ingest-exemplars` 与弱模型升维补偿器 |
|
|
57
59
|
| 写大纲、标题与正文前 | `references/copywriting.md` | 六大画像叙事骨架、Action Title 写法、字数预算、反空话与双语规范 |
|
|
58
|
-
| 选主题、配色、骨架或吸收母版 | `references/themes.md` |
|
|
59
|
-
| 写结构化 `slides` 或扩展 Markdown | `references/syntax.md` |
|
|
60
|
-
| 图表、图片、吸收 `.pptx`、编辑与渲染 | `references/advanced.md` | 13 类出版级图表、瀑布图、`ppt_absorb`/`referencePptx`/`cloneStructure`、
|
|
61
|
-
| 数字溯源、公式与现场推演 | `references/data.md` | `dataModel`
|
|
60
|
+
| 选主题、配色、骨架或吸收母版 | `references/themes.md` | 24 套大师主题色板(16 浅 8 深)、6 套母版骨架(Chrome)、语义 Token、六大画像选型树 |
|
|
61
|
+
| 写结构化 `slides` 或扩展 Markdown | `references/syntax.md` | 41 种原生可编辑版式(36 核心 + 5 媒体,含 `issue-tree`/`treemap`/`gauge`/`pricing`)+ 53 别名、`items` 结构、`:::` 容器指令、三线表与 `takeaway` |
|
|
62
|
+
| 图表、图片、吸收 `.pptx`、编辑与渲染 | `references/advanced.md` | 13 类出版级图表、瀑布图、`ppt_absorb`/`referencePptx`/`cloneStructure`、20 套蓝图、Vision QA 与 CLI |
|
|
63
|
+
| 数字溯源、公式与现场推演 | `references/data.md` | `dataModel` 源绑定(含 `bindDataModel: true`)、公式约束、全字段 `{{metricId}}` 联动与预览确认流 |
|
|
62
64
|
| 遇到报错或渲染异常 | `references/troubleshooting.md` | 症状 → 根因与处理速查表 |
|
|
63
65
|
|
|
64
|
-
## 质量与反土味门禁(SLOP-01..
|
|
66
|
+
## 质量与反土味门禁(SLOP-01..14,交付前逐项核对)
|
|
65
67
|
|
|
66
68
|
- [ ] **SLOP-01 结论标题**:内容页与图表页标题均为完整判断句(Action Title),无「项目背景 / 数据图表 / 总结」等纯名词短标题。
|
|
67
69
|
- [ ] **SLOP-02 章节面包屑**:`kicker` 体现章节脉络(如 `01 · 增长引擎`),未连续多页硬编码重复「要点 / Point」。
|
|
68
|
-
- [ ] **SLOP-03 拒绝要点墙**:单页普通 bullets ≤ 5 条;无连续 > 2 页 `bullets` 版式,并列信息已升格为 `kpi / cards / comparison / process / matrix`。
|
|
70
|
+
- [ ] **SLOP-03 拒绝要点墙**:单页普通 bullets ≤ 5 条;无连续 > 2 页 `bullets` 版式,并列信息已升格为 `kpi / cards / comparison / process / matrix / issue-tree / treemap / gauge / pricing`。
|
|
69
71
|
- [ ] **SLOP-04 字号与字数底线**:正文绝不低于 `13.5pt`;单条要点中文 ≤ 24 字(英文 ≤ 14 词),卡片正文中文 ≤ 40 字,引导词使用 `**关键词**:说明` 形成层级。
|
|
70
|
-
- [ ] **SLOP-05 图文对齐与呼吸感**:配图采用圆角细框对齐或 `split-bleed`
|
|
72
|
+
- [ ] **SLOP-05 图文对齐与呼吸感**:配图采用圆角细框对齐或 `split-bleed` 半屏出血,人像/团队照设 `focalPoint: 'top'` 防切头,正文列垂直居中,无「左上角两行字 + 大片死白」。
|
|
71
73
|
- [ ] **SLOP-06 出版级图表与三线表**:单系列图表无冗余图例,网格线 ≤ 5 条细灰线,关键柱已用 `highlight` 聚焦并带直接数值标签;学术表格采用 `booktabs` 无竖线三线表;数据页左下角有真实 `source` 说明(未虚构出处)。
|
|
72
74
|
- [ ] **SLOP-07 投影安全与对比度**:会议/政务/学术/培训优先浅底主题;政务风杜绝刺眼纯红底配黄字;正文与背景对比度 ≥ 4.5:1,HTML 与 PPTX 主题完全一致。
|
|
73
75
|
- [ ] **SLOP-08 版式多样性**:≥ 6 页的文稿至少组合 4 种不同版式原型,封面与封底不误印页码。
|
|
74
76
|
- [ ] **SLOP-09 可执行收尾**:`closing` 页包含明确的下一步行动号召(CTA / 里程碑 / 联络方式),绝不仅写两个字「谢谢」。
|
|
75
77
|
- [ ] **SLOP-10 真实性与跨平台完备**:无未填占位草稿(除非用户明确要求空模板并标注 `draft`),全部产物为工作区绝对路径;若已运行渲染,确认 `missingFonts: []` 且收据匹配最新 PPTX。
|
|
76
78
|
- [ ] **SLOP-11/12 卡片材质节奏与图表聚光灯**:长篇文稿避免连续 ≥ 4 页等宽方框卡片;单系列 ≥ 5 项柱状/条形图须通过 `highlight` / `spotlight` / `referenceLine` 聚焦核心主角。
|
|
77
|
-
- [ ] **SLOP-13
|
|
79
|
+
- [ ] **SLOP-13 事实出处与代码级权威信源门禁(v0.35 升级 9 项)**:严禁空洞假出处(`vague-placeholder-source`)、悬空 `[E#]` 引用(`dangling-evidence-ref`)、未披露口径的 `unverified`/`conflicting`(`unverified-evidence-claim`)与调研模式无出处量化页(`unsourced-research-numbers`);由 `classifySourceAuthority` 代码级核验 Tier 1/2/3 与工作区 `preferredSources`/`blockedDomains`,同步拦截「名义权威机构 + 自媒体二手转引链接」(`secondary-relay-source`)、把 Tier 3 噪声站/屏蔽域标为 `verified`(`low-authority-source`)、`claimType: 'forecast'` 预测数字未标「预计/预测/E」(`unmarked-forecast-claim`)、外源缺失年份(`missing-external-date`)以及超 3 年过时外部基准(`stale-evidence-date`)。
|
|
80
|
+
- [ ] **SLOP-14 企业品牌宪章与合规门禁**:工作区存在 `.dsh-ppt/brand-kit.json` 时默认自动锁定企业主色、字体、页脚、内容页保密水印(`brand.watermark`)、官方封底与 `preferredSources`/`blockedDomains`;全篇无企业禁用词(`forbidden-brand-term`)与主色漂移(`brand-palette-drift`);需为高管/董事会/客户压缩精简版本时直接用 `ppt_edit({ remixPreset })` / `--remix` 另存无损归档副本。
|
|
78
81
|
|
|
79
82
|
## 跨 harness 安装
|
|
80
83
|
|
|
81
|
-
把整个 `skills/dsh-ppt` 目录复制到目标 Agent 的技能目录,在 Node `^22.19.0 || >=24.0.0` 下执行 `npm install --ignore-scripts`。
|
|
84
|
+
把整个 `skills/dsh-ppt` 目录复制到目标 Agent 的技能目录,在 Node `^22.19.0 || >=24.0.0` 下执行 `npm install --ignore-scripts`。24 套主题与 36 种零依赖核心原生版式/图示(含 41 种完整版式中的核心图谱)纯 Node 内置模块即可运行;图片、13 类图表与外部 `.pptx` 吸收使用已声明的 `@office-kit/pptx@0.21.0`;PNG/PDF 渲染按需安装 `@deepseek-ai/libreoffice-kit`:
|
|
82
85
|
|
|
83
86
|
| Agent | 技能目录 / 安装命令 |
|
|
84
87
|
| --- | --- |
|