goofish-cli 0.6.5__tar.gz → 0.6.6__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.5 → goofish_cli-0.6.6}/.claude-plugin/marketplace.json +1 -1
  2. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/CHANGELOG.md +7 -0
  3. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/PKG-INFO +2 -2
  4. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/README.md +1 -1
  5. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/pyproject.toml +1 -1
  6. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/message/send.py +18 -1
  7. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/ws.py +33 -0
  8. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/.gitignore +0 -0
  9. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/LICENSE +0 -0
  10. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/NOTICE +0 -0
  11. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/examples/README.md +0 -0
  12. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-overview/SKILL.md +0 -0
  13. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-overview/references/accounts.md +0 -0
  14. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-overview/references/mcp-tools-index.md +0 -0
  15. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-overview/references/xianyu-concepts.md +0 -0
  16. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-publish-item/SKILL.md +0 -0
  17. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-publish-item/references/category-selection.md +0 -0
  18. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-publish-item/references/common-pitfalls.md +0 -0
  19. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-publish-item/references/image-checklist.md +0 -0
  20. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-publish-item/references/title-formula.md +0 -0
  21. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-reply-buyer/SKILL.md +0 -0
  22. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-reply-buyer/references/bargain-ladder.md +0 -0
  23. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-reply-buyer/references/intent-classification.md +0 -0
  24. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-reply-buyer/references/tone-guide.md +0 -0
  25. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-risk-guard/SKILL.md +0 -0
  26. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-risk-guard/references/external-contact-keywords.md +0 -0
  27. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-risk-guard/references/forbidden-words.md +0 -0
  28. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-risk-guard/references/publish-red-lines.md +0 -0
  29. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-risk-guard/references/x5sec-recovery.md +0 -0
  30. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-shop-diagnosis/SKILL.md +0 -0
  31. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-shop-diagnosis/references/diagnosis-workflow.md +0 -0
  32. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-shop-diagnosis/references/rank-factors.md +0 -0
  33. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/skills/goofish-shop-diagnosis/references/traffic-drop-causes.md +0 -0
  34. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/__init__.py +0 -0
  35. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/cli.py +0 -0
  36. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/__init__.py +0 -0
  37. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/auth/__init__.py +0 -0
  38. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/auth/login.py +0 -0
  39. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/auth/reset_guard.py +0 -0
  40. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/auth/status.py +0 -0
  41. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/category/__init__.py +0 -0
  42. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/category/recommend.py +0 -0
  43. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/__init__.py +0 -0
  44. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/delete.py +0 -0
  45. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/get.py +0 -0
  46. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/list.py +0 -0
  47. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/publish.py +0 -0
  48. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/item/view.py +0 -0
  49. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/location/__init__.py +0 -0
  50. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/location/default.py +0 -0
  51. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/media/__init__.py +0 -0
  52. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/media/upload.py +0 -0
  53. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/message/__init__.py +0 -0
  54. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/message/history.py +0 -0
  55. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/message/list_chats.py +0 -0
  56. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/message/watch.py +0 -0
  57. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/search/__init__.py +0 -0
  58. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/search/search.py +0 -0
  59. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/skills/__init__.py +0 -0
  60. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/commands/skills/install.py +0 -0
  61. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/__init__.py +0 -0
  62. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/browser.py +0 -0
  63. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/browser_cookie.py +0 -0
  64. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/cookie_types.py +0 -0
  65. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/crypto.py +0 -0
  66. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/errors.py +0 -0
  67. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/guard.py +0 -0
  68. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/item_data.py +0 -0
  69. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/item_page.py +0 -0
  70. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/limiter.py +0 -0
  71. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/local_state.py +0 -0
  72. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/message_history.py +0 -0
  73. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/mtop.py +0 -0
  74. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/output.py +0 -0
  75. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/qr_login.py +0 -0
  76. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/refresh.py +0 -0
  77. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/registry.py +0 -0
  78. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/sandbox_browser.py +0 -0
  79. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/search_data.py +0 -0
  80. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/session.py +0 -0
  81. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/sign.py +0 -0
  82. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/strategy.py +0 -0
  83. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/token.py +0 -0
  84. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/core/write_operation.py +0 -0
  85. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/mcp_server.py +0 -0
  86. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/__init__.py +0 -0
  87. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/assets/Dockerfile +0 -0
  88. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/assets/entrypoint.sh +0 -0
  89. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/cli.py +0 -0
  90. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/interactive.py +0 -0
  91. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/src/goofish_cli/sandbox/runtime.py +0 -0
  92. {goofish_cli-0.6.5 → goofish_cli-0.6.6}/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.5",
6
+ "version": "0.6.6",
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.6](https://github.com/fancyboi999/goofish-cli/compare/v0.6.5...v0.6.6) (2026-11-18)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **message:** use created conversation cid when sending to a new chat ([#61](https://github.com/fancyboi999/goofish-cli/issues/61)) ([399f0b0](https://github.com/fancyboi999/goofish-cli/commit/399f0b046acb2b5ef3316a9bc4c294291d36c8ac))
13
+
7
14
  ## [0.6.5](https://github.com/fancyboi999/goofish-cli/compare/v0.6.4...v0.6.5) (2026-11-18)
8
15
 
9
16
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: goofish-cli
3
- Version: 0.6.5
3
+ Version: 0.6.6
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.5 goofish auth login --qr
206
+ uvx --from goofish-cli==0.6.6 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.5 goofish auth login --qr
165
+ uvx --from goofish-cli==0.6.6 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.5"
7
+ version = "0.6.6"
8
8
  description = "闲鱼 CLI — 支持 MCP,未来支持 Claude Skills。为 AI Agent 提供闲鱼自动化基础能力。"
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }
@@ -17,6 +17,7 @@ from goofish_cli.core.errors import GoofishError
17
17
  from goofish_cli.core.token import get_access_token
18
18
  from goofish_cli.core.write_operation import write_operation
19
19
  from goofish_cli.core.ws import (
20
+ cid_from_create_ack,
20
21
  connect,
21
22
  create_chat,
22
23
  heartbeat_loop,
@@ -88,7 +89,23 @@ async def _send(
88
89
  create_mid = await create_chat(
89
90
  ws, myid=session.unb, toid=toid, item_id=item_id
90
91
  )
91
- await recv_ack(ws, create_mid)
92
+ create_ack = await recv_ack(ws, create_mid)
93
+ create_code = (create_ack or {}).get("code")
94
+ if create_code != 200:
95
+ detail = (
96
+ "无回包(超时)"
97
+ if create_ack is None
98
+ else f"code={create_code}"
99
+ )
100
+ raise GoofishError(f"创建会话失败:{detail},未发送")
101
+ created_cid = cid_from_create_ack(create_ack)
102
+ if not created_cid:
103
+ raise GoofishError("创建会话失败:回包里没有 cid,未发送")
104
+ cid = created_cid
105
+ elif cid in ("", "0"):
106
+ raise GoofishError(
107
+ "未知会话 cid;新会话请传 --item-id 先创建单聊"
108
+ )
92
109
 
93
110
  if kind == "text":
94
111
  if not text:
@@ -308,6 +308,39 @@ async def create_chat(ws: ClientConnection, *, myid: str, toid: str, item_id: st
308
308
  return mid
309
309
 
310
310
 
311
+ def cid_from_create_ack(ack: dict[str, Any] | None) -> str:
312
+ """从 `/r/SingleChatConversation/create` 回包里取出真实会话 cid。
313
+
314
+ 创建成功时服务端把会话放在 body.singleChatConversation.cid(形如
315
+ `<masked-cid>@goofish`)。只发 `cid=0` 直接发送会被服务端以 code=500 拒绝,
316
+ 所以新会话必须先拿到这个 cid 再发消息。
317
+ """
318
+ if not isinstance(ack, dict) or ack.get("code") != 200:
319
+ return ""
320
+ body = ack.get("body") or {}
321
+ if not isinstance(body, dict):
322
+ return ""
323
+ conv = body.get("singleChatConversation") or {}
324
+ candidates = [
325
+ conv.get("cid") if isinstance(conv, dict) else None,
326
+ body.get("cid"),
327
+ body.get("sessionId"),
328
+ body.get("conversationId"),
329
+ ]
330
+ for msgs in (body.get("messages"), body.get("messageList")):
331
+ if isinstance(msgs, list):
332
+ for item in msgs:
333
+ if isinstance(item, dict):
334
+ candidates.append(item.get("cid"))
335
+ if isinstance(body.get("lastMessage"), dict):
336
+ candidates.append(body["lastMessage"].get("cid"))
337
+ for raw in candidates:
338
+ if not raw:
339
+ continue
340
+ return str(raw).split("@")[0]
341
+ return ""
342
+
343
+
311
344
  async def collect_session_cids(session: Session, duration: float = 5.0) -> list[dict[str, Any]]:
312
345
  """连 WS + /reg + ackDiff(pts=0),收 duration 秒,返回所有 push 到的 session cid。
313
346
 
File without changes
File without changes
File without changes