chuspeeism/dashi-ppt-skill / skills/dashi-ppt
dashi-ppt
Flagged制作 PPT、演示文稿、幻灯片、汇报材料时使用。Dashi PPT 基于预置视觉主题组合页面,生成可离线打开、可在浏览器编辑的 HTML 演示,支持导出 PPTX / PDF 文件。
project/scripts/preview/launch-export-browser.mjs
View on GitHub// 导出浏览器统一启动器:三个导出入口(HTTP 的 PPTX/PDF 路由 + CLI)共用,收敛
// tmpdir 保险丝、headless shell 优先解析、以及沙箱宿主下的 --single-process 重试。
//
// 沙箱宿主(如豆包)的 seatbelt 会被 daemonize 的预览服务继承,对 Chromium 的拦截
// 逐层出现过三种形态(均为真实事故):
// 1. mkdtemp ENOENT/EPERM —— 临时目录死亡/不可写(ensure-tmpdir.mjs 处理);
// 2. ProcessSingleton socket 创建失败 —— confstr 临时区被拦(headless shell 无此机制);
// 3. Mach 端口注册被拒 —— bootstrap_check_in Permission denied (1100),多进程
// Chromium(含 headless shell)启动早期必经;唯一可行规避是 --single-process
// (不派生子进程 → 不需要 Mach rendezvous)。
// 策略:默认常规启动(最大兼容);失败信息命中沙箱特征时,带
// --single-process --in-process-gpu 自动重试一次。导出渲染的是本 skill 自己生成的
// 受控静态页面、进程短生命周期,single-process 模式的稳定性代价在此场景可忽略。
import { getExportBrowserPath } from '../chrome-path.mjs';
import { resolveBrowserTmpdir } from './ensure-tmpdir.mjs';
export const SANDBOX_LAUNCH_FAILURE_RE = /bootstrap_check_in|MachPortRendezvous|ProcessSingleton|Permission denied \(1100\)|mkdtemp/i;
export async function launchExportBrowser(chromium, { fallbackTmpDirs = [], log = () => {} } = {}) {
const browserTmpdir = resolveBrowserTmpdir(fallbackTmpDirs, log);
const baseOptions = {
headless: true,
executablePath: getExportBrowserPath(),
env: { ...process.env, TMPDIR: browserTmpdir },
};
try {
return await chromium.launch(baseOptions);
} catch (error) {
const message = String((error && error.message) || error);
if (!SANDBOX_LAUNCH_FAILURE_RE.test(message)) throw error;
log('[export] 浏览器常规启动被宿主沙箱拦截(Mach/Singleton/tmp),改用 --single-process 重试');
// --disable-gpu:第 4 层防线。single-process + in-process-gpu 会把 GPU 初始化
// 拉进浏览器主进程,进而向 WindowServer 查询真实显示器建立刷新同步
// (CVDisplayLinkCreateWithCGDisplay);豆包的服务上下文接触不到图形会话,
// 该调用返回 kCVReturnInvalidDisplay 后浏览器直接崩溃(newPage 时报
// "browser has been closed")。headless 导出全程用软件渲染即可,不碰显示服务。
return chromium.launch({ ...baseOptions, args: ['--single-process', '--in-process-gpu', '--disable-gpu'] });
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |