@whyshu/argent-engine 0.14.10 → 0.14.12
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/MANIFEST.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@whyshu/argent-engine",
|
|
4
4
|
"files": {
|
|
5
|
-
"VERSION": "
|
|
5
|
+
"VERSION": "4ea2186b37b218d1cdc88a362c00e84909692bb579df3b640a9840b6fb2753a5",
|
|
6
6
|
"agents/catalog.json": "5356a812f2554dfd3115370363d4c3f787a82c9e5928a85d05b2a07c9e4b324d",
|
|
7
7
|
"configs/_aliases.proposed.json": "3a59edf80563bcc20d410d488decad6fd787bd3de9489321367b0783904cd3e5",
|
|
8
8
|
"configs/_migration-plan.proposed.json": "dd9f90b0b9b2f217dd23367a618402e57997d44f7fddcfa88a7cadf52e056c0d",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"configs/mcp-tools.snapshot.json": "cfa94a6ba64a7ae9d133a4a878ce3d5e0e85e554ccd3e3ebaf0d51ad750acf6a",
|
|
15
15
|
"configs/notify.json": "cb9ef11c1c498fcf99af99ec50271b8a2598061b77ed73a6099032e837474ef0",
|
|
16
16
|
"core/cli/argent.mjs": "9a8977324c238ca4e20435f9817eb7ec76157da32b1d510977dc03e0feb416a9",
|
|
17
|
-
"core/contracts/argent.contracts.json": "
|
|
17
|
+
"core/contracts/argent.contracts.json": "40b1dabc2829502f4147f37833e5555679f9e4114497d4c5849cdc2a16f3498d",
|
|
18
18
|
"core/contracts/verbs.schema.json": "54d726181c11536eb30bd25090584a7af103e4c0462f8ef078053c8177e19dcb",
|
|
19
19
|
"core/lib/account-token.mjs": "35faad2c34e67755c1867f74a74885f0f268d5daabe01d339cf30dc747f86501",
|
|
20
20
|
"core/lib/argent-datadir.mjs": "1fdd799c933382c4f9e36bd4af33d51b8ac4a466a9d67a8f2296bb267b5251ac",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"scripts/argent-runner.mjs": "a4996d382cddc16d77cd760715eb89daf6fc38115df31d98a9a706d828009f15",
|
|
71
71
|
"scripts/argent-schedule.mjs": "4d2485f454094ae7d9978334e0ee995aef22fdc7058f3694c1f7d363e8a51f09",
|
|
72
72
|
"scripts/argent-setup-check.mjs": "44d3558ae6eebd5cc2dd25752019d3386190e63006b544e1ceee3f4f1c526aff",
|
|
73
|
-
"scripts/argent-timers.mjs": "
|
|
73
|
+
"scripts/argent-timers.mjs": "dff1953348f58d3f5b0c9bc534c9caf38acee441f66de4bb3f27a95f6747a6e3",
|
|
74
74
|
"scripts/argent-upgrade.mjs": "ba75148cb3c27b4aab2b184d1320d4b57a203adf8b90214fa3d62880685a0d81",
|
|
75
75
|
"scripts/argent-web-preflight.mjs": "7aa67912098b23cab2dec68d78830f7e5dc1d6c9cb915f4e00628fcd47bb694d",
|
|
76
76
|
"scripts/argent-web-verify.mjs": "9690885f7b379da87d879018e254e563ad6631b56381ee293ee06796ce605694",
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
"scripts/ops-codefix-queue.mjs": "bf377ee88f0b5c0493067fe38fd7355bc081285dfd3b06f8a48c2efaa297f705",
|
|
298
298
|
"scripts/ops-digest.mjs": "7fcb827d2ad258a9014c677d35be3222e7985894d483e6d18b8b089ac7f80e0d",
|
|
299
299
|
"scripts/ops-verify.mjs": "cfe80ad4693c0ebc8c1782f7f09934529b98cd8edbdd9c980028754e370370f1",
|
|
300
|
-
"scripts/orchestrator.py": "
|
|
300
|
+
"scripts/orchestrator.py": "5f87527633e8b5fc07d18542cd27bfd891955dc748803cdef3689bf0657a6b28",
|
|
301
301
|
"scripts/orchestrator_br.py": "103544e887add1f8d2bc7bfd0168fc8a0f2cd8a0547874e064a2465fd5626459",
|
|
302
302
|
"scripts/p2-report-run.mjs": "86bd6b3005f1a5fca3f808f4ea77dcce43a11a4a9be7ee814a029daaae201fb5",
|
|
303
303
|
"scripts/pack-plugins.mjs": "b1b42fb30ebd27f320af72bc28b5b8e2b76e54031b4ac1ba5c3909374990b38b",
|
package/engine/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.14.
|
|
1
|
+
0.14.12
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"argentVersion": "0.14.
|
|
3
|
-
"_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.
|
|
2
|
+
"argentVersion": "0.14.12",
|
|
3
|
+
"_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.12 校正。",
|
|
4
4
|
"principle": "宿主无关:宿主只依赖 `argent <verb>`;确定性逻辑在 CLI/MCP,不在提示词里。",
|
|
5
5
|
"verbs": {
|
|
6
6
|
"version": {
|
|
@@ -28,7 +28,7 @@ import { resolveDataDir } from './lib/argent-datadir.mjs'
|
|
|
28
28
|
/** 已知 label 的释义与归属(未知 label 也照实列出,⛔ 不丢)。 */
|
|
29
29
|
export const KNOWN_LABELS = Object.freeze({
|
|
30
30
|
'com.whyshu.appointment-worker': { desc: '抢预约 worker(常驻)', kind: 'worker' },
|
|
31
|
-
'com.whyshu.full-booking-worker': { desc: 'FULL 自动预约 worker(
|
|
31
|
+
'com.whyshu.full-booking-worker': { desc: 'FULL 自动预约 worker(2026-12-02 退役:预约并入统一 FULL 队列)', kind: 'retired' },
|
|
32
32
|
'com.whyshu.daily-report-timer': { desc: '日报(每小时直跑脚本)', kind: 'report', statusFile: 'daily-report-timer-status.json' },
|
|
33
33
|
'com.whyshu.ml-listing-timer': { desc: 'Listing 体检 + 推 ERP', kind: 'insight', statusFile: 'ml-insight-listing-status.json' },
|
|
34
34
|
'com.whyshu.ml-market-timer': { desc: '竞品快照(只读)', kind: 'insight', statusFile: 'ml-insight-market-status.json' },
|
|
@@ -2922,6 +2922,22 @@ def _is_page_dead_message(msg: str) -> bool:
|
|
|
2922
2922
|
return any(k in m for k in PAGE_DEAD_MARKERS)
|
|
2923
2923
|
|
|
2924
2924
|
|
|
2925
|
+
def _env_delays(name: str, default: list[float]) -> list[float]:
|
|
2926
|
+
"""解析「逗号分隔秒数」的 env(如 30,60,120);非法/空 ⇒ 用默认。"""
|
|
2927
|
+
raw = str(os.environ.get(name, "") or "").strip()
|
|
2928
|
+
if not raw:
|
|
2929
|
+
return list(default)
|
|
2930
|
+
out: list[float] = []
|
|
2931
|
+
for part in raw.split(","):
|
|
2932
|
+
try:
|
|
2933
|
+
v = float(part.strip())
|
|
2934
|
+
except Exception: # noqa: BLE001
|
|
2935
|
+
continue
|
|
2936
|
+
if v >= 0:
|
|
2937
|
+
out.append(v)
|
|
2938
|
+
return out or list(default)
|
|
2939
|
+
|
|
2940
|
+
|
|
2925
2941
|
def _cancel_failure_stage(exc: "StepError") -> str:
|
|
2926
2942
|
"""KB-127:归类取消预约单次失败发生在哪个阶段(navigate/click/modal/verify)。"""
|
|
2927
2943
|
msg = exc.message or ""
|
|
@@ -2937,7 +2953,7 @@ def _cancel_failure_stage(exc: "StepError") -> str:
|
|
|
2937
2953
|
|
|
2938
2954
|
|
|
2939
2955
|
def _cancel_final_error(last_exc: Optional["StepError"], stages: list[str],
|
|
2940
|
-
*, evidence: str = "") -> "StepError":
|
|
2956
|
+
*, evidence: str = "", total: int = 3) -> "StepError":
|
|
2941
2957
|
"""KB-127:按最后一次真实失败阶段生成**准确**的步骤8失败错误(保真 err_type/消息)。
|
|
2942
2958
|
|
|
2943
2959
|
- NAV / CLICK → 取消**未执行**(预约可能仍有效,需重试取消),err_type 保留原类型;
|
|
@@ -2953,22 +2969,22 @@ def _cancel_final_error(last_exc: Optional["StepError"], stages: list[str],
|
|
|
2953
2969
|
prev_recovery = list(base.recovery_attempted or [])
|
|
2954
2970
|
if stage == CANCEL_STAGE_VERIFY:
|
|
2955
2971
|
return StepError(8, "business",
|
|
2956
|
-
f"预约失败:取消预约未生效({n}/
|
|
2972
|
+
f"预约失败:取消预约未生效({n}/{total} 次均在【{label}】阶段失败——已点到 "
|
|
2957
2973
|
f"Cancelar cita 但未验证到生效;最后一次:{base.message}){tail}",
|
|
2958
2974
|
recovery_attempted=["cancel_modal_confirm", "cancel_verify_retry"])
|
|
2959
2975
|
if stage == CANCEL_STAGE_CLICK:
|
|
2960
2976
|
return StepError(8, base.err_type or "selector_not_found",
|
|
2961
|
-
f"预约失败:取消预约**未执行**({n}/
|
|
2977
|
+
f"预约失败:取消预约**未执行**({n}/{total} 次在【{label}】阶段失败:页面未出现 "
|
|
2962
2978
|
f"Cancelar reserva 按钮,可能本无有效预约/已取消(幂等)或页面异常;"
|
|
2963
2979
|
f"最后一次:{base.message}){tail}",
|
|
2964
2980
|
recovery_attempted=prev_recovery + ["cancel_btn_absent"])
|
|
2965
2981
|
if stage == CANCEL_STAGE_MODAL:
|
|
2966
2982
|
return StepError(8, base.err_type or "timeout",
|
|
2967
|
-
f"预约失败:取消预约未完成({n}/
|
|
2983
|
+
f"预约失败:取消预约未完成({n}/{total} 次在【{label}】阶段失败:已点 "
|
|
2968
2984
|
f"Cancelar reserva 但确认弹窗未出现;最后一次:{base.message}){tail}",
|
|
2969
2985
|
recovery_attempted=["cancel_modal_confirm"])
|
|
2970
2986
|
return StepError(8, base.err_type or "timeout",
|
|
2971
|
-
f"预约失败:取消预约**未执行**({n}/
|
|
2987
|
+
f"预约失败:取消预约**未执行**({n}/{total} 次在【{label}】阶段失败,未点到 "
|
|
2972
2988
|
f"Cancelar reserva,预约可能仍有效、需重试取消;最后一次:{base.message}){tail}",
|
|
2973
2989
|
recovery_attempted=prev_recovery + ["cancel_navigate_failed"])
|
|
2974
2990
|
|
|
@@ -11944,9 +11960,22 @@ class Orchestrator:
|
|
|
11944
11960
|
# KB-127:旧实现无论何因都抛 business「取消预约未生效(Cancelar reserva 后未跳转
|
|
11945
11961
|
# appointmentCancellationSuccess)」——把「3 次都卡在导航/页面已关闭」误报成
|
|
11946
11962
|
# 「点到按钮但没生效」,既误导人工(以为取消已尝试)又错分失败类型(落 manual 初查)。
|
|
11963
|
+
# 2026-12-03:ML 限流页("Tenemos más tráfico de lo normal")会让 3×2s 的重试全灭
|
|
11964
|
+
# (实测 83670718:3 次都停在限流页,取消没执行、预约还活着 ⇒ 到期罚款风险)。
|
|
11965
|
+
# 前 3 次保持快重试(页面瞬时错误);之后对「可重试形态」(导航失败 / 按钮未渲染)
|
|
11966
|
+
# 追加长退避(默认 30/60/120/180/300s,总预算约 12 分钟),每次仍重新 visit(= 刷页)。
|
|
11967
|
+
# ⛔ 不是无限刷:总尝试有上限;MODAL/VERIFY(真实交互失败)不再拖长。
|
|
11968
|
+
quick_delays = _env_delays("ARGENT_CANCEL_QUICK_DELAYS", [0.0, 2.0, 2.0])
|
|
11969
|
+
slow_delays = _env_delays("ARGENT_CANCEL_SLOW_DELAYS", [30.0, 60.0, 120.0, 180.0, 300.0])
|
|
11947
11970
|
last_exc: Optional[StepError] = None
|
|
11948
11971
|
stages: list[str] = []
|
|
11949
|
-
|
|
11972
|
+
queue: list[float] = list(quick_delays)
|
|
11973
|
+
slow_used = 0
|
|
11974
|
+
total = len(quick_delays)
|
|
11975
|
+
while queue:
|
|
11976
|
+
wait_s = queue.pop(0)
|
|
11977
|
+
if wait_s:
|
|
11978
|
+
await asyncio.sleep(wait_s)
|
|
11950
11979
|
try:
|
|
11951
11980
|
await self._cancel_appointment_once()
|
|
11952
11981
|
self._mark_done(8)
|
|
@@ -11955,13 +11984,18 @@ class Orchestrator:
|
|
|
11955
11984
|
last_exc = exc
|
|
11956
11985
|
stage = _cancel_failure_stage(exc)
|
|
11957
11986
|
stages.append(stage)
|
|
11958
|
-
self._log(f" ⚠️ 取消预约第 {
|
|
11987
|
+
self._log(f" ⚠️ 取消预约第 {len(stages)}/{total} 次尝试失败"
|
|
11959
11988
|
f"[{CANCEL_STAGE_LABEL.get(stage, stage)}]: {exc.message}")
|
|
11960
|
-
|
|
11961
|
-
|
|
11989
|
+
retryable = stage in (CANCEL_STAGE_NAV, CANCEL_STAGE_CLICK)
|
|
11990
|
+
if not retryable:
|
|
11991
|
+
break
|
|
11992
|
+
if len(stages) >= len(quick_delays) and slow_used < len(slow_delays):
|
|
11993
|
+
queue.append(slow_delays[slow_used])
|
|
11994
|
+
slow_used += 1
|
|
11995
|
+
total += 1
|
|
11962
11996
|
evidence = await self._cancel_page_evidence()
|
|
11963
11997
|
self._log(f" 🔎 取消预约失败现场证据:{evidence}")
|
|
11964
|
-
raise _cancel_final_error(last_exc, stages, evidence=evidence)
|
|
11998
|
+
raise _cancel_final_error(last_exc, stages, evidence=evidence, total=max(total, 1))
|
|
11965
11999
|
|
|
11966
12000
|
async def _cancel_page_evidence(self) -> str:
|
|
11967
12001
|
"""KB-127:取消预约失败现场证据(URL + 按钮/弹窗/正文摘要)。
|
package/engine/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.14.
|
|
1
|
+
export const VERSION = "0.14.12"
|