@vincentbanana/bananacli 0.8.14 → 0.8.16
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.en.md +1 -1
- package/README.md +1 -1
- package/design-tokens.json +1 -0
- package/dist/server/ui-server.js +5 -1
- package/dist/ui/app.js +231 -2
- package/dist/ui/style.css +58 -34
- package/dist/ui/vendor/inter.woff2 +0 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -36,7 +36,7 @@ A multi-provider AI agent for the terminal, with a local GUI. It can read and wr
|
|
|
36
36
|
| |_) | (_| | | | | (_| | |_) | (_| | | | |
|
|
37
37
|
|____/ \__,_|_| |_|\__,_|_.__/ \__,_|_| |_|
|
|
38
38
|
|
|
39
|
-
BananaCLI v0.8.
|
|
39
|
+
BananaCLI v0.8.16 · terminal + GUI
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
- **No frontend framework**: the CLI uses Node built-ins only; runtime dependencies are `ws` and `@lydell/node-pty` (prebuilt native module).
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
| |_) | (_| | | | | (_| | |_) | (_| | | | |
|
|
35
35
|
|____/ \__,_|_| |_|\__,_|_.__/ \__,_|_| |_|
|
|
36
36
|
|
|
37
|
-
BananaCLI v0.8.
|
|
37
|
+
BananaCLI v0.8.16 · 终端 + 图形界面
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
- **无前端框架依赖**:CLI 只用 Node 内置模块;运行时依赖 `ws`(GUI/终端 WebSocket)和 `@lydell/node-pty`(预编译原生模块)。
|
package/design-tokens.json
CHANGED
package/dist/server/ui-server.js
CHANGED
|
@@ -39,7 +39,10 @@ const MIME = {
|
|
|
39
39
|
'.css': 'text/css; charset=utf-8',
|
|
40
40
|
'.js': 'text/javascript; charset=utf-8',
|
|
41
41
|
'.svg': 'image/svg+xml',
|
|
42
|
+
'.woff2': 'font/woff2',
|
|
42
43
|
};
|
|
44
|
+
// 随界面一起打包的本地字体,不走依赖解析
|
|
45
|
+
const LOCAL_VENDOR_FILES = new Set(['inter.woff2']);
|
|
43
46
|
const VENDOR_FILES = {
|
|
44
47
|
'xterm.js': '@xterm/xterm/lib/xterm.js',
|
|
45
48
|
'xterm.css': '@xterm/xterm/css/xterm.css',
|
|
@@ -556,8 +559,9 @@ export async function startUiServer(options) {
|
|
|
556
559
|
// 终端与语法高亮的本地资源:只放行固定文件,避免任意路径读取
|
|
557
560
|
if (path.startsWith('/vendor/')) {
|
|
558
561
|
const name = path.slice('/vendor/'.length);
|
|
559
|
-
if (Object.hasOwn(VENDOR_FILES, name))
|
|
562
|
+
if (Object.hasOwn(VENDOR_FILES, name) || LOCAL_VENDOR_FILES.has(name)) {
|
|
560
563
|
return sendFile(res, `vendor/${name}`);
|
|
564
|
+
}
|
|
561
565
|
return notFound(res);
|
|
562
566
|
}
|
|
563
567
|
let session = turn?.session ??
|
package/dist/ui/app.js
CHANGED
|
@@ -251,6 +251,226 @@ function t(key) {
|
|
|
251
251
|
return STRINGS[uiLang]?.[key] ?? STRINGS.zh[key] ?? key;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
// 界面静态文案的中英对照:设置、弹窗、命令中心等由 DOM 层统一替换,
|
|
255
|
+
// 避免每个渲染函数都写一遍双语分支。
|
|
256
|
+
const UI_EN = {
|
|
257
|
+
'设置': 'Settings',
|
|
258
|
+
'模型、外观、终端、工作区、插件': 'Model, appearance, terminal, workspace, plugins',
|
|
259
|
+
'插件': 'Plugins',
|
|
260
|
+
'关于': 'About',
|
|
261
|
+
'模型': 'Model',
|
|
262
|
+
'选择 provider、模型和密钥。CLI 与 GUI 共用同一份配置。': 'Choose a provider, model and key. CLI and GUI share the same config.',
|
|
263
|
+
'切换后新消息使用这个 provider。': 'New messages use this provider.',
|
|
264
|
+
'模型名,例如 deepseek-chat': 'Model name, e.g. deepseek-chat',
|
|
265
|
+
'保存': 'Save',
|
|
266
|
+
'请填写模型名': 'Enter a model name',
|
|
267
|
+
'模型已更新': 'Model updated',
|
|
268
|
+
'保存后立即生效。': 'Takes effect after saving.',
|
|
269
|
+
'已保存,留空表示不修改': 'Saved; leave blank to keep unchanged',
|
|
270
|
+
'粘贴 API Key': 'Paste API key',
|
|
271
|
+
'留空表示不修改': 'Leave blank to keep unchanged',
|
|
272
|
+
'API Key 已保存': 'API key saved',
|
|
273
|
+
'未设置': 'Not set',
|
|
274
|
+
'更安全的做法是使用环境变量,不要把 key 写进仓库。': 'Prefer environment variables; do not commit keys.',
|
|
275
|
+
'显示思考过程': 'Show reasoning',
|
|
276
|
+
'推理模型会展示思考内容;关闭后只保留最终回答。': 'Reasoning models show their thinking; off keeps only the final answer.',
|
|
277
|
+
'已显示思考过程': 'Reasoning shown',
|
|
278
|
+
'已隐藏思考过程': 'Reasoning hidden',
|
|
279
|
+
'系统提示词': 'System prompt',
|
|
280
|
+
'给模型的长期指令,会影响所有对话。': 'Long-lived instructions that affect every conversation.',
|
|
281
|
+
'例如:回答尽量简洁,优先给可执行命令。': 'e.g. Be concise; prefer runnable commands.',
|
|
282
|
+
'恢复默认': 'Restore defaults',
|
|
283
|
+
'已清空,使用内置系统提示词': 'Cleared; using the built-in system prompt',
|
|
284
|
+
'保存提示词': 'Save prompt',
|
|
285
|
+
'系统提示词已保存': 'System prompt saved',
|
|
286
|
+
'联网搜索': 'Web search',
|
|
287
|
+
'免费源开箱即用;填入 Key 后自动升级到更稳定的搜索 API。': 'Free sources work out of the box; a key upgrades to a more stable search API.',
|
|
288
|
+
'自动(有 Key 用 API,否则免费源)': 'Auto (API when keyed)',
|
|
289
|
+
'只用免费源': 'Free sources only',
|
|
290
|
+
'搜索方式已更新': 'Search mode updated',
|
|
291
|
+
'搜索方式': 'Search mode',
|
|
292
|
+
'自动模式优先用已配置的 Key;API 失败时会回退到免费源。': 'Auto mode prefers configured keys and falls back to free sources.',
|
|
293
|
+
'清除': 'Clear',
|
|
294
|
+
'深度搜索': 'Deep search',
|
|
295
|
+
'开启后每次搜索会自动读前 3 页正文,答案更准,但会多花几秒。默认关闭;对话里也可以临时要求 deep。': 'Reads the first 3 pages for each search; more accurate but slower. Off by default.',
|
|
296
|
+
'已开启深度搜索': 'Deep search on',
|
|
297
|
+
'已关闭深度搜索': 'Deep search off',
|
|
298
|
+
'结果语言': 'Result language',
|
|
299
|
+
'英文/技术优先会更多命中官方文档、GitHub 和 Stack Overflow;自动会跟随问题语言。': 'English/technical prefers official docs, GitHub and Stack Overflow; Auto follows the question.',
|
|
300
|
+
'英文/技术优先': 'English/technical first',
|
|
301
|
+
'自动': 'Auto',
|
|
302
|
+
'中文优先': 'Chinese first',
|
|
303
|
+
'搜索语言偏好已更新': 'Search language updated',
|
|
304
|
+
'外观': 'Appearance',
|
|
305
|
+
'黑白主题,柔和对比。切换会同步终端和代码高亮。': 'Black-and-white theme with soft contrast; terminal and code highlighting follow.',
|
|
306
|
+
'界面语言 / Language': 'Language',
|
|
307
|
+
'切换后立即生效,只影响当前浏览器。': 'Applies immediately in this browser only.',
|
|
308
|
+
'中文': 'Chinese',
|
|
309
|
+
'主题': 'Theme',
|
|
310
|
+
'跟随系统最省心;也可以固定浅色或深色。': 'Follow the system, or pin light/dark.',
|
|
311
|
+
'跟随系统': 'System',
|
|
312
|
+
'浅色': 'Light',
|
|
313
|
+
'深色': 'Dark',
|
|
314
|
+
'灵动动效': 'Lively motion',
|
|
315
|
+
'测试功能:消息、按钮和面板带自然弹力与阻尼;终端与代码区不受影响。': 'Experimental: natural spring and damping for messages, buttons and panels; terminal and code are untouched.',
|
|
316
|
+
' 当前“减少动效”已开启,开启后也不会生效。': ' Reduce motion is on, so this will not take effect.',
|
|
317
|
+
'灵动动效已开启': 'Lively motion on',
|
|
318
|
+
'灵动动效已关闭': 'Lively motion off',
|
|
319
|
+
'动效强度': 'Motion strength',
|
|
320
|
+
'阻尼越大越收得住;大面板不会来回晃。': 'Higher damping settles faster; large panels do not bounce.',
|
|
321
|
+
'克制': 'Subtle',
|
|
322
|
+
'自然': 'Natural',
|
|
323
|
+
'明显': 'Playful',
|
|
324
|
+
'减少动效': 'Reduce motion',
|
|
325
|
+
'关闭大部分弹簧和入场动画,适合晕动或低性能设备。': 'Disables most spring and entrance animations.',
|
|
326
|
+
'已减少动效': 'Reduced motion on',
|
|
327
|
+
'已恢复弹力动画': 'Spring animations restored',
|
|
328
|
+
'终端': 'Terminal',
|
|
329
|
+
'真实 PTY,支持 PowerShell、cmd、Git Bash 和 WSL。关面板不会杀进程。': 'Real PTY with PowerShell, cmd, Git Bash and WSL; closing the panel keeps it running.',
|
|
330
|
+
'字号': 'Font size',
|
|
331
|
+
'只影响终端显示,不改变 shell 行为。': 'Display only; shell behavior is unchanged.',
|
|
332
|
+
'默认 Shell': 'Default shell',
|
|
333
|
+
'新建终端标签时使用。': 'Used for new terminal tabs.',
|
|
334
|
+
'收起终端': 'Hide terminal',
|
|
335
|
+
'打开终端': 'Open terminal',
|
|
336
|
+
'终端面板': 'Terminal panel',
|
|
337
|
+
'在底部 dock 打开,不会挡住输入框。快捷键 Ctrl+`。': 'Opens in the bottom dock without covering the composer. Shortcut Ctrl+`.',
|
|
338
|
+
'常用快捷键': 'Shortcuts',
|
|
339
|
+
'打开 / 收起终端工作台': 'Toggle terminal workbench',
|
|
340
|
+
'全局命令中心': 'Command center',
|
|
341
|
+
'打开文件工作台': 'Open file workbench',
|
|
342
|
+
'查看本会话改动': 'View changes in this session',
|
|
343
|
+
'关闭最上层;在终端里留给 shell': 'Close topmost layer; in the terminal it goes to the shell',
|
|
344
|
+
'发送 / 换行': 'Send / newline',
|
|
345
|
+
'引用项目文件': 'Reference project files',
|
|
346
|
+
'打开命令面板': 'Open command palette',
|
|
347
|
+
'工作区': 'Workspace',
|
|
348
|
+
'文件工具和命令都只能在这个目录下执行。': 'File tools and commands run only inside this directory.',
|
|
349
|
+
'切换': 'Switch',
|
|
350
|
+
'请填写目录路径': 'Enter a directory path',
|
|
351
|
+
'当前工作区': 'Current workspace',
|
|
352
|
+
'切换后插件也会重新加载项目目录。': 'Plugins reload for the project directory after switching.',
|
|
353
|
+
'检测到未信任的项目级配置/插件/AGENT.md;信任后才会加载。': 'Untrusted project config/plugins/AGENT.md found; trust to load.',
|
|
354
|
+
'未找到 AGENT.md;可在项目根目录创建,或运行 /env 查看模板。': 'No AGENT.md found; create one at the project root or run /env for a template.',
|
|
355
|
+
'项目规则 AGENT.md': 'Project rules (AGENT.md)',
|
|
356
|
+
'用户确认过的环境、路径、命令和限制会直接采用,不再重复探测。': 'Confirmed environment, paths, commands and limits are reused without re-probing.',
|
|
357
|
+
'权限': 'Permissions',
|
|
358
|
+
'不确定就保持「每次问」。改动会立刻保存,CLI 和 GUI 共用。': 'When unsure keep Ask; changes save immediately and are shared by CLI and GUI.',
|
|
359
|
+
'执行命令': 'Run commands',
|
|
360
|
+
'运行 npm test、git status 等命令。': 'Run npm test, git status and similar.',
|
|
361
|
+
'写入文件': 'Write files',
|
|
362
|
+
'新建或修改文件,可用左下角撤销回滚。': 'Create or modify files; undo from the bottom-left.',
|
|
363
|
+
'联网': 'Network',
|
|
364
|
+
'搜索和抓取网页。': 'Search and fetch web pages.',
|
|
365
|
+
'每次问': 'Ask every time',
|
|
366
|
+
'允许': 'Allow',
|
|
367
|
+
'禁止': 'Block',
|
|
368
|
+
'插件工坊': 'Plugin workshop',
|
|
369
|
+
'插件就是 .mjs 文件。可以生成模板、查看错误、试运行和启用停用。': 'Plugins are .mjs files; create templates, inspect errors, test and toggle them.',
|
|
370
|
+
'重新加载': 'Reload',
|
|
371
|
+
'插件已重新加载': 'Plugins reloaded',
|
|
372
|
+
'新建模板': 'New template',
|
|
373
|
+
'打开全局目录': 'Open global folder',
|
|
374
|
+
'打开项目目录': 'Open project folder',
|
|
375
|
+
'还没有插件。点「新建模板」生成第一个,或把 .mjs 放进插件目录。': 'No plugins yet. Create a template or drop an .mjs into the plugin folder.',
|
|
376
|
+
'已停用': 'Disabled',
|
|
377
|
+
'已加载': 'Loaded',
|
|
378
|
+
'加载失败': 'Failed to load',
|
|
379
|
+
'没有填写说明。': 'No description.',
|
|
380
|
+
'插件文件存在错误,模型暂时无法调用。': 'The plugin has an error; the model cannot call it.',
|
|
381
|
+
'试运行': 'Test',
|
|
382
|
+
'运行': 'Run',
|
|
383
|
+
'运行中…': 'Running…',
|
|
384
|
+
'(无输出)': '(no output)',
|
|
385
|
+
'输入 JSON,然后点运行。': 'Enter JSON, then Run.',
|
|
386
|
+
'关于 Banana': 'About Banana',
|
|
387
|
+
'一个把 CLI 内核完整搬进图形界面的本地 agent。': 'A local agent with the full CLI core inside a graphical shell.',
|
|
388
|
+
'CLI 版本': 'CLI version',
|
|
389
|
+
'CLI 与 GUI 使用同一套 agent 循环和工具。': 'CLI and GUI share the same agent loop and tools.',
|
|
390
|
+
'工具数量': 'Tools',
|
|
391
|
+
'平台': 'Platform',
|
|
392
|
+
'命令中心': 'Command center',
|
|
393
|
+
'按 Ctrl+K 搜索会话、文件、动作和设置。': 'Press Ctrl+K to search sessions, files, actions and settings.',
|
|
394
|
+
'打开': 'Open',
|
|
395
|
+
'项目文件': 'Project files',
|
|
396
|
+
'代码支持行号、全屏查看和选中后问 AI。': 'Code view supports line numbers, fullscreen and ask-AI on selection.',
|
|
397
|
+
'还没有会话。': 'No conversations yet.',
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
const LOCALIZE_SKIP = '.msg, .thread, pre, code, textarea';
|
|
401
|
+
|
|
402
|
+
function translateTextNode(node) {
|
|
403
|
+
const raw = node.nodeValue;
|
|
404
|
+
const key = raw.trim();
|
|
405
|
+
if (!key) return;
|
|
406
|
+
if (uiLang === 'en') {
|
|
407
|
+
let next = UI_EN[key];
|
|
408
|
+
if (next == null) {
|
|
409
|
+
const env = key.match(/^也可以只设置环境变量 (.+?),当前(.+?)。$/);
|
|
410
|
+
if (env) {
|
|
411
|
+
const current = UI_EN[env[2]] ?? env[2];
|
|
412
|
+
next = `Or set the environment variable ${env[1]}; currently ${current.toLowerCase()}.`;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
const shifted = key.match(/^已切换到 (.+)$/);
|
|
416
|
+
if (next == null && shifted) next = `Switched to ${shifted[1]}`;
|
|
417
|
+
if (next == null) return;
|
|
418
|
+
if (node.__zhText == null) node.__zhText = raw;
|
|
419
|
+
node.nodeValue = raw.replace(key, next);
|
|
420
|
+
} else if (node.__zhText != null) {
|
|
421
|
+
node.nodeValue = node.__zhText;
|
|
422
|
+
delete node.__zhText;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function translateAttrs(el) {
|
|
427
|
+
for (const attr of ['title', 'placeholder', 'aria-label']) {
|
|
428
|
+
const value = el.getAttribute(attr);
|
|
429
|
+
if (!value) continue;
|
|
430
|
+
const key = value.trim();
|
|
431
|
+
const store = `__zh${attr.replace('-', '')}`;
|
|
432
|
+
if (uiLang === 'en') {
|
|
433
|
+
if (!Object.hasOwn(UI_EN, key)) continue;
|
|
434
|
+
if (el[store] == null) el[store] = value;
|
|
435
|
+
el.setAttribute(attr, UI_EN[key]);
|
|
436
|
+
} else if (el[store] != null) {
|
|
437
|
+
el.setAttribute(attr, el[store]);
|
|
438
|
+
delete el[store];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function localizeUi(root = document.body) {
|
|
444
|
+
if (!root) return;
|
|
445
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT);
|
|
446
|
+
while (walker.nextNode()) {
|
|
447
|
+
const node = walker.currentNode;
|
|
448
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
449
|
+
const parent = node.parentElement;
|
|
450
|
+
if (!parent || parent.closest(LOCALIZE_SKIP)) continue;
|
|
451
|
+
translateTextNode(node);
|
|
452
|
+
} else if (node.nodeType === Node.ELEMENT_NODE) {
|
|
453
|
+
if (node.closest(LOCALIZE_SKIP)) continue;
|
|
454
|
+
translateAttrs(node);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
let localizeObserver = null;
|
|
460
|
+
function watchLocalization() {
|
|
461
|
+
if (localizeObserver) return;
|
|
462
|
+
localizeObserver = new MutationObserver((records) => {
|
|
463
|
+
if (uiLang !== 'en') return;
|
|
464
|
+
for (const record of records) {
|
|
465
|
+
for (const node of record.addedNodes) {
|
|
466
|
+
if (node.nodeType === Node.ELEMENT_NODE) localizeUi(node);
|
|
467
|
+
else if (node.nodeType === Node.TEXT_NODE) translateTextNode(node);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
localizeObserver.observe(document.body, { subtree: true, childList: true });
|
|
472
|
+
}
|
|
473
|
+
|
|
254
474
|
function applyLanguage() {
|
|
255
475
|
document.documentElement.lang = uiLang === 'en' ? 'en' : 'zh-CN';
|
|
256
476
|
const setTitle = (id, key) => {
|
|
@@ -304,6 +524,7 @@ function setLanguage(lang) {
|
|
|
304
524
|
renderHeader();
|
|
305
525
|
renderThread();
|
|
306
526
|
}
|
|
527
|
+
localizeUi(document.body);
|
|
307
528
|
}
|
|
308
529
|
|
|
309
530
|
// ---------------- Markdown(够用即可) ----------------
|
|
@@ -1963,7 +2184,9 @@ function renderThreadPlan() {
|
|
|
1963
2184
|
function renderPendingPlan(plan) {
|
|
1964
2185
|
THREAD.querySelector('.plan-card')?.remove();
|
|
1965
2186
|
if (!plan || plan.status === 'cancelled') return;
|
|
1966
|
-
|
|
2187
|
+
const card = planCardNode(plan);
|
|
2188
|
+
card.classList.add('is-new');
|
|
2189
|
+
THREAD.appendChild(card);
|
|
1967
2190
|
scrollToEnd();
|
|
1968
2191
|
}
|
|
1969
2192
|
|
|
@@ -3596,10 +3819,14 @@ function renderAppearanceSettings(body) {
|
|
|
3596
3819
|
section.appendChild(card);
|
|
3597
3820
|
|
|
3598
3821
|
const lively = settingsCard();
|
|
3822
|
+
const motionSuppressed =
|
|
3823
|
+
document.documentElement.dataset.reduceMotion === '1' ||
|
|
3824
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
3599
3825
|
lively.appendChild(
|
|
3600
3826
|
settingsRow(
|
|
3601
3827
|
'灵动动效',
|
|
3602
|
-
'测试功能:消息、按钮和面板带自然弹力与阻尼;终端与代码区不受影响。'
|
|
3828
|
+
'测试功能:消息、按钮和面板带自然弹力与阻尼;终端与代码区不受影响。' +
|
|
3829
|
+
(motionSuppressed ? ' 当前“减少动效”已开启,开启后也不会生效。' : ''),
|
|
3603
3830
|
settingsSwitch(motionOn(), (on) => {
|
|
3604
3831
|
setMotion(on);
|
|
3605
3832
|
renderSettings();
|
|
@@ -5669,6 +5896,8 @@ async function boot() {
|
|
|
5669
5896
|
bind();
|
|
5670
5897
|
applyLanguage();
|
|
5671
5898
|
applyMotion();
|
|
5899
|
+
watchLocalization();
|
|
5900
|
+
localizeUi(document.body);
|
|
5672
5901
|
// 命令表来自服务端(与 CLI 同一份),拉不到也不影响对话
|
|
5673
5902
|
try {
|
|
5674
5903
|
const all = (await get('commands')).commands ?? [];
|
package/dist/ui/style.css
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "Inter";
|
|
3
|
+
src: url("vendor/inter.woff2") format("woff2");
|
|
4
|
+
font-weight: 100 900;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
:root {
|
|
2
10
|
/* 唯一一套设计令牌:颜色、间距、字号、圆角、阴影、动效。 */
|
|
3
|
-
--bg-deep: #
|
|
11
|
+
--bg-deep: #f7f7f5;
|
|
4
12
|
--bg: #ffffff;
|
|
5
|
-
--panel: #
|
|
6
|
-
--
|
|
7
|
-
--panel-
|
|
8
|
-
--
|
|
9
|
-
--line
|
|
10
|
-
--
|
|
11
|
-
--text
|
|
12
|
-
--text-
|
|
13
|
-
--text-
|
|
14
|
-
--
|
|
13
|
+
--panel: #f6f6f4;
|
|
14
|
+
--surface: #fbfbf9;
|
|
15
|
+
--panel-2: #f0f0ed;
|
|
16
|
+
--panel-3: #e9e9e5;
|
|
17
|
+
--line: rgba(0, 0, 0, 0.07);
|
|
18
|
+
--line-strong: rgba(0, 0, 0, 0.13);
|
|
19
|
+
--text: #1a1a1a;
|
|
20
|
+
--text-2: #666666;
|
|
21
|
+
--text-3: #8a8a8a;
|
|
22
|
+
--text-placeholder: #b8b8b8;
|
|
23
|
+
--inverse: #1a1a1a;
|
|
15
24
|
--accent: #dcde8d;
|
|
16
25
|
--accent-ink: #8a6d12;
|
|
17
26
|
--accent-soft: #f7f7dd;
|
|
@@ -64,7 +73,7 @@
|
|
|
64
73
|
--dur-3: 240ms;
|
|
65
74
|
--sidebar: 344px;
|
|
66
75
|
--mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
|
|
67
|
-
--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
76
|
+
--sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
/* 深色令牌:系统主题与手动 data-theme 共用同一组属性。 */
|
|
@@ -73,6 +82,7 @@
|
|
|
73
82
|
--bg-deep: #080808;
|
|
74
83
|
--bg: #161616;
|
|
75
84
|
--panel: #1e1e1e;
|
|
85
|
+
--surface: #1c1c1c;
|
|
76
86
|
--panel-2: #242424;
|
|
77
87
|
--panel-3: #2e2e2e;
|
|
78
88
|
--line: rgba(255, 255, 255, 0.08);
|
|
@@ -106,6 +116,7 @@
|
|
|
106
116
|
--bg-deep: #080808;
|
|
107
117
|
--bg: #161616;
|
|
108
118
|
--panel: #1e1e1e;
|
|
119
|
+
--surface: #1c1c1c;
|
|
109
120
|
--panel-2: #242424;
|
|
110
121
|
--panel-3: #2e2e2e;
|
|
111
122
|
--line: rgba(255, 255, 255, 0.08);
|
|
@@ -155,8 +166,9 @@ html, body {
|
|
|
155
166
|
background: var(--bg);
|
|
156
167
|
color: var(--text);
|
|
157
168
|
font-family: var(--sans);
|
|
158
|
-
font-size:
|
|
169
|
+
font-size: 14px;
|
|
159
170
|
line-height: 1.62;
|
|
171
|
+
letter-spacing: -0.005em;
|
|
160
172
|
-webkit-font-smoothing: antialiased;
|
|
161
173
|
}
|
|
162
174
|
|
|
@@ -4213,7 +4225,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4213
4225
|
.todo-dock { max-width: 900px; }
|
|
4214
4226
|
|
|
4215
4227
|
/* 正文节奏 */
|
|
4216
|
-
.msg-body { font-size:
|
|
4228
|
+
.msg-body { font-size: 14px; line-height: 1.68; }
|
|
4217
4229
|
.msg-body p { margin-bottom: 12px; }
|
|
4218
4230
|
.msg-body h1,
|
|
4219
4231
|
.msg-body h2,
|
|
@@ -4231,8 +4243,8 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4231
4243
|
.msg.assistant .msg-role::before { background: var(--accent-ink); opacity: 0.45; }
|
|
4232
4244
|
.msg.assistant .msg-role { color: var(--text-3); }
|
|
4233
4245
|
.msg.user .msg-body {
|
|
4234
|
-
background: var(--
|
|
4235
|
-
border-color: var(--line
|
|
4246
|
+
background: var(--surface);
|
|
4247
|
+
border-color: var(--line);
|
|
4236
4248
|
padding: 10px 14px;
|
|
4237
4249
|
}
|
|
4238
4250
|
|
|
@@ -4278,8 +4290,8 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4278
4290
|
|
|
4279
4291
|
/* 输入区:与聊天区同宽,工具栏与输入框分层 */
|
|
4280
4292
|
.composer {
|
|
4281
|
-
background: var(--
|
|
4282
|
-
border-color: var(--line
|
|
4293
|
+
background: var(--surface);
|
|
4294
|
+
border-color: var(--line);
|
|
4283
4295
|
padding: 8px 10px 8px 14px;
|
|
4284
4296
|
}
|
|
4285
4297
|
.composer textarea { font-size: 14.5px; line-height: 1.6; }
|
|
@@ -4328,23 +4340,29 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4328
4340
|
|
|
4329
4341
|
/* ---------- 灵动动效(测试功能,默认关闭) ---------- */
|
|
4330
4342
|
:root[data-motion='1'] {
|
|
4331
|
-
--motion-dur:
|
|
4332
|
-
--motion-dur-slow:
|
|
4333
|
-
--motion-
|
|
4343
|
+
--motion-dur: 340ms;
|
|
4344
|
+
--motion-dur-slow: 380ms;
|
|
4345
|
+
--motion-dur-msg: 260ms;
|
|
4346
|
+
--motion-spring: linear(0, 0.026 5%, 0.091 10%, 0.179 15%, 0.278 20%, 0.379 25%, 0.478 30%, 0.569 35%, 0.652 40%, 0.724 45%, 0.786 50%, 0.837 55%, 0.88 60%, 0.915 65%, 0.942 70%, 0.963 75%, 0.979 80%, 0.991 85%, 0.999 90%, 1.005 95%, 1 100%);
|
|
4347
|
+
--motion-spring-panel: linear(0, 0.021 5%, 0.073 10%, 0.143 15%, 0.224 20%, 0.308 25%, 0.391 30%, 0.471 35%, 0.545 40%, 0.612 45%, 0.672 50%, 0.725 55%, 0.771 60%, 0.811 65%, 0.845 70%, 0.874 75%, 0.898 80%, 0.918 85%, 0.935 90%, 0.949 95%, 1 100%);
|
|
4334
4348
|
--motion-shift: 7px;
|
|
4335
4349
|
--motion-press: 0.96;
|
|
4336
4350
|
}
|
|
4337
4351
|
:root[data-motion='1'][data-motion-level='subtle'] {
|
|
4338
|
-
--motion-dur:
|
|
4339
|
-
--motion-dur-slow:
|
|
4340
|
-
--motion-
|
|
4352
|
+
--motion-dur: 260ms;
|
|
4353
|
+
--motion-dur-slow: 300ms;
|
|
4354
|
+
--motion-dur-msg: 200ms;
|
|
4355
|
+
--motion-spring: linear(0, 0.019 5%, 0.068 10%, 0.135 15%, 0.211 20%, 0.291 25%, 0.37 30%, 0.446 35%, 0.517 40%, 0.582 45%, 0.641 50%, 0.694 55%, 0.74 60%, 0.781 65%, 0.816 70%, 0.846 75%, 0.872 80%, 0.894 85%, 0.913 90%, 0.928 95%, 1 100%);
|
|
4356
|
+
--motion-spring-panel: linear(0, 0.018 5%, 0.062 10%, 0.123 15%, 0.193 20%, 0.267 25%, 0.34 30%, 0.412 35%, 0.479 40%, 0.541 45%, 0.599 50%, 0.65 55%, 0.696 60%, 0.737 65%, 0.774 70%, 0.805 75%, 0.833 80%, 0.857 85%, 0.878 90%, 0.896 95%, 1 100%);
|
|
4341
4357
|
--motion-shift: 4px;
|
|
4342
4358
|
--motion-press: 0.975;
|
|
4343
4359
|
}
|
|
4344
4360
|
:root[data-motion='1'][data-motion-level='playful'] {
|
|
4345
|
-
--motion-dur:
|
|
4346
|
-
--motion-dur-slow:
|
|
4347
|
-
--motion-
|
|
4361
|
+
--motion-dur: 420ms;
|
|
4362
|
+
--motion-dur-slow: 460ms;
|
|
4363
|
+
--motion-dur-msg: 320ms;
|
|
4364
|
+
--motion-spring: linear(0, 0.041 5%, 0.143 10%, 0.278 15%, 0.424 20%, 0.567 25%, 0.696 30%, 0.806 35%, 0.895 40%, 0.962 45%, 1.011 50%, 1.042 55%, 1.06 60%, 1.067 65%, 1.067 70%, 1.062 75%, 1.053 80%, 1.044 85%, 1.034 90%, 1.024 95%, 1 100%);
|
|
4365
|
+
--motion-spring-panel: linear(0, 0.024 5%, 0.085 10%, 0.167 15%, 0.26 20%, 0.356 25%, 0.449 30%, 0.537 35%, 0.617 40%, 0.688 45%, 0.749 50%, 0.802 55%, 0.847 60%, 0.883 65%, 0.913 70%, 0.937 75%, 0.956 80%, 0.971 85%, 0.982 90%, 0.99 95%, 1 100%);
|
|
4348
4366
|
--motion-shift: 10px;
|
|
4349
4367
|
--motion-press: 0.94;
|
|
4350
4368
|
}
|
|
@@ -4353,9 +4371,15 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4353
4371
|
from { opacity: 0; transform: translateY(var(--motion-shift, 6px)) scale(0.996); }
|
|
4354
4372
|
to { opacity: 1; transform: none; }
|
|
4355
4373
|
}
|
|
4374
|
+
@keyframes msgIn {
|
|
4375
|
+
from { opacity: 0; transform: scale(0.985); }
|
|
4376
|
+
to { opacity: 1; transform: none; }
|
|
4377
|
+
}
|
|
4356
4378
|
|
|
4357
|
-
:root[data-motion='1'] .msg.enter
|
|
4358
|
-
:
|
|
4379
|
+
:root[data-motion='1'] .msg.enter {
|
|
4380
|
+
animation: msgIn var(--motion-dur-msg) var(--motion-spring-panel) both;
|
|
4381
|
+
}
|
|
4382
|
+
:root[data-motion='1'] .plan-card.is-new {
|
|
4359
4383
|
animation: motionIn var(--motion-dur-slow) var(--motion-spring) both;
|
|
4360
4384
|
}
|
|
4361
4385
|
|
|
@@ -4369,14 +4393,15 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4369
4393
|
}
|
|
4370
4394
|
|
|
4371
4395
|
:root[data-motion='1'] .review.is-opening {
|
|
4372
|
-
animation: reviewIn var(--motion-dur) var(--motion-spring) both;
|
|
4396
|
+
animation: reviewIn var(--motion-dur) var(--motion-spring-panel) both;
|
|
4373
4397
|
}
|
|
4374
4398
|
:root[data-motion='1'] .model-pop,
|
|
4375
|
-
:root[data-motion='1'] .reasoning-pop
|
|
4376
|
-
|
|
4399
|
+
:root[data-motion='1'] .reasoning-pop,
|
|
4400
|
+
:root[data-motion='1'] .modal-card {
|
|
4401
|
+
animation: pop var(--motion-dur) var(--motion-spring-panel) both;
|
|
4377
4402
|
}
|
|
4378
4403
|
:root[data-motion='1'] .sidebar {
|
|
4379
|
-
transition-timing-function: var(--motion-spring);
|
|
4404
|
+
transition-timing-function: var(--motion-spring-panel);
|
|
4380
4405
|
transition-duration: var(--motion-dur);
|
|
4381
4406
|
}
|
|
4382
4407
|
|
|
@@ -4394,5 +4419,4 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4394
4419
|
.topbar { height: 50px; }
|
|
4395
4420
|
.chat-head { height: 46px; }
|
|
4396
4421
|
.chat-title { font-size: 13.5px; }
|
|
4397
|
-
.chat-card { box-shadow: var(--shadow-sm); }
|
|
4398
4422
|
|
|
Binary file
|
package/package.json
CHANGED