engine7 7.1.133 → 7.1.137
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/README.md +1 -0
- package/dist/auth-server.mjs +632 -0
- package/dist/bg-worker.mjs +31663 -28486
- package/dist/cc-desktop.mjs +951 -0
- package/dist/cli.mjs +41495 -30171
- package/dist/engine-startup.mjs +54213 -40973
- package/dist/main.mjs +50129 -36887
- package/dist/recall-worker.mjs +20446 -0
- package/dist/sqlite-maintenance-worker.mjs +1166 -124
- package/dist/stop-history-worker.mjs +180 -0
- package/dist/topics-worker.mjs +3353 -1078
- package/dist/travel-authority.mjs +1068 -0
- package/dist/travel-console.mjs +2206 -0
- package/dist/travel-controller.mjs +1883 -0
- package/dist/travel-data.mjs +7253 -0
- package/dist/travel-gateway.mjs +3259 -0
- package/dist/travel-key-service.mjs +483 -0
- package/dist/travel-node-data.mjs +4936 -0
- package/dist/travel-node.mjs +21258 -0
- package/dist/travel-retire.mjs +1095 -0
- package/dist/web-console.mjs +3355 -0
- package/package.json +32 -17
- package/templates/config.template.json +45 -0
- package/templates/skills/auth-connect/SKILL.md +22 -0
- package/templates/skills/email/SKILL.md +119 -115
- package/templates/skills/email/scripts/email-config-path.test.js +52 -0
- package/templates/skills/email/scripts/email-config.d.ts +4 -0
- package/templates/skills/email/scripts/email-config.js +6 -3
- package/templates/skills/pptx/SKILL.md +5 -0
- package/templates/skills/pptx/assets/engine7-aurora/field.png +0 -0
- package/templates/skills/pptx/assets/engine7-aurora/hero.png +0 -0
- package/templates/skills/pptx/assets/engine7-aurora/wordmark.png +0 -0
- package/templates/skills/pptx/examples/engine7-aurora.cjs +190 -0
- package/templates/skills/pptx/package-lock.json +171 -0
- package/templates/skills/pptx/package.json +12 -0
- package/templates/skills/pptx/scripts/engine7-aurora.cjs +132 -0
- package/templates/skills/pptx/styles/engine7-aurora.md +136 -0
- package/templates/skills/pptx/tests/engine7-aurora.test.cjs +116 -0
- package/templates/workspace/AGENTS.md +2 -9
- package/templates/workspace/RULES.md +22 -0
- package/templates/workspace/hooks/loop-detector.mjs +37 -0
- package/templates/workspace/souls/unnamed.md +10 -0
|
@@ -39,11 +39,14 @@ function resolveEmailConfig(opts = {}) {
|
|
|
39
39
|
|| process.env.ENGINE_STATE_DIR
|
|
40
40
|
|| process.env.ENGINE7_STATE_DIR
|
|
41
41
|
|| null
|
|
42
|
+
// 宿主实际加载的具名配置优先;显式选中后不能误读同目录的另一邮箱。
|
|
43
|
+
const configFilePath = opts.configFilePath || process.env.ENGINE7_CONFIG_FILE || process.env.ENGINE_CONFIG
|
|
44
|
+
const configFiles = configFilePath ? [path.resolve(configFilePath)]
|
|
45
|
+
: stateDir ? [path.join(stateDir, 'configs', 'main.json')] : []
|
|
42
46
|
|
|
43
47
|
// 1) stateDir config 的 tools.email
|
|
44
|
-
if (
|
|
45
|
-
for (const
|
|
46
|
-
const p = path.join(stateDir, name.startsWith('configs') ? name : path.join('configs', name))
|
|
48
|
+
if (configFiles.length) {
|
|
49
|
+
for (const p of configFiles) {
|
|
47
50
|
try {
|
|
48
51
|
if (!fs.existsSync(p)) continue
|
|
49
52
|
const cfg = JSON.parse(fs.readFileSync(p, 'utf8'))
|
|
@@ -13,6 +13,11 @@ license: Proprietary. LICENSE.txt has complete terms
|
|
|
13
13
|
| Read/analyze content | `python -m markitdown presentation.pptx` |
|
|
14
14
|
| Edit or create from template | Read [editing.md](editing.md) |
|
|
15
15
|
| Create from scratch | Read [pptxgenjs.md](pptxgenjs.md) |
|
|
16
|
+
| Engine7 极光 / Engine7 Aurora style | Read [styles/engine7-aurora.md](styles/engine7-aurora.md) |
|
|
17
|
+
|
|
18
|
+
## Named Styles
|
|
19
|
+
|
|
20
|
+
When the user requests **Engine7 极光**, **Engine7 Aurora**, `engine7-aurora`, or a presentation in the style of Engine7's product deck, read [styles/engine7-aurora.md](styles/engine7-aurora.md). It includes the original dark backgrounds, exact palette, light typography, layout recipes and an editable example. Use the named style's typography and layout rules in place of the generic design suggestions below; retain the PPTX editing and QA workflows. Keep the user's subject and brand. Style attribution is optional and does not identify the presentation's author.
|
|
16
21
|
|
|
17
22
|
---
|
|
18
23
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Engine7 Aurora: eight editable layouts. SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Run: node examples/engine7-aurora.cjs /path/to/output.pptx
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const pptxgen = require('pptxgenjs');
|
|
6
|
+
const { createAurora } = require('../scripts/engine7-aurora.cjs');
|
|
7
|
+
|
|
8
|
+
async function buildExample(output, options = {}) {
|
|
9
|
+
const deck = new pptxgen();
|
|
10
|
+
const a = createAurora(deck, {
|
|
11
|
+
title: 'Engine7 极光 · 可复用 PPT 风格',
|
|
12
|
+
author: options.brand && options.brand !== 'Engine7 · 栖' ? '' : 'TWINSUN',
|
|
13
|
+
website: 'https://www.twinsun.top/', ...options,
|
|
14
|
+
});
|
|
15
|
+
const C = a.colors;
|
|
16
|
+
const text = a.text, title = a.title, panel = a.panel;
|
|
17
|
+
const tag = (s, value, x, y, w, color) => text(s, value, x, y, w, 0.3,
|
|
18
|
+
{ fontSize: 12, color });
|
|
19
|
+
|
|
20
|
+
// 1. The final approved product-deck cover geometry, with a new topic.
|
|
21
|
+
{
|
|
22
|
+
const s = a.addSlide({ hero: true });
|
|
23
|
+
text(s, '可复用的演示风格', 0.85, 1.39, 5.3, 0.3,
|
|
24
|
+
{ fontFace: a.config.titleFont, fontSize: 16, color: C.muted });
|
|
25
|
+
title(s, '让你的想法,有了回响。', { highlight: '有了回响。',
|
|
26
|
+
x: 0.8, y: 2.46, w: 11.75, h: 1.03, fontSize: 49, align: 'center' });
|
|
27
|
+
title(s, 'Engine7 极光 · 可复用的 PPT 风格',
|
|
28
|
+
{ x: 1.2, y: 3.70, w: 10.95, h: 0.66, fontSize: 26, align: 'center' });
|
|
29
|
+
panel(s, 4.83, 6.06, 3.67, 0.34, { fill: '171224', stroke: '3D3152' });
|
|
30
|
+
text(s, '风格示例 · 主题与品牌自由替换', 4.90, 6.06, 3.53, 0.34,
|
|
31
|
+
{ fontSize: 10.5, align: 'center' });
|
|
32
|
+
s.addNotes('这是 Engine7 极光的版式示例。标题、正文、卡片和流程均可以继续编辑;背景沿用产品介绍的黑紫光场。主题和品牌可以替换。');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 2. Four full-card internal links; the hint is separated from the footer.
|
|
36
|
+
{
|
|
37
|
+
const s = a.addSlide({ title: '先看这四件事,找到你的表达。', highlight: '四件事',
|
|
38
|
+
subtitle: '从重点到作品:每一页回答一个具体问题。', section: '风格导读' });
|
|
39
|
+
const entries = [
|
|
40
|
+
['讲清重点', '哪些内容值得记住?', '三卡概览', C.blue, 3],
|
|
41
|
+
['推进叙事', '下一步怎样自然展开?', '流程与关系', C.violet, 4],
|
|
42
|
+
['展示作品', '用什么材料说明结果?', '双栏与作品', C.pink, 5],
|
|
43
|
+
['形成判断', '变化与数据意味着什么?', '对照与数据', C.gold, 6],
|
|
44
|
+
];
|
|
45
|
+
entries.forEach(([heading, question, label, color, page], i) => {
|
|
46
|
+
const x = 0.80 + i % 2 * 6.03, y = 2.62 + Math.floor(i / 2) * 1.82;
|
|
47
|
+
panel(s, x, y, 5.72, 1.56, { fill: '110D1C' });
|
|
48
|
+
text(s, String(i + 1).padStart(2, '0'), x + 0.28, y + 0.30, 0.44, 0.40,
|
|
49
|
+
{ fontSize: 14, color });
|
|
50
|
+
title(s, heading, { x: x + 0.93, y: y + 0.28, w: 4.10, h: 0.46, fontSize: 27 });
|
|
51
|
+
text(s, question, x + 0.28, y + 0.86, 5.12, 0.30, { fontSize: 14.6 });
|
|
52
|
+
text(s, label, x + 0.28, y + 1.28, 3.72, 0.18, { fontSize: 10.5, color: C.muted });
|
|
53
|
+
text(s, String(page).padStart(2, '0'), x + 4.40, y + 1.25, 1.04, 0.24,
|
|
54
|
+
{ fontSize: 10.5, color: C.dim, align: 'right' });
|
|
55
|
+
a.hotspot(s, x, y, 5.72, 1.56, { slide: page });
|
|
56
|
+
});
|
|
57
|
+
text(s, [{ text: '点击卡片即可跳转。', options: { color: C.blue } },
|
|
58
|
+
{ text: ' 版式可按你的内容自由组合。', options: { color: C.dim } }],
|
|
59
|
+
0.85, 6.24, 11.7, 0.28, { fontSize: 11 });
|
|
60
|
+
s.addNotes('四张目录卡片可在 PPT 中跳转到第三、四、五、六页。第七页是数据版式,第八页收束。PDF 转换器是否保留形状内部跳转需单独检查。');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 3. Three cards; restrained accent labels instead of dense decoration.
|
|
64
|
+
{
|
|
65
|
+
const s = a.addSlide({ title: '把三个重点,讲得清楚。', highlight: '三个重点',
|
|
66
|
+
subtitle: '一张卡片只承载一个结论,再给两句具体说明。', section: '01 讲清重点', sectionColor: C.blue });
|
|
67
|
+
const entries = [
|
|
68
|
+
['明确主题', '先回答听众关心的问题。\n让标题成为结论,\n让正文提供依据。', C.blue],
|
|
69
|
+
['保持层级', '细字重标题留下呼吸。\n正文负责解释,\n颜色只标记重点。', C.violet],
|
|
70
|
+
['留出空间', '卡片之间保持间距。\n说不完的内容拆页,\n让每一页容易阅读。', C.pink],
|
|
71
|
+
];
|
|
72
|
+
entries.forEach(([heading, body, color], i) => {
|
|
73
|
+
const x = 0.73 + i * 4.15;
|
|
74
|
+
panel(s, x, 2.8, 3.85, 3.33);
|
|
75
|
+
tag(s, String(i + 1).padStart(2, '0'), x + 0.24, 3.10, 1, color);
|
|
76
|
+
title(s, heading, { x: x + 0.24, y: 3.68, w: 3.37, h: 0.5, fontSize: 23 });
|
|
77
|
+
text(s, body, x + 0.24, 4.42, 3.37, 1.23, { fontSize: 15.2, color: C.muted, valign: 'top' });
|
|
78
|
+
});
|
|
79
|
+
s.addNotes('三卡版式适合三个产品特性、三个项目重点或三个学习目标。不要用满每个角落;内容过长时选择分页面。');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 4. Relationship lines belong to a process, not beneath the slide title.
|
|
83
|
+
{
|
|
84
|
+
const s = a.addSlide({ title: '从一个想法,走到一份作品。', highlight: '一份作品',
|
|
85
|
+
subtitle: '用四个短步骤串起叙事,让读者知道过程如何推进。', section: '02 推进叙事' });
|
|
86
|
+
const entries = [['理解问题', '明确听众和目标'], ['组织内容', '选择结论与依据'],
|
|
87
|
+
['制作画面', '保持字体和留白'], ['检查交付', '实看输出与链接']];
|
|
88
|
+
const colors = [C.blue, C.violet, C.pink, C.gold];
|
|
89
|
+
entries.forEach(([heading, body], i) => {
|
|
90
|
+
const x = 0.73 + i * 3.09;
|
|
91
|
+
s.addShape(deck.ShapeType.ellipse, { x: x + 0.04, y: 2.98, w: 0.13, h: 0.13,
|
|
92
|
+
line: { color: colors[i], width: 0 }, fill: { color: colors[i] } });
|
|
93
|
+
if (i < 3) s.addShape(deck.ShapeType.line, { x: x + 0.21, y: 3.045, w: 2.92, h: 0,
|
|
94
|
+
line: { color: '514260', width: 1 } });
|
|
95
|
+
tag(s, String(i + 1).padStart(2, '0'), x, 3.44, 1, colors[i]);
|
|
96
|
+
title(s, heading, { x, y: 4.05, w: 2.75, h: 0.5, fontSize: 23 });
|
|
97
|
+
text(s, body, x, 4.89, 2.75, 0.7, { fontSize: 15, color: C.muted });
|
|
98
|
+
});
|
|
99
|
+
s.addNotes('流程页只表达步骤关系。节点可以换成真实时间或阶段名称,不需要给标题添加装饰线。');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 5. A native work card stands in for the user's own real artwork or screenshot.
|
|
103
|
+
{
|
|
104
|
+
const s = a.addSlide({ title: '让作品,成为最具体的说明。', highlight: '作品',
|
|
105
|
+
subtitle: '左边解释价值,右边展示材料;真实图片保持比例。', section: '03 展示作品', sectionColor: C.pink });
|
|
106
|
+
title(s, '先说清楚,\n再给人看见。', { x: 0.73, y: 2.86, w: 4.4, h: 1.18, fontSize: 30 });
|
|
107
|
+
text(s, '作品页把结果放在中心。\n用一句话说明解决了什么问题,\n再补充必要的背景。', 0.76, 4.50, 4.75, 1.20,
|
|
108
|
+
{ fontSize: 17, color: C.muted });
|
|
109
|
+
panel(s, 6.16, 2.76, 6.47, 3.76, { fill: '141020' });
|
|
110
|
+
tag(s, '原生可编辑作品卡', 6.48, 3.08, 5.6, C.pink);
|
|
111
|
+
title(s, '年度创作计划', { x: 6.48, y: 3.68, w: 5.83, h: 0.52, fontSize: 26 });
|
|
112
|
+
const rows = [['春季', '内容选题与资料整理', C.blue], ['夏季', '第一组作品与反馈', C.violet], ['秋季', '修订与对外展示', C.gold]];
|
|
113
|
+
rows.forEach(([label, body, color], i) => {
|
|
114
|
+
const y = 4.51 + i * 0.49;
|
|
115
|
+
tag(s, label, 6.50, y, 0.90, color);
|
|
116
|
+
text(s, body, 7.63, y, 4.5, 0.30, { fontSize: 14.5, color: C.muted });
|
|
117
|
+
});
|
|
118
|
+
text(s, '说明性作品卡;可替换为你的真实截图或图片', 6.48, 6.14, 5.8, 0.22,
|
|
119
|
+
{ fontSize: 10.5, color: C.dim });
|
|
120
|
+
s.addNotes('右侧是说明性创作计划卡,不是客户案例或真实软件截图。实际作品页可以使用用户自己的图像;裁切保持比例,并写明作品的真实阶段。');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 6. Two sides use the same text baselines and hierarchy.
|
|
124
|
+
{
|
|
125
|
+
const s = a.addSlide({ title: '少一点堆叠,多一点清晰。', highlight: '清晰',
|
|
126
|
+
subtitle: '通过相同尺度的对照,让读者看见表达方式的变化。', section: '04 形成判断', sectionColor: C.gold });
|
|
127
|
+
const entries = [
|
|
128
|
+
['信息堆叠', '标题、正文和注释挤在一起。\n每个颜色都在争抢注意力。\n读者难以找到最重要的结论。', C.pink],
|
|
129
|
+
['清楚表达', '标题先给结论,正文再解释。\n用一段颜色强调关键短语。\n让留白帮助读者跟上节奏。', C.blue],
|
|
130
|
+
];
|
|
131
|
+
entries.forEach(([heading, body, color], i) => {
|
|
132
|
+
const x = 0.80 + i * 6.03;
|
|
133
|
+
panel(s, x, 2.76, 5.72, 3.20);
|
|
134
|
+
tag(s, i === 0 ? '之前' : '之后', x + 0.30, 3.08, 4.8, color);
|
|
135
|
+
title(s, heading, { x: x + 0.30, y: 3.63, w: 5.12, h: 0.51, fontSize: 25 });
|
|
136
|
+
text(s, body, x + 0.30, 4.45, 5.12, 1.10, { fontSize: 15.5, color: C.muted });
|
|
137
|
+
});
|
|
138
|
+
text(s, '用一致的版式比较变化,让判断来自内容。', 0.85, 6.30, 11.7, 0.32,
|
|
139
|
+
{ fontSize: 15, color: C.muted });
|
|
140
|
+
s.addNotes('对照页用同样的框、字号和行基准。蓝色和粉色帮助区分两边,不改变两侧的阅读层级。');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// 7. Large native numbers; these describe this example, not product metrics.
|
|
144
|
+
{
|
|
145
|
+
const s = a.addSlide({ title: '用数字,说明具体的事情。', highlight: '数字',
|
|
146
|
+
subtitle: '每个数字都需要清楚的含义,示例不代表产品性能。', section: '数据版式', sectionColor: C.gold });
|
|
147
|
+
[['8', '示例版式', '从封面到封底', C.blue], ['4', '虹彩基色', '蓝 · 紫 · 粉 · 金', C.violet],
|
|
148
|
+
['16:9', '宽屏比例', '适合阅读与演示', C.gold]].forEach(([value, label, detail, color], i) => {
|
|
149
|
+
const x = 0.73 + i * 4.15;
|
|
150
|
+
panel(s, x, 2.8, 3.85, 3.33);
|
|
151
|
+
text(s, value, x + 0.24, 3.24, 3.37, 1.16,
|
|
152
|
+
{ fontFace: a.config.titleFont, fontSize: 58, color });
|
|
153
|
+
title(s, label, { x: x + 0.24, y: 4.66, w: 3.37, h: 0.46, fontSize: 23 });
|
|
154
|
+
text(s, detail, x + 0.24, 5.44, 3.37, 0.32, { fontSize: 14.6, color: C.muted });
|
|
155
|
+
});
|
|
156
|
+
text(s, '数据来源:本份风格示例。使用业务数据时补充来源与统计时间。',
|
|
157
|
+
0.80, 6.42, 11.8, 0.3, { fontSize: 11, color: C.dim });
|
|
158
|
+
s.addNotes('八页、四色和 16:9 都是本示例可以直接核对的结构信息。这里没有编造客户、性能或收益数据。');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// 8. A quiet link and optional style credit; no invented contact address.
|
|
162
|
+
{
|
|
163
|
+
const s = a.addSlide({ hero: true });
|
|
164
|
+
title(s, '让你的想法,有了回响。', { highlight: '有了回响。',
|
|
165
|
+
x: 0.8, y: 2.46, w: 11.75, h: 1.03, fontSize: 49, align: 'center' });
|
|
166
|
+
title(s, 'Engine7 极光 · 从这里开始',
|
|
167
|
+
{ x: 1.2, y: 3.70, w: 10.95, h: 0.66, fontSize: 26, align: 'center' });
|
|
168
|
+
if (a.config.website) text(s, a.config.website.replace(/^https?:\/\//, '').replace(/\/$/, ''),
|
|
169
|
+
3.4, 5.53, 6.53, 0.45, { fontFace: a.config.titleFont, fontSize: 18,
|
|
170
|
+
color: C.muted, align: 'center', underline: { style: 'none' },
|
|
171
|
+
hyperlink: { url: a.config.website } });
|
|
172
|
+
a.closingCredit(s);
|
|
173
|
+
s.addNotes('最后回到中心句和真实入口。Engine7 Aurora 是可选风格来源,用户可以保留或关闭;作品品牌和作者归属于用户。');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
fs.mkdirSync(path.dirname(path.resolve(output)), { recursive: true });
|
|
177
|
+
await deck.writeFile({ fileName: output });
|
|
178
|
+
return output;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
module.exports = { buildExample };
|
|
182
|
+
if (require.main === module) {
|
|
183
|
+
const output = process.argv[2];
|
|
184
|
+
if (!output) {
|
|
185
|
+
console.error('Usage: node examples/engine7-aurora.cjs OUTPUT.pptx');
|
|
186
|
+
process.exitCode = 1;
|
|
187
|
+
} else buildExample(output).then(file => console.log(file)).catch(error => {
|
|
188
|
+
console.error(error.message); process.exitCode = 1;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "engine7-pptx-skill-tools",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "engine7-pptx-skill-tools",
|
|
9
|
+
"version": "1.0.0",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"pptxgenjs": "4.0.1"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"node_modules/@types/node": {
|
|
15
|
+
"version": "22.20.5",
|
|
16
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz",
|
|
17
|
+
"integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"undici-types": "~6.21.0"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"node_modules/core-util-is": {
|
|
24
|
+
"version": "1.0.3",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
26
|
+
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
|
27
|
+
"license": "MIT"
|
|
28
|
+
},
|
|
29
|
+
"node_modules/https": {
|
|
30
|
+
"version": "1.0.0",
|
|
31
|
+
"resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz",
|
|
32
|
+
"integrity": "sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==",
|
|
33
|
+
"license": "ISC"
|
|
34
|
+
},
|
|
35
|
+
"node_modules/image-size": {
|
|
36
|
+
"version": "1.2.1",
|
|
37
|
+
"resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz",
|
|
38
|
+
"integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==",
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"queue": "6.0.2"
|
|
42
|
+
},
|
|
43
|
+
"bin": {
|
|
44
|
+
"image-size": "bin/image-size.js"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=16.x"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"node_modules/immediate": {
|
|
51
|
+
"version": "3.0.6",
|
|
52
|
+
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
|
53
|
+
"integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==",
|
|
54
|
+
"license": "MIT"
|
|
55
|
+
},
|
|
56
|
+
"node_modules/inherits": {
|
|
57
|
+
"version": "2.0.4",
|
|
58
|
+
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
|
59
|
+
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
|
60
|
+
"license": "ISC"
|
|
61
|
+
},
|
|
62
|
+
"node_modules/isarray": {
|
|
63
|
+
"version": "1.0.0",
|
|
64
|
+
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
|
65
|
+
"integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
|
|
66
|
+
"license": "MIT"
|
|
67
|
+
},
|
|
68
|
+
"node_modules/jszip": {
|
|
69
|
+
"version": "3.10.2",
|
|
70
|
+
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.2.tgz",
|
|
71
|
+
"integrity": "sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==",
|
|
72
|
+
"license": "(MIT OR GPL-3.0-or-later)",
|
|
73
|
+
"dependencies": {
|
|
74
|
+
"lie": "~3.3.0",
|
|
75
|
+
"pako": "~1.0.2",
|
|
76
|
+
"readable-stream": "~2.3.6",
|
|
77
|
+
"setimmediate": "^1.0.5"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"node_modules/lie": {
|
|
81
|
+
"version": "3.3.0",
|
|
82
|
+
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
|
83
|
+
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"dependencies": {
|
|
86
|
+
"immediate": "~3.0.5"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"node_modules/pako": {
|
|
90
|
+
"version": "1.0.11",
|
|
91
|
+
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
|
92
|
+
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
|
|
93
|
+
"license": "(MIT AND Zlib)"
|
|
94
|
+
},
|
|
95
|
+
"node_modules/pptxgenjs": {
|
|
96
|
+
"version": "4.0.1",
|
|
97
|
+
"resolved": "https://registry.npmjs.org/pptxgenjs/-/pptxgenjs-4.0.1.tgz",
|
|
98
|
+
"integrity": "sha512-TeJISr8wouAuXw4C1F/mC33xbZs/FuEG6nH9FG1Zj+nuPcGMP5YRHl6X+j3HSUnS1f3at6k75ZZXPMZlA5Lj9A==",
|
|
99
|
+
"license": "MIT",
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"@types/node": "^22.8.1",
|
|
102
|
+
"https": "^1.0.0",
|
|
103
|
+
"image-size": "^1.2.1",
|
|
104
|
+
"jszip": "^3.10.1"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"node_modules/process-nextick-args": {
|
|
108
|
+
"version": "2.0.1",
|
|
109
|
+
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
|
110
|
+
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
|
|
111
|
+
"license": "MIT"
|
|
112
|
+
},
|
|
113
|
+
"node_modules/queue": {
|
|
114
|
+
"version": "6.0.2",
|
|
115
|
+
"resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz",
|
|
116
|
+
"integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==",
|
|
117
|
+
"license": "MIT",
|
|
118
|
+
"dependencies": {
|
|
119
|
+
"inherits": "~2.0.3"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"node_modules/readable-stream": {
|
|
123
|
+
"version": "2.3.8",
|
|
124
|
+
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
|
|
125
|
+
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
|
|
126
|
+
"license": "MIT",
|
|
127
|
+
"dependencies": {
|
|
128
|
+
"core-util-is": "~1.0.0",
|
|
129
|
+
"inherits": "~2.0.3",
|
|
130
|
+
"isarray": "~1.0.0",
|
|
131
|
+
"process-nextick-args": "~2.0.0",
|
|
132
|
+
"safe-buffer": "~5.1.1",
|
|
133
|
+
"string_decoder": "~1.1.1",
|
|
134
|
+
"util-deprecate": "~1.0.1"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"node_modules/safe-buffer": {
|
|
138
|
+
"version": "5.1.2",
|
|
139
|
+
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
140
|
+
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
|
141
|
+
"license": "MIT"
|
|
142
|
+
},
|
|
143
|
+
"node_modules/setimmediate": {
|
|
144
|
+
"version": "1.0.5",
|
|
145
|
+
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
|
146
|
+
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
|
|
147
|
+
"license": "MIT"
|
|
148
|
+
},
|
|
149
|
+
"node_modules/string_decoder": {
|
|
150
|
+
"version": "1.1.1",
|
|
151
|
+
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
|
152
|
+
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
|
153
|
+
"license": "MIT",
|
|
154
|
+
"dependencies": {
|
|
155
|
+
"safe-buffer": "~5.1.0"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"node_modules/undici-types": {
|
|
159
|
+
"version": "6.21.0",
|
|
160
|
+
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
|
|
161
|
+
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
|
|
162
|
+
"license": "MIT"
|
|
163
|
+
},
|
|
164
|
+
"node_modules/util-deprecate": {
|
|
165
|
+
"version": "1.0.2",
|
|
166
|
+
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
|
167
|
+
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
|
168
|
+
"license": "MIT"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "engine7-pptx-skill-tools",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Local PptxGenJS dependency for the bundled PPTX skill and Engine7 Aurora style",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "node --test tests/engine7-aurora.test.cjs"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"pptxgenjs": "4.0.1"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Engine7-authored style helpers. SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Pass a PptxGenJS instance; assets resolve beside the skill, independent of cwd.
|
|
3
|
+
const path = require('node:path');
|
|
4
|
+
|
|
5
|
+
const COLORS = Object.freeze({
|
|
6
|
+
bg: '040408', surface: '0B0B13', panel: '100D1D', line: '30283F',
|
|
7
|
+
white: 'ECE8E1', muted: 'B3ADBE', dim: '8B8397', blue: '6ECDFF',
|
|
8
|
+
violet: 'A78BFA', pink: 'FF6B9D', gold: 'FFCF8A', green: '5FE6C0',
|
|
9
|
+
});
|
|
10
|
+
const SIZE = Object.freeze({ w: 13.3333333333, h: 7.5 });
|
|
11
|
+
const ASSETS = path.join(__dirname, '../assets/engine7-aurora');
|
|
12
|
+
const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
|
|
13
|
+
|
|
14
|
+
function gradientRuns(text) {
|
|
15
|
+
const chars = [...segmenter.segment(text)].map(s => s.segment);
|
|
16
|
+
const stops = [COLORS.blue, COLORS.violet, COLORS.pink, COLORS.gold];
|
|
17
|
+
return chars.map((char, i) => {
|
|
18
|
+
const position = chars.length === 1 ? 0 : i / (chars.length - 1) * 3;
|
|
19
|
+
const left = Math.min(2, Math.floor(position));
|
|
20
|
+
const fraction = position - left;
|
|
21
|
+
const color = [0, 2, 4].map(offset => {
|
|
22
|
+
const a = parseInt(stops[left].slice(offset, offset + 2), 16);
|
|
23
|
+
const b = parseInt(stops[left + 1].slice(offset, offset + 2), 16);
|
|
24
|
+
return Math.round(a + (b - a) * fraction).toString(16).padStart(2, '0');
|
|
25
|
+
}).join('').toUpperCase();
|
|
26
|
+
return { text: char, options: { color } };
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createAurora(pptx, options = {}) {
|
|
31
|
+
const defaults = process.platform === 'darwin'
|
|
32
|
+
? ['PingFang SC Thin', 'PingFang SC']
|
|
33
|
+
: process.platform === 'win32'
|
|
34
|
+
? ['Microsoft YaHei Light', 'Microsoft YaHei']
|
|
35
|
+
: ['Noto Sans CJK SC Light', 'Noto Sans CJK SC'];
|
|
36
|
+
const config = {
|
|
37
|
+
brand: 'Engine7 · 栖', title: 'Engine7 极光', author: '', website: '',
|
|
38
|
+
titleFont: defaults[0], bodyFont: defaults[1], credit: true, ...options,
|
|
39
|
+
};
|
|
40
|
+
pptx.layout = 'LAYOUT_WIDE';
|
|
41
|
+
pptx.title = config.title;
|
|
42
|
+
pptx.author = config.author;
|
|
43
|
+
pptx.subject = 'Presentation style: Engine7 Aurora';
|
|
44
|
+
pptx.company = '';
|
|
45
|
+
pptx.lang = 'zh-CN';
|
|
46
|
+
pptx.theme = { headFontFace: config.titleFont, bodyFontFace: config.bodyFont, lang: 'zh-CN' };
|
|
47
|
+
let number = 0;
|
|
48
|
+
|
|
49
|
+
function text(slide, value, x, y, w, h, opts = {}) {
|
|
50
|
+
slide.addText(value, {
|
|
51
|
+
x, y, w, h, fontFace: config.bodyFont, fontSize: 18, color: COLORS.white,
|
|
52
|
+
bold: false, margin: 0, valign: 'mid', paraSpaceAfter: 0,
|
|
53
|
+
lineSpacingMultiple: 1.12, ...opts,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function title(slide, value, opts = {}) {
|
|
58
|
+
const { highlight = '', x = 0.64, y = 0.94, w = 12.05, h = 0.76,
|
|
59
|
+
fontSize = 33, ...rest } = opts;
|
|
60
|
+
let runs = value;
|
|
61
|
+
const start = highlight ? value.indexOf(highlight) : -1;
|
|
62
|
+
if (start !== -1) {
|
|
63
|
+
runs = [
|
|
64
|
+
{ text: value.slice(0, start) }, ...gradientRuns(highlight),
|
|
65
|
+
{ text: value.slice(start + highlight.length) },
|
|
66
|
+
].filter(r => r.text);
|
|
67
|
+
}
|
|
68
|
+
text(slide, runs, x, y, w, h, {
|
|
69
|
+
fontFace: config.titleFont, fontSize, charSpacing: fontSize * 0.035, ...rest,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function panel(slide, x, y, w, h, opts = {}) {
|
|
74
|
+
const { fill = COLORS.panel, stroke = COLORS.line, radius = 0.18, ...rest } = opts;
|
|
75
|
+
slide.addShape(pptx.ShapeType.roundRect, {
|
|
76
|
+
x, y, w, h, radius, rectRadius: radius,
|
|
77
|
+
line: { color: stroke, width: 0.8 }, fill: { color: fill }, ...rest,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function brand(slide, hero = false) {
|
|
82
|
+
if (config.brand === 'Engine7 · 栖') {
|
|
83
|
+
const w = hero ? 3.9 : 1.85;
|
|
84
|
+
slide.addImage({ path: path.join(ASSETS, 'wordmark.png'),
|
|
85
|
+
x: hero ? 0.8 : 0.5, y: hero ? 0.55 : 0.19, w, h: w * 0.90 / 4.65,
|
|
86
|
+
altText: config.brand });
|
|
87
|
+
} else {
|
|
88
|
+
text(slide, config.brand, hero ? 0.8 : 0.5, hero ? 0.55 : 0.19,
|
|
89
|
+
hero ? 7 : 5.2, hero ? 0.76 : 0.38,
|
|
90
|
+
{ fontFace: config.titleFont, fontSize: hero ? 30 : 16 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Add after card contents so text shapes cannot cover the clickable area.
|
|
95
|
+
function hotspot(slide, x, y, w, h, hyperlink) {
|
|
96
|
+
slide.addShape(pptx.ShapeType.rect, { x, y, w, h,
|
|
97
|
+
line: { type: 'none' }, fill: { color: COLORS.bg, transparency: 100 }, hyperlink });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function addSlide({ title: heading = '', highlight = '', subtitle = '',
|
|
101
|
+
section = '', sectionColor = COLORS.violet, hero = false } = {}) {
|
|
102
|
+
const slide = pptx.addSlide();
|
|
103
|
+
number += 1;
|
|
104
|
+
slide.background = { color: COLORS.bg };
|
|
105
|
+
slide.addImage({ path: path.join(ASSETS, hero ? 'hero.png' : 'field.png'),
|
|
106
|
+
x: 0, y: 0, w: SIZE.w, h: SIZE.h, altText: 'Engine7 Aurora background' });
|
|
107
|
+
brand(slide, hero);
|
|
108
|
+
if (!hero) {
|
|
109
|
+
if (section) text(slide, section, 6.2, 0.24, 6.46, 0.29,
|
|
110
|
+
{ fontSize: 14, color: sectionColor, align: 'right' });
|
|
111
|
+
if (heading) title(slide, heading, { highlight });
|
|
112
|
+
if (subtitle) text(slide, subtitle, 0.67, 1.84, 11.9, 0.45,
|
|
113
|
+
{ fontSize: 15.5, color: COLORS.muted });
|
|
114
|
+
}
|
|
115
|
+
text(slide, config.brand, 0.66, 7.09, 6, 0.23,
|
|
116
|
+
{ fontSize: 10.3, color: COLORS.muted, charSpacing: 0.5 });
|
|
117
|
+
text(slide, String(number).padStart(2, '0'), 12.13, 7.06, 0.53, 0.24,
|
|
118
|
+
{ fontSize: 9, color: COLORS.muted, align: 'right' });
|
|
119
|
+
return slide;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function closingCredit(slide) {
|
|
123
|
+
if (!config.credit) return;
|
|
124
|
+
text(slide, 'Style: Engine7 Aurora · twinsun.top', 4.0, 6.60, 5.33, 0.28,
|
|
125
|
+
{ fontSize: 10, color: COLORS.dim, align: 'center',
|
|
126
|
+
underline: { style: 'none' }, hyperlink: { url: 'https://www.twinsun.top/' } });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return { colors: COLORS, size: SIZE, config, addSlide, text, title, panel, brand, hotspot, closingCredit };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
module.exports = { createAurora, gradientRuns, COLORS, SIZE };
|