@whyshu/argent-engine 0.14.3 → 0.14.4

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": "f562b78d53673f1c58695eacf0753914674f1930a8ef51196cffca98ed8bee12",
5
+ "VERSION": "c78c310b641231eb31cf7f005d8defa7d36327d421e9b20903fec67a0de982bc",
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": "6f3b925258c219b605ae769f5c5a77db1582abb0af5817e704af4b2420b0105f",
17
+ "core/contracts/argent.contracts.json": "5ab37d2cb1c6b0a6760fe2e99950e66beabb7924aa77a5ea1804bc169780e357",
18
18
  "core/contracts/verbs.schema.json": "54d726181c11536eb30bd25090584a7af103e4c0462f8ef078053c8177e19dcb",
19
19
  "core/lib/account-token.mjs": "35faad2c34e67755c1867f74a74885f0f268d5daabe01d339cf30dc747f86501",
20
20
  "core/lib/argent-datadir.mjs": "1fdd799c933382c4f9e36bd4af33d51b8ac4a466a9d67a8f2296bb267b5251ac",
@@ -311,9 +311,9 @@
311
311
  "scripts/patches/verify-session-migration.mjs": "0f6b3a177306fd4cbbe87b4423b7ff5f0d18e4e77bfa50b385ecc354dea90c17",
312
312
  "scripts/patches/verify-turn-outside-replace.mjs": "eeff9c907e8509652759fb3d1ce864e828a68ec882c977c8d819be165817f96d",
313
313
  "scripts/plan-role-rename.mjs": "63a52ddaeb1ca2a246fcbf069318166fe5d0abee6003e5304b3e771defb43da2",
314
- "scripts/platform-appointment-scan.py": "955732419259690258cfd5001eb9c9ac9c54a717b125398c18ac53e301a5fc8e",
315
- "scripts/platform-scan-run.sh": "0590e3b3a51835e22f2772d0f312cf988e8d6301cea4cd2255ca2509bfc119c7",
316
- "scripts/platform-scan-timers.sh": "6ed5f1e6576c1b2dc652860ff60004a49eac0a3acb5d4ddcc25bf3ebb82cd8ff",
314
+ "scripts/platform-appointment-scan.py": "7cab576e0d596c5f03386dac65455b2d74bd974d97af5f4b50383bd08ed9c3a0",
315
+ "scripts/platform-scan-run.sh": "f6934bd484deca5f654faea1a39de8411ddfecad34e68ca9dd7223b0b803126a",
316
+ "scripts/platform-scan-timers.sh": "7848ed280261d1651f5ff66cd6be6d6aedf967f6c3e205fd1eca3930dec32a03",
317
317
  "scripts/plugin-bootcheck.mjs": "bbfbfc9ec0fa409f9ca52012ecdd3b7b068bb4c0b31d49da491f1efc8784d977",
318
318
  "scripts/plugin-composition.json": "99c545b56828d81882bc126eac3c3826e04146c3bb68be288a2b3c3e4ed11b9d",
319
319
  "scripts/poc-mcp-host.mjs": "5c4befdc95f98bf9c84f94bb525b245248c751e08e3fc09bb987781e9e4859cb",
package/engine/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.3
1
+ 0.14.4
@@ -1,6 +1,6 @@
1
1
  {
2
- "argentVersion": "0.14.3",
3
- "_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.3 校正。",
2
+ "argentVersion": "0.14.4",
3
+ "_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.4 校正。",
4
4
  "principle": "宿主无关:宿主只依赖 `argent <verb>`;确定性逻辑在 CLI/MCP,不在提示词里。",
5
5
  "verbs": {
6
6
  "version": {
@@ -112,39 +112,34 @@ def parse_row(texts: dict[str, str], store: str, page_no: int) -> dict[str, Any]
112
112
 
113
113
 
114
114
  def _rows_from_page(page: Any, store: str, page_no: int) -> list[dict[str, Any]]:
115
- rows = page.locator("table tr").all()
115
+ # 一次 evaluate 取回整张表:避免逐 cell Playwright timeout 叠加(店铺忙时尤其慢)。
116
+ try:
117
+ raw = page.evaluate("""() => Array.from(document.querySelectorAll('table tr')).map((row) => {
118
+ const tds = Array.from(row.querySelectorAll('td'));
119
+ const texts = {};
120
+ for (const td of tds) {
121
+ const title = td.getAttribute('data-title') || '';
122
+ if (title) texts[title] = td.innerText || '';
123
+ }
124
+ const wh = row.querySelector('.inbound-warehouse-name');
125
+ return { texts, warehouse: wh ? (wh.innerText || '') : '' };
126
+ })""")
127
+ except Exception:
128
+ return []
116
129
  out: list[dict[str, Any]] = []
117
- for row in rows:
118
- cells = row.locator("td").all()
119
- if not cells:
120
- continue
121
- texts: dict[str, str] = {}
122
- for cell in cells:
123
- title = cell.get_attribute("data-title") or ""
124
- if not title:
125
- continue
126
- try:
127
- text = cell.inner_text(timeout=3000)
128
- except Exception:
129
- text = ""
130
- # 列表页的预约/仓库/状态在同一行;保留完整文本供解析。
131
- texts[title] = text
132
- if "Envío" not in texts:
130
+ for row in raw or []:
131
+ texts = row.get("texts") if isinstance(row, dict) else None
132
+ if not isinstance(texts, dict) or "Envío" not in texts:
133
133
  continue
134
134
  item = parse_row(texts, store, page_no)
135
135
  if not item:
136
136
  continue
137
- # 仓库是预约单元格里的第二段;单独抓一下 class 更稳。
138
- try:
139
- wh = row.locator(".inbound-warehouse-name").first.inner_text(timeout=2000).strip()
140
- if wh:
141
- item["warehouse"] = wh[:200]
142
- except Exception:
143
- pass
137
+ wh = str((row or {}).get("warehouse") or "").strip()
138
+ if wh:
139
+ item["warehouse"] = wh[:200]
144
140
  out.append(item)
145
141
  return out
146
142
 
147
-
148
143
  def post_snapshot(*, api_base: str, tenant_app: str, machine_id: str, machine_token: str, result: dict[str, Any], complete: bool = False) -> dict[str, Any]:
149
144
  url = f"{str(api_base).rstrip('/')}/api/argent/v1/tenants/{tenant_app}/machines/{machine_id}/platform-appointments/scan"
150
145
  body = json.dumps({
@@ -184,10 +179,10 @@ def scan(store: str, cdp_port: int, *, base_url: str, max_pages: int = 20, wait_
184
179
  except Exception:
185
180
  pass
186
181
  page = ctx.new_page()
187
- page.set_default_timeout(30_000)
182
+ page.set_default_timeout(12_000)
188
183
  try:
189
184
  for page_no in range(1, max_pages + 1):
190
- page.goto(str(base_url).rstrip("/") + INBOUNDS_PATH.format(page=page_no), wait_until="domcontentloaded", timeout=30_000)
185
+ page.goto(str(base_url).rstrip("/") + INBOUNDS_PATH.format(page=page_no), wait_until="domcontentloaded", timeout=20_000)
191
186
  time.sleep(wait_sec)
192
187
  page_rows = _rows_from_page(page, store, page_no)
193
188
  fresh = [x for x in page_rows if x["shipmentNo"] not in seen]
@@ -33,7 +33,7 @@ if [ ! -f "$REPORT" ]; then write_status 1 "agent-report.json 缺失"; exit 1; f
33
33
  TOKEN="$("/usr/bin/python3" -c 'import json,sys; print(json.load(open(sys.argv[1])).get("machineToken",""))' "$REPORT" 2>/dev/null || true)"
34
34
  APP="$("/usr/bin/python3" -c 'import json,sys; print(json.load(open(sys.argv[1])).get("tenantAppId","ly-0001"))' "$REPORT" 2>/dev/null || true)"
35
35
  MID="$("/usr/bin/python3" -c 'import json,sys; print(json.load(open(sys.argv[1])).get("machineId",""))' "$REPORT" 2>/dev/null || true)"
36
- BASE="$(env_get SELLER_CENTER_BASE)"
36
+ BASE="${SELLER_CENTER_BASE:-$(env_get SELLER_CENTER_BASE)}"
37
37
  if [ -z "$BASE" ]; then echo "缺少 SELLER_CENTER_BASE:请在 $DATA_HOME/platform-scan.env 配置" >&2; write_status 1 "SELLER_CENTER_BASE 未配置"; exit 1; fi
38
38
  PYBIN="$HOME/.dsh/argent/venv/bin/python3"; [ -x "$PYBIN" ] || PYBIN="$("/usr/bin/which" python3)"
39
39
  STARTED="$(now)"
@@ -57,7 +57,7 @@ do_install() {
57
57
  gen > "$PLIST"; chmod 644 "$PLIST"
58
58
  launchctl bootout "gui/$(id -u)" "$PLIST" 2>/dev/null || true
59
59
  launchctl bootstrap "gui/$(id -u)" "$PLIST"
60
- echo "✅ 已安装 $LABEL(每 30 分钟)"
60
+ echo "✅ 已安装 ${LABEL}(每 30 分钟)"
61
61
  }
62
62
  do_uninstall() {
63
63
  if [ -f "$PLIST" ]; then launchctl bootout "gui/$(id -u)" "$PLIST" 2>/dev/null || true; rm -f "$PLIST"; echo "✅ 已卸载 $LABEL"; fi
@@ -1 +1 @@
1
- export const VERSION = "0.14.3"
1
+ export const VERSION = "0.14.4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyshu/argent-engine",
3
- "version": "0.14.3",
3
+ "version": "0.14.4",
4
4
  "description": "Argent 引擎(L1):流程/台账/重试/守卫/审计/浏览器自动化 —— 逐字节来自 argent-dsh 仓库",
5
5
  "type": "module",
6
6
  "engines": {