goofish-cli 0.6.0__tar.gz → 0.6.1__tar.gz

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.
Files changed (92) hide show
  1. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/.claude-plugin/marketplace.json +1 -1
  2. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/CHANGELOG.md +7 -0
  3. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/PKG-INFO +2 -2
  4. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/README.md +1 -1
  5. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/pyproject.toml +1 -1
  6. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/view.py +44 -1
  7. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/.gitignore +0 -0
  8. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/LICENSE +0 -0
  9. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/NOTICE +0 -0
  10. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/examples/README.md +0 -0
  11. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-overview/SKILL.md +0 -0
  12. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-overview/references/accounts.md +0 -0
  13. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-overview/references/mcp-tools-index.md +0 -0
  14. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-overview/references/xianyu-concepts.md +0 -0
  15. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-publish-item/SKILL.md +0 -0
  16. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-publish-item/references/category-selection.md +0 -0
  17. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-publish-item/references/common-pitfalls.md +0 -0
  18. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-publish-item/references/image-checklist.md +0 -0
  19. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-publish-item/references/title-formula.md +0 -0
  20. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-reply-buyer/SKILL.md +0 -0
  21. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-reply-buyer/references/bargain-ladder.md +0 -0
  22. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-reply-buyer/references/intent-classification.md +0 -0
  23. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-reply-buyer/references/tone-guide.md +0 -0
  24. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-risk-guard/SKILL.md +0 -0
  25. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-risk-guard/references/external-contact-keywords.md +0 -0
  26. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-risk-guard/references/forbidden-words.md +0 -0
  27. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-risk-guard/references/publish-red-lines.md +0 -0
  28. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-risk-guard/references/x5sec-recovery.md +0 -0
  29. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-shop-diagnosis/SKILL.md +0 -0
  30. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-shop-diagnosis/references/diagnosis-workflow.md +0 -0
  31. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-shop-diagnosis/references/rank-factors.md +0 -0
  32. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/skills/goofish-shop-diagnosis/references/traffic-drop-causes.md +0 -0
  33. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/__init__.py +0 -0
  34. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/cli.py +0 -0
  35. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/__init__.py +0 -0
  36. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/auth/__init__.py +0 -0
  37. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/auth/login.py +0 -0
  38. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/auth/reset_guard.py +0 -0
  39. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/auth/status.py +0 -0
  40. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/category/__init__.py +0 -0
  41. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/category/recommend.py +0 -0
  42. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/__init__.py +0 -0
  43. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/delete.py +0 -0
  44. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/get.py +0 -0
  45. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/list.py +0 -0
  46. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/item/publish.py +0 -0
  47. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/location/__init__.py +0 -0
  48. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/location/default.py +0 -0
  49. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/media/__init__.py +0 -0
  50. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/media/upload.py +0 -0
  51. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/message/__init__.py +0 -0
  52. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/message/history.py +0 -0
  53. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/message/list_chats.py +0 -0
  54. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/message/send.py +0 -0
  55. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/message/watch.py +0 -0
  56. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/search/__init__.py +0 -0
  57. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/search/search.py +0 -0
  58. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/skills/__init__.py +0 -0
  59. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/commands/skills/install.py +0 -0
  60. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/__init__.py +0 -0
  61. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/browser.py +0 -0
  62. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/browser_cookie.py +0 -0
  63. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/cookie_types.py +0 -0
  64. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/crypto.py +0 -0
  65. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/errors.py +0 -0
  66. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/guard.py +0 -0
  67. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/item_data.py +0 -0
  68. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/item_page.py +0 -0
  69. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/limiter.py +0 -0
  70. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/local_state.py +0 -0
  71. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/message_history.py +0 -0
  72. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/mtop.py +0 -0
  73. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/output.py +0 -0
  74. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/qr_login.py +0 -0
  75. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/refresh.py +0 -0
  76. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/registry.py +0 -0
  77. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/sandbox_browser.py +0 -0
  78. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/search_data.py +0 -0
  79. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/session.py +0 -0
  80. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/sign.py +0 -0
  81. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/strategy.py +0 -0
  82. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/token.py +0 -0
  83. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/write_operation.py +0 -0
  84. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/core/ws.py +0 -0
  85. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/mcp_server.py +0 -0
  86. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/__init__.py +0 -0
  87. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/assets/Dockerfile +0 -0
  88. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/assets/entrypoint.sh +0 -0
  89. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/cli.py +0 -0
  90. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/interactive.py +0 -0
  91. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/sandbox/runtime.py +0 -0
  92. {goofish_cli-0.6.0 → goofish_cli-0.6.1}/src/goofish_cli/static/goofish_js_version_2.js +0 -0
@@ -3,7 +3,7 @@
3
3
  "name": "goofish-cli-skills",
4
4
  "displayName": "goofish-cli Skills",
5
5
  "description": "闲鱼(goofish.com)自动化运营的 Claude Skills 套件。配合 goofish-cli MCP server 使用,让 Agent 在发布商品 / 回复买家 / 风控预检 / 店铺诊断这些场景里上手即会。",
6
- "version": "0.6.0",
6
+ "version": "0.6.1",
7
7
  "author": {
8
8
  "name": "fancy",
9
9
  "url": "https://github.com/fancyboi999"
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.6.1](https://github.com/fancyboi999/goofish-cli/compare/v0.6.0...v0.6.1) (2026-10-26)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **item:** retry evaluate when the detail page navigates mid-read ([#48](https://github.com/fancyboi999/goofish-cli/issues/48)) ([f0299f8](https://github.com/fancyboi999/goofish-cli/commit/f0299f8533a253c661c5b21d9a3f061adf6f85e0))
13
+
7
14
  ## [0.6.0](https://github.com/fancyboi999/goofish-cli/compare/v0.5.3...v0.6.0) (2026-10-19)
8
15
 
9
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: goofish-cli
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: 闲鱼 CLI — 支持 MCP,未来支持 Claude Skills。为 AI Agent 提供闲鱼自动化基础能力。
5
5
  Project-URL: Homepage, https://github.com/fancyboi999/goofish-cli
6
6
  Project-URL: Repository, https://github.com/fancyboi999/goofish-cli
@@ -203,7 +203,7 @@ OpenClaw `2026.6.1` 及以上可把本仓库作为 compatible bundle 加载。
203
203
  openclaw plugins install clawhub:openclaw-goofish
204
204
 
205
205
  # 登录态由用户在终端初始化,不交给 Agent 覆盖
206
- uvx --from goofish-cli==0.6.0 goofish auth login --qr
206
+ uvx --from goofish-cli==0.6.1 goofish auth login --qr
207
207
 
208
208
  openclaw plugins inspect goofish --json
209
209
  openclaw gateway restart
@@ -162,7 +162,7 @@ OpenClaw `2026.6.1` 及以上可把本仓库作为 compatible bundle 加载。
162
162
  openclaw plugins install clawhub:openclaw-goofish
163
163
 
164
164
  # 登录态由用户在终端初始化,不交给 Agent 覆盖
165
- uvx --from goofish-cli==0.6.0 goofish auth login --qr
165
+ uvx --from goofish-cli==0.6.1 goofish auth login --qr
166
166
 
167
167
  openclaw plugins inspect goofish --json
168
168
  openclaw gateway restart
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "goofish-cli"
7
- version = "0.6.0"
7
+ version = "0.6.1"
8
8
  description = "闲鱼 CLI — 支持 MCP,未来支持 Claude Skills。为 AI Agent 提供闲鱼自动化基础能力。"
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -18,6 +18,48 @@ from goofish_cli.core.errors import AuthRequiredError, GoofishError
18
18
  from goofish_cli.core.item_data import normalize_item
19
19
  from goofish_cli.core.item_page import read_item_page
20
20
 
21
+ try: # playwright 是运行时依赖;缺失时退化为直接抛原始异常
22
+ from playwright.async_api import Error as PlaywrightError
23
+ except ImportError: # pragma: no cover
24
+ PlaywrightError = Exception # type: ignore[assignment,misc]
25
+
26
+
27
+ def _is_navigation_race(exc: BaseException) -> bool:
28
+ """详情页在 domcontentloaded 之后还会再导航一次(同 URL)。
29
+
30
+ 在导航间隙执行 page.evaluate 会抛 "Execution context was destroyed"。
31
+ 这是竞态,不是登录态或风控问题,重试即可。
32
+ """
33
+ msg = str(exc)
34
+ return (
35
+ "Execution context was destroyed" in msg
36
+ or "Cannot find context with specified id" in msg
37
+ or "most likely because of a navigation" in msg
38
+ )
39
+
40
+
41
+ async def _evaluate_detail(page: Any, item_id: str, *, attempts: int = 3) -> Any:
42
+ """在页面里执行取数脚本;遇到导航竞态就等页面重新稳定后重试。"""
43
+ last: BaseException | None = None
44
+ for attempt in range(1, attempts + 1):
45
+ try:
46
+ return await page.evaluate(_FETCH_JS, item_id)
47
+ except PlaywrightError as exc:
48
+ if not _is_navigation_race(exc):
49
+ raise
50
+ last = exc
51
+ if attempt == attempts:
52
+ break
53
+ await page.wait_for_timeout(700 * attempt)
54
+ # 页面被导航去了别处(登录页/首页)时重新进入,否则原地重试
55
+ if f"id={item_id}" not in (page.url or ""):
56
+ await page.goto(_build_item_url(item_id), wait_until="domcontentloaded", timeout=45000)
57
+ await page.wait_for_timeout(1500)
58
+ raise GoofishError(
59
+ f"详情页在 {attempts} 次尝试内持续处于导航中,未取到商品 {item_id}"
60
+ ) from last
61
+
62
+
21
63
 
22
64
  def _normalize_item_id(value: Any) -> str:
23
65
  s = str(value or "").strip()
@@ -173,7 +215,7 @@ async def _run_native(item_id: str) -> dict[str, Any]:
173
215
  async with goofish_page() as page:
174
216
  await page.goto(url, wait_until="domcontentloaded")
175
217
  await page.wait_for_timeout(2000)
176
- result = await page.evaluate(_FETCH_JS, item_id)
218
+ result = await _evaluate_detail(page, item_id)
177
219
 
178
220
  if not isinstance(result, dict):
179
221
  raise GoofishError("商品详情页返回结构非预期")
@@ -238,4 +280,5 @@ def view(item_id: str) -> dict[str, Any]:
238
280
  __test__ = {
239
281
  "_normalize_item_id": _normalize_item_id,
240
282
  "_build_item_url": _build_item_url,
283
+ "_is_navigation_race": _is_navigation_race,
241
284
  }
File without changes
File without changes
File without changes