@hfyjq/crannia 1.0.0 → 1.1.1
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/LICENSE +201 -201
- package/NOTICE +45 -45
- package/THIRD-PARTY-FRONTEND.md +5266 -5266
- package/THIRD-PARTY-PYTHON.md +162 -153
- package/THIRD-PARTY.md +316 -316
- package/apps/desktop/quotes.txt +56 -56
- package/bus/core.py +671 -671
- package/bus/loaders/channel_loader.py +64 -64
- package/bus/loaders/skill_md.py +676 -676
- package/bus/skill_state.py +124 -124
- package/channels/cli_channel/manifest.yaml +5 -5
- package/channels/dingtalk_channel/manifest.yaml +12 -12
- package/channels/feishu_channel/manifest.yaml +12 -12
- package/channels/qq_bot_channel/__init__.py +1 -1
- package/channels/qq_bot_channel/handler.py +881 -881
- package/channels/qq_bot_channel/manifest.yaml +4 -4
- package/channels/telegram_channel/__init__.py +1 -1
- package/channels/telegram_channel/handler.py +813 -813
- package/channels/telegram_channel/manifest.yaml +4 -4
- package/channels/telegram_channel/media.py +231 -231
- package/channels/textfmt.py +58 -58
- package/channels/wechat_channel/__init__.py +1 -1
- package/channels/wechat_channel/auth.py +23 -5
- package/channels/wechat_channel/manifest.yaml +5 -5
- package/channels/wechat_channel/media.py +178 -178
- package/config.yaml +2 -2
- package/core/activity.py +3 -0
- package/core/agent_loop.py +390 -55
- package/core/approval.py +17 -6
- package/core/artifacts.py +7 -0
- package/core/auto_review.py +23 -5
- package/core/channel_configs.py +34 -2
- package/core/channel_turns.py +759 -759
- package/core/child_approval.py +150 -0
- package/core/config_requirements.py +205 -0
- package/core/cron/runner.py +118 -6
- package/core/cron/store.py +14 -5
- package/core/cron/tools.py +17 -5
- package/core/endpoint.py +141 -0
- package/core/events.py +23 -0
- package/core/i18n.py +329 -329
- package/core/ice/store.py +191 -191
- package/core/inbound.py +193 -193
- package/core/jobs.py +19 -3
- package/core/last_good.py +150 -150
- package/core/llm_errors.py +227 -227
- package/core/llm_retry.py +230 -230
- package/core/memory/compressor.py +1214 -1214
- package/core/memory/manager.py +14 -0
- package/core/model_configs.py +80 -0
- package/core/pipeline/scheduler.py +2 -2
- package/core/pipeline/stages/agent_loop.py +24 -4
- package/core/pipeline/stages/pre_process.py +58 -7
- package/core/prompt_assembler.py +680 -680
- package/core/rg.py +255 -255
- package/core/security.py +1544 -1544
- package/core/settings_baseline.py +70 -1
- package/core/shell.py +5 -17
- package/core/skill_settings.py +7 -2
- package/core/state_registry.py +19 -0
- package/core/subagent.py +64 -3
- package/core/task_tool.py +1 -1
- package/core/tasks_notify.py +69 -4
- package/core/tiers.py +9 -3
- package/core/tool_outcome.py +108 -0
- package/core/update_tui.py +158 -0
- package/core/updater.py +229 -40
- package/core/version.py +2 -2
- package/core/web_cache.py +152 -0
- package/crannia_tray.py +278 -278
- package/creators/models.json +4 -4
- package/data/settings.example.json +67 -0
- package/licenses/GPL-3.0.txt +619 -619
- package/licenses/LGPL-2.1.txt +502 -502
- package/licenses/LGPL-3.0.txt +165 -165
- package/licenses/MIT-chat-on-wechat.txt +18 -18
- package/licenses/MIT-deepseek-harness.txt +21 -21
- package/licenses/Molio-LICENSE.txt +44 -44
- package/locales/en.json +9 -4
- package/main.py +154 -154
- package/mcpx/manager.py +522 -522
- package/mcpx/servers/__init__.py +22 -22
- package/mcpx/servers/web_search.py +321 -33
- package/package.json +24 -10
- package/providers/anthropic/client.py +772 -772
- package/providers/cost_table.json +3779 -3779
- package/providers/deepseek/client.py +20 -20
- package/providers/deepseek/manifest.yaml +2 -2
- package/providers/factory.py +136 -136
- package/providers/lmstudio/client.py +2 -2
- package/providers/metadata.py +80 -80
- package/providers/model_capabilities.json +6665 -6665
- package/providers/moonshot/client.py +12 -12
- package/providers/ollama/client.py +2 -2
- package/providers/openai/client.py +13 -13
- package/providers/openrouter/client.py +2 -2
- package/providers/qwen/__init__.py +1 -1
- package/providers/qwen/client.py +2 -2
- package/providers/qwen/manifest.yaml +16 -16
- package/providers/rate_limiter.py +144 -144
- package/providers/siliconflow/client.py +2 -2
- package/providers/validation.py +171 -171
- package/providers/window_table.json +8909 -8909
- package/sbom.json +4413 -4296
- package/skills/entertainment/SKILL.md +35 -35
- package/skills/entertainment/__init__.py +1 -1
- package/skills/entertainment/handler.py +91 -91
- package/skills/entertainment/manifest.yaml +26 -26
- package/skills/file_parser/GUIDANCE.md +10 -10
- package/skills/file_parser/handler.py +177 -4
- package/skills/file_parser/manifest.yaml +22 -1
- package/skills/github/SKILL.md +32 -32
- package/skills/github/__init__.py +1 -1
- package/skills/github/manifest.yaml +5 -0
- package/skills/mail_parser/SKILL.md +68 -68
- package/skills/mail_parser/__init__.py +1 -1
- package/skills/mail_parser/handler.py +806 -806
- package/skills/mail_parser/manifest.yaml +5 -0
- package/skills/media_gen/GUIDANCE.md +19 -19
- package/skills/media_gen/SKILL.md +43 -43
- package/skills/media_gen/__init__.py +1 -1
- package/skills/media_gen/handler.py +430 -430
- package/skills/media_gen/manifest.yaml +93 -88
- package/skills/office_parser/cell_validation.py +127 -127
- package/skills/office_parser/excel_transform.py +936 -936
- package/skills/office_parser/layout_spec.py +243 -243
- package/skills/office_parser/pptx_export/console_encoding.py +27 -27
- package/skills/office_parser/pptx_export/resource_paths.py +88 -88
- package/skills/office_parser/pptx_export/svg_finalize/__init__.py +12 -12
- package/skills/office_parser/pptx_export/svg_finalize/align_embed_images.py +575 -575
- package/skills/office_parser/pptx_export/svg_finalize/crop_images.py +366 -366
- package/skills/office_parser/pptx_export/svg_finalize/embed_icons.py +498 -498
- package/skills/office_parser/pptx_export/svg_finalize/embed_images.py +288 -288
- package/skills/office_parser/pptx_export/svg_finalize/fix_image_aspect.py +388 -388
- package/skills/office_parser/pptx_export/svg_finalize/flatten_tspan.py +818 -818
- package/skills/office_parser/pptx_export/svg_finalize/svg_rect_to_path.py +345 -345
- package/skills/office_parser/pptx_export/svg_to_pptx/__init__.py +14 -14
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/__init__.py +1 -1
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/context.py +186 -186
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/converter.py +781 -781
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/elements.py +2490 -2490
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/paths.py +429 -429
- package/skills/office_parser/pptx_export/svg_to_pptx/drawingml/styles.py +656 -656
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/__init__.py +1 -1
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/builder.py +1267 -1267
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/dimensions.py +155 -155
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/discovery.py +101 -101
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/media.py +141 -141
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/narration.py +236 -236
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/notes.py +257 -257
- package/skills/office_parser/pptx_export/svg_to_pptx/pptx_package/slide_xml.py +136 -136
- package/skills/office_parser/pptx_export/svg_to_pptx/tspan_flattener.py +44 -44
- package/skills/office_parser/pptx_export/svg_to_pptx/use_expander.py +129 -129
- package/skills/office_parser/references/LICENSE-Office-Word-MCP-Server.txt +20 -20
- package/skills/office_parser/references/LICENSE-excel-mcp-server.txt +21 -21
- package/skills/office_parser/references/layout_library.md +816 -816
- package/skills/office_parser/references/ppt-master/LICENSE +21 -21
- package/skills/office_parser/references/ppt-master/references/executor-base.md +474 -474
- package/skills/office_parser/references/ppt-master/references/shared-standards.md +1002 -1002
- package/skills/office_parser/references/ppt-master/references/strategist.md +880 -880
- package/skills/office_parser/references/ppt-master/references/template-designer.md +402 -402
- package/skills/office_parser/references/ppt-master/references/visual-review.md +240 -240
- package/skills/office_parser/references/ppt-master/references/visual-styles/_index.md +106 -106
- package/skills/office_parser/references/ppt-master/references/visual-styles/blueprint.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/brutalist.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/chalkboard.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/dark-tech.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/data-journalism.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/editorial.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/glassmorphism.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/ink-notes.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/ink-wash.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/memphis.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/paper-cut.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/photo-editorial.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/pixel-art.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/sketch-notes.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/soft-rounded.md +37 -37
- package/skills/office_parser/references/ppt-master/references/visual-styles/swiss-minimal.md +38 -38
- package/skills/office_parser/references/ppt-master/references/visual-styles/vintage-poster.md +36 -36
- package/skills/office_parser/references/ppt-master/references/visual-styles/zine.md +37 -37
- package/skills/office_parser/references/spec_lock.md +235 -235
- package/skills/office_parser/soffice.py +68 -68
- package/skills/office_parser/word_tools.py +2909 -2909
- package/tui/crannia.cmd +134 -0
- package/tui/crannia_tui/__init__.py +1 -0
- package/tui/crannia_tui/__main__.py +223 -0
- package/tui/crannia_tui/app.py +1318 -0
- package/tui/crannia_tui/app.tcss +153 -0
- package/tui/crannia_tui/approval.py +85 -0
- package/tui/crannia_tui/backend.py +279 -0
- package/tui/crannia_tui/channel.py +472 -0
- package/tui/crannia_tui/client.py +125 -0
- package/tui/crannia_tui/clipboard.py +62 -0
- package/tui/crannia_tui/commands.py +65 -0
- package/tui/crannia_tui/doctor.py +304 -0
- package/tui/crannia_tui/events.py +84 -0
- package/tui/crannia_tui/headless.py +152 -0
- package/tui/crannia_tui/i18n.py +164 -0
- package/tui/crannia_tui/locales/en.json +263 -0
- package/tui/crannia_tui/outcome.py +62 -0
- package/tui/crannia_tui/paths.py +181 -0
- package/tui/crannia_tui/probe.py +53 -0
- package/tui/crannia_tui/profile.py +169 -0
- package/tui/crannia_tui/render.py +209 -0
- package/tui/crannia_tui/settings.py +134 -0
- package/tui/crannia_tui/setup.py +380 -0
- package/tui/crannia_tui/term.py +116 -0
- package/tui/crannia_tui/ui.py +1236 -0
- package/tui/crannia_tui/update.py +389 -0
- package/vendor/ripgrep/COPYING.txt +3 -3
- package/vendor/ripgrep/LICENSE-MIT.txt +21 -21
- package/vendor/ripgrep/NOTICE-vscode-ripgrep.txt +13 -13
- package/vendor/ripgrep/README.md +51 -51
- package/vendor/ripgrep/UNLICENSE.txt +24 -24
- package/vendor/ripgrep/package-source.json +19 -19
- package/web/__main__.py +15 -0
- package/web/server.py +178 -20
- package/web/static/img/channel-telegram.svg +1 -1
- package/web/static/img/channel-wechat.svg +1 -1
- package/web/templates/logs.html +49 -49
- package/web/templates/models.html +46 -46
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"""TUI 自己那些话的界面语言 —— 与后端 `core/i18n.py` 同一条判据。
|
|
2
|
+
|
|
3
|
+
## 键是什么:中文原文就是键
|
|
4
|
+
|
|
5
|
+
与后端逐字同一条:`{"中文原文": "English"}`,没有 `status.running` 这种键名。
|
|
6
|
+
查不到就回落原文(永不显示裸键)—— 用户改了原文最多"这句还是中文",
|
|
7
|
+
不会白屏。占位符由调用方填:`t("共 %s 条") % n`(`t()` 只换句子、不碰 `%s`)。
|
|
8
|
+
|
|
9
|
+
首尾空白先摘掉再查、查完原样放回去 —— 与后端 `tr_fmt` / 前端 `i18n.js`
|
|
10
|
+
同一个做法,否则 `" · 接近触发"` 这种带前导空格的键永远查不到。
|
|
11
|
+
|
|
12
|
+
## 两张表:后端的做基,TUI 只补差集
|
|
13
|
+
|
|
14
|
+
- 基:crannia 根的 `locales/<lang>.json`(后端那张表)。界面语言、加载短语、
|
|
15
|
+
故障文案这些两边共用的术语直接用它,术语对齐是结构性的,不是靠人记。
|
|
16
|
+
- 补:`crannia_tui/locales/<lang>.json`(TUI 独有的句子)。
|
|
17
|
+
多语言自动发现:放一个 `ja.json` 进去就能用,一行代码都不用改。
|
|
18
|
+
|
|
19
|
+
测试钉着"补集不许重复基":同一个键只许有一个家,重复了就是两套译文在漂。
|
|
20
|
+
也钉着"用到的键都得有译文",以及占位符个数一致。
|
|
21
|
+
|
|
22
|
+
## 语言从哪来
|
|
23
|
+
|
|
24
|
+
`configure()` 由入口在启动那一刻调一次(问后端 `core.i18n.current()`,
|
|
25
|
+
理由同上:系统探测、"跟随系统"、坏值回落全在后端一处)。TUI 没有设置页,
|
|
26
|
+
改了 `interface_language` 要重开界面才生效;`CRANNIA_INTERFACE_LANGUAGE`
|
|
27
|
+
留给测试与临时排查(只认表里真有的一门)。
|
|
28
|
+
|
|
29
|
+
## 读不到的时候
|
|
30
|
+
|
|
31
|
+
没设置 / 包读不出来 / 表里不是字符串,一律回落原文,绝不抛 ——
|
|
32
|
+
这个函数在渲染路径上,抛一次就是整屏空白。
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
from __future__ import annotations
|
|
36
|
+
|
|
37
|
+
import json
|
|
38
|
+
import sys
|
|
39
|
+
from pathlib import Path
|
|
40
|
+
|
|
41
|
+
__all__ = ["SOURCE", "available", "configure", "current", "reload", "t"]
|
|
42
|
+
|
|
43
|
+
#: 源码语言。它就是表里的键,回落也回落到它。
|
|
44
|
+
SOURCE = "zh"
|
|
45
|
+
|
|
46
|
+
_PACK_DIR = Path(__file__).resolve().parent / "locales"
|
|
47
|
+
|
|
48
|
+
#: 进程级两格:语言(启动时定一次)、已读的表(按语言键)。
|
|
49
|
+
_lang: str = SOURCE
|
|
50
|
+
_home: Path | None = None
|
|
51
|
+
_packs: dict[str, dict] = {}
|
|
52
|
+
_noted: set[str] = set()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def configure(lang: str | None, *, home: Path | None = None) -> None:
|
|
56
|
+
"""定下这一进程用哪一门界面语言。
|
|
57
|
+
|
|
58
|
+
*lang* 是 `core.i18n.current()` 的读数(或测试给的值);认不出 / 空串 /
|
|
59
|
+
`None` 都按源码语言处理(原文照常显示,不会出现裸键)。
|
|
60
|
+
*home* 是 crannia 根:基表从 `home/locales/` 读。不传就只用补集。
|
|
61
|
+
"""
|
|
62
|
+
global _lang, _home
|
|
63
|
+
_lang = str(lang or "").strip().lower() or SOURCE
|
|
64
|
+
if home is not None:
|
|
65
|
+
_home = Path(home)
|
|
66
|
+
_packs.clear()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def current() -> str:
|
|
70
|
+
"""当前界面语言。"""
|
|
71
|
+
return _lang
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def reload() -> None:
|
|
75
|
+
"""清缓存(测试改语言 / 表被改写)。下一次 `t()` 重新读盘。"""
|
|
76
|
+
_packs.clear()
|
|
77
|
+
_noted.clear()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def available() -> list[str]:
|
|
81
|
+
"""真有补集的那几门(源码语言永远在)。"""
|
|
82
|
+
out = [SOURCE]
|
|
83
|
+
try:
|
|
84
|
+
for p in sorted(_PACK_DIR.glob("*.json")):
|
|
85
|
+
if p.stem not in out:
|
|
86
|
+
out.append(p.stem)
|
|
87
|
+
except OSError:
|
|
88
|
+
pass
|
|
89
|
+
return out
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _files(lang: str) -> list[tuple[Path, bool]]:
|
|
93
|
+
"""基表在前、补集在后(补集赢 —— 但测试不许两边同时有同一个键)。
|
|
94
|
+
|
|
95
|
+
第二个分量是"要不要把译文也 strip 掉"。基表要:那是扫描器按源码原样
|
|
96
|
+
记的,同一句话被记成 `· 接近触发` 与 ` · 接近触发` 两条,译文便各自
|
|
97
|
+
带/不带前导空格;不归一的话 `t()` 补回原文的空格后会出现两个空格。
|
|
98
|
+
补集不要:那里只有我们手写的条目,`Context: ` 这种尾随空格是有意的。
|
|
99
|
+
"""
|
|
100
|
+
out: list[tuple[Path, bool]] = []
|
|
101
|
+
if _home is not None:
|
|
102
|
+
out.append((Path(_home) / "locales" / ("%s.json" % lang), True))
|
|
103
|
+
out.append((_PACK_DIR / ("%s.json" % lang), False))
|
|
104
|
+
return out
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _note(path: Path, exc: BaseException) -> None:
|
|
108
|
+
"""一个包读不出来只说一次,走 stderr(全屏界面里 print 会弄花画面)。"""
|
|
109
|
+
key = str(path)
|
|
110
|
+
if key in _noted:
|
|
111
|
+
return
|
|
112
|
+
_noted.add(key)
|
|
113
|
+
try:
|
|
114
|
+
sys.stderr.write("[i18n] %s unreadable: %s: %s\n"
|
|
115
|
+
% (path, type(exc).__name__, exc))
|
|
116
|
+
sys.stderr.flush()
|
|
117
|
+
except Exception: # noqa: BLE001
|
|
118
|
+
pass
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _pack(lang: str) -> dict:
|
|
122
|
+
"""读一门语言的两张表并合并。读不出来的那张跳过,不抛。"""
|
|
123
|
+
hit = _packs.get(lang)
|
|
124
|
+
if hit is not None:
|
|
125
|
+
return hit
|
|
126
|
+
data: dict[str, str] = {}
|
|
127
|
+
for path, _strip_values in _files(lang):
|
|
128
|
+
try:
|
|
129
|
+
raw = json.loads(path.read_text(encoding="utf-8"))
|
|
130
|
+
except FileNotFoundError:
|
|
131
|
+
continue
|
|
132
|
+
except Exception as exc: # noqa: BLE001
|
|
133
|
+
_note(path, exc)
|
|
134
|
+
continue
|
|
135
|
+
if not isinstance(raw, dict):
|
|
136
|
+
_note(path, ValueError("top level is not an object"))
|
|
137
|
+
continue
|
|
138
|
+
for key, value in raw.items():
|
|
139
|
+
if isinstance(value, str):
|
|
140
|
+
# 键统一 strip:后端那张表的键是扫描器按源码原样记下的,
|
|
141
|
+
# 有些带前导/尾随空格(` (未实现)`)。`t()` 按 strip 后的
|
|
142
|
+
# 原文查,这里不归一就永远查不到 —— 而症状是"英文界面里
|
|
143
|
+
# 这几句仍是中文",看着像漏翻。
|
|
144
|
+
core = str(key).strip()
|
|
145
|
+
if core:
|
|
146
|
+
data[core] = value.strip() if _strip_values else value
|
|
147
|
+
_packs[lang] = data
|
|
148
|
+
return data
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def t(text: str) -> str:
|
|
152
|
+
"""把一句界面文案换成当前语言;查不到,原文。"""
|
|
153
|
+
if not text:
|
|
154
|
+
return text
|
|
155
|
+
if _lang == SOURCE:
|
|
156
|
+
return text
|
|
157
|
+
core = text.strip()
|
|
158
|
+
if not core:
|
|
159
|
+
return text
|
|
160
|
+
hit = _pack(_lang).get(core)
|
|
161
|
+
if not isinstance(hit, str):
|
|
162
|
+
return text
|
|
163
|
+
at = text.index(core)
|
|
164
|
+
return text[:at] + hit + text[at + len(core):]
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
{
|
|
2
|
+
"待审批": "Awaiting approval",
|
|
3
|
+
"未执行": "Not run",
|
|
4
|
+
"自动审查拦截": "Blocked by auto-review",
|
|
5
|
+
"被拒绝": "Rejected",
|
|
6
|
+
"未采纳": "Discarded",
|
|
7
|
+
"%s(%s)": "%s (%s)",
|
|
8
|
+
"── 还有 %s 行 ──": "── %s more lines ──",
|
|
9
|
+
"# 使用 ctrl+b 转至后台运行": "# ctrl+b to run in the background",
|
|
10
|
+
"· 共 %s 条": "· %s total",
|
|
11
|
+
"连接异常": "Connection error",
|
|
12
|
+
"正在压缩": "Compacting",
|
|
13
|
+
"后台服务:关": "Background services: off",
|
|
14
|
+
"(定时 %s 条未启用)": " (%s scheduled tasks not enabled)",
|
|
15
|
+
"通道 %s": "Channel %s",
|
|
16
|
+
"定时 %s": "%s scheduled tasks",
|
|
17
|
+
"%s个后台": "%s background tasks",
|
|
18
|
+
"%s个子代理": "%s subagents",
|
|
19
|
+
"中断": "Interrupt",
|
|
20
|
+
"上下文:—": "Context: —",
|
|
21
|
+
"上下文:": "Context: ",
|
|
22
|
+
"—— 还有 %s 条 ——": "── %s more ──",
|
|
23
|
+
";空格勾选": "; Space to tick",
|
|
24
|
+
"(没有收到结束事件)": "(no completion event received)",
|
|
25
|
+
"%s 字符": "%s chars",
|
|
26
|
+
"未知错误": "Unknown error",
|
|
27
|
+
"正在初始化…": "Starting…",
|
|
28
|
+
"我可以怎么帮助您?": "How can I help you?",
|
|
29
|
+
"后端未就绪,输入不会生效": "Backend not ready — input is ignored",
|
|
30
|
+
"步骤流已断开,正在重连...": "Step stream disconnected, reconnecting…",
|
|
31
|
+
"提交审批失败:%s": "Could not submit the approval: %s",
|
|
32
|
+
"中断失败:%s": "Stop failed: %s",
|
|
33
|
+
"新会话已就绪:下一句话将开一段新对话": "New conversation ready: your next message starts a fresh thread",
|
|
34
|
+
"剪贴板里没有图片": "No image in the clipboard",
|
|
35
|
+
"转后台失败:%s": "Could not move it to the background: %s",
|
|
36
|
+
"正在重试 %s/%s": "Retrying %s/%s",
|
|
37
|
+
"定位失败:%s": "Could not reveal the path: %s",
|
|
38
|
+
"定位失败(HTTP %s)": "Could not reveal the path (HTTP %s)",
|
|
39
|
+
"压缩失败": "Compaction failed",
|
|
40
|
+
"压缩失败:%s": "Compaction failed: %s",
|
|
41
|
+
"请求失败:%s": "Request failed: %s",
|
|
42
|
+
"后端返回 %s:%s": "Backend returned %s: %s",
|
|
43
|
+
"已取消。": "Cancelled.",
|
|
44
|
+
"密钥被拒绝": "API key rejected",
|
|
45
|
+
"账户余额不足": "Account balance too low",
|
|
46
|
+
"API已被限流,请稍后重试": "API rate limit reached — try again later",
|
|
47
|
+
"地区受限": "Region restricted",
|
|
48
|
+
"请求被内容审核拦下": "Blocked by content moderation",
|
|
49
|
+
"请求体被拒": "Request body rejected",
|
|
50
|
+
"上下文超长": "Context too long",
|
|
51
|
+
"请求被拒": "Request rejected",
|
|
52
|
+
"上游故障": "Upstream fault",
|
|
53
|
+
"上游繁忙": "Upstream busy",
|
|
54
|
+
"上游异常": "Upstream error",
|
|
55
|
+
"连接错误": "Connection error",
|
|
56
|
+
"模型名错误": "Wrong model name",
|
|
57
|
+
"地址错误": "Wrong address",
|
|
58
|
+
"配置错误": "Configuration error",
|
|
59
|
+
"输入对应编号以开始配置(直接回车 = 其他 / OpenAI 兼容):": "Enter a number to start (Enter = Other / OpenAI-compatible):",
|
|
60
|
+
"API 异常(%s):%s": "API error (%s): %s",
|
|
61
|
+
"选择更改条目(直接回车以更改推荐条目) 1 地址 · 2 模型 · 3 密钥 · 0 保留并退出 [%s]:": "Choose what to change (Enter = suggested item) 1 Address · 2 Model · 3 Key · 0 Keep and exit [%s]:",
|
|
62
|
+
"新的请求地址:": "New base URL:",
|
|
63
|
+
"新的模型名:": "New model name:",
|
|
64
|
+
"新的 API Key:": "New API key:",
|
|
65
|
+
"欢迎!看起来这是您的首次使用,让我们从配置您的首个API开始": "Welcome! It looks like this is your first run. Let's start by configuring your first API.",
|
|
66
|
+
"按下enter以继续…": "Press Enter to continue…",
|
|
67
|
+
"模型列表:": "Available models:",
|
|
68
|
+
"(地址由 SDK 决定)": "(base URL determined by the SDK)",
|
|
69
|
+
"API Key(此字段不可见,请直接粘贴;本地模型可直接回车跳过):": "API key (input is hidden; paste it here. Local models: press Enter to skip):",
|
|
70
|
+
"最小请求联通测试…": "Sending a minimal test request…",
|
|
71
|
+
"已确认。运行 `crannia` 开始使用。": "Confirmed. Run `crannia` to get started.",
|
|
72
|
+
"[setup] 未识别的可用配置,进入启动引导": "[setup] No usable model configuration found — starting the first-run guide",
|
|
73
|
+
"[setup] 检查失败(%s)—— 继续启动": "[setup] Check failed (%s) — continuing startup",
|
|
74
|
+
"%s=%r 不是 %s,按默认 %r": "%s=%r is not %s — using default %r",
|
|
75
|
+
"(未记下路径)": "(path not recorded)",
|
|
76
|
+
"[settings] 设置检查失败(%s)—— 继续启动": "[settings] Settings check failed (%s) — continuing startup",
|
|
77
|
+
"[settings] 首次启动:已写入默认设置 %s": "[settings] First run: wrote default settings to %s",
|
|
78
|
+
"[settings] 设置文件处置失败(%s)—— 继续启动": "[settings] Could not repair the settings file (%s) — continuing startup",
|
|
79
|
+
"[settings] 检查失败:%s": "[settings] Check failed: %s",
|
|
80
|
+
"[settings] %s": "[settings] %s",
|
|
81
|
+
"这条命令在桌面端使用:TUI 不重画切换后的对话。": "Use this command in the desktop app: the TUI cannot redraw a switched conversation.",
|
|
82
|
+
"正在回答…": "Answering...",
|
|
83
|
+
"(没有回答)": "(no answer)",
|
|
84
|
+
"(没有内容)": "(no content)",
|
|
85
|
+
"不可使用,上一轮回答尚未完成。": "Not available - the previous answer is still in progress.",
|
|
86
|
+
"[warn] 后端:探测失败(%s)—— 跳过": "[warn] Backend: probe failed (%s) — skipped",
|
|
87
|
+
"[ok ] 后端:已有一个在跑(端口 %s)": "[ok ] Backend: one is already running (port %s)",
|
|
88
|
+
"[ok ] 后端:未运行(首次启动会拉起一个)": "[ok ] Backend: not running (one starts on first launch)",
|
|
89
|
+
"[warn] 密钥:检查失败(%s)—— 跳过": "[warn] API key: check failed (%s) — skipped",
|
|
90
|
+
"[warn] 密钥:还没有默认模型配置(运行 crannia setup)": "[warn] API key: no default model profile yet (run crannia setup)",
|
|
91
|
+
"[ok ] 密钥:默认配置「%s」已填": "[ok ] API key: default profile \"%s\" has one",
|
|
92
|
+
"[ok ] 密钥:本机模型,无需密钥": "[ok ] API key: local model, no key needed",
|
|
93
|
+
"[FAIL] 密钥:默认配置「%s」没有 API Key": "[FAIL] API key: default profile \"%s\" has none",
|
|
94
|
+
"后端未响应,未更改任何配置": "The backend did not respond; nothing was changed",
|
|
95
|
+
"[FAIL] crannia 根:%s": "[FAIL] crannia root: %s",
|
|
96
|
+
"[FAIL] crannia 根:%s 缺少 %s": "[FAIL] crannia root: %s is missing %s",
|
|
97
|
+
"[ok ] crannia 根:%s": "[ok ] crannia root: %s",
|
|
98
|
+
"[FAIL] 解释器:%s": "[FAIL] Interpreter: %s",
|
|
99
|
+
"[ok ] 解释器:%s": "[ok ] Interpreter: %s",
|
|
100
|
+
"[FAIL] 数据根:查询失败:%s: %s": "[FAIL] Data root: query failed: %s: %s",
|
|
101
|
+
"[FAIL] 数据根:%s %s": "[FAIL] Data root: %s %s",
|
|
102
|
+
"[ok ] 数据根:%s 存在且可写": "[ok ] Data root: %s exists and is writable",
|
|
103
|
+
"[FAIL] 数据根:根或解释器不可用,跳过查询": "[FAIL] Data root: root or interpreter unavailable; skipped",
|
|
104
|
+
"[warn] 设置文件:%s 尚未播种": "[warn] Settings file: %s not seeded yet",
|
|
105
|
+
"[ok ] 设置文件:%s": "[ok ] Settings file: %s",
|
|
106
|
+
"[info] 端口:由系统分配(未传 --port)": "[info] Port: assigned by the system (no --port)",
|
|
107
|
+
"[FAIL] 端口:探测失败:%s: %s": "[FAIL] Port: probe failed: %s: %s",
|
|
108
|
+
"[ok ] 端口:%s 空闲": "[ok ] Port: %s is free",
|
|
109
|
+
"[FAIL] 端口:%s 已被占用": "[FAIL] Port: %s is in use",
|
|
110
|
+
"子进程输出不是 UTF-8:%s": "Subprocess output is not UTF-8: %s",
|
|
111
|
+
"子进程查询失败(%s):%s": "Subprocess query failed (%s): %s",
|
|
112
|
+
"子进程查询没有输出": "Subprocess query produced no output",
|
|
113
|
+
"data_root() 返回空值": "data_root() returned an empty value",
|
|
114
|
+
"core.version 没有输出": "core.version produced no output",
|
|
115
|
+
"crannia (版本未知)": "crannia (unknown version)",
|
|
116
|
+
"目录不存在": "Directory does not exist",
|
|
117
|
+
"、": ", ",
|
|
118
|
+
"(未填模型)": "(no model)",
|
|
119
|
+
"「%s」撞名了,用 id 指定:%s": "“%s” is ambiguous — use an id: %s",
|
|
120
|
+
"没有「%s」。现有:%s": "No “%s”. Available: %s",
|
|
121
|
+
"「%s」已经是默认了。": "“%s” is already the default.",
|
|
122
|
+
"切换失败": "Switch failed",
|
|
123
|
+
"已设为默认:%s": "Default set to: %s",
|
|
124
|
+
"用法:\n crannia channel list 列出各通道的配置条目与警告\n crannia channel add <平台> [名字] 新建一条(凭据逐格输入)\n crannia channel config <名字|id> 改一条(回车表示不改)\n crannia channel remove <名字|id> 删一条(默认那条要先换默认)\n crannia channel default <名字|id> 设为该平台的默认条目\n crannia channel start <平台> 启动一个通道(要求后端在跑)\n crannia channel stop <平台> 停止一个通道(要求后端在跑)\n crannia channel login wechat 微信扫码登录(要求后端在跑)\n\n平台:feishu / dingtalk / telegram / qq_bot(需要凭据)· wechat(扫码)\n选项:--yes 直接确认已读接入警告(脚本用)": "Usage:\n crannia channel list list channel profiles and notices\n crannia channel add <platform> [name] create a profile (credentials one by one)\n crannia channel config <name|id> edit a profile (Enter = keep)\n crannia channel remove <name|id> delete a profile (switch the default first)\n crannia channel default <name|id> make it the platform's default\n crannia channel start <platform> start a channel (backend must be running)\n crannia channel stop <platform> stop a channel (backend must be running)\n crannia channel login wechat WeChat QR login (backend must be running)\n\nPlatforms: feishu / dingtalk / telegram / qq_bot (credentials) · wechat (QR)\nOption: --yes accept the integration notice without asking (for scripts)",
|
|
125
|
+
"%s(%s)%s%s": "%s (%s)%s%s",
|
|
126
|
+
"%s(回车不改): ": "%s (Enter = keep): ",
|
|
127
|
+
"(无凭据)": "(no credentials)",
|
|
128
|
+
"(未命名)": "(unnamed)",
|
|
129
|
+
"[群聊未完善]": "[group chat incomplete]",
|
|
130
|
+
"注意:": "Note: ",
|
|
131
|
+
"非交互环境:加 --yes 表示已读并继续。": "Non-interactive: pass --yes to confirm you read the notice.",
|
|
132
|
+
"启动微信登录失败": "Could not start WeChat login",
|
|
133
|
+
"已扫码,请在手机上确认…": "Code scanned — confirm on your phone…",
|
|
134
|
+
"微信已登录。": "WeChat is logged in.",
|
|
135
|
+
"登录失败:%s": "Login failed: %s",
|
|
136
|
+
"等超时了(%s 秒)—— 再执行一次。": "Timed out after %s seconds — try again.",
|
|
137
|
+
"已新建:「%s」(%s)": "Created “%s” (%s)",
|
|
138
|
+
"已更新:「%s」(%s)": "Updated “%s” (%s)",
|
|
139
|
+
"非交互环境:加 --yes 确认删除。": "Non-interactive: pass --yes to confirm deletion.",
|
|
140
|
+
"删除「%s」?[y/N] ": "Delete “%s”? [y/N] ",
|
|
141
|
+
"已删除:%s": "Deleted: %s",
|
|
142
|
+
"停止失败": "Failed to stop",
|
|
143
|
+
"已启动": "Started",
|
|
144
|
+
"目前只有 `crannia channel login wechat`。": "Only `crannia channel login wechat` is supported.",
|
|
145
|
+
"只认 .zip 或目录(收到 %s)": "Only .zip files or directories are accepted (got %s)",
|
|
146
|
+
"无扩展名": "no extension",
|
|
147
|
+
"版本名不合法:%r(只许字母数字和 . _ + -)": "Invalid version name: %r (letters, digits and . _ + - only)",
|
|
148
|
+
"当前版本:%s": "Current version: %s",
|
|
149
|
+
"(未记录)": "(not recorded)",
|
|
150
|
+
"检查更新失败:%s": "Update check failed: %s",
|
|
151
|
+
"这个 TUI 随桌面端一起更新:请在桌面端里检查更新,或运行安装包。": "This TUI updates together with the desktop app: check for updates in the desktop app, or run the installer.",
|
|
152
|
+
"已是最新版本:%s": "Already up to date: %s",
|
|
153
|
+
"新版本 %s 下载失败 · 运行 crannia update 重试": "Downloading %s failed - run crannia update to retry",
|
|
154
|
+
"发现新版本 %s,正在安装…": "New version %s found; installing...",
|
|
155
|
+
"下载失败:%s": "Download failed: %s",
|
|
156
|
+
"用法:crannia update --from <zip 或目录> [--version V] [--sha256 H]": "Usage: crannia update --from <zip or directory> [--version V] [--sha256 H]",
|
|
157
|
+
"CRANNIA_PYTHON 指向 %s,但那里没有可执行文件": "CRANNIA_PYTHON points at %s, but there is no executable there",
|
|
158
|
+
"/api/start 失败(%s):%s": "/api/start failed (%s): %s",
|
|
159
|
+
"后端进程已退出(code=%s)。\n": "Backend process exited (code=%s).\n",
|
|
160
|
+
"(没有输出)": "(no output)",
|
|
161
|
+
"中断请求失败:%s: %s": "Stop request failed: %s: %s",
|
|
162
|
+
"事件流被拒绝(HTTP %s)": "Event stream rejected (HTTP %s)",
|
|
163
|
+
"事件流已断开:%s": "Event stream disconnected: %s",
|
|
164
|
+
"powershell 退出码 %s": "powershell exited with code %s",
|
|
165
|
+
"crannia 的终端界面": "Crannia's terminal interface",
|
|
166
|
+
"固定后端端口。默认让系统分配空闲端口": "Fixed backend port. By default an idle port is assigned by the system",
|
|
167
|
+
"按键诊断:只显示收到的按键,不启动后端": "Key diagnostics: show received keys only; no backend",
|
|
168
|
+
"config 后接 path;profile 后接配置名或 id;channel 后接 list / add / config / remove / default / start / stop / login": "after config: path; after profile: a profile name or id; after channel: list / add / config / remove / default / start / stop / login",
|
|
169
|
+
"channel 子命令的参数": "Arguments for the channel subcommand",
|
|
170
|
+
"打印 crannia 版本后退出": "Print the crannia version and exit",
|
|
171
|
+
"update:zip 的 sha256(对不上就拒)": "update: sha256 of the zip (rejected on mismatch)",
|
|
172
|
+
"update:覆盖已存在的同版本目录": "update: replace an existing directory for the same version",
|
|
173
|
+
"附加命令:doctor(自检) · config path(打印设置文件绝对路径) · profile [名字](列出或切换模型配置) · channel (通道的配置与启停) · --version(打印版本)——都不启动界面": "Extra commands: doctor (self-check) · config path (print the settings file path) · profile [name] (list or switch model profiles) · channel (configure and start/stop channels) · --version (print the version) — none of them start the UI",
|
|
174
|
+
"config 后需要 path": "config requires path",
|
|
175
|
+
"无默认": "No default",
|
|
176
|
+
"配置名称 [eg:%s]:": "Profile name [e.g. %s]:",
|
|
177
|
+
"模型名 [eg:%s]:": "Model [e.g. %s]:",
|
|
178
|
+
"模型名:": "Model:",
|
|
179
|
+
"未检测到结束事件": "No completion event detected",
|
|
180
|
+
"↑↓ 选择 · enter填入 · Esc 收起": "↑↓ select · enter to insert · Esc close",
|
|
181
|
+
"↑↓ 翻页 · ↓ 返回底栏 · Esc 收起": "↑↓ page · ↓ back to the status bar · Esc close",
|
|
182
|
+
"还有补充…": "Anything to add…",
|
|
183
|
+
"无在跑的%s": "Nothing running in %s",
|
|
184
|
+
"输入框未就绪": "Composer not ready",
|
|
185
|
+
"后端未就绪:%s": "Backend not ready: %s",
|
|
186
|
+
"审批未受理(%s):%s": "Approval not accepted (%s): %s",
|
|
187
|
+
"剪贴板读取失败:%s": "Could not read the clipboard: %s",
|
|
188
|
+
"审批详情获取失败:%s": "Could not load approval details: %s",
|
|
189
|
+
"setup 需要在终端中启用,请在 Windows Terminal 里执行 `crannia setup`。": "setup needs a terminal; run `crannia setup` in Windows Terminal.",
|
|
190
|
+
"供应商错误,此程序遇到了一些问题,请先运行 `crannia doctor`尝试修复": "Provider error — something is wrong with this installation. Run `crannia doctor` to try to fix it.",
|
|
191
|
+
"模型名不能为空": "The model name cannot be empty",
|
|
192
|
+
"没有「%s」。请填写编号或直接回车。": "No “%s”. Enter a number or press Enter.",
|
|
193
|
+
"默认:「%s」(模型 %s)": "Default: “%s” (model %s)",
|
|
194
|
+
"「其他」需要一个请求地址。": "“Other” needs a base URL.",
|
|
195
|
+
"配置设置失败": "Configuration failed",
|
|
196
|
+
"已保留,联通测试未通过": "Kept, but the connectivity test did not pass",
|
|
197
|
+
"测试未完成:%s": "Test did not finish: %s",
|
|
198
|
+
"未更改": "Not changed",
|
|
199
|
+
"模型配置读取失败:%s": "Could not read the model configuration: %s",
|
|
200
|
+
"供应商读取错误:%s": "Could not read provider cards: %s",
|
|
201
|
+
"配置失败:%s": "Configuration failed: %s",
|
|
202
|
+
"更改默认失败:%s": "Could not change the default: %s",
|
|
203
|
+
"未更改:%s": "Not changed: %s",
|
|
204
|
+
"?(未填写)": "? (empty)",
|
|
205
|
+
"请求地址(例如 https://…/v1):": "Base URL (e.g. https://…/v1):",
|
|
206
|
+
"重新配置?[y/N]": "Configure again? [y/N]",
|
|
207
|
+
"发送一条消息而不做交互(脚本 / CI 用)": "Send one message without interaction (for scripts / CI)",
|
|
208
|
+
"doctor:逐项自检;config:配合 path 打印设置文件路径;profile:列出或切换模型配置;channel:通道的配置与启停;setup:配置一条模型 API(首次引导);update:安装一个新版本": "doctor: self-check; config: with path, print the settings file path; profile: list or switch model profiles; channel: configure and start/stop channels; setup: configure a model API (first run); update: install a new version",
|
|
209
|
+
"update:从本地 zip 或从目录装载": "update: install from a local zip or directory",
|
|
210
|
+
"update:当前版本版本名": "update: release name",
|
|
211
|
+
"[setup] 引导未完成": "[setup] The guide did not finish",
|
|
212
|
+
"非目录": "Not a directory",
|
|
213
|
+
"写入失败:%s": "Write failed: %s",
|
|
214
|
+
"探针删除失败:%s": "Could not delete the probe: %s",
|
|
215
|
+
"[FAIL] 设置文件:%s 读取失败:%s: %s": "[FAIL] Settings file: %s unreadable: %s: %s",
|
|
216
|
+
"后端未启动": "The backend is not running",
|
|
217
|
+
"请提供名字或 id": "Provide a name or id",
|
|
218
|
+
"没有「%s」。尝试运行 `crannia channel list`": "No “%s”. Try running `crannia channel list`",
|
|
219
|
+
"后端回复了未知内容": "The backend returned unknown content",
|
|
220
|
+
"请提供一个名字或 id": "Provide a name or id",
|
|
221
|
+
"已设为默认:「%s」。重启以更换运行中的通道。": "“%s” is now the default. Restart to switch running channels.",
|
|
222
|
+
"(未配置)": "(not configured)",
|
|
223
|
+
"密钥应在终端里输入。": "Secrets must be entered in a terminal.",
|
|
224
|
+
"后端无应答(%s)": "No response from the backend (%s)",
|
|
225
|
+
"请使用手机微信扫码继续…": "Scan the QR code with WeChat on your phone to continue…",
|
|
226
|
+
"需要平台名:": "Platform name required:",
|
|
227
|
+
"未知平台:%s(有:%s)": "Unknown platform: %s (available: %s)",
|
|
228
|
+
"配置丢失": "Profile lost",
|
|
229
|
+
"二维码过期,请再次运行 `crannia channel login wechat`。": "The QR code expired; run `crannia channel login wechat` again.",
|
|
230
|
+
"尚未拥有模型配置 —— 请前往 GUI 端配置内新建。": "No model profiles yet — create one in the GUI endpoint settings.",
|
|
231
|
+
"请提供一个配置名或 id": "Provide a profile name or id",
|
|
232
|
+
"后端无应答 —— 先用 `crannia doctor` 看它还在不在。": "No response from the backend — run `crannia doctor` to check it.",
|
|
233
|
+
"已安装 %s(上一版:%s)。下次启动生效。": "Installed %s (previous: %s). Takes effect on next start.",
|
|
234
|
+
"找不到此包:%s": "Package not found: %s",
|
|
235
|
+
"此包存在一些不可解决的问题": "This package has problems that cannot be resolved",
|
|
236
|
+
"此版本版本号未知,使用 --version 指定,或在包里放一份 version.json": "Unknown release version — pass --version or include version.json in the package",
|
|
237
|
+
"解包失败:%s": "Could not unpack: %s",
|
|
238
|
+
"校验不通过: %s…, %s…": "Checksum mismatch: %s…, %s…",
|
|
239
|
+
"releases/%s 已存在,使用 --force 尝试覆盖": "releases/%s already exists — pass --force to replace it",
|
|
240
|
+
"未更新:%s": "Not updated: %s",
|
|
241
|
+
"找不到 crannia。设 CRANNIA_HOME 指向它的根目录": "Could not find crannia. Set CRANNIA_HOME to its root directory",
|
|
242
|
+
"CRANNIA_HOME 指向 %s,但未在目标位置读取到 main.py / core / web": "CRANNIA_HOME points at %s, but main.py / core / web were not found there",
|
|
243
|
+
"版本不一致:TUI 是 %s,当前后端 %s。请优先升级后重试。": "Version mismatch: TUI is %s, the backend is %s. Upgrade first and retry.",
|
|
244
|
+
"需要审批;--once 模式下无法响应,请改用交互界面。": "Approval required; --once mode cannot respond. Use the interactive UI instead.",
|
|
245
|
+
"后端错误:": "Backend error:",
|
|
246
|
+
"剪贴板图片读取仅在windows下支持": "Clipboard image reading is only supported on Windows",
|
|
247
|
+
"未找到 powershell": "powershell not found",
|
|
248
|
+
"剪贴板读取超时(20 秒)": "Clipboard read timed out (20s)",
|
|
249
|
+
"[settings] 数据根读取失败(%s)—— 跳过设置检查": "[settings] Could not read the data root (%s) — skipping the settings check",
|
|
250
|
+
"[settings] 设置文件读取失败,已备份到 %s,并按默认重建": "[settings] Settings file unreadable; backed up to %s and rebuilt from defaults",
|
|
251
|
+
"找不到运行所需 Python:当前解释器没有 flask,crannia 目录下也没有可用的 .venv。\n设 CRANNIA_PYTHON 指向一个装了 crannia 依赖的解释器(通常是 `crannia/.venv/Scripts/python.exe`)。": "Could not find a Python that can run crannia: the current interpreter has no flask, and there is no usable .venv under the crannia directory.\nSet CRANNIA_PYTHON to an interpreter with crannia's dependencies (usually `crannia/.venv/Scripts/python.exe`).",
|
|
252
|
+
"CRANNIA_PYTHON 指向 %s,但 `import flask` 失败,后端异常\n它应当指向已安装 crannia 依赖的解释器(通常是未安装 TUI 依赖的 venv),而非本程序自己的 venv。": "CRANNIA_PYTHON points at %s, but `import flask` fails and the backend cannot run.\nIt should point at an interpreter with crannia's installed dependencies (usually the venv without the TUI deps), not this program's own venv.",
|
|
253
|
+
"按下小键盘的 /,Ctrl+Q 退出。\n记录:%s": "Press / on the numeric keypad; Ctrl+Q to quit.\nLog: %s",
|
|
254
|
+
"· 运行中": "· running",
|
|
255
|
+
"是否继续?[y/N]": "Continue? [y/N]",
|
|
256
|
+
"后端 %ss 内未就绪(最后错误:%s)。": "Backend was not ready within %ss (last error: %s).",
|
|
257
|
+
"用法:\n crannia channel list 列出各通道的配置条目与警告\n crannia channel add <平台> [名字] 新建(凭据逐格输入)\n crannia channel config <名字|id> 更改条目(回车以取消更改)\n crannia channel remove <名字|id> 删除条目(若目标为默认条目,则应优先更换默认)\n crannia channel default <名字|id> 设为该平台的默认条目\n crannia channel start <平台> 启动一个通道\n crannia channel stop <平台> 停止一个通道\n crannia channel login wechat 微信扫码登录\n\n平台:feishu / dingtalk / telegram / qq_bot(需要凭据)· wechat(扫码登录)\n选项:--yes 直接确认已读接入警告(脚本用)": "Usage:\n crannia channel list list channel profiles and notices\n crannia channel add <platform> [name] create a profile (credentials one by one)\n crannia channel config <name|id> edit a profile (Enter cancels an edit)\n crannia channel remove <name|id> delete a profile (switch the default first if it is the default)\n crannia channel default <name|id> make it the platform's default\n crannia channel start <platform> start a channel\n crannia channel stop <platform> stop a channel\n crannia channel login wechat WeChat QR login\n\nPlatforms: feishu / dingtalk / telegram / qq_bot (credentials) · wechat (QR login)\nOption: --yes accept the integration notice without asking (for scripts)",
|
|
258
|
+
"[warn] 技能配置:%s 需要 %s(%s)": "[warn] Skill config: %s needs %s (%s)",
|
|
259
|
+
"[warn] 技能配置:检查失败(%s)—— 跳过": "[warn] Skill config: check failed (%s) — skipped",
|
|
260
|
+
"提示:这个窗口用不了 ANSI,颜色退到 16 色、底部实时区关掉(功能都在)。": "Note: this window cannot render ANSI. Colors fall back to 16, and the live area at the bottom is disabled (everything still works).",
|
|
261
|
+
"想恢复:换 Windows Terminal 跑,或设 CRANNIA_TUI_ANSI=1 强制开启。": "To restore them, run in Windows Terminal, or set CRANNIA_TUI_ANSI=1.",
|
|
262
|
+
"无法确定会话(/api/status 没有 session),不再订阅全部会话;请改用交互界面。": "Could not determine the session (/api/status returned no session); refusing to subscribe to all sessions. Use the interactive UI instead."
|
|
263
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""工具结局在界面上的说法。
|
|
2
|
+
|
|
3
|
+
词表在 crannia 那边(`core/tool_outcome.py`):`outcome` 五选一决定颜色,
|
|
4
|
+
`reason` 细分决定文案。这里只做翻译,不另造语义,也不从回执正文里猜 ——
|
|
5
|
+
修前 TUI 靠拉轨迹正文认"被拒绝",正是要撤掉的那条路。
|
|
6
|
+
|
|
7
|
+
两个白点例外:`rejected` 下的 `cancelled`(用户打断并补充)与 `recused`
|
|
8
|
+
(框架没办成)都不是"用户说不行",所以不染红。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from .i18n import t
|
|
14
|
+
|
|
15
|
+
#: 结局 → 圆点颜色。`unknown` 不是后端给的:它表示"这一轮结束了,
|
|
16
|
+
#: 但那个工具的结束事件没来"(`ToolCard.orphan`)。
|
|
17
|
+
DOT = {
|
|
18
|
+
"completed": "green",
|
|
19
|
+
"waiting": "yellow",
|
|
20
|
+
"error": "white",
|
|
21
|
+
"denied": "red",
|
|
22
|
+
"rejected": "red",
|
|
23
|
+
"unknown": "yellow",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#: `rejected` 里这两条用白点。
|
|
27
|
+
_WHITE_REJECTED = {"cancelled", "recused"}
|
|
28
|
+
|
|
29
|
+
#: (结局, 细分) → 卡片括号里那句话。细分缺省时用 (结局, "") 那一行。
|
|
30
|
+
_LABELS = {
|
|
31
|
+
("completed", ""): "已完成",
|
|
32
|
+
("waiting", ""): "待审批",
|
|
33
|
+
("error", ""): "失败",
|
|
34
|
+
("error", "failed"): "失败",
|
|
35
|
+
("error", "refused"): "未执行",
|
|
36
|
+
("denied", ""): "自动审查拦截",
|
|
37
|
+
("denied", "auto-review-blocked"): "自动审查拦截",
|
|
38
|
+
("rejected", ""): "被拒绝",
|
|
39
|
+
("rejected", "user"): "被拒绝",
|
|
40
|
+
("rejected", "unavailable"): "被拒绝",
|
|
41
|
+
("rejected", "auto-review-unavailable"): "被拒绝",
|
|
42
|
+
("rejected", "cancelled"): "未采纳",
|
|
43
|
+
("rejected", "recused"): "未执行",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def dot(outcome: str, reason: str = "") -> str:
|
|
48
|
+
"""这个结局的圆点颜色。"""
|
|
49
|
+
if outcome == "rejected" and reason in _WHITE_REJECTED:
|
|
50
|
+
return "white"
|
|
51
|
+
return DOT.get(outcome or "", "yellow")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def label(outcome: str, reason: str = "") -> str:
|
|
55
|
+
"""这个结局在卡片括号里的那句话。
|
|
56
|
+
|
|
57
|
+
认不出来的组合给"未完成":那是实话,也不会让一个没跑成的调用
|
|
58
|
+
看起来像跑完了。
|
|
59
|
+
"""
|
|
60
|
+
return t(_LABELS.get((outcome or "", reason or ""))
|
|
61
|
+
or _LABELS.get((outcome or "", ""))
|
|
62
|
+
or "未完成")
|