dsh-ppt 0.24.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.en.md +13 -13
- package/README.md +13 -13
- package/docs/DATA.md +2 -2
- package/docs/REFERENCE.en.md +8 -8
- package/docs/REFERENCE.zh.md +8 -8
- package/docs/USAGE.en.md +11 -7
- package/docs/USAGE.md +11 -7
- package/docs/VALIDATION.md +4 -0
- package/docs/WORKBENCH.md +4 -4
- package/docs/assets/intro/workflow-en-dark.svg +1 -1
- package/docs/assets/intro/workflow-en-light.svg +1 -1
- package/docs/assets/intro/workflow-en-mobile-dark.svg +1 -1
- package/docs/assets/intro/workflow-en-mobile-light.svg +1 -1
- package/docs/assets/intro/workflow-zh-dark.svg +1 -1
- package/docs/assets/intro/workflow-zh-light.svg +1 -1
- package/docs/assets/intro/workflow-zh-mobile-dark.svg +1 -1
- package/docs/assets/intro/workflow-zh-mobile-light.svg +1 -1
- package/lib/client.js +3435 -467
- package/lib/ecosystem.d.ts +73 -0
- package/lib/ecosystem.js +1352 -0
- package/lib/execution.d.ts +6 -1
- package/lib/execution.js +69 -0
- package/lib/tools.js +77 -0
- package/lib/types.d.ts +57 -1
- package/lib/workbench-language.js +4 -0
- package/lib/workbench.d.ts +2 -0
- package/lib/workbench.js +331 -8
- package/package.json +1 -1
- package/skills/dsh-ppt/SKILL.md +3 -3
- package/skills/dsh-ppt/package.json +1 -1
- package/skills/dsh-ppt/references/advanced.md +10 -5
- package/skills/dsh-ppt/references/syntax.md +1 -0
- package/skills/dsh-ppt/scripts/build-deck.mjs +39 -8
- package/skills/dsh-ppt/scripts/deck-advanced.mjs +50 -13
- package/skills/dsh-ppt/scripts/deck-chrome.mjs +1706 -0
- package/skills/dsh-ppt/scripts/deck-core.mjs +116 -6
- package/skills/dsh-ppt/scripts/deck-delivery.mjs +636 -41
- package/skills/dsh-ppt/scripts/deck-diagrams.mjs +2842 -0
- package/skills/dsh-ppt/scripts/deck-director.mjs +49 -3
- package/skills/dsh-ppt/scripts/deck-layouts.mjs +482 -5270
- package/skills/dsh-ppt/scripts/deck-mermaid.mjs +2737 -0
- package/skills/dsh-ppt/scripts/deck-office.mjs +1541 -0
package/lib/execution.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedPptConfig } from './config.js';
|
|
2
|
-
import type { DeckEngine, PptAbsorbResult, PptCreateResult, PptThemesResult } from './types.js';
|
|
2
|
+
import type { DeckEngine, PptAbsorbResult, PptCiteResult, PptCreateResult, PptRemotionResult, PptThemesResult } from './types.js';
|
|
3
3
|
/** The Harness execution fields used by this plugin; optional for direct callers. */
|
|
4
4
|
export interface PptExecution {
|
|
5
5
|
readonly signal?: AbortSignal;
|
|
@@ -29,4 +29,9 @@ export declare function createPptExecutors(config: ResolvedPptConfig, loadEngine
|
|
|
29
29
|
render(rawArgs: unknown, exec?: PptExecution): Promise<import("./types.js").PptRenderResult>;
|
|
30
30
|
data(rawArgs: unknown, exec?: PptExecution): Promise<PptCreateResult | Record<string, any>>;
|
|
31
31
|
importPptx(rawArgs: unknown, exec?: PptExecution): Promise<PptCreateResult>;
|
|
32
|
+
fromOffice(rawArgs: unknown, exec?: PptExecution): Promise<PptCreateResult>;
|
|
33
|
+
cite(rawArgs: unknown, exec?: PptExecution): Promise<PptCiteResult & {
|
|
34
|
+
jsonPath?: string;
|
|
35
|
+
}>;
|
|
36
|
+
remotion(rawArgs: unknown, exec?: PptExecution): Promise<PptRemotionResult>;
|
|
32
37
|
};
|
package/lib/execution.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { attachCitationsToDeck, exportRemotionBundle } from './ecosystem.js';
|
|
4
5
|
let enginePromise = null;
|
|
5
6
|
export function getEngine() {
|
|
6
7
|
if (enginePromise === null) {
|
|
@@ -93,6 +94,7 @@ export function createPptExecutors(config, loadEngine = getEngine) {
|
|
|
93
94
|
maxSlides: config.maxSlides,
|
|
94
95
|
template: args.template,
|
|
95
96
|
brand: args.brand,
|
|
97
|
+
...(typeof args.targetMinutes === 'number' && Number.isFinite(args.targetMinutes) ? { targetMinutes: args.targetMinutes } : {}),
|
|
96
98
|
dataModel: args.dataModel,
|
|
97
99
|
cwd,
|
|
98
100
|
signal: exec?.signal,
|
|
@@ -184,5 +186,72 @@ export function createPptExecutors(config, loadEngine = getEngine) {
|
|
|
184
186
|
signal: exec?.signal,
|
|
185
187
|
});
|
|
186
188
|
},
|
|
189
|
+
async fromOffice(rawArgs, exec) {
|
|
190
|
+
exec?.signal?.throwIfAborted();
|
|
191
|
+
const args = asRecord(rawArgs);
|
|
192
|
+
if (typeof args.filePath !== 'string' || args.filePath.trim() === '') {
|
|
193
|
+
throw new Error('dsh-ppt:filePath 不能为空');
|
|
194
|
+
}
|
|
195
|
+
const engine = await loadEngine();
|
|
196
|
+
exec?.signal?.throwIfAborted();
|
|
197
|
+
if (typeof engine.importOfficeDeck !== 'function') {
|
|
198
|
+
throw new Error('dsh-ppt:当前引擎版本暂不支持导入 Excel / Word 文档');
|
|
199
|
+
}
|
|
200
|
+
const cwd = exec?.agent?.session.header.cwd ?? process.cwd();
|
|
201
|
+
const rawOut = typeof args.outputDir === 'string' && args.outputDir.trim() !== '' ? args.outputDir.trim() : config.outputDir;
|
|
202
|
+
const resolvedOut = resolve(cwd, rawOut || '.');
|
|
203
|
+
return engine.importOfficeDeck({
|
|
204
|
+
filePath: args.filePath.trim(),
|
|
205
|
+
cwd,
|
|
206
|
+
outDir: resolvedOut,
|
|
207
|
+
outputDir: resolvedOut,
|
|
208
|
+
...(typeof args.fileName === 'string' && args.fileName.trim() !== '' ? { fileName: args.fileName.trim() } : {}),
|
|
209
|
+
theme: typeof args.theme === 'string' && args.theme.trim() !== '' ? args.theme.trim() : (config.defaultTheme || 'auto'),
|
|
210
|
+
persona: typeof args.persona === 'string' && args.persona.trim() !== '' ? args.persona.trim() : 'auto',
|
|
211
|
+
...(typeof args.chromeStyle === 'string' && args.chromeStyle.trim() !== '' ? { chromeStyle: args.chromeStyle.trim() } : {}),
|
|
212
|
+
...(typeof args.targetMinutes === 'number' && Number.isFinite(args.targetMinutes) ? { targetMinutes: args.targetMinutes } : {}),
|
|
213
|
+
lang: typeof args.lang === 'string' && args.lang.trim() !== '' ? args.lang.trim() : (config.defaultLang || undefined),
|
|
214
|
+
overwrite: args.overwrite === true,
|
|
215
|
+
signal: exec?.signal,
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
async cite(rawArgs, exec) {
|
|
219
|
+
exec?.signal?.throwIfAborted();
|
|
220
|
+
const args = asRecord(rawArgs);
|
|
221
|
+
if (typeof args.deckPath !== 'string' || args.deckPath.trim() === '') {
|
|
222
|
+
throw new Error('dsh-ppt:deckPath 不能为空');
|
|
223
|
+
}
|
|
224
|
+
const engine = await loadEngine();
|
|
225
|
+
exec?.signal?.throwIfAborted();
|
|
226
|
+
const cwd = exec?.agent?.session.header.cwd ?? process.cwd();
|
|
227
|
+
const result = await attachCitationsToDeck({
|
|
228
|
+
...args,
|
|
229
|
+
deckPath: args.deckPath.trim(),
|
|
230
|
+
cwd,
|
|
231
|
+
signal: exec?.signal,
|
|
232
|
+
engine,
|
|
233
|
+
});
|
|
234
|
+
return {
|
|
235
|
+
...result,
|
|
236
|
+
...(result.deck?.jsonPath ? { jsonPath: result.deck.jsonPath } : {}),
|
|
237
|
+
};
|
|
238
|
+
},
|
|
239
|
+
async remotion(rawArgs, exec) {
|
|
240
|
+
exec?.signal?.throwIfAborted();
|
|
241
|
+
const args = asRecord(rawArgs);
|
|
242
|
+
if (typeof args.deckPath !== 'string' || args.deckPath.trim() === '') {
|
|
243
|
+
throw new Error('dsh-ppt:deckPath 不能为空');
|
|
244
|
+
}
|
|
245
|
+
const engine = await loadEngine();
|
|
246
|
+
exec?.signal?.throwIfAborted();
|
|
247
|
+
const cwd = exec?.agent?.session.header.cwd ?? process.cwd();
|
|
248
|
+
return exportRemotionBundle({
|
|
249
|
+
...args,
|
|
250
|
+
deckPath: args.deckPath.trim(),
|
|
251
|
+
cwd,
|
|
252
|
+
signal: exec?.signal,
|
|
253
|
+
engine,
|
|
254
|
+
});
|
|
255
|
+
},
|
|
187
256
|
};
|
|
188
257
|
}
|
package/lib/tools.js
CHANGED
|
@@ -157,6 +157,23 @@ function renderPreview(value) {
|
|
|
157
157
|
(value.missingFonts?.length ? '\n请先替换为环境和目标机器可用字体,重新生成并渲染检查;解决前不能声称已验收。' : '') +
|
|
158
158
|
'\n请查看实际画面,确认文字、图片和图表后再交付。原可编辑 PPTX 保留。');
|
|
159
159
|
}
|
|
160
|
+
function renderCite(value) {
|
|
161
|
+
if (value.matchedCount === 0) {
|
|
162
|
+
return oneText('dsh-cite 引文链接:未匹配到 [@citeKey] / [doi:...] 标记或指定文献' +
|
|
163
|
+
(value.missingKeys.length ? '(未找到:' + value.missingKeys.join(', ') + ')' : '') +
|
|
164
|
+
',未修改工程文件。');
|
|
165
|
+
}
|
|
166
|
+
return oneText('dsh-cite 已链接 ' + value.matchedCount + ' 条已核验文献(' + value.citedKeys.join(', ') + ')' +
|
|
167
|
+
(value.referencesSlideIndex ? ',已同步更新第 ' + value.referencesSlideIndex + ' 页参考文献' : '') +
|
|
168
|
+
(value.missingKeys.length ? ';未匹配键:' + value.missingKeys.join(', ') : '') +
|
|
169
|
+
(value.deck ? '。\n最新修订号:' + value.deck.revision + ' · PPTX:' + value.deck.pptxPath : '。'));
|
|
170
|
+
}
|
|
171
|
+
function renderRemotion(value) {
|
|
172
|
+
return oneText('dsh-remotion 视频分镜工程已导出至:' + value.outputDir + '\n' +
|
|
173
|
+
'分镜清单:' + value.storyboardPath + '\n' +
|
|
174
|
+
'规格:' + value.slideCount + ' 页 · ' + value.fps + ' fps · 共 ' + value.totalFrames + ' 帧(约 ' + value.totalSeconds + ' 秒)\n' +
|
|
175
|
+
'进入目录运行 npm install && npm run preview 或 npm run render 即可预览与渲染 MP4。');
|
|
176
|
+
}
|
|
160
177
|
const imageObjectProperties = {
|
|
161
178
|
src: { type: 'string', description: 'Local PNG/JPEG path relative to the session cwd, or image data URI. Embedded into all output files.' },
|
|
162
179
|
alt: { type: 'string' }, fit: { type: 'string', enum: ['contain', 'cover'] }, caption: { type: 'string' },
|
|
@@ -233,6 +250,7 @@ const slideLayouts = [
|
|
|
233
250
|
'bento', 'pillars', 'exec-summary', 'timeline', 'steps', 'layers', 'funnel', 'chevron', 'value-chain',
|
|
234
251
|
'issue-action', 'before-after', 'matrix-2x2', 'kpi-grid', 'scorecard',
|
|
235
252
|
'formula-callout', 'takeaways', 'gallery-grid', 'ablation-compare', 'roadmap', 'swimlane', 'team',
|
|
253
|
+
'mermaid', 'flowchart', 'sequence',
|
|
236
254
|
];
|
|
237
255
|
const templateIds = [
|
|
238
256
|
'weekly', 'defense', 'project', 'pitch',
|
|
@@ -251,6 +269,7 @@ const slideProperties = {
|
|
|
251
269
|
source: { type: 'string', description: 'Bottom-left data/citation source line.' },
|
|
252
270
|
text: { type: 'string' },
|
|
253
271
|
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").' },
|
|
272
|
+
mermaid: { type: 'string', description: 'Mermaid flowchart or sequenceDiagram code compiled into native editable PowerPoint shapes & attached connectors in PPTX and SVG in HTML.' },
|
|
254
273
|
notes: { type: 'string' },
|
|
255
274
|
start: { type: 'number' }, span: { type: 'number' },
|
|
256
275
|
activeIndex: { type: 'integer' },
|
|
@@ -344,6 +363,7 @@ export function buildPptTools(config) {
|
|
|
344
363
|
slides: { type: 'array', items: { type: 'object', properties: slideProperties, additionalProperties: true }, description: 'Structured slides across 24 native layouts & pro diagrams (cover, agenda, section, bullets, kpi, cards, comparison, matrix, process, callout, gantt, architecture, harvey, tam, org, 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.' },
|
|
345
364
|
template: { type: 'string', enum: templateIds, description: 'Industry blueprint from ppt_templates (16 blueprints). Provide finished content/slides following its outline; template alone creates an unfilled draft.' },
|
|
346
365
|
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.' },
|
|
366
|
+
targetMinutes: { type: 'number', description: 'Optional target speaking duration in minutes for pace budgeting.' },
|
|
347
367
|
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.' },
|
|
348
368
|
outputDir: { type: 'string', description: 'Directory to write the files into. Default: session working directory (or the plugin outputDir config).' },
|
|
349
369
|
fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: sanitized deck title.' },
|
|
@@ -375,6 +395,7 @@ export function buildPptTools(config) {
|
|
|
375
395
|
theme: { type: 'string', description: 'Optional built-in theme id (' + ALLOWED_THEME_IDS.join(' / ') + ') to restyle the entire project atomically (undoable).' },
|
|
376
396
|
referencePptx: { type: 'string', description: 'Optional local reference .pptx path to absorb sanitized palette/fonts/logo and chrome skeleton onto this project (undoable).' },
|
|
377
397
|
brand: { type: ['object', 'null'], properties: brandProperties, additionalProperties: false, description: 'Merge shared branding. null clears all branding. Empty footer clears footer; logo:null clears logo.' },
|
|
398
|
+
targetMinutes: { type: ['number', 'null'], description: 'Optional target speaking duration in minutes for pace budgeting (null clears).' },
|
|
378
399
|
}),
|
|
379
400
|
output: { schema: createResultSchema, render: (_args, value) => renderCreate(value) },
|
|
380
401
|
execute: executors.edit,
|
|
@@ -440,5 +461,61 @@ export function buildPptTools(config) {
|
|
|
440
461
|
},
|
|
441
462
|
execute: executors.importPptx,
|
|
442
463
|
},
|
|
464
|
+
{
|
|
465
|
+
name: 'ppt_from_office',
|
|
466
|
+
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 文档并智能拆分为高颜值多页演示文稿三件套。',
|
|
467
|
+
parameters: compileParameters({
|
|
468
|
+
filePath: { type: 'string', required: true, description: 'Local .xlsx, .csv, .tsv, or .docx file path, relative to session cwd or absolute.' },
|
|
469
|
+
outputDir: { type: 'string', description: 'Directory to write the generated files into. Default: session working directory (or the plugin outputDir config).' },
|
|
470
|
+
fileName: { type: 'string', description: 'Base file name for the three artifacts. Default: derived from source file or title.' },
|
|
471
|
+
theme: { type: 'string', description: 'Target built-in theme id (or "auto", default "auto").' },
|
|
472
|
+
persona: { type: 'string', enum: ['auto', 'consulting', 'tech-pitch', 'academic', 'gov-exec', 'education', 'editorial'], description: 'Optional scenario/audience persona for Auto-Director choreography. Default auto.' },
|
|
473
|
+
chromeStyle: { type: 'string', enum: ALLOWED_CHROME_STYLES, description: 'Optional master chrome skeleton override: ' + ALLOWED_CHROME_STYLES.join(' | ') + '.' },
|
|
474
|
+
targetMinutes: { type: 'number', description: 'Optional target speaking duration in minutes for pace budgeting.' },
|
|
475
|
+
lang: { type: 'string', description: 'UI language: zh (default), en, or bilingual.' },
|
|
476
|
+
overwrite: { type: 'boolean', description: 'Replace existing same-name output files. Default false.' },
|
|
477
|
+
}),
|
|
478
|
+
output: {
|
|
479
|
+
schema: createResultSchema,
|
|
480
|
+
render: (_args, value) => renderCreate(value),
|
|
481
|
+
},
|
|
482
|
+
execute: executors.fromOffice,
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: 'ppt_cite',
|
|
486
|
+
description: 'Attach verified academic citations from a dsh-cite library (.json/.jsonl), BibTeX (.bib) file, or inline BibTeX/DOIs to a dsh-ppt project. Resolves [@citeKey] and [doi:...] markers into slide.source footers and appends or updates a formatted References slide without inventing metadata. 中文:对接 dsh-cite 文献库或 BibTeX/DOI,自动将 [@citeKey] / [doi:...] 解析写入页脚并生成或更新标准参考文献页。',
|
|
487
|
+
parameters: compileParameters({
|
|
488
|
+
deckPath: { type: 'string', required: true, description: 'Path to a dsh-ppt .json project, relative to session cwd or absolute.' },
|
|
489
|
+
citePath: { type: 'string', description: 'Optional path to dsh-cite library.json, .jsonl, or .bib file. Auto-discovers workspace or ~/.dsh/data/dsh-cite/library.json if omitted.' },
|
|
490
|
+
bibtex: { type: 'string', description: 'Optional inline BibTeX entries.' },
|
|
491
|
+
dois: { type: 'array', items: { type: 'string' }, description: 'Optional verified DOI strings to resolve and cite.' },
|
|
492
|
+
citeKeys: { type: 'array', items: { type: 'string' }, description: 'Optional explicit citeKeys or DOIs to attach as citations.' },
|
|
493
|
+
style: { type: 'string', enum: ['gb-t-7714', 'apa', 'mla', 'chicago'], description: 'Bibliography formatting style: gb-t-7714 (default), apa, mla, or chicago.' },
|
|
494
|
+
appendReferences: { type: 'boolean', description: 'Append or update a References slide (default true).' },
|
|
495
|
+
expectedRevision: { type: 'integer', description: 'Use revision returned by ppt_create/ppt_check to prevent overwriting another edit.' },
|
|
496
|
+
saveAs: { type: 'boolean', description: 'Save a new uniquely named copy instead of updating in place.' },
|
|
497
|
+
}),
|
|
498
|
+
output: {
|
|
499
|
+
schema: { type: 'object', additionalProperties: true },
|
|
500
|
+
render: (_args, value) => renderCite(value),
|
|
501
|
+
},
|
|
502
|
+
execute: executors.cite,
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
name: 'ppt_remotion',
|
|
506
|
+
description: 'Export a dsh-ppt project into a ready-to-render Remotion (dsh-remotion) animated video storyboard package (remotion-storyboard.json, src/DeckVideo.tsx, src/slides-data.json, src/index.ts, package.json, README.md) with 30fps pace-budgeted durations, spring entrances, KPI count-up, progressive bars, and synchronized speaker-note captions. 中文:将演示文稿导出为可直接渲染的 Remotion 视频分镜工程包(含 30fps 时长预算、KPI 数字递增、进度条生长动画与同步字幕)。',
|
|
507
|
+
parameters: compileParameters({
|
|
508
|
+
deckPath: { type: 'string', required: true, description: 'Path to a dsh-ppt .json project, relative to session cwd or absolute.' },
|
|
509
|
+
outputDir: { type: 'string', description: 'Directory to write the Remotion package into. Default: <deck>-remotion next to deckPath.' },
|
|
510
|
+
format: { type: 'string', enum: ['landscape', 'portrait', 'square'], description: 'Video aspect ratio: landscape (1920x1080, default), portrait (1080x1920), or square (1080x1080).' },
|
|
511
|
+
fps: { type: 'integer', description: 'Frames per second (24, 30, or 60; default 30).' },
|
|
512
|
+
overwrite: { type: 'boolean', description: 'Overwrite existing files in outputDir (default false).' },
|
|
513
|
+
}),
|
|
514
|
+
output: {
|
|
515
|
+
schema: { type: 'object', additionalProperties: true },
|
|
516
|
+
render: (_args, value) => renderRemotion(value),
|
|
517
|
+
},
|
|
518
|
+
execute: executors.remotion,
|
|
519
|
+
},
|
|
443
520
|
];
|
|
444
521
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type PptThemeId = 'swiss' | 'velvet' | 'data' | 'soft' | 'bold' | 'consul
|
|
|
3
3
|
export type PptChromeStyle = 'consulting-classic' | 'keynote-spatial' | 'editorial-folio' | 'saas-bento' | 'academic-minimal' | 'gov-ceremonial';
|
|
4
4
|
export type PptPersonaId = 'auto' | 'consulting' | 'tech-pitch' | 'academic' | 'gov-exec' | 'education' | 'editorial';
|
|
5
5
|
export type PptLanguage = 'zh' | 'en' | 'bilingual';
|
|
6
|
-
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';
|
|
6
|
+
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';
|
|
7
7
|
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';
|
|
8
8
|
export type PptTableStyle = 'consulting' | 'booktabs' | 'minimal' | 'banded' | 'harvey';
|
|
9
9
|
export interface PptImageSpec {
|
|
@@ -124,6 +124,7 @@ export interface PptEditArgs {
|
|
|
124
124
|
theme?: string;
|
|
125
125
|
referencePptx?: string;
|
|
126
126
|
brand?: PptBrand | null;
|
|
127
|
+
targetMinutes?: number | null;
|
|
127
128
|
expectedRevision?: number;
|
|
128
129
|
saveAs?: boolean;
|
|
129
130
|
}
|
|
@@ -180,6 +181,7 @@ export interface PptSlideSpec {
|
|
|
180
181
|
source?: string;
|
|
181
182
|
text?: string;
|
|
182
183
|
formula?: string;
|
|
184
|
+
mermaid?: string;
|
|
183
185
|
bullets?: string[];
|
|
184
186
|
items?: PptSlideItem[];
|
|
185
187
|
cards?: PptSlideItem[];
|
|
@@ -238,6 +240,8 @@ export interface PptCreateArgs {
|
|
|
238
240
|
overwrite?: boolean;
|
|
239
241
|
template?: PptTemplateId | string;
|
|
240
242
|
brand?: PptBrand;
|
|
243
|
+
/** Optional target speaking duration in minutes for pace budgeting. */
|
|
244
|
+
targetMinutes?: number;
|
|
241
245
|
/** Optional explicit source facts, assumptions and safe arithmetic; bind slides with {{metricId}}. */
|
|
242
246
|
dataModel?: PptDataModel;
|
|
243
247
|
}
|
|
@@ -323,6 +327,55 @@ export interface PptImportArgs {
|
|
|
323
327
|
modernize?: boolean;
|
|
324
328
|
preserveSourceTheme?: boolean;
|
|
325
329
|
}
|
|
330
|
+
export interface PptFromOfficeArgs {
|
|
331
|
+
filePath: string;
|
|
332
|
+
outputDir?: string;
|
|
333
|
+
fileName?: string;
|
|
334
|
+
theme?: string;
|
|
335
|
+
persona?: PptPersonaId | string;
|
|
336
|
+
chromeStyle?: PptChromeStyle | string;
|
|
337
|
+
targetMinutes?: number;
|
|
338
|
+
lang?: string;
|
|
339
|
+
overwrite?: boolean;
|
|
340
|
+
}
|
|
341
|
+
export type PptCitationStyle = 'gb-t-7714' | 'apa' | 'mla' | 'chicago';
|
|
342
|
+
export interface PptCiteArgs {
|
|
343
|
+
deckPath: string;
|
|
344
|
+
citePath?: string;
|
|
345
|
+
bibtex?: string;
|
|
346
|
+
dois?: string[];
|
|
347
|
+
citeKeys?: string[];
|
|
348
|
+
style?: PptCitationStyle;
|
|
349
|
+
appendReferences?: boolean;
|
|
350
|
+
expectedRevision?: number;
|
|
351
|
+
saveAs?: boolean;
|
|
352
|
+
}
|
|
353
|
+
export interface PptCiteResult {
|
|
354
|
+
ok: boolean;
|
|
355
|
+
matchedCount: number;
|
|
356
|
+
citedKeys: string[];
|
|
357
|
+
missingKeys: string[];
|
|
358
|
+
sourcePath?: string;
|
|
359
|
+
referencesSlideIndex?: number;
|
|
360
|
+
deck?: PptCreateResult;
|
|
361
|
+
}
|
|
362
|
+
export interface PptRemotionArgs {
|
|
363
|
+
deckPath: string;
|
|
364
|
+
outputDir?: string;
|
|
365
|
+
format?: 'landscape' | 'portrait' | 'square';
|
|
366
|
+
fps?: number;
|
|
367
|
+
overwrite?: boolean;
|
|
368
|
+
}
|
|
369
|
+
export interface PptRemotionResult {
|
|
370
|
+
ok: boolean;
|
|
371
|
+
outputDir: string;
|
|
372
|
+
storyboardPath: string;
|
|
373
|
+
files: string[];
|
|
374
|
+
fps: number;
|
|
375
|
+
totalFrames: number;
|
|
376
|
+
totalSeconds: number;
|
|
377
|
+
slideCount: number;
|
|
378
|
+
}
|
|
326
379
|
export interface PptCreateResult {
|
|
327
380
|
ok: boolean;
|
|
328
381
|
title: string;
|
|
@@ -353,6 +406,7 @@ export interface PptCreateResult {
|
|
|
353
406
|
export interface DeckEngine {
|
|
354
407
|
absorbPptx(options: Record<string, unknown>): Promise<PptAbsorbResult>;
|
|
355
408
|
importPptxDeck(options: Record<string, unknown>): Promise<PptCreateResult>;
|
|
409
|
+
importOfficeDeck?(options: Record<string, unknown>): Promise<PptCreateResult>;
|
|
356
410
|
repairDeckVisual(options: Record<string, unknown>): Promise<PptCreateResult>;
|
|
357
411
|
readRenderReceipt(pptxPath: string, receiptPath: string): PptRenderResult;
|
|
358
412
|
previewDeckData(options: Record<string, unknown>): Record<string, any>;
|
|
@@ -360,6 +414,8 @@ export interface DeckEngine {
|
|
|
360
414
|
dataReport(manifest: any): string;
|
|
361
415
|
dataNotes(manifest: any, slide: any): string;
|
|
362
416
|
renderHandoutMarkdown?(manifest: any, lang?: string): string;
|
|
417
|
+
renderOnePagerHtml?(manifest: any, lang?: string): string;
|
|
418
|
+
computePaceBudget?(manifest: any, targetMinutes?: number): Record<string, any>;
|
|
363
419
|
buildDeckAsync?(options: Record<string, unknown>): Promise<PptCreateResult>;
|
|
364
420
|
listTemplates(lang?: string): unknown[];
|
|
365
421
|
editDeck(options: Record<string, unknown>): Promise<PptCreateResult>;
|
|
@@ -34,6 +34,10 @@ const messages = {
|
|
|
34
34
|
'图片必须从面板上传,不能读取其他本地文件': 'Upload the image from this panel. Other local file paths cannot be read.',
|
|
35
35
|
'图片说明或适应方式无效': 'The image description or fit setting is invalid.',
|
|
36
36
|
'不支持此文件类型': 'This file type is unsupported.',
|
|
37
|
+
'当前引擎版本暂不支持导入 Excel / Word 文档': 'Office document import (.xlsx/.csv/.docx) is unavailable in the current engine.',
|
|
38
|
+
'请选择 24 MiB 以内的 .xlsx、.csv、.tsv 或 .docx 文件': 'Choose an .xlsx, .csv, .tsv, or .docx file up to 24 MiB.',
|
|
39
|
+
'目标演讲时长需为 1–240 分钟的数字': 'Target speaking duration must be between 1 and 240 minutes.',
|
|
40
|
+
'Mermaid 代码无效或超过 16,000 字符': 'Mermaid diagram code is invalid or exceeds 16,000 characters.',
|
|
37
41
|
'请先渲染当前版本的 PPTX': 'Render the current PPTX version first.',
|
|
38
42
|
'页码无效': 'The slide number is invalid.',
|
|
39
43
|
'渲染图片已变化,请重新渲染当前 PPTX': 'The rendered image changed. Render the current PPTX again.',
|
package/lib/workbench.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class PptWorkbench {
|
|
|
37
37
|
private itemsPatch;
|
|
38
38
|
private patch;
|
|
39
39
|
private pptxBytes;
|
|
40
|
+
private officeBytes;
|
|
41
|
+
private flagshipDemoSlides;
|
|
40
42
|
action(body: Record<string, unknown>, signal?: AbortSignal): Promise<unknown>;
|
|
41
43
|
fetchDownload(request: Request): Promise<Response>;
|
|
42
44
|
fetch(request: Request): Promise<Response>;
|