cladogram 0.5.5-beta.4 → 0.5.5-beta.6
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 +2 -2
- package/docs/release.md +12 -0
- package/package.json +1 -3
- package/plugins/agent/index.js +167 -33
- package/plugins/agent/style.css +384 -94
- package/plugins/brand/index.js +12 -1
- package/plugins/brand/style.css +48 -29
- package/plugins/directory/style.css +131 -24
- package/plugins/view-controls/style.css +6 -9
- package/src/agent/runtime.js +1 -1
- package/src/core/parse.js +56 -6
- package/src/core/tags.js +197 -0
- package/src/html/app-css.js +27 -10
- package/src/html/canvas-focus.js +1 -1
- package/src/html/canvas-ui.css +122 -36
- package/src/html/canvas-wires.js +5 -2
- package/src/html/media-anchors.js +233 -5
- package/src/html/mindmap-connectors.js +7 -3
- package/src/html/page.js +2 -1
- package/src/html/plugin-ui.css +115 -96
- package/src/html/runtime.js +74 -5
- package/src/server/assets/library.css +3 -3
- package/src/server/assets/library.html +1 -1
- package/src/workspace/references.js +32 -4
- package/docs/plugin-development.md +0 -135
- package/docs/plugin-ui.md +0 -43
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**你描述需求,AI 整理内容,网页实时展示。** Clado 把 Markdown 内容组织成可逐层阅读的画布,同一份内容可切换卡片、脑图和文档视图(默认卡片视图),适合从想法、需求讨论、测试用例到开发设计和系统归档。
|
|
4
4
|
|
|
5
|
-
> 📖
|
|
5
|
+
> 📖 **官方文档站(中英双语 · 支持全站搜索)**:前往 **[Clado 官方文档](https://godshelvis.github.io/clado-docs/)**(涵盖核心本体、快速开始、语义 Tag 与连线、内置插件详解、MCP 协议与插件开发)。
|
|
6
6
|
|
|
7
7
|
## 产品流程
|
|
8
8
|
|
|
@@ -75,7 +75,7 @@ clado serve /你的项目
|
|
|
75
75
|
|
|
76
76
|
交互式运行 `clado version` 或 `clado serve` 时,最多每天自动检查一次。在旧版还没有 `update` 命令时,先运行 `npm install -g cladogram@latest --registry=https://registry.npmjs.org/`。
|
|
77
77
|
|
|
78
|
-
在左上角 Clado 菜单选择「插件管理」→「安装插件」,选中包含 `clado-plugin.json` 的本地目录,查看权限后安装。插件保存在当前工作区的 `.clado/plugins
|
|
78
|
+
在左上角 Clado 菜单选择「插件管理」→「安装插件」,选中包含 `clado-plugin.json` 的本地目录,查看权限后安装。插件保存在当前工作区的 `.clado/plugins/`。详细开发与权限规范见 [Clado 插件开发指南](https://godshelvis.github.io/clado-docs/plugins/development)。
|
|
79
79
|
|
|
80
80
|
### 在画布里用「灵感」
|
|
81
81
|
|
package/docs/release.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# 版本更新说明
|
|
2
2
|
|
|
3
|
+
## 0.5.5-beta.6 · 30% 灵动晶透毛玻璃 UI、自研人设下拉浮层与全新品牌徽标(灰度版)
|
|
4
|
+
|
|
5
|
+
- **30% 灵动晶透毛玻璃体系(彻底去除内部灰块)**:全局插件基座(`clado.brand`、`clado.view-controls`、`clado.directory`、`clado.agent`)升级为标准 30% 晶透毛玻璃与顶部镜面细高光;取消未选中按钮、文档行和工作流 Tab 的灰底灰框,仅选中项浮起为通透晶亮胶囊,移动端抽屉升级为悬浮圆角液态毛玻璃卡片。
|
|
6
|
+
- **自研毛玻璃「人设 / 执行器」下拉浮层**:彻底替代浏览器与手机端原生系统 `<select>` 弹窗,内置角色色点、说明摘要、选中勾选与高可读磨砂浮层(`84% / 88%`)。
|
|
7
|
+
- **品牌徽标同步与文档体系升级**:同步全新 Clado 矢量 Logo(含精细蓝点与底部柔光丝带)至左上角插件与页面 Favicon;主仓库精简旧文档并统一指向官方文档站 `https://godshelvis.github.io/clado-docs/`。
|
|
8
|
+
|
|
9
|
+
## 0.5.5-beta.5 · 单色透明毛玻璃 UI、PC/移动端适配与统一语义 Tag 锚点(灰度版)
|
|
10
|
+
|
|
11
|
+
- **克制单色透明毛玻璃视觉与 AI 体感柔光**:移除卡片、决策卡与插件弹窗上的四周边彩框与不透明底色,升级为浅/深双色统一透明毛玻璃;仅在 AI 活跃处理或生成时,于卡片 / 灵感面板底部中央呈现延伸至 ≥80% 宽度的渐隐羽化呼吸柔光(普通点击与静止卡片零打扰)。
|
|
12
|
+
- **PC / 移动端通用响应式布局与触控手势**:完整保留桌面端四角悬浮控件,小屏(`≤ 680px`)自动适配安全区(紧凑顶栏、底栏防重叠截断、灵感对话/文档目录/插件管理自动切换为底部抽屉 Bottom Sheet 与 44px 触控热区),画布原生支持双指捏合缩放与单指平滑拖拽。
|
|
13
|
+
- **统一语义 Tag 锚点(卡片 + Tag 二元连线模型)**:支持 6 色语义 Tag(有字低饱和胶囊 `[新增]{#id .green}` 与无字 `5.5px` 极简纯色圆点 `[]{#id .amber}`,无冗余外圈,视觉自动归左),同步支持代码块行尾注释 Tag(`// {#id .blue}` 视觉自动提取至左侧边槽)与 Mermaid 注释 Tag(`%% {#id .green}`);同文档 `[文案](#id)` 与跨文档 `[文案](other.md#id)` 统一连线,解析器新增 `MD_TAG_DUPLICATE_ID` 唯一性校验并兼容既有 `clado:code:` / `clado:to:` 语法与模板五色标记。
|
|
14
|
+
|
|
3
15
|
## 0.5.5-beta.4 · 轻量插件市场底座、`clado plugin` CLI 与权限审计(灰度版)
|
|
4
16
|
|
|
5
17
|
- 新增 `clado plugin <list|create|install|remove|search>` 完整命令行插件管理:支持一键生成可运行的 UI 能力插件(`--kind ui`)与 ACP 外包执行器插件(`--kind executor`)脚手架、本地安全打包安装与卸载。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cladogram",
|
|
3
|
-
"version": "0.5.5-beta.
|
|
3
|
+
"version": "0.5.5-beta.6",
|
|
4
4
|
"description": "MDC 三视图工作区与 MCP 文档服务:模板、节点、链接、批量操作和单文件交付",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
"templates",
|
|
16
16
|
"README.md",
|
|
17
17
|
"docs/release.md",
|
|
18
|
-
"docs/plugin-development.md",
|
|
19
|
-
"docs/plugin-ui.md",
|
|
20
18
|
"LICENSE"
|
|
21
19
|
],
|
|
22
20
|
"engines": {
|
package/plugins/agent/index.js
CHANGED
|
@@ -24,41 +24,44 @@
|
|
|
24
24
|
灵感
|
|
25
25
|
</button>
|
|
26
26
|
<section id="clado-agent-panel" class="clado-ui-glass clado-ui-glass-panel clado-agent-panel" aria-labelledby="clado-agent-title" hidden>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
<span class="clado-ai-aura" aria-hidden="true"></span>
|
|
28
|
+
<div class="clado-agent-panel-body">
|
|
29
|
+
<header>
|
|
30
|
+
<div class="clado-agent-heading"><h2 id="clado-agent-title">灵感</h2><small class="clado-agent-provider"></small></div>
|
|
31
|
+
<div class="clado-agent-header-actions">
|
|
32
|
+
<button type="button" class="clado-ui-button clado-agent-follow" aria-pressed="${initialFollowAi ? 'true' : 'false'}" title="跟随 AI 视角:AI 定位或修改卡片时平滑平移镜头">跟随</button>
|
|
33
|
+
<button type="button" class="clado-ui-button clado-agent-history" aria-expanded="false" title="切换历史会话">历史</button>
|
|
34
|
+
<button type="button" class="clado-ui-button clado-agent-new">新对话</button>
|
|
35
|
+
<button type="button" class="clado-ui-button clado-agent-close" aria-label="关闭 灵感 对话">×</button>
|
|
36
|
+
</div>
|
|
37
|
+
</header>
|
|
38
|
+
<div class="clado-agent-sessions" hidden></div>
|
|
39
|
+
<div class="clado-agent-modes" role="group" aria-label="工作模式">
|
|
40
|
+
<button type="button" class="clado-ui-button clado-agent-chip" data-workflow="design" aria-pressed="true">架构设计</button>
|
|
41
|
+
<button type="button" class="clado-ui-button clado-agent-chip" data-workflow="qa" aria-pressed="false">测试用例</button>
|
|
42
|
+
<button type="button" class="clado-ui-button clado-agent-chip" data-workflow="audit" aria-pressed="false">Diff 验收</button>
|
|
43
|
+
<button type="button" class="clado-ui-button clado-agent-chip" data-workflow="dispatch" aria-pressed="false">派发开发</button>
|
|
34
44
|
</div>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
<div class="clado-agent-persona-bar">
|
|
46
|
+
<label for="clado-agent-persona">人设</label>
|
|
47
|
+
<select id="clado-agent-persona" class="clado-agent-select">
|
|
48
|
+
<option value="architect">研发架构师</option>
|
|
49
|
+
<option value="qa">QA 测试专家</option>
|
|
50
|
+
<option value="auditor">验收审计官</option>
|
|
51
|
+
</select>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="clado-agent-executor-bar" hidden>
|
|
54
|
+
<label for="clado-agent-executor">执行器</label>
|
|
55
|
+
<select id="clado-agent-executor" class="clado-agent-select"></select>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="clado-agent-log" role="log" aria-label="对话消息" aria-live="off"></div>
|
|
58
|
+
<p class="clado-agent-status" role="status" hidden></p>
|
|
59
|
+
<form>
|
|
60
|
+
<textarea aria-label="给 灵感 的消息" placeholder="给 灵感 发一条消息…" rows="2" maxlength="12000"></textarea>
|
|
61
|
+
<button class="clado-ui-button clado-agent-stop" type="button" hidden>停止</button>
|
|
62
|
+
<button class="clado-ui-button clado-ui-button-primary clado-agent-send" type="submit" disabled>发送</button>
|
|
63
|
+
</form>
|
|
54
64
|
</div>
|
|
55
|
-
<div class="clado-agent-log" role="log" aria-label="对话消息" aria-live="off"></div>
|
|
56
|
-
<p class="clado-agent-status" role="status" hidden></p>
|
|
57
|
-
<form>
|
|
58
|
-
<textarea aria-label="给 灵感 的消息" placeholder="给 灵感 发一条消息…" rows="2" maxlength="12000"></textarea>
|
|
59
|
-
<button class="clado-ui-button clado-agent-stop" type="button" hidden>停止</button>
|
|
60
|
-
<button class="clado-ui-button clado-ui-button-primary clado-agent-send" type="submit" disabled>发送</button>
|
|
61
|
-
</form>
|
|
62
65
|
</section>`;
|
|
63
66
|
host.mount('bottom-right', root, 'clado.agent');
|
|
64
67
|
|
|
@@ -94,7 +97,129 @@
|
|
|
94
97
|
method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(data), keepalive,
|
|
95
98
|
});
|
|
96
99
|
const canSubmit = () => !running && (workflow === 'dispatch' || workflow === 'audit' || !!input.value.trim());
|
|
100
|
+
const personaDotColors = { architect: '#3b82f6', qa: '#10b981', auditor: '#8b5cf6' };
|
|
101
|
+
const personaDefaultSummaries = {
|
|
102
|
+
architect: '关注系统边界、调用链与幂等演进',
|
|
103
|
+
qa: '推导边界条件、并发竞争与回归用例树',
|
|
104
|
+
auditor: '严格核对代码 Diff 与设计契约偏差',
|
|
105
|
+
};
|
|
106
|
+
const glassDropdowns = [];
|
|
107
|
+
function attachGlassDropdown(selectEl, { dotColors = {}, fallbackSummaries = {}, defaultDot = '#64748b' } = {}) {
|
|
108
|
+
selectEl.classList.add('clado-agent-select-native');
|
|
109
|
+
selectEl.tabIndex = -1;
|
|
110
|
+
selectEl.setAttribute('aria-hidden', 'true');
|
|
111
|
+
const wrap = document.createElement('div');
|
|
112
|
+
wrap.className = 'clado-glass-dropdown';
|
|
113
|
+
const trigger = document.createElement('button');
|
|
114
|
+
trigger.type = 'button';
|
|
115
|
+
trigger.className = 'clado-glass-dropdown-trigger';
|
|
116
|
+
trigger.setAttribute('aria-haspopup', 'listbox');
|
|
117
|
+
trigger.setAttribute('aria-expanded', 'false');
|
|
118
|
+
trigger.innerHTML =
|
|
119
|
+
'<span class="clado-glass-dropdown-value"><span class="clado-glass-dropdown-dot"></span><span class="clado-glass-dropdown-label"></span></span>' +
|
|
120
|
+
'<svg class="clado-glass-dropdown-chevron" aria-hidden="true" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>';
|
|
121
|
+
const menu = document.createElement('div');
|
|
122
|
+
menu.className = 'clado-glass-dropdown-menu';
|
|
123
|
+
menu.setAttribute('role', 'listbox');
|
|
124
|
+
menu.hidden = true;
|
|
125
|
+
wrap.append(trigger, menu);
|
|
126
|
+
selectEl.after(wrap);
|
|
127
|
+
|
|
128
|
+
const dotEl = trigger.querySelector('.clado-glass-dropdown-dot');
|
|
129
|
+
const labelEl = trigger.querySelector('.clado-glass-dropdown-label');
|
|
130
|
+
|
|
131
|
+
const setOpen = (open) => {
|
|
132
|
+
if (open && selectEl.disabled) return;
|
|
133
|
+
if (open) {
|
|
134
|
+
for (const other of glassDropdowns) {
|
|
135
|
+
if (other.menu !== menu && !other.menu.hidden) other.setOpen(false);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
menu.hidden = !open;
|
|
139
|
+
wrap.classList.toggle('open', open);
|
|
140
|
+
trigger.setAttribute('aria-expanded', String(open));
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const sync = () => {
|
|
144
|
+
trigger.disabled = selectEl.disabled;
|
|
145
|
+
const opts = [...selectEl.options];
|
|
146
|
+
const activeVal = selectEl.value;
|
|
147
|
+
const currentOpt = opts.find(o => o.value === activeVal) || opts[0];
|
|
148
|
+
const color = (currentOpt && dotColors[currentOpt.value]) || defaultDot;
|
|
149
|
+
dotEl.style.background = color;
|
|
150
|
+
labelEl.textContent = currentOpt ? currentOpt.textContent : '';
|
|
151
|
+
menu.replaceChildren();
|
|
152
|
+
for (const opt of opts) {
|
|
153
|
+
const item = document.createElement('button');
|
|
154
|
+
item.type = 'button';
|
|
155
|
+
item.className = 'clado-ui-button clado-glass-dropdown-option';
|
|
156
|
+
item.setAttribute('role', 'option');
|
|
157
|
+
const selected = opt.value === activeVal;
|
|
158
|
+
item.setAttribute('aria-selected', String(selected));
|
|
159
|
+
if (selected) item.setAttribute('aria-current', 'page');
|
|
160
|
+
const itemDot = document.createElement('span');
|
|
161
|
+
itemDot.className = 'clado-glass-dropdown-dot';
|
|
162
|
+
itemDot.style.background = dotColors[opt.value] || defaultDot;
|
|
163
|
+
const copy = document.createElement('span');
|
|
164
|
+
copy.className = 'clado-glass-dropdown-copy';
|
|
165
|
+
const title = document.createElement('strong');
|
|
166
|
+
title.textContent = opt.textContent;
|
|
167
|
+
copy.append(title);
|
|
168
|
+
const descText = opt.title || fallbackSummaries[opt.value] || '';
|
|
169
|
+
if (descText) {
|
|
170
|
+
const desc = document.createElement('small');
|
|
171
|
+
desc.textContent = descText;
|
|
172
|
+
copy.append(desc);
|
|
173
|
+
}
|
|
174
|
+
const check = document.createElement('span');
|
|
175
|
+
check.className = 'clado-glass-dropdown-check';
|
|
176
|
+
check.textContent = '✓';
|
|
177
|
+
item.append(itemDot, copy, check);
|
|
178
|
+
item.onclick = () => {
|
|
179
|
+
if (selectEl.value !== opt.value) {
|
|
180
|
+
selectEl.value = opt.value;
|
|
181
|
+
selectEl.dispatchEvent(new Event('change', { bubbles: true }));
|
|
182
|
+
}
|
|
183
|
+
sync();
|
|
184
|
+
setOpen(false);
|
|
185
|
+
};
|
|
186
|
+
menu.append(item);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
trigger.onclick = (event) => {
|
|
191
|
+
event.stopPropagation();
|
|
192
|
+
setOpen(menu.hidden);
|
|
193
|
+
};
|
|
194
|
+
const api = { wrap, menu, sync, setOpen };
|
|
195
|
+
glassDropdowns.push(api);
|
|
196
|
+
sync();
|
|
197
|
+
return api;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const personaDropdown = attachGlassDropdown(personaSelect, {
|
|
201
|
+
dotColors: personaDotColors,
|
|
202
|
+
fallbackSummaries: personaDefaultSummaries,
|
|
203
|
+
defaultDot: '#3b82f6',
|
|
204
|
+
});
|
|
205
|
+
const executorDropdown = attachGlassDropdown(executorSelect, {
|
|
206
|
+
defaultDot: '#10b981',
|
|
207
|
+
});
|
|
208
|
+
document.addEventListener('pointerdown', event => {
|
|
209
|
+
for (const dd of glassDropdowns) {
|
|
210
|
+
if (!dd.menu.hidden && !dd.wrap.contains(event.target)) dd.setOpen(false);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
document.addEventListener('keydown', event => {
|
|
214
|
+
if (event.key === 'Escape') {
|
|
215
|
+
for (const dd of glassDropdowns) {
|
|
216
|
+
if (!dd.menu.hidden) dd.setOpen(false);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
97
221
|
const syncActions = () => {
|
|
222
|
+
panel.classList.toggle('clado-ai-working', running);
|
|
98
223
|
send.disabled = !canSubmit();
|
|
99
224
|
send.textContent = workflow === 'dispatch' ? '派发' : '发送';
|
|
100
225
|
stop.hidden = !running;
|
|
@@ -107,6 +232,8 @@
|
|
|
107
232
|
personaBar.hidden = isDispatch;
|
|
108
233
|
executorSelect.disabled = running;
|
|
109
234
|
personaSelect.disabled = running;
|
|
235
|
+
personaDropdown.sync();
|
|
236
|
+
executorDropdown.sync();
|
|
110
237
|
for (const chip of chips) chip.disabled = running;
|
|
111
238
|
};
|
|
112
239
|
const showStatus = text => {
|
|
@@ -124,6 +251,10 @@
|
|
|
124
251
|
personaSelect.onchange = () => {
|
|
125
252
|
persona = personaSelect.value || 'architect';
|
|
126
253
|
personaLockedByUser = true;
|
|
254
|
+
personaDropdown.sync();
|
|
255
|
+
};
|
|
256
|
+
executorSelect.onchange = () => {
|
|
257
|
+
executorDropdown.sync();
|
|
127
258
|
};
|
|
128
259
|
|
|
129
260
|
function selectWorkflow(nextWorkflow) {
|
|
@@ -179,6 +310,8 @@
|
|
|
179
310
|
}
|
|
180
311
|
if (previous && list.some(item => item.id === previous)) executorSelect.value = previous;
|
|
181
312
|
}
|
|
313
|
+
personaDropdown.sync();
|
|
314
|
+
executorDropdown.sync();
|
|
182
315
|
} catch {}
|
|
183
316
|
}
|
|
184
317
|
|
|
@@ -266,6 +399,7 @@
|
|
|
266
399
|
if (record.persona) {
|
|
267
400
|
persona = record.persona;
|
|
268
401
|
personaSelect.value = persona;
|
|
402
|
+
personaDropdown.sync();
|
|
269
403
|
}
|
|
270
404
|
log.replaceChildren();
|
|
271
405
|
for (const msg of record.uiMessages || []) {
|