@vincentbanana/bananacli 0.8.15 → 0.8.17
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/dist/server/ui-server.js +5 -1
- package/dist/ui/app.js +257 -0
- package/dist/ui/style.css +38 -16
- 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.17 · 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.17 · 终端 + 图形界面
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
- **无前端框架依赖**:CLI 只用 Node 内置模块;运行时依赖 `ws`(GUI/终端 WebSocket)和 `@lydell/node-pty`(预编译原生模块)。
|
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,260 @@ 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
|
+
'取消': 'Cancel',
|
|
399
|
+
'确定': 'Confirm',
|
|
400
|
+
'删除': 'Delete',
|
|
401
|
+
'清空': 'Clear',
|
|
402
|
+
'关闭': 'Close',
|
|
403
|
+
'重命名会话': 'Rename conversation',
|
|
404
|
+
'输入新的标题': 'Enter a new title',
|
|
405
|
+
'标题不能为空': 'Title cannot be empty',
|
|
406
|
+
'删除这个会话?': 'Delete this conversation?',
|
|
407
|
+
'清空当前对话?': 'Clear this conversation?',
|
|
408
|
+
'消息、任务清单和计划都会被清空,这个操作无法撤回。': 'Messages, tasks and the plan will be cleared. This cannot be undone.',
|
|
409
|
+
'删除对话?': 'Delete conversation?',
|
|
410
|
+
'切换工作目录?': 'Switch working directory?',
|
|
411
|
+
'匹配到的对话会被删除,无法恢复。': 'Matching conversations will be deleted permanently.',
|
|
412
|
+
'agent 的文件工具范围会切换到新目录。': 'The agent will work inside the new directory.',
|
|
413
|
+
'发现项目级配置': 'Project-level config found',
|
|
414
|
+
'信任并加载': 'Trust and load',
|
|
415
|
+
'新建对话': 'New conversation',
|
|
416
|
+
'开始一个干净的会话': 'Start with a clean conversation',
|
|
417
|
+
'打开项目文件': 'Open project files',
|
|
418
|
+
'浏览、全屏查看、引用文件': 'Browse, view fullscreen and reference files',
|
|
419
|
+
'按文件查看增删行,审阅 agent 的修改': 'Review additions and deletions per file',
|
|
420
|
+
'底部 dock,不遮挡输入框': 'Bottom dock without covering the composer',
|
|
421
|
+
'打开控制中心': 'Open control center',
|
|
422
|
+
'模型、外观、终端、工作区、插件': 'Model, appearance, terminal, workspace, plugins',
|
|
423
|
+
'启用、停用、生成模板、试运行插件': 'Enable, disable, scaffold and test plugins',
|
|
424
|
+
'切换主题': 'Switch theme',
|
|
425
|
+
'浅色 / 深色 / 跟随系统': 'Light / dark / system',
|
|
426
|
+
'撤销上一轮改动': 'Undo the last turn',
|
|
427
|
+
'把文件恢复到上一轮对话之前': 'Restore files to before the last turn',
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
const LOCALIZE_SKIP = '.msg, .thread, pre, code, textarea';
|
|
431
|
+
|
|
432
|
+
function translateTextNode(node) {
|
|
433
|
+
const raw = node.nodeValue;
|
|
434
|
+
const key = raw.trim();
|
|
435
|
+
if (!key) return;
|
|
436
|
+
if (uiLang === 'en') {
|
|
437
|
+
let next = UI_EN[key];
|
|
438
|
+
if (next == null) {
|
|
439
|
+
const env = key.match(/^也可以只设置环境变量 (.+?),当前(.+?)。$/);
|
|
440
|
+
if (env) {
|
|
441
|
+
const current = UI_EN[env[2]] ?? env[2];
|
|
442
|
+
next = `Or set the environment variable ${env[1]}; currently ${current.toLowerCase()}.`;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
const shifted = key.match(/^已切换到 (.+)$/);
|
|
446
|
+
if (next == null && shifted) next = `Switched to ${shifted[1]}`;
|
|
447
|
+
const deleted = key.match(/^「(.+?)」会从本地删除,无法恢复。$/);
|
|
448
|
+
if (next == null && deleted) next = `“${deleted[1]}” will be deleted locally. This cannot be undone.`;
|
|
449
|
+
const trust = key.match(/^这个工作区包含(.+?)。只有信任后才会加载;不信任时会被忽略。$/);
|
|
450
|
+
if (next == null && trust) next = `This workspace contains ${trust[1]}. It loads only after you trust it; otherwise it is ignored.`;
|
|
451
|
+
if (next == null) return;
|
|
452
|
+
if (node.__zhText == null) node.__zhText = raw;
|
|
453
|
+
node.nodeValue = raw.replace(key, next);
|
|
454
|
+
} else if (node.__zhText != null) {
|
|
455
|
+
node.nodeValue = node.__zhText;
|
|
456
|
+
delete node.__zhText;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
function translateAttrs(el) {
|
|
461
|
+
for (const attr of ['title', 'placeholder', 'aria-label']) {
|
|
462
|
+
const value = el.getAttribute(attr);
|
|
463
|
+
if (!value) continue;
|
|
464
|
+
const key = value.trim();
|
|
465
|
+
const store = `__zh${attr.replace('-', '')}`;
|
|
466
|
+
if (uiLang === 'en') {
|
|
467
|
+
if (!Object.hasOwn(UI_EN, key)) continue;
|
|
468
|
+
if (el[store] == null) el[store] = value;
|
|
469
|
+
el.setAttribute(attr, UI_EN[key]);
|
|
470
|
+
} else if (el[store] != null) {
|
|
471
|
+
el.setAttribute(attr, el[store]);
|
|
472
|
+
delete el[store];
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function localizeUi(root = document.body) {
|
|
478
|
+
if (!root) return;
|
|
479
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT);
|
|
480
|
+
while (walker.nextNode()) {
|
|
481
|
+
const node = walker.currentNode;
|
|
482
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
483
|
+
const parent = node.parentElement;
|
|
484
|
+
if (!parent || parent.closest(LOCALIZE_SKIP)) continue;
|
|
485
|
+
translateTextNode(node);
|
|
486
|
+
} else if (node.nodeType === Node.ELEMENT_NODE) {
|
|
487
|
+
if (node.closest(LOCALIZE_SKIP)) continue;
|
|
488
|
+
translateAttrs(node);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let localizeObserver = null;
|
|
494
|
+
function watchLocalization() {
|
|
495
|
+
if (localizeObserver) return;
|
|
496
|
+
localizeObserver = new MutationObserver((records) => {
|
|
497
|
+
if (uiLang !== 'en') return;
|
|
498
|
+
for (const record of records) {
|
|
499
|
+
for (const node of record.addedNodes) {
|
|
500
|
+
if (node.nodeType === Node.ELEMENT_NODE) localizeUi(node);
|
|
501
|
+
else if (node.nodeType === Node.TEXT_NODE) translateTextNode(node);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
localizeObserver.observe(document.body, { subtree: true, childList: true });
|
|
506
|
+
}
|
|
507
|
+
|
|
254
508
|
function applyLanguage() {
|
|
255
509
|
document.documentElement.lang = uiLang === 'en' ? 'en' : 'zh-CN';
|
|
256
510
|
const setTitle = (id, key) => {
|
|
@@ -304,6 +558,7 @@ function setLanguage(lang) {
|
|
|
304
558
|
renderHeader();
|
|
305
559
|
renderThread();
|
|
306
560
|
}
|
|
561
|
+
localizeUi(document.body);
|
|
307
562
|
}
|
|
308
563
|
|
|
309
564
|
// ---------------- Markdown(够用即可) ----------------
|
|
@@ -5675,6 +5930,8 @@ async function boot() {
|
|
|
5675
5930
|
bind();
|
|
5676
5931
|
applyLanguage();
|
|
5677
5932
|
applyMotion();
|
|
5933
|
+
watchLocalization();
|
|
5934
|
+
localizeUi(document.body);
|
|
5678
5935
|
// 命令表来自服务端(与 CLI 同一份),拉不到也不影响对话
|
|
5679
5936
|
try {
|
|
5680
5937
|
const all = (await get('commands')).commands ?? [];
|
package/dist/ui/style.css
CHANGED
|
@@ -1,18 +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
|
-
--surface: #
|
|
7
|
-
--panel-2: #
|
|
8
|
-
--panel-3: #
|
|
9
|
-
--line: rgba(0, 0, 0, 0.
|
|
10
|
-
--line-strong: rgba(0, 0, 0, 0.
|
|
11
|
-
--text: #
|
|
12
|
-
--text-2: #
|
|
13
|
-
--text-3: #
|
|
14
|
-
--text-placeholder: #
|
|
15
|
-
--inverse: #
|
|
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;
|
|
16
24
|
--accent: #dcde8d;
|
|
17
25
|
--accent-ink: #8a6d12;
|
|
18
26
|
--accent-soft: #f7f7dd;
|
|
@@ -65,7 +73,7 @@
|
|
|
65
73
|
--dur-3: 240ms;
|
|
66
74
|
--sidebar: 344px;
|
|
67
75
|
--mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Consolas, "Microsoft YaHei", monospace;
|
|
68
|
-
--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;
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
/* 深色令牌:系统主题与手动 data-theme 共用同一组属性。 */
|
|
@@ -158,8 +166,9 @@ html, body {
|
|
|
158
166
|
background: var(--bg);
|
|
159
167
|
color: var(--text);
|
|
160
168
|
font-family: var(--sans);
|
|
161
|
-
font-size:
|
|
169
|
+
font-size: 14px;
|
|
162
170
|
line-height: 1.62;
|
|
171
|
+
letter-spacing: -0.005em;
|
|
163
172
|
-webkit-font-smoothing: antialiased;
|
|
164
173
|
}
|
|
165
174
|
|
|
@@ -4216,7 +4225,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4216
4225
|
.todo-dock { max-width: 900px; }
|
|
4217
4226
|
|
|
4218
4227
|
/* 正文节奏 */
|
|
4219
|
-
.msg-body { font-size:
|
|
4228
|
+
.msg-body { font-size: 14px; line-height: 1.68; }
|
|
4220
4229
|
.msg-body p { margin-bottom: 12px; }
|
|
4221
4230
|
.msg-body h1,
|
|
4222
4231
|
.msg-body h2,
|
|
@@ -4333,6 +4342,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4333
4342
|
:root[data-motion='1'] {
|
|
4334
4343
|
--motion-dur: 340ms;
|
|
4335
4344
|
--motion-dur-slow: 380ms;
|
|
4345
|
+
--motion-dur-msg: 260ms;
|
|
4336
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%);
|
|
4337
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%);
|
|
4338
4348
|
--motion-shift: 7px;
|
|
@@ -4341,6 +4351,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4341
4351
|
:root[data-motion='1'][data-motion-level='subtle'] {
|
|
4342
4352
|
--motion-dur: 260ms;
|
|
4343
4353
|
--motion-dur-slow: 300ms;
|
|
4354
|
+
--motion-dur-msg: 200ms;
|
|
4344
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%);
|
|
4345
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%);
|
|
4346
4357
|
--motion-shift: 4px;
|
|
@@ -4349,6 +4360,7 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4349
4360
|
:root[data-motion='1'][data-motion-level='playful'] {
|
|
4350
4361
|
--motion-dur: 420ms;
|
|
4351
4362
|
--motion-dur-slow: 460ms;
|
|
4363
|
+
--motion-dur-msg: 320ms;
|
|
4352
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%);
|
|
4353
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%);
|
|
4354
4366
|
--motion-shift: 10px;
|
|
@@ -4359,8 +4371,14 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4359
4371
|
from { opacity: 0; transform: translateY(var(--motion-shift, 6px)) scale(0.996); }
|
|
4360
4372
|
to { opacity: 1; transform: none; }
|
|
4361
4373
|
}
|
|
4374
|
+
@keyframes msgIn {
|
|
4375
|
+
from { opacity: 0; transform: scale(0.985); }
|
|
4376
|
+
to { opacity: 1; transform: none; }
|
|
4377
|
+
}
|
|
4362
4378
|
|
|
4363
|
-
:root[data-motion='1'] .msg.enter
|
|
4379
|
+
:root[data-motion='1'] .msg.enter {
|
|
4380
|
+
animation: msgIn var(--motion-dur-msg) var(--motion-spring-panel) both;
|
|
4381
|
+
}
|
|
4364
4382
|
:root[data-motion='1'] .plan-card.is-new {
|
|
4365
4383
|
animation: motionIn var(--motion-dur-slow) var(--motion-spring) both;
|
|
4366
4384
|
}
|
|
@@ -4396,6 +4414,10 @@ input:focus-visible, textarea:focus-visible { outline: none; }
|
|
|
4396
4414
|
.composer { box-shadow: none; }
|
|
4397
4415
|
.composer:focus-within { box-shadow: none; }
|
|
4398
4416
|
.chat-card { box-shadow: none; }
|
|
4417
|
+
.modal-card,
|
|
4418
|
+
.sheet-panel,
|
|
4419
|
+
.think,
|
|
4420
|
+
.work-group { box-shadow: none; }
|
|
4399
4421
|
|
|
4400
4422
|
/* 顶栏和聊天头部:少一点装饰,多一点边界 */
|
|
4401
4423
|
.topbar { height: 50px; }
|
|
Binary file
|
package/package.json
CHANGED