@amaster.ai/pi-lark 0.1.2-beta.40 → 0.1.2-beta.41
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/package.json +2 -2
- package/skills/lark-apps/SKILL.md +10 -0
- package/skills/lark-apps/references/lark-apps-db-execute.md +1 -1
- package/skills/lark-apps/references/lark-apps-db.md +2 -2
- package/skills/lark-calendar/SKILL.md +89 -31
- package/skills/lark-calendar/references/lark-calendar-create.md +7 -39
- package/skills/lark-calendar/references/lark-calendar-room-find.md +5 -9
- package/skills/lark-calendar/references/lark-calendar-rsvp.md +1 -5
- package/skills/lark-calendar/references/lark-calendar-schedule-clear-time.md +59 -0
- package/skills/lark-calendar/references/lark-calendar-schedule-fuzzy-time.md +88 -0
- package/skills/lark-calendar/references/lark-calendar-schedule-meeting.md +67 -210
- package/skills/lark-calendar/references/lark-calendar-suggestion.md +1 -5
- package/skills/lark-calendar/references/lark-calendar-update.md +2 -7
- package/skills/lark-doc/SKILL.md +1 -1
- package/skills/lark-doc/references/lark-doc-fetch.md +4 -2
- package/skills/lark-doc/references/lark-doc-mindnote.md +17 -2
- package/skills/lark-doc/references/lark-doc-whiteboard.md +4 -0
- package/skills/lark-doc/references/lark-doc-xml-extended-blocks.md +34 -0
- package/skills/lark-doc/references/lark-doc-xml.md +3 -2
- package/skills/lark-drive/SKILL.md +7 -3
- package/skills/lark-drive/references/lark-drive-delete.md +12 -0
- package/skills/lark-drive/references/lark-drive-files-list.md +27 -2
- package/skills/lark-drive/references/lark-drive-inspect.md +2 -0
- package/skills/lark-drive/references/lark-drive-permission-guide.md +12 -0
- package/skills/lark-drive/references/lark-drive-push.md +32 -5
- package/skills/lark-drive/references/lark-drive-workflow-knowledge-organize.md +26 -20
- package/skills/lark-drive/references/lark-drive-workflow.md +2 -1
- package/skills/lark-mail/SKILL.md +12 -9
- package/skills/lark-mail/references/lark-mail-forward.md +1 -1
- package/skills/lark-mail/references/lark-mail-message-modify.md +48 -0
- package/skills/lark-mail/references/lark-mail-message-trash.md +41 -0
- package/skills/lark-mail/references/lark-mail-reply-all.md +1 -1
- package/skills/lark-mail/references/lark-mail-reply.md +1 -1
- package/skills/lark-mail/references/lark-mail-watch.md +1 -1
- package/skills/lark-markdown/SKILL.md +3 -2
- package/skills/lark-markdown/references/lark-markdown-create.md +22 -2
- package/skills/lark-minutes/references/lark-minutes-download.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-search.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-speaker-replace.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-summary.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-todo.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-update.md +0 -2
- package/skills/lark-minutes/references/lark-minutes-upload.md +10 -10
- package/skills/lark-shared/SKILL.md +18 -0
- package/skills/lark-slides/references/asset-planning.md +16 -4
- package/skills/lark-slides/references/lark-slides-whiteboard.md +31 -30
- package/skills/lark-slides/references/planning-layer.md +31 -1
- package/skills/lark-slides/references/slides_chart_demo.xml +1 -0
- package/skills/lark-slides/references/slides_xml_schema_definition.xml +1 -1
- package/skills/lark-slides/references/xml-format-guide.md +50 -1
- package/skills/lark-slides/references/xml-schema-quick-ref.md +1 -1
- package/skills/lark-task/references/lark-task-create.md +14 -1
- package/skills/lark-vc/references/lark-vc-recording.md +0 -2
- package/skills/lark-vc-agent/SKILL.md +13 -10
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-events.md +64 -36
- package/skills/lark-vc-agent/references/lark-vc-agent-meeting-list-active.md +7 -7
- package/skills/lark-whiteboard/references/lark-whiteboard-workflow.md +5 -2
- package/skills/lark-wiki/SKILL.md +4 -2
- package/skills/lark-wiki/references/lark-wiki-node-get.md +1 -1
- package/skills/lark-wiki/references/lark-wiki-node-list.md +9 -2
- package/skills/lark-calendar/references/lark-calendar-agenda.md +0 -78
- package/skills/lark-calendar/references/lark-calendar-freebusy.md +0 -124
- package/skills/lark-calendar/references/lark-calendar-search-event.md +0 -29
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# minutes +upload
|
|
2
2
|
|
|
3
|
-
> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。
|
|
4
3
|
|
|
5
4
|
上传音视频文件到飞书妙记并生成妙记(Minute)。
|
|
6
5
|
|
|
@@ -31,12 +30,12 @@
|
|
|
31
30
|
```
|
|
32
31
|
- 命令执行成功后,将返回生成的妙记链接 `minute_url`。
|
|
33
32
|
|
|
34
|
-
3. **如需纪要 / 逐字稿 / 文字稿 /
|
|
35
|
-
-
|
|
36
|
-
- 如果用户要的是纪要、逐字稿、文字稿、撰写文字、总结、待办或章节,继续调用:
|
|
33
|
+
3. **如需纪要 / 逐字稿 / 文字稿 / 撰写文字,使用返回的 `minute_token` 调用 `minutes +detail`**
|
|
34
|
+
- 如果用户要的是纪要、逐字稿、文字稿、撰写文字、总结、待办或章节,使用上一步返回的 `minute_token` 继续调用:
|
|
37
35
|
```bash
|
|
38
|
-
lark-cli minutes +detail --minute-tokens <minute_token> --summary --todo --chapter --keyword --transcript
|
|
36
|
+
lark-cli minutes +detail --minute-tokens <minute_token> --wait-ready --summary --todo --chapter --keyword --transcript
|
|
39
37
|
```
|
|
38
|
+
- `--wait-ready` 参数表示等待妙记生成完毕后再获取产物,上传后立即读取详情时必须加上此参数。
|
|
40
39
|
- `minutes +detail --minute-tokens` 会返回妙记产物(总结、待办、章节、关键词、逐字稿);必要时还会把逐字稿落地到本地文件。
|
|
41
40
|
|
|
42
41
|
> **异步生成提示**:API 会立即返回 `minute_url`,但妙记可能仍在异步生成中,您可以直接通过该妙记链接查看当前的处理状态和转写结果。
|
|
@@ -47,8 +46,8 @@
|
|
|
47
46
|
# 通过已上传到云空间(云盘/云存储)的 file_token 生成妙记
|
|
48
47
|
lark-cli minutes +upload --file-token boxcnxxxxxxxxxxxxxxxx
|
|
49
48
|
|
|
50
|
-
#
|
|
51
|
-
lark-cli minutes +detail --minute-tokens obcnxxxxxxxxxxxxxxxx --summary
|
|
49
|
+
# 上传后立即获取妙记产物,需加 --wait-ready 等待生成完毕(--summary --todo --chapter --keyword --transcript 按需传入)
|
|
50
|
+
lark-cli minutes +detail --minute-tokens obcnxxxxxxxxxxxxxxxx --wait-ready --summary
|
|
52
51
|
```
|
|
53
52
|
|
|
54
53
|
## 参数
|
|
@@ -81,7 +80,7 @@ lark-cli minutes +detail --minute-tokens obcnxxxxxxxxxxxxxxxx --summary
|
|
|
81
80
|
1. 使用 `lark-cli drive +upload --file <path>` 上传本地音视频文件到云空间(云盘/云存储)
|
|
82
81
|
2. 从返回结果中取出 `file_token`
|
|
83
82
|
3. 调用 `lark-cli minutes +upload --file-token <file_token>` 生成妙记
|
|
84
|
-
4.
|
|
83
|
+
4. 如果目标是纪要、逐字稿、文字稿、撰写文字、总结、待办或章节,使用返回的 `minute_token`,继续调用 `lark-cli minutes +detail --minute-tokens <minute_token> --wait-ready`
|
|
85
84
|
|
|
86
85
|
> **边界说明**:`minutes +upload` 本身只负责把文件转成妙记并返回 `minute_url`。纪要内容、逐字稿、文字稿、撰写文字、总结、待办、章节属于后续产物获取,应由 [minutes +detail](lark-minutes-detail.md) 承接。
|
|
87
86
|
|
|
@@ -89,16 +88,17 @@ lark-cli minutes +detail --minute-tokens obcnxxxxxxxxxxxxxxxx --summary
|
|
|
89
88
|
|
|
90
89
|
```json
|
|
91
90
|
{
|
|
92
|
-
"minute_url": "http(s)://<host>/minutes/<minute-token>"
|
|
91
|
+
"minute_url": "http(s)://<host>/minutes/<minute-token>",
|
|
92
|
+
"minute_token": "<minute-token>"
|
|
93
93
|
}
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
| 字段 | 说明 |
|
|
97
97
|
|------|------|
|
|
98
98
|
| `minute_url` | 生成的妙记访问链接 |
|
|
99
|
+
| `minute_token` | 从 `minute_url` 提取出的妙记 Token,可直接传给 `minutes +detail --minute-tokens` |
|
|
99
100
|
|
|
100
101
|
## 参考
|
|
101
102
|
|
|
102
103
|
- [lark-minutes](../SKILL.md) -- 妙记相关功能说明
|
|
103
104
|
- [drive +upload](../../lark-drive/references/lark-drive-upload.md) -- 上传文件到云空间(云盘/云存储)
|
|
104
|
-
- [lark-shared](../../lark-shared/SKILL.md) -- 认证和全局参数
|
|
@@ -146,6 +146,24 @@ lark-cli update
|
|
|
146
146
|
|
|
147
147
|
**重要**:始终使用 `lark-cli update` 更新,它会同时更新 CLI 和 AI Skills。
|
|
148
148
|
|
|
149
|
+
## JSON 输出契约
|
|
150
|
+
|
|
151
|
+
`--format json`(默认)下,成功与错误的信封结构不同:
|
|
152
|
+
|
|
153
|
+
成功信封写入 **stdout**(退出码 0):
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{ "ok": true, "identity": "user", "data": { "guid": "..." }, "meta": { "count": 1 } }
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
错误信封写入 **stderr**(退出码非 0):
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{ "ok": false, "identity": "user", "error": { "type": "api", "subtype": "...", "code": 99991679, "message": "...", "hint": "..." } }
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**判断成功必须用 `ok == true`(或进程退出码 0),不要用 `code == 0`**:成功信封没有顶层 `code` / `msg` 字段,`code` 只出现在错误信封的 `error` 内,含义是上游 OpenAPI 的 numeric code。按 OpenAPI 老格式 `{"code": 0, "msg": "ok"}` 判断会把所有成功调用误判为失败;封装写入类命令(如 `task +create`)时尤其危险,误判会绕过幂等逻辑导致重复创建。
|
|
166
|
+
|
|
149
167
|
## 安全规则
|
|
150
168
|
|
|
151
169
|
- **禁止输出密钥**(appSecret、accessToken)到终端明文。
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## Core Rules
|
|
8
8
|
|
|
9
9
|
- `asset_need` is metadata only. It can guide page design, but it must not require web search, local download, media upload, or external tools.
|
|
10
|
-
- Every planned asset must include a fallback visual plan
|
|
10
|
+
- Every planned asset must include a fallback visual plan. The fallback can use native charts, tables, whiteboard diagrams, placeholder regions, or XML shapes, text, and arrows as appropriate.
|
|
11
11
|
- Asset needs must serve the page's `key_message` and `visual_focus`. Do not add decorative assets that do not clarify the page.
|
|
12
12
|
- Prefer a few high-value asset plans over one asset on every page. For a 6-page technical or business deck, plan assets on at least 3 pages when the content allows.
|
|
13
13
|
- If a real local asset already exists or the user provides one, it can be used through the normal media-upload workflow. Still keep `fallback_if_missing` in the plan.
|
|
@@ -43,7 +43,7 @@ For a page without a meaningful asset need, use:
|
|
|
43
43
|
- `architecture_diagram`: system components, data flow, dependency map, or model structure.
|
|
44
44
|
- `icon`: small semantic symbol for a concept, step, role, or status.
|
|
45
45
|
- `logo`: brand, product, team, or customer mark.
|
|
46
|
-
- `chart`:
|
|
46
|
+
- `chart`: column, bar, line, area, radar, pie, doughnut/ring, or combo data visual. Note: `<chart>` does not support funnel or scatter — map those to `<whiteboard>` SVG at generation time.
|
|
47
47
|
- `infographic`: composed visual explanation, usually combining labels, numbers, and simple shapes.
|
|
48
48
|
- `screenshot`: product UI, terminal output, workflow state, or page capture.
|
|
49
49
|
- `flow_diagram`: process, sequence, decision tree, or mechanism diagram.
|
|
@@ -64,11 +64,23 @@ Match asset type to slide role:
|
|
|
64
64
|
|
|
65
65
|
`suggested_query` is only a future lookup hint. Write it as a short phrase a human or later workflow could search, but do not execute the search unless the user separately requests real assets.
|
|
66
66
|
|
|
67
|
+
For `asset_type: "chart"`:
|
|
68
|
+
|
|
69
|
+
- If the visual is a supported standard data chart — column, bar, line, area, radar, pie, doughnut/ring, or combo — `fallback_if_missing` must still render as a native `<chart>`.
|
|
70
|
+
- Do not imitate supported standard data visuals with manual drawing primitives or `<whiteboard>`.
|
|
71
|
+
- Choose the data source explicitly:
|
|
72
|
+
- `user_provided`: when the user provides concrete values, tables, CSV, or metric lists, use those values and do not replace them with mock data.
|
|
73
|
+
- `mock_placeholder`: when the user asks for a placeholder, template, example, or chart position to replace later, use mock data in a native `<chart>`.
|
|
74
|
+
- `mock_required_by_intent`: when the user does not provide concrete values but asks for data expression, charts, trends, comparisons, or distributions, use mock data in a native `<chart>`.
|
|
75
|
+
- Mock data must be labeled as `模拟数据,仅占位,待替换真实数据` or equivalent. Do not present mock values as facts.
|
|
76
|
+
- Manual drawing fallbacks are allowed only for unsupported chart types such as scatter, funnel, waterfall-like custom visuals, or decorative non-data visuals.
|
|
77
|
+
|
|
67
78
|
`fallback_if_missing` must be concrete enough to turn into XML, for example:
|
|
68
79
|
|
|
69
80
|
- "Draw a simplified attention matrix with 5 token labels, semi-transparent cells, and arrows to output token."
|
|
70
81
|
- "Use three grouped boxes with arrows from client to gateway to service; add small protocol labels."
|
|
71
|
-
- "Render a
|
|
82
|
+
- "Render a native `<chart>` using the user-provided series."
|
|
83
|
+
- "Render a native `<chart>` with mock placeholder values and label it as `模拟数据,仅占位,待替换真实数据`."
|
|
72
84
|
- "Use a bordered placeholder panel with product area labels, not an empty image."
|
|
73
85
|
|
|
74
86
|
Weak fallbacks to avoid:
|
|
@@ -118,7 +130,7 @@ Business comparison page:
|
|
|
118
130
|
When generating XML:
|
|
119
131
|
|
|
120
132
|
1. If an asset exists and the workflow supports it, place it in the planned visual region.
|
|
121
|
-
2. If no asset exists, immediately render `fallback_if_missing` with XML-native shapes, text, lines, arrows, tables, whiteboard diagrams, or
|
|
133
|
+
2. If no asset exists, immediately render `fallback_if_missing` with the planned XML-native element type. Supported standard data visuals still use native `<chart>`; other fallbacks may use shapes, text, lines, arrows, tables, whiteboard diagrams, or placeholder panels.
|
|
122
134
|
3. Size the fallback to satisfy `visual_focus`; it should be a real page element, not a tiny decoration.
|
|
123
135
|
4. Keep text-density limits. Do not compensate for missing assets by adding long bullet text.
|
|
124
136
|
5. After creation, fetch the presentation and verify asset pages are not blank and that each planned fallback is visible when no real asset was used.
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`<whiteboard>` 放在 `<data>` 内,内部可放 **SVG** 或 **Mermaid**,用于绘制流程图、时序图、架构图、散点图、漏斗图、自定义图标、装饰图案等 `<chart>` 和 `<shape>` 难以覆盖的视觉内容。
|
|
4
4
|
|
|
5
|
+
普通柱状图、条形图、折线图、面积图、雷达图、饼图 / 环图和组合图应优先使用原生 `<chart>`。除非用户明确要求像素级自定义,或图表类型确实不受 `<chart>` 支持,否则不要用 `<whiteboard>` + SVG / Mermaid 重画这些标准图表。
|
|
6
|
+
|
|
5
7
|
> 前置条件:使用本文档前先阅读 [lark-slides SKILL.md](../SKILL.md)。
|
|
6
8
|
|
|
7
9
|
---
|
|
@@ -12,13 +14,13 @@
|
|
|
12
14
|
|
|
13
15
|
| 场景 | 推荐元素 |
|
|
14
16
|
|------|---------|
|
|
15
|
-
|
|
|
16
|
-
| 散点图、漏斗图(`<chart>`
|
|
17
|
+
| 有结构化数据序列的柱/条/折线/面积/雷达/饼/环/组合图 | `<chart>` — 原生渲染,支持 legend / tooltip / 系列配色 |
|
|
18
|
+
| 散点图、漏斗图(`<chart>` 不支持)或其他非原生数据视觉 | `<whiteboard>` SVG |
|
|
17
19
|
| 流程图、时序图、架构图、类图、ER 图等拓扑图 | `<whiteboard>` Mermaid 或 SVG |
|
|
18
20
|
| 自定义图标、徽标、示意性图形(需要 path/polygon 精确控制) | `<whiteboard>` SVG |
|
|
19
21
|
| 进度条、波浪背景、装饰图案、像素级自定义可视化 | `<whiteboard>` SVG |
|
|
20
22
|
|
|
21
|
-
> 适合 `<chart>` 的内容就用 `<chart>`,不要用 SVG
|
|
23
|
+
> 适合 `<chart>` 的内容就用 `<chart>`,不要用 SVG / Mermaid 手绘——原生渲染更省力、结构更稳定,也更容易被回读和后续编辑。
|
|
22
24
|
|
|
23
25
|
---
|
|
24
26
|
|
|
@@ -39,9 +41,13 @@ SVG 内的坐标相对于 whiteboard 自身左上角(0,0),与 slide 坐标
|
|
|
39
41
|
|
|
40
42
|
## SVG 还是 Mermaid?
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
选择分三步:**先排除原生 `<chart>`,再判断 whiteboard 类型,最后看当前模型身份**。
|
|
45
|
+
|
|
46
|
+
### 第一步:先确认是否应该使用 `<chart>`
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
如果内容是柱状图、条形图、折线图、面积图、雷达图、饼图 / 环图或组合图,返回使用原生 `<chart>`,不要继续套用本文档的 SVG / Mermaid 路径。
|
|
49
|
+
|
|
50
|
+
### 第二步:whiteboard 类型优先判断
|
|
45
51
|
|
|
46
52
|
以下类型**推荐 Mermaid**,自动布局、代码简洁;如需精确匹配品牌配色或自定义节点样式,可改用 SVG:
|
|
47
53
|
|
|
@@ -50,20 +56,19 @@ SVG 内的坐标相对于 whiteboard 自身左上角(0,0),与 slide 坐标
|
|
|
50
56
|
| 流程图、决策树、架构图 | `flowchart TD` / `flowchart LR` |
|
|
51
57
|
| 时序图 | `sequenceDiagram` |
|
|
52
58
|
| 类图 | `classDiagram` |
|
|
53
|
-
| 饼图 | `pie` |
|
|
54
59
|
| 甘特图 | `gantt` |
|
|
55
60
|
| 状态图 | `stateDiagram-v2` |
|
|
56
61
|
| 思维导图 | `mindmap` |
|
|
57
62
|
| ER 图 | `erDiagram` |
|
|
58
63
|
|
|
59
|
-
###
|
|
64
|
+
### 第三步:非原生图表与装饰元素按模型身份选路径
|
|
60
65
|
|
|
61
66
|
上表以外的场景(散点图、漏斗图、进度条、时间线、波浪背景、星点纹理等)需要精确控制坐标和配色,SVG 表达力更强,但各模型生成 SVG 的能力有差异:
|
|
62
67
|
|
|
63
68
|
| 模型身份 | 路径 |
|
|
64
69
|
|----------|------|
|
|
65
70
|
| Claude / Gemini / GPT / GLM | **SVG** — 精确控制坐标、颜色、透明度 |
|
|
66
|
-
| Doubao / Seed / Other | **Mermaid** — 用 `
|
|
71
|
+
| Doubao / Seed / Other | **Mermaid** — 用 `gantt`、`flowchart` 等近似表达;确实无法用 Mermaid 表达时才回退到简单 SVG 矩形/线条 |
|
|
67
72
|
|
|
68
73
|
> **先自报身份再选路径**:在决定使用 SVG 之前,确认当前模型属于哪一类。不要跳过这一步。
|
|
69
74
|
|
|
@@ -73,13 +78,13 @@ SVG 内的坐标相对于 whiteboard 自身左上角(0,0),与 slide 坐标
|
|
|
73
78
|
|
|
74
79
|
### ⚠️ 设计品质要求
|
|
75
80
|
|
|
76
|
-
在 slide 里嵌入 `<whiteboard>`
|
|
81
|
+
在 slide 里嵌入 `<whiteboard>` 的目的是**表达原生 `<chart>` 或基础 `<shape>` 难以覆盖的视觉关系**,不是把标准数据图表手绘一遍。
|
|
77
82
|
|
|
78
83
|
- **不要只用矩形加文字应付**:通篇纯白底色 + 方块 + 黑字等于白做,这是不及格输出
|
|
79
|
-
-
|
|
84
|
+
- **非原生数据视觉必须有坐标系**:散点、漏斗等仍要有必要的坐标轴、刻度、数值标注或分段说明,不要只画点或色块
|
|
80
85
|
- **字号必须有层级**:标题 ≠ 标签 ≠ 数值,混用同一字号会消灭视觉焦点
|
|
81
86
|
- **配色要与 slide 主题呼应**:深色 slide 背景下图表用透明底或深色卡片;浅色背景下避免再加纯白底块
|
|
82
|
-
- **每个 whiteboard
|
|
87
|
+
- **每个 whiteboard 都是设计机会**:主动用圆角、半透明填充、清晰分组、节点状态等细节拉开与默认模板的差距
|
|
83
88
|
- **写 SVG 前先判断背景亮度**:背景亮度 < 30% 时,装饰元素"对比不足"比"过强"危害更大,宁重勿轻;
|
|
84
89
|
- **装饰层次用亮度跳跃,不用线性叠透明度**:`α=0.04→0.08→0.12` 的等差递增在深色底上几乎看不出差异(相邻层亮度差 ≈20);正确做法是非线性跳跃如 `0.10→0.40→0.70→1.0`,相邻层亮度差 ≥60。
|
|
85
90
|
|
|
@@ -106,11 +111,11 @@ whiteboard 渲染时以**所有子元素的几何包围盒合并结果**为内
|
|
|
106
111
|
|
|
107
112
|
| 元素 | 说明 | 典型用途 |
|
|
108
113
|
|------|------|---------|
|
|
109
|
-
| `<rect>` | 矩形,支持 `rx` 圆角 |
|
|
114
|
+
| `<rect>` | 矩形,支持 `rx` 圆角 | 卡片、进度条、分段色块 |
|
|
110
115
|
| `<circle>` | 圆 | 节点、装饰点、环形图 |
|
|
111
116
|
| `<ellipse>` | 椭圆 | 自定义轮廓图形 |
|
|
112
|
-
| `<line>` | 直线 |
|
|
113
|
-
| `<path>` | 任意路径(支持 Q/C 曲线) |
|
|
117
|
+
| `<line>` | 直线 | 轴线、分隔线、连接线 |
|
|
118
|
+
| `<path>` | 任意路径(支持 Q/C 曲线) | 波浪、曲线、弧形 |
|
|
114
119
|
| `<text>` | 文本,支持中文 | 标签、数值 |
|
|
115
120
|
| `<polygon>` | 多边形 | 箭头、星形、面积填充 |
|
|
116
121
|
| `<g>` | 分组 | 批量变换、语义分组 |
|
|
@@ -123,27 +128,25 @@ whiteboard 渲染时以**所有子元素的几何包围盒合并结果**为内
|
|
|
123
128
|
---
|
|
124
129
|
### 元素计算
|
|
125
130
|
|
|
126
|
-
SVG 中只要涉及批量定位、等间距排布或数据映射,**建议额外运行一个 Python 脚本把坐标算出来再填入 SVG
|
|
131
|
+
SVG 中只要涉及批量定位、等间距排布或数据映射,**建议额外运行一个 Python 脚本把坐标算出来再填入 SVG**,而不是手动估值。适用范围包括散点、漏斗、装饰性点阵、等间距圆、重复图案等;普通柱状图、折线图、饼图仍应回到原生 `<chart>`。
|
|
127
132
|
|
|
128
133
|
> **主动去算**:写 SVG 之前先运行脚本,把输出当注释贴在 `<svg>` 开头,再照着填坐标。估值几乎每次都需要反复调整,跳过这步反而更慢。
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
**散点图 / 装饰性点阵范式**
|
|
131
136
|
|
|
132
137
|
```python
|
|
133
138
|
W, H = 360, 260
|
|
134
139
|
origin_x, origin_y = 50, 216 # 左下角,SVG Y 轴向下
|
|
135
140
|
cw, ch = 290, 184
|
|
136
141
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
for i,
|
|
140
|
-
|
|
141
|
-
y
|
|
142
|
-
print(f"
|
|
142
|
+
points = [(12, 40), (28, 80), (45, 65)]
|
|
143
|
+
x_min, x_max, y_min, y_max = 0, 50, 0, 100
|
|
144
|
+
for i, (xv, yv) in enumerate(points):
|
|
145
|
+
x = round(origin_x + (xv - x_min) / (x_max - x_min) * cw)
|
|
146
|
+
y = round(origin_y - (yv - y_min) / (y_max - y_min) * ch)
|
|
147
|
+
print(f"point-{i}: cx={x} cy={y}")
|
|
143
148
|
```
|
|
144
149
|
|
|
145
|
-
折线图:`x = origin_x + i/(n-1)*cw`,`y = origin_y - (v-y_min)/(y_max-y_min)*ch`。
|
|
146
|
-
|
|
147
150
|
**装饰性元素(等间距范式)**
|
|
148
151
|
|
|
149
152
|
```python
|
|
@@ -160,9 +163,9 @@ for i in range(n):
|
|
|
160
163
|
```python
|
|
161
164
|
# 每个元素登记 (x, y, w, h),含 stroke 外扩
|
|
162
165
|
elements = [
|
|
163
|
-
(10, 20, 80, 160), #
|
|
164
|
-
(107, 10, 80, 170), #
|
|
165
|
-
(204, 40, 80, 140), #
|
|
166
|
+
(10, 20, 80, 160), # item-0
|
|
167
|
+
(107, 10, 80, 170), # item-1
|
|
168
|
+
(204, 40, 80, 140), # item-2
|
|
166
169
|
(0, 0, 300, 1), # x-axis
|
|
167
170
|
]
|
|
168
171
|
|
|
@@ -261,7 +264,6 @@ print(f"whiteboard width={wb_w} height={wb_h}")
|
|
|
261
264
|
| 流程图 | `flowchart TD` / `flowchart LR` | 业务流程、决策树、工作流 |
|
|
262
265
|
| 时序图 | `sequenceDiagram` | 系统交互、API 调用链 |
|
|
263
266
|
| 甘特图 | `gantt` | 项目计划、里程碑 |
|
|
264
|
-
| 饼图 | `pie` | 占比数据 |
|
|
265
267
|
| 类图 | `classDiagram` | 对象关系、架构设计 |
|
|
266
268
|
| ER 图 | `erDiagram` | 数据库结构 |
|
|
267
269
|
| 状态图 | `stateDiagram-v2` | 状态机、生命周期 |
|
|
@@ -279,7 +281,6 @@ Mermaid 图表会自动撑满 whiteboard 区域。建议:
|
|
|
279
281
|
|---------|-----------|------------|
|
|
280
282
|
| 流程图(5-8 节点) | 720-816 | 300-400 |
|
|
281
283
|
| 时序图(3-5 参与者) | 720-816 | 320-420 |
|
|
282
|
-
| 饼图 | 500-600 | 300-360 |
|
|
283
284
|
| 甘特图 | 816 | 280-360 |
|
|
284
285
|
| 思维导图 | 816 | 380-480 |
|
|
285
286
|
|
|
@@ -307,7 +308,7 @@ Mermaid 语法包含 `[`、`>`、`-->`,不用 CDATA 直接写会破坏 XML 解
|
|
|
307
308
|
- [ ] 文字 `y` 坐标为 baseline 位置,最小值 ≥ font-size(避免被裁切)
|
|
308
309
|
|
|
309
310
|
**SVG 模式——视觉品质检查:**
|
|
310
|
-
- [ ]
|
|
311
|
+
- [ ] 非原生数据视觉有必要的坐标轴、网格线、数值标注或分段说明,没有"裸点"或无解释色块
|
|
311
312
|
- [ ] 字号有层级:标题 > 数值 > 轴标签,非全部相同
|
|
312
313
|
- [ ] 单一数据系列用同一颜色,多系列用不同颜色且对比充足
|
|
313
314
|
- [ ] 轴标签与图表元素互不遮挡,留有足够空间
|
|
@@ -119,6 +119,34 @@ Each slide must include:
|
|
|
119
119
|
- `text_density`: `low`, `medium`, or `high`.
|
|
120
120
|
- `speaker_intent`: why the speaker needs this page and how it advances the story.
|
|
121
121
|
|
|
122
|
+
Optional slide fields:
|
|
123
|
+
|
|
124
|
+
- `chart_contract`: required when the page plan includes a standard data chart that `<chart>` supports. Use this shape:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"chart_contract": {
|
|
129
|
+
"required": true,
|
|
130
|
+
"render_as": "native_chart",
|
|
131
|
+
"chart_type": "line",
|
|
132
|
+
"data_source": "mock_placeholder",
|
|
133
|
+
"data_series_required": true,
|
|
134
|
+
"placeholder_label_required": true,
|
|
135
|
+
"manual_shape_fallback_allowed": false
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
When `chart_contract.required == true`, XML generation must produce a `<chart>` element on that slide. A shape, line, polyline, or whiteboard approximation does not satisfy the plan.
|
|
141
|
+
|
|
142
|
+
`data_source` must be one of:
|
|
143
|
+
|
|
144
|
+
- `user_provided`: the user supplied concrete values, tables, CSV, or metric lists; use them and do not replace them with mock data.
|
|
145
|
+
- `mock_placeholder`: the user asked for a placeholder, template, example, or later-replaceable chart position; use mock data in native `<chart>`.
|
|
146
|
+
- `mock_required_by_intent`: the user did not provide concrete values but asked for data expression, charts, trends, comparisons, or distributions; use mock data in native `<chart>`.
|
|
147
|
+
|
|
148
|
+
`data_series_required` means the generated XML must include `<chartData>`. It does not require user-provided real-world values. When real values are unavailable but chart expression is part of the user's intent, write mock or placeholder values into native `<chart>` and label them clearly instead of switching to manual drawing primitives or metric blocks.
|
|
149
|
+
|
|
122
150
|
## Layout Vocabulary
|
|
123
151
|
|
|
124
152
|
Use one of these `layout_type` values unless the user explicitly needs a custom structure:
|
|
@@ -183,6 +211,7 @@ Use an object for one planned asset, an array for multiple real needs, or `asset
|
|
|
183
211
|
- `purpose`: why this asset helps the page's key message.
|
|
184
212
|
- `suggested_query`: short future lookup hint only; do not execute it unless separately requested.
|
|
185
213
|
- `fallback_if_missing`: concrete XML-native visual plan using shapes, labels, tables, whiteboard diagrams, or placeholder panels.
|
|
214
|
+
- `chart_contract`: when `asset_type` is `chart` and the visual is a supported standard data chart, set this optional slide-level field so generation is locked to native `<chart>`.
|
|
186
215
|
|
|
187
216
|
For detailed rules and examples, read `asset-planning.md`.
|
|
188
217
|
|
|
@@ -190,7 +219,7 @@ Good examples:
|
|
|
190
219
|
|
|
191
220
|
- `{"asset_type":"architecture_diagram","purpose":"Explain component relationships.","suggested_query":"service architecture diagram","fallback_if_missing":"Draw a component diagram with grouped boxes, connector arrows, and short labels."}`
|
|
192
221
|
- `{"asset_type":"logo","purpose":"Identify the customer context.","suggested_query":"customer logo","fallback_if_missing":"Use a text label in a small badge."}`
|
|
193
|
-
- `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"
|
|
222
|
+
- `{"asset_type":"chart","purpose":"Show adoption trend.","suggested_query":"monthly adoption trend chart","fallback_if_missing":"Render a native `<chart>` using the provided series when available; otherwise render a native `<chart>` with mock placeholder values and label it as 模拟数据,仅占位,待替换真实数据."}`
|
|
194
223
|
|
|
195
224
|
## XML Generation Contract
|
|
196
225
|
|
|
@@ -201,6 +230,7 @@ Before writing each slide XML, map the plan fields to concrete decisions:
|
|
|
201
230
|
- `visual_focus` determines the largest visual region or emphasized object.
|
|
202
231
|
- `text_density` caps visible text volume.
|
|
203
232
|
- `asset_need` informs placeholder diagrams, icons, charts, screenshots, or shape-based fallback visuals only. Missing real assets must use `fallback_if_missing`, not blank regions.
|
|
233
|
+
- `chart_contract` locks supported standard data charts to native `<chart>` output. Manual approximations are allowed only when the planned chart type is unsupported by `<chart>` or when the visual is explicitly non-data/decorative.
|
|
204
234
|
|
|
205
235
|
After creating the PPT, fetch the presentation and verify:
|
|
206
236
|
|