@hfyjq/crannia 1.1.0 → 1.1.2
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/core/activity.py +1 -1
- package/core/agent_loop.py +7 -8
- package/core/approval.py +2 -2
- package/core/file_history.py +5 -5
- package/core/im_routing.py +1 -1
- package/core/llm_errors.py +1 -1
- package/core/pipeline/stages/pre_process.py +9 -9
- package/core/updater.py +229 -40
- package/core/version.py +2 -2
- package/locales/en.json +124 -131
- package/package.json +21 -12
- package/tui/crannia_tui/locales/en.json +2 -2
- package/web/server.py +24 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hfyjq/crannia",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Crannia application code pack for automatic updates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -11,28 +11,37 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"crannia": {
|
|
14
|
-
"version": "1.1.
|
|
14
|
+
"version": "1.1.2",
|
|
15
15
|
"channel": "stable",
|
|
16
|
-
"published_at": "2026-11-
|
|
17
|
-
"release_notes_url": "",
|
|
16
|
+
"published_at": "2026-11-22T14:27:09Z",
|
|
17
|
+
"release_notes_url": "https://github.com/hfyjq/Crannia/releases/tag/v1.1.2",
|
|
18
18
|
"minimum_client_version": null,
|
|
19
19
|
"mandatory": false,
|
|
20
20
|
"changelog": {},
|
|
21
21
|
"artifacts": {
|
|
22
22
|
"windows-exe": {
|
|
23
|
-
"url": "https://
|
|
24
|
-
"sha256": "
|
|
25
|
-
"size_bytes":
|
|
23
|
+
"url": "https://gitcode.com/KanocRain/crannia-release/releases/download/v1.1.2/crannia-1.1.2-win-x64.exe",
|
|
24
|
+
"sha256": "b53a032dbb387aa75b27067ae48ecf879c09ec493d56f559de07668685949d38",
|
|
25
|
+
"size_bytes": 268385107,
|
|
26
|
+
"urls": [
|
|
27
|
+
"https://gitcode.com/KanocRain/crannia-release/releases/download/v1.1.2/crannia-1.1.2-win-x64.exe",
|
|
28
|
+
"https://github.com/hfyjq/Crannia/releases/download/v1.1.2/crannia-1.1.2-win-x64.exe"
|
|
29
|
+
]
|
|
26
30
|
},
|
|
27
31
|
"codepack": {
|
|
28
|
-
"app_version": "1.1.
|
|
32
|
+
"app_version": "1.1.2",
|
|
29
33
|
"runtime": "81c9471a1aed5e0ec6716c5447082df39b68aa3c06332dc32d44d0682dd716f6",
|
|
30
|
-
"shell_sha256": "
|
|
34
|
+
"shell_sha256": "232422afa7655f825bc95a8fea3db52094bf192ae697b3121c1c5ce9756be826",
|
|
35
|
+
"shell_sig": "632889ca8516def7945583355714f85981cbde529fb4149b5ff511bfdb8fbdce"
|
|
31
36
|
},
|
|
32
37
|
"tui": {
|
|
33
|
-
"url": "https://
|
|
34
|
-
"sha256": "
|
|
35
|
-
"size_bytes":
|
|
38
|
+
"url": "https://gitcode.com/KanocRain/crannia-release/releases/download/v1.1.2/crannia-tui-1.1.2-code.zip",
|
|
39
|
+
"sha256": "4b94af2b3cfa4f3bf7f7a545e1c52311f84cf42b834b1a173937ec26ad80be5f",
|
|
40
|
+
"size_bytes": 5061573,
|
|
41
|
+
"urls": [
|
|
42
|
+
"https://gitcode.com/KanocRain/crannia-release/releases/download/v1.1.2/crannia-tui-1.1.2-code.zip",
|
|
43
|
+
"https://github.com/hfyjq/Crannia/releases/download/v1.1.2/crannia-tui-1.1.2-code.zip"
|
|
44
|
+
]
|
|
36
45
|
}
|
|
37
46
|
}
|
|
38
47
|
}
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"%s 字符": "%s chars",
|
|
26
26
|
"未知错误": "Unknown error",
|
|
27
27
|
"正在初始化…": "Starting…",
|
|
28
|
-
"我可以怎么帮助您?": "How can I help you?",
|
|
29
28
|
"后端未就绪,输入不会生效": "Backend not ready — input is ignored",
|
|
30
29
|
"步骤流已断开,正在重连...": "Step stream disconnected, reconnecting…",
|
|
31
30
|
"提交审批失败:%s": "Could not submit the approval: %s",
|
|
@@ -259,5 +258,6 @@
|
|
|
259
258
|
"[warn] 技能配置:检查失败(%s)—— 跳过": "[warn] Skill config: check failed (%s) — skipped",
|
|
260
259
|
"提示:这个窗口用不了 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
260
|
"想恢复:换 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."
|
|
261
|
+
"无法确定会话(/api/status 没有 session),不再订阅全部会话;请改用交互界面。": "Could not determine the session (/api/status returned no session); refusing to subscribe to all sessions. Use the interactive UI instead.",
|
|
262
|
+
"转后台失败": "Could not move it to the background"
|
|
263
263
|
}
|
package/web/server.py
CHANGED
|
@@ -1012,7 +1012,7 @@ def api_skill_uninstall():
|
|
|
1012
1012
|
|
|
1013
1013
|
· 目录内(`source == "repo"` 且不是框架自带)-> 挪到系统回收站(可恢复)
|
|
1014
1014
|
· 外部来源 -> 不卸,回一句
|
|
1015
|
-
|
|
1015
|
+
「外部应用的组件,暂不提供卸载。路径 __」
|
|
1016
1016
|
|
|
1017
1017
|
[!] 路径只从扫描结果取(`_scan_skills()`),请求里那个 `name` 只当键——
|
|
1018
1018
|
用户传 `../core` 之类在这里查不到 -> 404 -> 构造不出路径。
|
|
@@ -1042,10 +1042,10 @@ def api_skill_uninstall():
|
|
|
1042
1042
|
return jsonify({"ok": False, "error": tr("没有这个技能:%r") % name}), 404
|
|
1043
1043
|
if target.get("source") != "repo":
|
|
1044
1044
|
return jsonify({"ok": False, "external": True, "path": target.get("path", ""),
|
|
1045
|
-
"error": tr("
|
|
1045
|
+
"error": tr("外部应用的组件,暂不提供卸载。路径 %s")
|
|
1046
1046
|
% (target.get("path") or "(未提供)")}), 400
|
|
1047
1047
|
if target.get("builtin"):
|
|
1048
|
-
return jsonify({"ok": False, "error": tr("
|
|
1048
|
+
return jsonify({"ok": False, "error": tr("框架自带的技能,暂不提供卸载")}), 400
|
|
1049
1049
|
|
|
1050
1050
|
skill_dir = Path(target["path"])
|
|
1051
1051
|
try:
|
|
@@ -1204,7 +1204,7 @@ def api_skill_install():
|
|
|
1204
1204
|
return jsonify({"ok": False, "error": tr("不是一个目录")}), 400
|
|
1205
1205
|
if not ((src / "SKILL.md").is_file() or (src / "manifest.yaml").is_file()):
|
|
1206
1206
|
return jsonify({"ok": False,
|
|
1207
|
-
"error": tr("
|
|
1207
|
+
"error": tr("此目录里无法找到 SKILL.md 或 manifest.yaml")}), 400
|
|
1208
1208
|
|
|
1209
1209
|
name = src.name
|
|
1210
1210
|
if not name or name.startswith((".", "_", "$")):
|
|
@@ -2103,7 +2103,7 @@ def api_model_configs_test():
|
|
|
2103
2103
|
base_url = _PROTOCOL_DEFAULT_BASE.get(provider_dir, "")
|
|
2104
2104
|
if not base_url:
|
|
2105
2105
|
return jsonify({"ok": False, "window": None,
|
|
2106
|
-
"error": tr("
|
|
2106
|
+
"error": tr("此配置未填请求地址,服务商也没有提供默认地址,请填写地址。")}), 400
|
|
2107
2107
|
|
|
2108
2108
|
from urllib.parse import urlsplit
|
|
2109
2109
|
scheme = (urlsplit(base_url).scheme or "").lower()
|
|
@@ -3344,7 +3344,7 @@ def _stop_channel(channel_id: str, *, wait_s: float = 5.0,
|
|
|
3344
3344
|
|
|
3345
3345
|
_log(f"[channel] {channel_id} 停不下来(线程没有退出)—— 需要重启应用")
|
|
3346
3346
|
return {"ok": False, "status": "stuck", "channel_id": channel_id,
|
|
3347
|
-
"error": tr("
|
|
3347
|
+
"error": tr("此通道没有成功停止;请尝试重启应用。")}
|
|
3348
3348
|
|
|
3349
3349
|
|
|
3350
3350
|
@app.route("/api/channel/stop", methods=["POST"])
|
|
@@ -3411,7 +3411,7 @@ def api_channel_entry_create():
|
|
|
3411
3411
|
data = request.get_json() or {}
|
|
3412
3412
|
platform = _channel_platform(data.get("channel_id", ""))
|
|
3413
3413
|
if platform not in _cc.PLATFORMS:
|
|
3414
|
-
return jsonify({"error": "
|
|
3414
|
+
return jsonify({"error": "此通道没有凭据表单"}), 400
|
|
3415
3415
|
try:
|
|
3416
3416
|
row = _cc.create(platform, data.get("name", ""), data.get("fields") or {})
|
|
3417
3417
|
except _cc.ChannelConfigError as exc:
|
|
@@ -4057,8 +4057,8 @@ def api_chat():
|
|
|
4057
4057
|
# (那是逐张、逐轮的判据,在下游);它管的是"在解析之前就拒绝"。
|
|
4058
4058
|
# 给的是一个余量很大的数:4 张 4 MB 的图 ≈ 21 MB body。
|
|
4059
4059
|
if (request.content_length or 0) > _CHAT_BODY_MAX_BYTES:
|
|
4060
|
-
return jsonify({"error": "
|
|
4061
|
-
"
|
|
4060
|
+
return jsonify({"error": "本轮的图片过大(请求体 %d 字节,上限 %d)"
|
|
4061
|
+
"—— 请尝试裁切图片或分次发送"
|
|
4062
4062
|
% (request.content_length, _CHAT_BODY_MAX_BYTES)}), 413
|
|
4063
4063
|
|
|
4064
4064
|
data = request.get_json() or {}
|
|
@@ -4332,12 +4332,12 @@ def api_approval_post():
|
|
|
4332
4332
|
verdict, why = _ca.answer(_key, request_id, choice)
|
|
4333
4333
|
if verdict != REPLY_OK:
|
|
4334
4334
|
return jsonify({"ok": False, "reason": REPLY_STALE,
|
|
4335
|
-
"error": why or tr("
|
|
4335
|
+
"error": why or tr("此条目已经完成")}), 409
|
|
4336
4336
|
return jsonify({"ok": True, "reply": "", "sent": choice})
|
|
4337
4337
|
if not cur:
|
|
4338
4338
|
# 已经没有待审批了 —— 多半是双击的第二下,或者已经在别处答过
|
|
4339
4339
|
return jsonify({"ok": False, "reason": REPLY_STALE,
|
|
4340
|
-
"error": tr("
|
|
4340
|
+
"error": tr("此条目已经完成或正在被处理")}), 409
|
|
4341
4341
|
|
|
4342
4342
|
verdict, payload_text = reply_decision(
|
|
4343
4343
|
request_id=request_id,
|
|
@@ -4354,7 +4354,7 @@ def api_approval_post():
|
|
|
4354
4354
|
return jsonify({
|
|
4355
4355
|
"ok": False, "reason": verdict,
|
|
4356
4356
|
#: 说人话:界面上弹的是 `error`,而 `409` 本身对用户没有信息量。
|
|
4357
|
-
"error": ("
|
|
4357
|
+
"error": ("此条目已经完成" if verdict == REPLY_STALE
|
|
4358
4358
|
else "这个选项不在这次给出的选项里。"),
|
|
4359
4359
|
}), 409
|
|
4360
4360
|
|
|
@@ -4367,7 +4367,7 @@ def api_approval_post():
|
|
|
4367
4367
|
_key = session_key_for(_web_session(group))
|
|
4368
4368
|
if not _claim_approval(_key):
|
|
4369
4369
|
return jsonify({"ok": False, "reason": REPLY_STALE,
|
|
4370
|
-
"error": tr("
|
|
4370
|
+
"error": tr("此条目已经完成或正在被处理")}), 409
|
|
4371
4371
|
try:
|
|
4372
4372
|
reply = _run_chat_turn(payload_text, group=group)
|
|
4373
4373
|
except Exception as e:
|
|
@@ -5281,7 +5281,7 @@ def api_reveal():
|
|
|
5281
5281
|
#: 顺便把"试过哪儿"说一句,那是唯一能让他自己纠的地方。
|
|
5282
5282
|
tried = "、".join(str(c) for c in cands[:3])
|
|
5283
5283
|
return jsonify({"ok": False,
|
|
5284
|
-
"error": tr("
|
|
5284
|
+
"error": tr("此路径不存在:%s(找过:%s)") % (raw, tried)}), 404
|
|
5285
5285
|
|
|
5286
5286
|
try:
|
|
5287
5287
|
if os.name == "nt":
|
|
@@ -7746,6 +7746,9 @@ def api_update_status():
|
|
|
7746
7746
|
"status": _update_state.get("status", "idle"),
|
|
7747
7747
|
"progress": _update_state.get("progress", 0.0),
|
|
7748
7748
|
"error": _update_state.get("error"),
|
|
7749
|
+
#: 当前这一段(downloading / verifying)的起点(epoch 秒)——
|
|
7750
|
+
#: 设置页那一行用它给"正在校验安装包…"计时。
|
|
7751
|
+
"phase_started": _update_state.get("phase_started") or 0,
|
|
7749
7752
|
#: 「没配更新源」与「查过了、没新版本」必须分得开 —— 设置页照这两格说人话。
|
|
7750
7753
|
"unconfigured": bool(_update_state.get("unconfigured")),
|
|
7751
7754
|
#: 已经下好、等着下次启动装的那一版(`None` = 没有)。
|
|
@@ -7836,7 +7839,10 @@ def api_update_download():
|
|
|
7836
7839
|
|
|
7837
7840
|
def _download_thread():
|
|
7838
7841
|
#: 代码包优先(几 MB),不适用/失败自动回退全量安装包。
|
|
7839
|
-
|
|
7842
|
+
#: 必须走 `download_thread_entry`:它把任何异常落成 `error`,
|
|
7843
|
+
#: 否则线程一死,状态永远停在 `verifying`(界面就一直转)。
|
|
7844
|
+
from core.updater import download_thread_entry
|
|
7845
|
+
download_thread_entry(manifest, checker)
|
|
7840
7846
|
|
|
7841
7847
|
task_id = secrets.token_hex(8)
|
|
7842
7848
|
_update_state["_task_id"] = task_id
|
|
@@ -7859,6 +7865,9 @@ def api_update_progress():
|
|
|
7859
7865
|
"progress": _update_state.get("progress", 0.0),
|
|
7860
7866
|
"error": _update_state.get("error"),
|
|
7861
7867
|
"downloaded_path": _update_state.get("downloaded_path"),
|
|
7868
|
+
#: 当前这一段(downloading / verifying)的起点(epoch 秒)——
|
|
7869
|
+
#: 界面用它给"正在校验安装包…"计时。
|
|
7870
|
+
"phase_started": _update_state.get("phase_started") or 0,
|
|
7862
7871
|
})
|
|
7863
7872
|
except Exception as e:
|
|
7864
7873
|
return jsonify({"status": "idle", "error": str(e)})
|