Skip to content

Give your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.

feat: simplify installation handoff and add Discord community links

LohseZSai0b04e90d30c4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d32f11f4..1b28e385 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,28 @@ All notable changes to this project will be documented in this file.
---
+## 1.6.5 — 2026-10-19(本地候选版)
+
+- 安装表格改用短语,如“读正文、看评论”“看热帖、看热股”;共用的范围说明只写一次。
+- 中英文 README 顶部新增 Discord 链接和加入徽章,校正 Reddit 公开内容的免登录说明。
+- Shorten feature labels while retaining public-first access, comment scope and subtitle requirements.
+
+
+## 1.6.4 — 2026-10-19(本地候选版)
+
+中文:
+- 安装后按本地时间问候,用三列表说明不用登录能查什么、哪些功能需要登录后再试。
+- 将“索引”“页面提示登录时”等说明改为具体内容;Reddit 的公开帖子和评论继续免登录先读。
+
+English:
+- Add a local-time greeting and a plain-language, three-column installation receipt.
+- Name concrete public content and authenticated features while preserving public-first access.
+
+Technical changes:
+- Generate the greeting locally with the standard library; no network lookup, new dependency or extra configuration.
+- Keep JSON output, private report saving, install failures and verification evidence intact; synchronize both Skill languages.
+
+
## 1.6.3 — 2026-10-19(本地候选版)
中文:
diff --git a/README.md b/README.md
index ff156132..5c34434b 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,11 @@
</p>
<p align="center">
- <a href="#快速上手">快速开始</a> · <a href="docs/README_en.md">English</a> · <a href="#支持的平台">支持平台</a> · <a href="#设计理念">设计理念</a>
+ <a href="#快速上手">快速开始</a> · <a href="docs/README_en.md">English</a> · <a href="#支持的平台">支持平台</a> · <a href="#设计理念">设计理念</a> · <a href="https://discord.gg/NSZz22R39">Discord</a>
+</p>
+
+<p align="center">
+ <a href="https://discord.gg/NSZz22R39"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&amp;logoColor=white" alt="加入 Agent Reach Discord 社区"></a>
</p>
---
@@ -61,7 +65,7 @@
Claude Code、Codex、Hermes Agent、OpenClaw 这类 CLI Agent 自带搜索和网页读取,但下面这些它们基本够不着:
-- **要登录才能看的平台**:小红书、Twitter/X、Reddit、LinkedIn、Boss直聘……网页抓不到,或者只能看到登录页。
+- **需要浏览器会话的功能**:在小红书搜笔记、在 X 查账号动态、读职位详情等,按所选功能复用登录态。能公开读取的内容先用已有搜索和网页工具。
- **视频里的内容**:YouTube 和 B站的字幕,以及 YouTube 视频的语音转文字。
- **中文平台**:B站、小红书、V2EX、雪球,通用搜索覆盖很差。
- **干净的结构化数据**:雪球行情、V2EX 帖子和回复、GitHub 仓库和 issue,直接给字段,不用从 HTML 里猜。
@@ -100,8 +104,8 @@ agent-reach read https://www.v2ex.com/t/123 # 按链接自动选渠道
| v2ex | 默认 | 热门、节点、帖子和回复、用户 | 无 |
| web | 默认 | 网页搜索、网页阅读(保底) | 无 |
| bilibili | 默认 | 搜索、视频信息、热门、字幕 | 无;字幕需要登录(扫码) |
-| xiaohongshu | 可选 | 搜笔记、读笔记 | 浏览器 + 登录 |
-| reddit | 可选 | 搜索、读帖子和评论、看版块 | 浏览器 + 登录 |
+| xiaohongshu | 可选 | 搜笔记、读正文、看评论 | 浏览器 + 登录 |
+| reddit | 可选 | 搜帖子、读正文、看评论、看版块 | 公开帖子和评论先用已有网页工具;浏览器功能按需登录 |
| linkedin | 可选 | 搜职位、读职位详情 | 登录 |
| boss | 可选 | 搜职位和 JD | 浏览器 + 登录 |
| xueqiu | 可选 | 实时行情、搜股票、热帖、热股 | 行情免登录;热帖热股需要浏览器登录 |
diff --git a/agent_reach/__init__.py b/agent_reach/__init__.py
index 6073d44f..b759fe9d 100644
--- a/agent_reach/__init__.py
+++ b/agent_reach/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""Agent Reach — internet access for AI agents."""
-__version__ = "1.6.3"
+__version__ = "1.6.5"
__all__ = ["__version__"]
diff --git a/agent_reach/runtime/onboarding.py b/agent_reach/runtime/onboarding.py
index ca6bd1d1..ea2362bd 100644
--- a/agent_reach/runtime/onboarding.py
+++ b/agent_reach/runtime/onboarding.py
@@ -1,6 +1,7 @@
"""Read-only session discovery and explicit connection choices. Never logs a user in."""
import json
import urllib.request
+from datetime import datetime
from urllib.parse import urlsplit
from agent_reach.config import Config
@@ -43,26 +44,26 @@ _CAPABILITY_LIMITS = {
}
-# Short user-facing receipt; detailed actions and limits stay in capability_summary.
+# Public web options and authenticated Reach actions; detailed limits stay in capability_summary.
_QUICK_ACCESS = {
- 'github': '✅ 仓库、README、Issue/PR 和公开评论',
- 'youtube': '✅ 视频搜索、简介、已有字幕;转录需配置 Key',
- 'bilibili': '✅ 视频搜索、简介;🔐 部分字幕路径',
- 'v2ex': '✅ 主题正文、部分回复',
- 'web': '✅ 网页搜索、公开正文',
- 'reddit': '✅ 公开帖子、部分评论;🔐 站内搜索/列表',
- 'twitter': '⚠️ 索引、部分单帖;🔐 站内搜索/推文串',
- 'xiaohongshu': '⚠️ 部分公开列表;🔐 笔记正文、评论',
- 'instagram': '⚠️ 部分主页/索引;🔐 用户搜索、帖子描述',
- 'facebook': '⚠️ 公开摘要;🔐 站内搜索、主页',
- 'linkedin': '⚠️ 职位索引;🔐 职位搜索、JD',
- 'boss': '⚠️ 职位索引;🔐 职位搜索、JD',
- 'xueqiu': '✅ 公开行情;🔐 社区热门内容',
+ 'github': ('✅ 找项目、读文档、看讨论、看评论', '—'),
+ 'youtube': ('✅ 找视频、读简介、读字幕', '—'),
+ 'bilibili': ('✅ 找视频、读简介', '❌ 读字幕'),
+ 'v2ex': ('✅ 读帖子、看回复', '—'),
+ 'web': ('✅ 搜资料、读网页', '—'),
+ 'reddit': ('✅ 搜帖子、读正文、看评论', '—'),
+ 'twitter': ('✅ 搜摘要、试读原文', '❌ 搜推文、看动态、看回复'),
+ 'xiaohongshu': ('✅ 看推荐(链接、作者)', '❌ 搜笔记、读正文、看评论'),
+ 'instagram': ('✅ 搜简介', '❌ 找用户、看主页、看帖子'),
+ 'facebook': ('✅ 搜摘要', '❌ 搜内容、看主页'),
+ 'linkedin': ('✅ 搜标题、找链接', '❌ 找职位、读详情'),
+ 'boss': ('✅ 搜标题、找链接', '❌ 找职位、读详情'),
+ 'xueqiu': ('✅ 找股票、查行情', '❌ 看热帖、看热股'),
}
_DISPLAY_NAMES = {
'github': 'GitHub', 'youtube': 'YouTube', 'bilibili': 'B站', 'v2ex': 'V2EX',
- 'web': 'Web', 'reddit': 'Reddit', 'twitter': 'X/Twitter', 'facebook': 'Facebook',
+ 'web': '网页', 'reddit': 'Reddit', 'twitter': 'X / Twitter', 'facebook': 'Facebook',
'instagram': 'Instagram', 'xiaohongshu': '小红书', 'linkedin': 'LinkedIn',
'boss': 'BOSS直聘', 'xueqiu': '雪球',
}
@@ -75,6 +76,20 @@ _STATUS_LABELS = {
}
+def _local_greeting():
+ """Use the installing computer's clock and timezone, without a network lookup."""
+ hour = datetime.now().hour
+ if 5 <= hour < 11:
+ return '早上好呀,想搜点什么?☀️'
+ if 11 <= hour < 14:
+ return '中午好,想搜点什么?'
+ if 14 <= hour < 18:
+ return '下午好,想搜点什么?'
+ if 18 <= hour < 22:
+ return '晚上好,想搜点什么?'
+ return '夜深了,想搜点什么?🌙'
+
+
def installation_report(result):
"""Render one short receipt; keep detailed evidence in the structured summary."""
def cell(value):
@@ -83,12 +98,13 @@ def installation_report(result):
entries = result['capability_summary']['channels']
installs = {row['channel']: row for row in result['default_channels']}
installed = sum(bool(row['ok']) for row in installs.values())
- names = '、'.join(_DISPLAY_NAMES.get(name, name) for name, row in installs.items() if row['ok'])
+ completed = all(row['ok'] for row in installs.values())
lines = [
- f"Agent Reach {result['version']} 已初始化。", '',
- f'默认依赖:{installed}/{len(installs)} 项准备成功' + (f'({names})。' if names else '。'), '',
- '✅ 公开可用;⚠️ 公开范围有限;🔐 按需登录/配置。内容和网络条件以实际访问为准。', '',
- '| 渠道 | 安装后能获取什么 |', '|---|---|',
+ _local_greeting(), '',
+ f"**Agent Reach {result['version']} {'安装完成' if completed else '安装还差一步'}。** "
+ f'默认功能:{installed}/{len(installs)} 项准备成功。', '',
+ '✅ 不用登录;❌ 登录后再试;— 不用额外登录。', '',
+ '| 平台 | 不登录可以查什么 | 需要登录后再试 |', '|---|---|---|',
]
for entry in sorted(entries, key=lambda item: item['level'] != 'default'):
name = entry['channel']
@@ -101,15 +117,17 @@ def installation_report(result):
label += '(保留用户移除)'
elif entry['reach_status'] in {'needs_setup', 'needs_login', 'cooldown', 'needs_user_action', 'broken'}:
label += '(' + _STATUS_LABELS[entry['reach_status']] + ')'
- lines.append('| ' + cell(label) + ' | ' + cell(_QUICK_ACCESS.get(name, entry['public_access'])) + ' |')
+ public, login = _QUICK_ACCESS.get(name, (entry['public_access'], '—'))
+ lines.append('| ' + ' | '.join(cell(value) for value in (label, public, login)) + ' |')
verified = [entry for entry in entries if entry['verified_actions']]
if verified:
names = ';'.join(_DISPLAY_NAMES.get(entry['channel'], entry['channel']) + ':' +
'/'.join(entry['verified_actions']) for entry in verified)
- lines += ['', '有效验收:' + names + '。其余待实测;本次初始化未发起平台查询。']
+ lines += ['', '已测通过:' + names + '。其余还没逐项联网测试。']
else:
- lines += ['', '联网验收:待实测;本次初始化未发起平台查询。']
- lines += ['公开内容优先用 Agent 已有能力;评论仅含实际返回样本。需要时再配置渠道,不要求逐个平台登录。']
+ lines += ['', '还没逐项联网测试。']
+ lines += ['摘要、标题和链接先从搜索引擎找;评论以已读内容为准,字幕需视频自带。', '',
+ '**想查什么,直接说。** 需要登录时,我帮你打开页面,你自己登录就行。']
return '\n'.join(lines) + '\n'
diff --git a/agent_reach/skill/SKILL.md b/agent_reach/skill/SKILL.md
index 3f85df52..8f6b2793 100644
--- a/agent_reach/skill/SKILL.md
+++ b/agent_reach/skill/SKILL.md
@@ -20,11 +20,13 @@ metadata:
## 安装完成展示精简能力表
-安装或重新初始化后,最终回复直接展示 `result.installation_report.markdown`:一句默认安装结果、一张“渠道 → 安装后能获取什么”的短表、一句实测状态。不要再补两张详细矩阵、重复解释图例或逐项列后台动作;详细边界仅在用户追问时读取 [能力边界](references/capabilities.md)。
+安装或重新初始化后,最终回复直接展示 `result.installation_report.markdown`:按安装电脑本地时间生成的问候、默认安装结果、图标说明、一张“平台 / 不登录可以查什么 / 需要登录后再试”的三列表、一句实测状态。不要自行补另一句问候,也不要再补详细矩阵或后台动作清单;详细边界仅在用户追问时读取 [能力边界](references/capabilities.md)。
-运行 `agent-reach setup` 获取 JSON;用户操作终端可用 `agent-reach setup --text`。报告链接只作补充。保留安装失败、用户移除和需处理的状态。Reddit 用“免登录可获取公开帖子、部分评论;站内功能按需登录”说明,不承诺完整评论树。
+运行 `agent-reach setup` 获取 JSON;用户操作终端可用 `agent-reach setup --text`。报告链接只作补充。保留安装失败、用户移除和需处理的状态。✅ 表示不用登录可先查的内容;❌ 只标明所列 Reach 功能需要登录后再试,登录不保证访问成功;— 表示这里没有额外的登录功能。Reddit 的公开帖子、正文和公开评论先用现有网页工具,不要求登录,也不承诺读全评论。
-如果当前运行时没有 `installation_report`,核对所装版本和来源。勾叉描述能力路径,联网实测状态单列,公开内容无需先配置全部渠道。
+问候由程序读取本地时钟:05–10 点早上、11–13 点中午、14–17 点下午、18–21 点晚上,其余为深夜;不联网定位、不询问时区。表中写清内容类型,如“搜摘要”“读正文”“读详情”,避免“页面提示登录时”“更多站内功能”“部分推文”等含糊说法。网络失败、尚未实测、未支持的功能不能标成 ❌ 要求用户登录。如果当前运行时没有 `installation_report`,核对所装版本和来源。
+
+表格功能项尽量用 2–3 字短语,如“读正文、看评论”“看热帖、看热股”。短语保留内容区别:摘要和链接不写成全文,热门股票不写成“牛股”;评论范围、字幕来源的共同说明只在表下写一次。
## 怎么用
diff --git a/agent_reach/skill/SKILL_en.md b/agent_reach/skill/SKILL_en.md
index f5f25b7d..6fe55d11 100644
--- a/agent_reach/skill/SKILL_en.md
+++ b/agent_reach/skill/SKILL_en.md
@@ -21,11 +21,13 @@ One command for every platform: `agent-reach`. Read-only; JSON by default, or a
## Compact installation handoff
-Present `result.installation_report.markdown` directly: one default-install outcome, one short channel-to-capability table, and one verification line. Do not append two detailed matrices, repeated legends or internal action lists. Load [Capability scope](references/capabilities.md) only when the user asks for detail.
+Present `result.installation_report.markdown` directly: a greeting generated from the installing computer's local clock, the install outcome, an icon legend, one three-column table (platform / content without login / features to try after login), and one verification line. Do not add another greeting, detailed matrices or internal action lists. Load [Capability scope](references/capabilities.md) only when the user asks for detail.
-Use JSON `agent-reach setup`, or `setup --text` for direct terminal output. A report link is supplementary. Preserve failed installs, user removals and states requiring attention. Explain Reddit as public posts and some comments without login, with site-specific features enabled on demand; do not promise complete comment trees.
+Use JSON `agent-reach setup`, or `setup --text` for direct terminal output. A report link is supplementary. Preserve failed installs, user removals and states requiring attention. ✅ marks content to try without login; ❌ marks the listed authenticated Reach features, with no promise that login guarantees access; — means no additional login feature here. Public Reddit search, post bodies and available comments use existing web tools without login; do not promise complete comment trees.
-If `installation_report` is missing, check the build/source. Capability paths and local live verification remain separate, and public access does not require configuring every channel.
+Local greeting hours: morning 05–10, noon 11–13, afternoon 14–17, evening 18–21, late night otherwise. No geolocation or timezone question is needed. Name concrete content and actions; avoid vague phrases such as "when the page asks," "more site features" or "some tweets." Network failures, untested paths and unsupported actions must not become ❌ login requirements. If `installation_report` is missing, check the build/source.
+
+Keep feature labels short: "read posts, view replies" or "view posts, trending stocks." Preserve distinctions between snippets, links and full text; trending stocks are not investment picks. State shared comment coverage and subtitle availability once below the table.
## Usage
diff --git a/docs/README_en.md b/docs/README_en.md
index c227a068..fa6ec96d 100644
--- a/docs/README_en.md
+++ b/docs/README_en.md
@@ -22,7 +22,11 @@
</p>
<p align="center">
- <a href="#quick-start">Quick Start</a> · <a href="../README.md">中文</a> · <a href="#supported-platforms">Platforms</a> · <a href="#design-philosophy">Philosophy</a>
+ <a href="#quick-start">Quick Start</a> · <a href="../README.md">中文</a> · <a href="#supported-platforms">Platforms</a> · <a href="#design-philosophy">Philosophy</a> · <a href="https://discord.gg/NSZz22R39">Discord</a>
+</p>
+
+<p align="center">
+ <a href="https://discord.gg/NSZz22R39"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&amp;logoColor=white" alt="Join the Agent Reach Discord community"></a>
</p>
> **No token or crypto affiliation:** Agent Reach has no official token, coin, investment product, fee-claim program, wallet connection, or Solana/Pump.fun project. Any crypto project using the Agent Reach name, GitHub URL, or author identity is not affiliated with this repository. Do not connect a wallet or claim fees based on messages, posts, or links that say otherwise.
@@ -63,7 +67,7 @@
CLI agents such as Claude Code, Codex, Hermes Agent and OpenClaw come with web search and page fetching, but they mostly can't reach:
-- **Login-walled platforms**: XiaoHongShu, Twitter/X, Reddit, LinkedIn, Boss Zhipin... a plain fetch gets nothing or a login page.
+- **Features that need a browser session**: searching XiaoHongShu notes, listing X account posts or reading job details. Reuse an authorized session for the selected action; public content stays on existing search and web tools.
- **What's inside video**: YouTube and Bilibili subtitles, plus speech-to-text for YouTube videos.
- **Chinese platforms**: Bilibili, XiaoHongShu, V2EX and Xueqiu, which general search covers poorly.
- **Clean structured data**: Xueqiu quotes, V2EX topics and replies, GitHub repos and issues, as fields instead of HTML to guess from.
@@ -102,8 +106,8 @@ Every command prints the same JSON shape, so the agent doesn't have to learn eac
| v2ex | default | hot topics, nodes, topics with replies, users | nothing |
| web | default | web search, page reading (fallback) | nothing |
| bilibili | default | search, video info, trending, subtitles | nothing; subtitles need a login (QR scan) |
-| xiaohongshu | optional | search notes, read a note | browser + login |
-| reddit | optional | search, read posts with comments, browse a subreddit | browser + login |
+| xiaohongshu | optional | search notes, read text, view comments | browser + login |
+| reddit | optional | search posts, read text/comments, browse a subreddit | public posts/comments use existing web tools first; browser actions request login only if needed |
| linkedin | optional | job search | login |
| boss | optional | job and JD search | browser + login |
| xueqiu | optional | real-time quotes, stock search, hot posts, hot stocks | quotes need nothing; hot posts/stocks need a browser login |
diff --git a/docs/install.md b/docs/install.md
index 701eff29..83bac63a 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -33,8 +33,8 @@ agent-reach doctor --text
Present the generated compact report directly in the final response:
-1. **Installation outcome**: version, default dependency results and AIs in `result.skill.agents`. An `ok: true` dependency install is not a live business check.
-2. **Capabilities**: present `result.installation_report.markdown` unchanged: one install outcome, one short channel/capability table, and one live-verification line. Keep failures and user removals visible. Do not append detailed matrices, extra backend/action lists or duplicate explanations. The report link supplements the table; detailed boundaries are available when asked.
+1. **Installation outcome**: the generated receipt includes the version and default dependency results. Do not repeat them or append the full agent-link list unless asked. An `ok: true` dependency install is not a live business check.
+2. **Capabilities**: present `result.installation_report.markdown` unchanged: a local-time greeting, install outcome, icon legend, three-column table (platform / without login / try after login), and live-verification line. Keep failures and user removals visible. Do not append detailed matrices or internal action lists. ✅ describes public content, ❌ the listed authenticated Reach features, and — no additional login feature here. Sign-in is no guarantee of access; network failures and untested actions are not login requirements. The report link is supplementary.
3. **Optional capabilities**: add only for a missing capability or explicit setup request. `login_if_required` and `logins[].when=only_if_required` are conditional, not a to-do list. Existing public content remains available if login is skipped.
4. **Example, Reddit**: public search, bodies and some comments can be attempted with existing web tools. Reach browser actions add search, post reading and subreddit lists; reuse an authorized session and log in only when the selected path requires it. Full comment trees, all replies and writing comments are outside the guarantee.
5. **Later management**: the user can say 'add Xiaohongshu' or 'remove V2EX'. Default channels can be removed too.
diff --git a/pyproject.toml b/pyproject.toml
index 04df0e69..da00972d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "agent-reach"
-version = "1.6.3"
+version = "1.6.5"
description = "Internet access for AI agents: one CLI with JSON output to search and read the web, YouTube, GitHub, V2EX and more."
readme = "README.md"
license = {text = "MIT"}
diff --git a/tests/test_manage.py b/tests/test_manage.py
index 2b0762b8..f3548abc 100644
--- a/tests/test_manage.py
+++ b/tests/test_manage.py
@@ -500,13 +500,16 @@ def test_setup_adds_default_channels_and_survives_a_failing_install(env, monkeyp
assert '安装失败:UPSTREAM_BROKEN' in report['markdown']
-def test_setup_text_displays_compact_capability_table_and_keeps_json_mode(env, capsys):
- from agent_reach.runtime import cli
+def test_setup_text_displays_compact_capability_table_and_keeps_json_mode(env, capsys, monkeypatch):
+ from agent_reach.runtime import cli, onboarding
+
+ monkeypatch.setattr(onboarding, '_local_greeting', lambda: '早上好呀,想搜点什么?☀️')
assert cli.main(['setup', '--text']) == 0
text = capsys.readouterr().out
- assert '| 渠道 | 安装后能获取什么 |' in text
- assert text.count('|---|---|') == 1
+ assert text.startswith('早上好呀,想搜点什么?☀️\n')
+ assert '| 平台 | 不登录可以查什么 | 需要登录后再试 |' in text
+ assert text.count('|---|---|---|') == 1
assert '完整报告已保存:' in text
assert not text.startswith('{')
assert cli.main(['setup']) == 0
@@ -529,7 +532,7 @@ def test_setup_receipt_never_overwrites_a_linked_foreign_file(env, tmp_path):
assert foreign.read_text() == 'keep this'
assert result['installation_report']['path'] is None
assert result['installation_report']['write_error']
- assert '| 渠道 | 安装后能获取什么 |' in result['installation_report']['markdown']
+ assert '| 平台 | 不登录可以查什么 | 需要登录后再试 |' in result['installation_report']['markdown']
# ── uninstall ──
diff --git a/tests/test_session_onboarding.py b/tests/test_session_onboarding.py
index 4eaa4890..e8692db9 100644
--- a/tests/test_session_onboarding.py
+++ b/tests/test_session_onboarding.py
@@ -1,5 +1,6 @@
"""Reuse contracts: no hidden browser launches, account switches or configuration overwrites."""
import json
+from datetime import datetime
from unittest.mock import Mock
import pytest
@@ -201,16 +202,21 @@ def test_install_receipt_displays_depth_and_authentication_without_claiming_live
for ch in channels if ch.level == 'default'],
})
assert '5/5 项准备成功' in report
- assert '| 渠道 | 安装后能获取什么 |' in report
- assert report.count('|---|---|') == 1
- assert '公开帖子、部分评论' in report
- assert '🔐 站内搜索/列表' in report
- assert '已有字幕' in report
- assert '本次初始化未发起平台查询' in report
- assert '联网验收:待实测' in report
- assert len(report) <= 1000
- for name in ('GitHub', 'YouTube', 'B站', 'V2EX', 'Web', 'Reddit', '小红书',
- 'X/Twitter', 'Facebook', 'Instagram', 'LinkedIn', 'BOSS直聘', '雪球'):
+ assert '| 平台 | 不登录可以查什么 | 需要登录后再试 |' in report
+ assert report.count('|---|---|---|') == 1
+ assert '| Reddit | ✅ 搜帖子、读正文、看评论 | — |' in report
+ assert '✅ 不用登录;❌ 登录后再试' in report
+ assert '摘要、标题和链接先从搜索引擎找' in report
+ assert '试读原文' in report
+ assert '❌ 搜笔记、读正文、看评论' in report
+ assert '字幕需视频自带' in report
+ assert '还没逐项联网测试' in report
+ assert '页面提示登录时' not in report
+ assert '更多站内功能' not in report
+ assert '部分推文' not in report
+ assert len(report) <= 700
+ for name in ('GitHub', 'YouTube', 'B站', 'V2EX', '网页', 'Reddit', '小红书',
+ 'X / Twitter', 'Facebook', 'Instagram', 'LinkedIn', 'BOSS直聘', '雪球'):
assert '| ' + name + ' |' in report
@@ -224,5 +230,41 @@ def test_install_receipt_preserves_failed_installs_and_user_removed_channels():
'channel': 'bilibili', 'ok': False, 'error': {'code': 'TIMEOUT'}}],
})
assert '1/2 项准备成功' in report
+ assert '安装还差一步' in report
assert '| B站(安装失败:TIMEOUT) |' in report
assert '| GitHub(保留用户移除) |' in report
+
+
[email protected](('hour', 'greeting'), [
+ (0, '夜深了'), (4, '夜深了'), (5, '早上好呀'), (10, '早上好呀'),
+ (11, '中午好'), (13, '中午好'), (14, '下午好'), (17, '下午好'),
+ (18, '晚上好'), (21, '晚上好'), (22, '夜深了'), (23, '夜深了'),
+])
+def test_install_greeting_uses_local_clock_at_period_boundaries(monkeypatch, hour, greeting):
+ class LocalClock(datetime):
+ @classmethod
+ def now(cls, tz=None):
+ assert tz is None, 'must use the installing computer local time'
+ return cls(2026, 10, 19, hour, 0)
+
+ monkeypatch.setattr(onboarding, 'datetime', LocalClock)
+ assert onboarding._local_greeting().startswith(greeting)
+
+
+def test_install_receipt_does_not_turn_reddit_or_web_failures_into_login(monkeypatch):
+ from agent_reach.runtime.cli import unified_channels
+
+ channels = unified_channels()
+ monkeypatch.setattr(onboarding, '_local_greeting', lambda: '中午好,想搜点什么?')
+ report = onboarding.installation_report({
+ 'version': 'test', 'capability_summary': onboarding.capability_summary(channels, [
+ {'channel': 'reddit', 'status': 'broken'},
+ {'channel': 'web', 'status': 'cooldown'},
+ ]),
+ 'default_channels': [{'channel': ch.name, 'ok': True}
+ for ch in channels if ch.level == 'default'],
+ })
+ rows = [line for line in report.splitlines() if line.startswith(('| Reddit', '| 网页'))]
+ assert len(rows) == 2
+ assert all('❌' not in row and row.endswith('| — |') for row in rows)
+ assert report.startswith('中午好,想搜点什么?\n')