bookmark-research 0.5.0-beta.1
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/.agents/plugins/marketplace.json +20 -0
- package/.codex-plugin/plugin.json +46 -0
- package/LICENSE +674 -0
- package/README.md +128 -0
- package/README.zh.md +126 -0
- package/bin/bookmark-research.js +30 -0
- package/config/providers.json +98 -0
- package/docs/bookmark-research-architecture.md +124 -0
- package/docs/cli-launcher-plan.md +58 -0
- package/docs/details.en.md +272 -0
- package/docs/details.md +93 -0
- package/docs/harness-compatibility.md +304 -0
- package/docs/harness-sources.json +342 -0
- package/docs/host-validation.json +298 -0
- package/docs/install-design-0.2.0.md +57 -0
- package/docs/installation.en.md +197 -0
- package/docs/installation.md +316 -0
- package/docs/instructions.en.md +42 -0
- package/docs/instructions.md +42 -0
- package/docs/mcp-aggregation-0.2.0.md +92 -0
- package/docs/multi-host-installation-plan.md +163 -0
- package/docs/prompt-reference.en.md +104 -0
- package/docs/prompt-reference.md +104 -0
- package/docs/provider-smoke-0.2.0.json +235 -0
- package/docs/release-notes-0.5.0-beta.1.md +33 -0
- package/docs/research-0.2.0.md +140 -0
- package/docs/research-sources-0.2.0.json +9360 -0
- package/docs/user-guide.en.md +74 -0
- package/docs/user-guide.md +74 -0
- package/docs/validation-0.2.0.md +126 -0
- package/docs/validation-0.4.0.md +154 -0
- package/docs/wiki-quality.md +105 -0
- package/docs/wiki-quality.zh.md +105 -0
- package/hosts/claude/runtime.js +13 -0
- package/hosts/codex/delegate.md +14 -0
- package/hosts/codex/prepare.py +61 -0
- package/hosts/dsh/plugin.js +36 -0
- package/hosts/dsh/runtime.js +14 -0
- package/hosts/dsh/workflow-call.py +45 -0
- package/hosts/pi/register-workflow.py +72 -0
- package/hosts/pi/runtime.js +18 -0
- package/hosts/shared/research-call.py +76 -0
- package/hosts/shared/research-flow.js +208 -0
- package/hosts/shared/workflow.json +15 -0
- package/install.sh +310 -0
- package/package.json +12 -0
- package/scripts/build_zip.py +143 -0
- package/scripts/export_bundle.py +496 -0
- package/scripts/host_assets.py +70 -0
- package/scripts/host_clients.py +196 -0
- package/scripts/host_install.py +277 -0
- package/scripts/install.py +593 -0
- package/scripts/launcher.py +186 -0
- package/scripts/verify_fixture.py +220 -0
- package/scripts/verify_live.py +62 -0
- package/scripts/verify_quality.py +87 -0
- package/skills/bookmark-research/SKILL.md +80 -0
- package/skills/bookmark-research/agents/openai.yaml +3 -0
- package/skills/bookmark-research/references/cli.md +150 -0
- package/skills/bookmark-research/references/deep-research.md +164 -0
- package/skills/bookmark-research/references/github-and-sync.md +30 -0
- package/skills/bookmark-research/references/host-workflows.md +101 -0
- package/skills/bookmark-research/references/package-semantics.md +78 -0
- package/skills/bookmark-research/references/research-methods.md +51 -0
- package/skills/bookmark-research/references/research-services.md +72 -0
- package/skills/bookmark-research/references/research-workflow.md +57 -0
- package/skills/bookmark-research/references/settings-and-archive.md +104 -0
- package/skills/bookmark-research/references/source-lifecycle.md +75 -0
- package/skills/bookmark-research/references/wiki-and-evaluation.md +63 -0
- package/skills/bookmark-research/references/zh/cli.md +150 -0
- package/skills/bookmark-research/references/zh/deep-research.md +164 -0
- package/skills/bookmark-research/references/zh/github-and-sync.md +30 -0
- package/skills/bookmark-research/references/zh/host-workflows.md +101 -0
- package/skills/bookmark-research/references/zh/package-semantics.md +78 -0
- package/skills/bookmark-research/references/zh/research-methods.md +51 -0
- package/skills/bookmark-research/references/zh/research-services.md +70 -0
- package/skills/bookmark-research/references/zh/research-workflow.md +57 -0
- package/skills/bookmark-research/references/zh/settings-and-archive.md +104 -0
- package/skills/bookmark-research/references/zh/skill-guide.md +75 -0
- package/skills/bookmark-research/references/zh/source-lifecycle.md +75 -0
- package/skills/bookmark-research/references/zh/wiki-and-evaluation.md +63 -0
- package/src/archive.py +302 -0
- package/src/bookmark_index.py +913 -0
- package/src/cli.py +435 -0
- package/src/credentials.py +82 -0
- package/src/evaluation.py +337 -0
- package/src/jina.py +96 -0
- package/src/mcp_server.py +641 -0
- package/src/onboarding.py +352 -0
- package/src/provider_adapters.py +152 -0
- package/src/readiness.py +283 -0
- package/src/remote_mcp.py +295 -0
- package/src/research.py +1334 -0
- package/src/research_coverage.py +160 -0
- package/src/research_services.py +684 -0
- package/src/routing.py +202 -0
- package/src/search_results.py +244 -0
- package/src/service_http.py +139 -0
- package/src/settings.py +247 -0
- package/src/source_inputs.py +201 -0
- package/src/source_manager.py +348 -0
- package/src/source_watcher.py +68 -0
- package/src/textio.py +9 -0
- package/src/tui.py +586 -0
- package/src/web_search.py +603 -0
- package/src/wiki.py +383 -0
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Bookmark Research
|
|
2
|
+
|
|
3
|
+
**English** · [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
Research your bookmarks with verified web sources. Give it a list of bookmark URLs or a [Bookmark Canvas](https://github.com/Browser-bookmark-hub/Bookmark-Canvas) package; it checks every link, searches and reads the web, and writes a cited report you can resume.
|
|
6
|
+
|
|
7
|
+
Works in **Codex, Claude Code, Pi and DSH (DeepSeek Harness)**.
|
|
8
|
+
|
|
9
|
+
[Installation guide](docs/installation.en.md) · [User guide](docs/user-guide.en.md) · [Details](docs/details.en.md) · [npm](https://www.npmjs.com/package/bookmark-research) · [Releases](https://github.com/Browser-bookmark-hub/Bookmark-Research/releases)
|
|
10
|
+
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> **0.5.0 is a beta.** Report problems on [GitHub Issues](https://github.com/Browser-bookmark-hub/Bookmark-Research/issues).
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- Python 3.9+ with SQLite FTS5 (check with `bookmark-research doctor`)
|
|
17
|
+
- The CLI of at least one client: Codex, Claude Code, Pi or DSH (DSH also needs `pnpm`)
|
|
18
|
+
- Node 18+ for the `bookmark-research` command; optional on macOS/Linux
|
|
19
|
+
- No API key is needed to install or to query bookmarks locally
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
**Interactive** (macOS, Linux, Windows):
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx bookmark-research install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Pick clients with the arrow keys and Space, confirm the summary, then choose search services and enter API keys. Start a new client session afterwards.
|
|
30
|
+
|
|
31
|
+
For a permanent `bookmark-research` command: `npm install -g bookmark-research`. Without Node (macOS/Linux/WSL): `curl -fsSL https://raw.githubusercontent.com/Browser-bookmark-hub/Bookmark-Research/main/install.sh | bash`.
|
|
32
|
+
|
|
33
|
+
**One client, no prompts:**
|
|
34
|
+
|
|
35
|
+
| Client | Command | Registers with |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| Codex | `npx bookmark-research install codex --non-interactive` | `codex plugin add` |
|
|
38
|
+
| Claude Code | `npx bookmark-research install claude --scope user --non-interactive` | `claude plugin install` |
|
|
39
|
+
| Pi | `npx bookmark-research install pi --non-interactive` | `pi install` |
|
|
40
|
+
| DSH | `npx bookmark-research install dsh --profile web --non-interactive` | `dsh plugin add` |
|
|
41
|
+
|
|
42
|
+
Several at once: `npx bookmark-research install claude dsh --profile web --non-interactive`. Project scope: `--scope project --project /path/to/project` (Claude Code, Pi). All options: [installation guide](docs/installation.en.md).
|
|
43
|
+
|
|
44
|
+
**Ask your agent to install it.** Paste this into Codex, Claude Code, Pi or DSH:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Install the Bookmark Research plugin into the client you are running in.
|
|
48
|
+
|
|
49
|
+
1. Identify your own client: codex, claude, pi or dsh.
|
|
50
|
+
2. Run: npx bookmark-research install <client> --non-interactive
|
|
51
|
+
- Claude Code or Pi: add --scope user (or --scope project --project <dir>).
|
|
52
|
+
- DSH: add --profile <profile>; ask me for the profile name.
|
|
53
|
+
3. The command prints JSON. Confirm "verified": true and report any "error".
|
|
54
|
+
4. Do not ask me for API keys in chat. Tell me to run `bookmark-research setup`
|
|
55
|
+
(or `npx bookmark-research setup`) in my terminal to enter them.
|
|
56
|
+
5. Tell me to start a new session so the Skill and MCP tools load.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Configure and API keys
|
|
60
|
+
|
|
61
|
+
No reinstall is needed. Settings and keys apply to every installed client; start a new client session after changing them.
|
|
62
|
+
|
|
63
|
+
| Task | Command |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| Menu: configure, check, install, update | `bookmark-research` |
|
|
66
|
+
| Preferences and API keys | `bookmark-research setup` |
|
|
67
|
+
| Installed clients, preferences, key status | `bookmark-research status` |
|
|
68
|
+
| Script preferences | `bookmark-research config show` · `bookmark-research config set --input prefs.json` |
|
|
69
|
+
| Update or verify all clients | `bookmark-research update` · `bookmark-research verify` |
|
|
70
|
+
|
|
71
|
+
Use `npx bookmark-research …` if the command is not installed globally.
|
|
72
|
+
|
|
73
|
+
**API keys are optional.** Enter them in `bookmark-research setup` (hidden input, checked immediately, saved in a private local file) or set environment variables, which take precedence. Keys are never accepted in chat, command arguments or JSON files.
|
|
74
|
+
|
|
75
|
+
| Variable | Service | Without it |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `EXA_API_KEY` | Exa search and page reading | Anonymous use where Exa allows it |
|
|
78
|
+
| `PARALLEL_API_KEY` | Parallel search and page reading | Free anonymous use with lower limits |
|
|
79
|
+
| `TAVILY_API_KEY` | Tavily search fallback and extraction | Keyless mode |
|
|
80
|
+
| `JINA_API_KEY` | Jina search | Jina Reader still reads pages anonymously |
|
|
81
|
+
| `OPENAI_API_KEY` | Optional OpenAI Deep Research runs | Feature off; host-led research still works |
|
|
82
|
+
|
|
83
|
+
Preferences (research depth, answer language, providers, archiving) can also be changed by asking the agent in a client session; it uses the `update_settings` tool.
|
|
84
|
+
|
|
85
|
+
## What's inside
|
|
86
|
+
|
|
87
|
+
### Skill
|
|
88
|
+
|
|
89
|
+
| Skill | Use it for |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| [`bookmark-research`](skills/bookmark-research/SKILL.md) | Query bookmarks, check links, run a full research pass over every bookmark and write a cited report. English, with a [Chinese reading copy](skills/bookmark-research/references/zh/skill-guide.md). |
|
|
92
|
+
|
|
93
|
+
### MCP server
|
|
94
|
+
|
|
95
|
+
One local stdio server, `bookmark-research` (`python3 src/cli.py serve`), with 36 tools:
|
|
96
|
+
|
|
97
|
+
| Group | Tools |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| Bookmarks | `sync_package`, `index_status`, `source_history`, `search_bookmarks`, `get_context` |
|
|
100
|
+
| Web | `search_web`, `fetch_web`, `search_providers` |
|
|
101
|
+
| Research | `research_readiness`, `research_start`, `research_status`, `research_search`, `research_fetch`, `research_source`, `research_record`, `research_inventory`, `research_coverage`, `research_import_evidence`, `research_finish`, `research_route` |
|
|
102
|
+
| Research services (optional) | `research_services`, `research_service_prepare`, `_start`, `_status`, `_result`, `_cancel`, `_attach`, `_import` |
|
|
103
|
+
| Settings | `get_settings`, `update_settings` |
|
|
104
|
+
| Wiki and evaluation | `wiki_write`, `wiki_get`, `wiki_list`, `wiki_search`, `wiki_lint`, `evaluate_research` |
|
|
105
|
+
|
|
106
|
+
Tool descriptions: [details](docs/details.en.md#mcp-tools).
|
|
107
|
+
|
|
108
|
+
### Web services
|
|
109
|
+
|
|
110
|
+
Called by the plugin's own MCP server; you do not add their MCPs separately.
|
|
111
|
+
|
|
112
|
+
| Service | Role |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| [Exa](https://exa.ai) | Primary search; first page reader |
|
|
115
|
+
| [Parallel](https://parallel.ai) | Primary search; fallback page reader |
|
|
116
|
+
| [Tavily](https://tavily.com) | Search fallback |
|
|
117
|
+
| [Jina Reader](https://jina.ai/reader) | Fallback page reader; search with a key |
|
|
118
|
+
|
|
119
|
+
Optional research MCPs you may add to your client yourself: Exa Agent, Parallel Task and Tavily Research. `bookmark-research setup` shows the steps for each client.
|
|
120
|
+
|
|
121
|
+
## More
|
|
122
|
+
|
|
123
|
+
- [Installation guide](docs/installation.en.md): all install options, updates, ZIP downloads
|
|
124
|
+
- [User guide](docs/user-guide.en.md): first use, the three research modes, languages
|
|
125
|
+
- [Details](docs/details.en.md): data model, research modes, settings, export formats, development checks
|
|
126
|
+
- [Architecture](docs/bookmark-research-architecture.md) (Chinese)
|
|
127
|
+
|
|
128
|
+
Originally developed in [Bookmark Canvas](https://github.com/Browser-bookmark-hub/Bookmark-Canvas). License: [GPL-3.0](LICENSE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Bookmark Research
|
|
2
|
+
|
|
3
|
+
[English](README.md) · **中文**
|
|
4
|
+
|
|
5
|
+
用联网查证来研究你的书签。给它一份书签 URL 列表或 [Bookmark Canvas](https://github.com/Browser-bookmark-hub/Bookmark-Canvas) 数据包,它会逐条核对链接、搜索和阅读网页,写出带引用、可以接着做的研究报告。
|
|
6
|
+
|
|
7
|
+
支持 **Codex、Claude Code、Pi、DSH(DeepSeek Harness)**。
|
|
8
|
+
|
|
9
|
+
[安装说明](docs/installation.md) · [使用指南](docs/user-guide.md) · [详细说明](docs/details.md) · [npm](https://www.npmjs.com/package/bookmark-research) · [Releases](https://github.com/Browser-bookmark-hub/Bookmark-Research/releases)
|
|
10
|
+
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> **0.5.0 是测试版。** 遇到问题请到 [GitHub Issues](https://github.com/Browser-bookmark-hub/Bookmark-Research/issues) 反馈。
|
|
13
|
+
|
|
14
|
+
## 环境要求
|
|
15
|
+
|
|
16
|
+
- Python 3.9+,含 SQLite FTS5(可用 `bookmark-research doctor` 检查)
|
|
17
|
+
- 至少一个宿主的 CLI:Codex、Claude Code、Pi 或 DSH(DSH 另需 `pnpm`)
|
|
18
|
+
- `bookmark-research` 命令需要 Node 18+;macOS/Linux 上可不用
|
|
19
|
+
- 安装和本地查书签都不需要 API Key
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
**交互安装**(macOS、Linux、Windows):
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npx bookmark-research install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
用方向键和空格选择宿主,确认汇总后安装,再选择搜索服务、输入 API Key。装好后新建一个宿主会话。
|
|
30
|
+
|
|
31
|
+
想一直能用 `bookmark-research` 命令:`npm install -g bookmark-research`。不用 Node(macOS/Linux/WSL):`curl -fsSL https://raw.githubusercontent.com/Browser-bookmark-hub/Bookmark-Research/main/install.sh | bash`。
|
|
32
|
+
|
|
33
|
+
**指定宿主、不弹提示:**
|
|
34
|
+
|
|
35
|
+
| 宿主 | 命令 | 实际登记方式 |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| Codex | `npx bookmark-research install codex --non-interactive` | `codex plugin add` |
|
|
38
|
+
| Claude Code | `npx bookmark-research install claude --scope user --non-interactive` | `claude plugin install` |
|
|
39
|
+
| Pi | `npx bookmark-research install pi --non-interactive` | `pi install` |
|
|
40
|
+
| DSH | `npx bookmark-research install dsh --profile web --non-interactive` | `dsh plugin add` |
|
|
41
|
+
|
|
42
|
+
一次装多个:`npx bookmark-research install claude dsh --profile web --non-interactive`。装到指定项目:`--scope project --project /path/to/project`(Claude Code、Pi)。全部参数见[安装说明](docs/installation.md)。
|
|
43
|
+
|
|
44
|
+
**让 agent 帮你装。** 把下面这段粘贴给 Codex、Claude Code、Pi 或 DSH:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
请把 Bookmark Research 插件安装到你当前运行的这个宿主里。
|
|
48
|
+
|
|
49
|
+
1. 先确认你自己是哪个宿主:codex、claude、pi 或 dsh。
|
|
50
|
+
2. 运行:npx bookmark-research install <宿主> --non-interactive
|
|
51
|
+
- Claude Code 或 Pi:加 --scope user(或 --scope project --project <目录>)。
|
|
52
|
+
- DSH:加 --profile <名称>;profile 名称请先问我。
|
|
53
|
+
3. 命令会输出 JSON。确认 "verified": true,有 "error" 就告诉我。
|
|
54
|
+
4. 不要在对话里向我要 API Key。请让我在终端运行 `bookmark-research setup`
|
|
55
|
+
(或 `npx bookmark-research setup`)自己输入。
|
|
56
|
+
5. 提醒我新建一个会话,让 Skill 和 MCP 工具生效。
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 配置与 API Key
|
|
60
|
+
|
|
61
|
+
不需要重新安装。配置和 Key 对所有已安装的宿主生效,修改后新建宿主会话即可。
|
|
62
|
+
|
|
63
|
+
| 要做什么 | 命令 |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| 主菜单:配置、检查、安装、更新 | `bookmark-research` |
|
|
66
|
+
| 修改偏好和 API Key | `bookmark-research setup` |
|
|
67
|
+
| 查看已装宿主、偏好、Key 状态 | `bookmark-research status` |
|
|
68
|
+
| 用脚本改偏好 | `bookmark-research config show` · `bookmark-research config set --input prefs.json` |
|
|
69
|
+
| 更新或验证所有宿主 | `bookmark-research update` · `bookmark-research verify` |
|
|
70
|
+
|
|
71
|
+
没有全局安装时,在前面加 `npx`,例如 `npx bookmark-research setup`。
|
|
72
|
+
|
|
73
|
+
**API Key 都是可选的。** 在 `bookmark-research setup` 里输入(隐藏显示,输完当场检查,保存在仅当前用户可读的本地文件),或者设置环境变量(优先于已保存的 Key)。Key 不接受对话、命令参数或 JSON 文件。
|
|
74
|
+
|
|
75
|
+
| 环境变量 | 服务 | 不配置时 |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `EXA_API_KEY` | Exa 搜索与网页读取 | 在 Exa 允许的范围内匿名使用 |
|
|
78
|
+
| `PARALLEL_API_KEY` | Parallel 搜索与网页读取 | 免费匿名使用,额度较低 |
|
|
79
|
+
| `TAVILY_API_KEY` | Tavily 备用搜索与提取 | 使用免 Key 模式 |
|
|
80
|
+
| `JINA_API_KEY` | Jina 搜索 | Jina Reader 仍可匿名读取网页 |
|
|
81
|
+
| `OPENAI_API_KEY` | 可选的 OpenAI Deep Research 任务 | 功能关闭;宿主自己的研究不受影响 |
|
|
82
|
+
|
|
83
|
+
研究深度、答复语言、服务选择、归档这些偏好,也可以直接在宿主会话里让 agent 改,它会调用 `update_settings` 工具。
|
|
84
|
+
|
|
85
|
+
## 插件包含什么
|
|
86
|
+
|
|
87
|
+
### Skill
|
|
88
|
+
|
|
89
|
+
| Skill | 用途 |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| [`bookmark-research`](skills/bookmark-research/SKILL.md) | 查书签、核对链接、对每条书签做完整研究并写出带引用的报告。英文执行版,另有[中文阅读版](skills/bookmark-research/references/zh/skill-guide.md)。 |
|
|
92
|
+
|
|
93
|
+
### MCP 服务
|
|
94
|
+
|
|
95
|
+
一个本地 stdio 服务 `bookmark-research`(`python3 src/cli.py serve`),共 36 个工具:
|
|
96
|
+
|
|
97
|
+
| 分类 | 工具 |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| 书签 | `sync_package`、`index_status`、`source_history`、`search_bookmarks`、`get_context` |
|
|
100
|
+
| 网页 | `search_web`、`fetch_web`、`search_providers` |
|
|
101
|
+
| 研究 | `research_readiness`、`research_start`、`research_status`、`research_search`、`research_fetch`、`research_source`、`research_record`、`research_inventory`、`research_coverage`、`research_import_evidence`、`research_finish`、`research_route` |
|
|
102
|
+
| 专业研究服务(可选) | `research_services`、`research_service_prepare`、`_start`、`_status`、`_result`、`_cancel`、`_attach`、`_import` |
|
|
103
|
+
| 设置 | `get_settings`、`update_settings` |
|
|
104
|
+
| Wiki 与评测 | `wiki_write`、`wiki_get`、`wiki_list`、`wiki_search`、`wiki_lint`、`evaluate_research` |
|
|
105
|
+
|
|
106
|
+
### 网页服务
|
|
107
|
+
|
|
108
|
+
由插件自带的 MCP 服务直接调用,不需要另外添加它们的 MCP。
|
|
109
|
+
|
|
110
|
+
| 服务 | 作用 |
|
|
111
|
+
| --- | --- |
|
|
112
|
+
| [Exa](https://exa.ai) | 主要搜索;首选网页读取 |
|
|
113
|
+
| [Parallel](https://parallel.ai) | 主要搜索;备用网页读取 |
|
|
114
|
+
| [Tavily](https://tavily.com) | 备用搜索 |
|
|
115
|
+
| [Jina Reader](https://jina.ai/reader) | 备用网页读取;有 Key 时可搜索 |
|
|
116
|
+
|
|
117
|
+
另有可选的研究 MCP 可以自己加到宿主里:Exa Agent、Parallel Task、Tavily Research。`bookmark-research setup` 会给出各宿主的接入步骤。
|
|
118
|
+
|
|
119
|
+
## 更多
|
|
120
|
+
|
|
121
|
+
- [安装说明](docs/installation.md):全部安装方式、更新、ZIP 下载
|
|
122
|
+
- [使用指南](docs/user-guide.md):首次使用、三种研究方式、语言
|
|
123
|
+
- [详细说明](docs/details.md):使用方式、数据包与保存位置、宿主与验证范围、开发
|
|
124
|
+
- [结构与触发流程](docs/bookmark-research-architecture.md)
|
|
125
|
+
|
|
126
|
+
项目源自 [Bookmark Canvas](https://github.com/Browser-bookmark-hub/Bookmark-Canvas)。许可证:[GPL-3.0](LICENSE)。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin cross-platform entry: find Python 3.9+ and run the bundled launcher.
|
|
3
|
+
"use strict";
|
|
4
|
+
const { spawnSync, spawn } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const launcher = path.join(__dirname, "..", "scripts", "launcher.py");
|
|
8
|
+
const candidates = [];
|
|
9
|
+
if (process.env.BOOKMARK_RESEARCH_PYTHON) candidates.push([process.env.BOOKMARK_RESEARCH_PYTHON]);
|
|
10
|
+
candidates.push(["python3"], ["python"]);
|
|
11
|
+
if (process.platform === "win32") candidates.push(["py", "-3"]);
|
|
12
|
+
|
|
13
|
+
const check = "import sys, sqlite3; sys.exit(0 if sys.version_info >= (3, 9) else 3)";
|
|
14
|
+
const python = candidates.find(([command, ...args]) =>
|
|
15
|
+
spawnSync(command, [...args, "-c", check], { stdio: "ignore", windowsHide: true }).status === 0);
|
|
16
|
+
|
|
17
|
+
if (!python) {
|
|
18
|
+
const chinese = /^zh/i.test(process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || "");
|
|
19
|
+
console.error(chinese
|
|
20
|
+
? "Bookmark Research 需要 Python 3.9+(含 SQLite)。请从 https://www.python.org/downloads/ 安装,或设置 BOOKMARK_RESEARCH_PYTHON 指向 Python。"
|
|
21
|
+
: "Bookmark Research needs Python 3.9+ with SQLite. Install it from https://www.python.org/downloads/ or set BOOKMARK_RESEARCH_PYTHON.");
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const [command, ...prefix] = python;
|
|
26
|
+
const child = spawn(command, [...prefix, launcher, ...process.argv.slice(2)], { stdio: "inherit", windowsHide: true });
|
|
27
|
+
// The terminal delivers Ctrl+C to the whole process group; let Python handle it.
|
|
28
|
+
process.on("SIGINT", () => {});
|
|
29
|
+
child.on("exit", (code, signal) => process.exit(signal ? 130 : code ?? 1));
|
|
30
|
+
child.on("error", (error) => { console.error(error.message); process.exit(1); });
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"providers": {
|
|
4
|
+
"exa": {
|
|
5
|
+
"label": "Exa",
|
|
6
|
+
"url": "https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa",
|
|
7
|
+
"search_tools": [
|
|
8
|
+
"web_search_exa"
|
|
9
|
+
],
|
|
10
|
+
"fetch_tools": [
|
|
11
|
+
"web_fetch_exa"
|
|
12
|
+
],
|
|
13
|
+
"direct_client": true,
|
|
14
|
+
"optional_header_env": {
|
|
15
|
+
"x-api-key": "EXA_API_KEY"
|
|
16
|
+
},
|
|
17
|
+
"authentication": "Anonymous rate-limited search/extraction, or optional EXA_API_KEY header. This plugin does not implement OAuth.",
|
|
18
|
+
"native_research": {
|
|
19
|
+
"url": "https://mcp.exa.ai/mcp?tools=agent_run",
|
|
20
|
+
"tools": ["agent_run"],
|
|
21
|
+
"required_tools": ["agent_run"],
|
|
22
|
+
"workflow_tools": ["agent_run"],
|
|
23
|
+
"authentication_required": true,
|
|
24
|
+
"mode": "host_native_mcp",
|
|
25
|
+
"note": "Opt-in Exa Agent; resumable with runId. Not part of the default search/extraction catalog."
|
|
26
|
+
},
|
|
27
|
+
"docs": "https://exa.ai/docs/reference/exa-mcp"
|
|
28
|
+
},
|
|
29
|
+
"parallel": {
|
|
30
|
+
"label": "Parallel",
|
|
31
|
+
"url": "https://search.parallel.ai/mcp",
|
|
32
|
+
"search_tools": [
|
|
33
|
+
"web_search"
|
|
34
|
+
],
|
|
35
|
+
"fetch_tools": [
|
|
36
|
+
"web_fetch"
|
|
37
|
+
],
|
|
38
|
+
"direct_client": true,
|
|
39
|
+
"optional_bearer_env": "PARALLEL_API_KEY",
|
|
40
|
+
"authentication": "Anonymous rate-limited search/extraction, or optional PARALLEL_API_KEY Bearer header. OAuth endpoint is host-managed.",
|
|
41
|
+
"native_research": {
|
|
42
|
+
"url": "https://task-mcp.parallel.ai/mcp",
|
|
43
|
+
"tools": ["createDeepResearch", "createTaskGroup", "getStatus", "getResultMarkdown"],
|
|
44
|
+
"required_tools": ["createDeepResearch", "getStatus", "getResultMarkdown"],
|
|
45
|
+
"workflow_tools": ["createDeepResearch", "getStatus", "getResultMarkdown"],
|
|
46
|
+
"authentication_required": true,
|
|
47
|
+
"mode": "host_native_mcp",
|
|
48
|
+
"docs": "https://docs.parallel.ai/integrations/mcp/task-mcp",
|
|
49
|
+
"note": "A separate authenticated asynchronous Task MCP; Search MCP capability probes do not contact it."
|
|
50
|
+
},
|
|
51
|
+
"docs": "https://docs.parallel.ai/integrations/mcp/search-mcp"
|
|
52
|
+
},
|
|
53
|
+
"jina": {
|
|
54
|
+
"label": "Jina Reader / Search",
|
|
55
|
+
"url": "https://r.jina.ai/",
|
|
56
|
+
"search_url": "https://s.jina.ai/",
|
|
57
|
+
"transport": "http",
|
|
58
|
+
"search_tools": ["jina_search"],
|
|
59
|
+
"fetch_tools": ["jina_reader"],
|
|
60
|
+
"direct_client": true,
|
|
61
|
+
"optional_bearer_env": "JINA_API_KEY",
|
|
62
|
+
"required_env": {"search": "JINA_API_KEY"},
|
|
63
|
+
"authentication": "Reader supports anonymous rate-limited webpage/PDF extraction. Search requires JINA_API_KEY. Uses the HTTP APIs, not the hosted Jina MCP, whose anonymous reading is not established.",
|
|
64
|
+
"docs": "https://jina.ai/reader/"
|
|
65
|
+
},
|
|
66
|
+
"tavily": {
|
|
67
|
+
"label": "Tavily",
|
|
68
|
+
"url": "https://mcp.tavily.com/mcp/",
|
|
69
|
+
"search_tools": [
|
|
70
|
+
"tavily_search",
|
|
71
|
+
"tavily-search"
|
|
72
|
+
],
|
|
73
|
+
"fetch_tools": [
|
|
74
|
+
"tavily_extract",
|
|
75
|
+
"tavily-extract"
|
|
76
|
+
],
|
|
77
|
+
"direct_client": true,
|
|
78
|
+
"optional_bearer_env": "TAVILY_API_KEY",
|
|
79
|
+
"keyless_headers": {
|
|
80
|
+
"X-Tavily-Access-Mode": "keyless"
|
|
81
|
+
},
|
|
82
|
+
"authentication": "Optional TAVILY_API_KEY Bearer header; otherwise explicitly selects keyless search/extraction. OAuth is host-managed.",
|
|
83
|
+
"keyless_docs": "https://docs.tavily.com/documentation/keyless",
|
|
84
|
+
"native_research": {
|
|
85
|
+
"url": "https://mcp.tavily.com/mcp/",
|
|
86
|
+
"tools": ["tavily_research", "tavily-research"],
|
|
87
|
+
"authentication_required": true,
|
|
88
|
+
"mode": "host_native_mcp",
|
|
89
|
+
"note": "May be advertised to keyless clients but requires an API key to execute. The aggregator routes search and extraction only."
|
|
90
|
+
},
|
|
91
|
+
"docs": "https://docs.tavily.com/documentation/mcp"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"default_providers": [
|
|
95
|
+
"exa",
|
|
96
|
+
"parallel"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Bookmark Research 0.4.0 结构图
|
|
2
|
+
|
|
3
|
+
用户可以直接用自然语言说明“查什么、查多大范围、要什么结果”,不用背固定提示词。安装并加载 Skill 后,由 Codex、Claude Code、Pi 或 DSH 理解请求,再调用插件工具执行。下面先看使用过程,再看内部结构。
|
|
4
|
+
|
|
5
|
+
| 研究方式 | 用户可以这样说 | 对书签/画布包怎样处理 | 交付 |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| ① 快速查证 `quick` | “打开包里 Exa 的官方文档,查一下它是否支持 MCP。” | 找到对应书签,读取已有 URL;找不到明确来源时,搜索后读取关键页。 | 简短答案与来源链接。 |
|
|
8
|
+
| ② 主动搜索 `agentic` | “比较我收藏的搜索服务,查清检索、正文读取和研究能力的区别。” | 读取相关卡片说明、书签和分组语境;拆出问题,搜索、读文、比较,再根据证据缺口补查。 | 带证据的比较与结论。 |
|
|
9
|
+
| ③ 深度研究 `deep` | “把整个 AI 调研包全量调查,核验排行榜,与我们的插件比较,交付报告和 Wiki。” | 冻结完整来源清单,按专题组织持续调查,保存证据,逐项审阅,检查遗漏与冲突后交付。 | 研究档案、覆盖明细、报告;按要求整理 Wiki。 |
|
|
10
|
+
|
|
11
|
+
第一行是插件的“快速查证”流程。[OpenAI 官方文档](https://developers.openai.com/api/docs/guides/tools-web-search)中的 **Non-reasoning** 指模型不进行主动的多轮搜索规划,并不要求用户已经有 URL。插件可以提供短流程,但不会把宿主模型自动切成非推理模型。Exa、Parallel、Tavily 是供这些流程使用的检索服务,不与三种研究深度一一对应。
|
|
12
|
+
|
|
13
|
+
默认 `research.depth=auto`:宿主根据任务判断深度,也可以遵循用户明确提出的“这次快速查证”或“这次深度研究”。`research_route` 只根据宿主报告的任务类型和可用工具建议入口;真正的工具调用、子代理启动或工作流执行由宿主发起。一般用户不需要手写这些参数。
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart TB
|
|
17
|
+
Request["你说明范围、问题和交付要求"] --> Host["宿主读取 Skill<br/>判断采用哪种研究方式"]
|
|
18
|
+
Host --> Context["按任务范围定位书签<br/>读取卡片说明、文件夹、组与连线语境"]
|
|
19
|
+
Context -->|快速查证| Quick["读取目标网页<br/>必要时搜索发现来源"]
|
|
20
|
+
Context -->|主动搜索| Agentic["拆问题 → 搜索 → 读文 → 比较"]
|
|
21
|
+
Context -->|深度研究| Deep["冻结完整范围<br/>分组调查、记录证据、审阅与核验"]
|
|
22
|
+
Quick --> Answer["简短答复与来源"]
|
|
23
|
+
Agentic --> Check{"证据足够回答问题?"}
|
|
24
|
+
Check -->|还不够,补查| Agentic
|
|
25
|
+
Check -->|足够| Comparison["比较结论与证据"]
|
|
26
|
+
Deep --> Coverage{"原始来源与研究问题有缺口?"}
|
|
27
|
+
Coverage -->|有,继续调查| Deep
|
|
28
|
+
Coverage -->|完成条件满足| Report["报告与覆盖明细<br/>按要求编写 Wiki"]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
深度研究有两条执行路线:宿主自身持续搜索、阅读、推理,必要时使用可用子代理/工作流;或者调用已启用并配置凭据的 OpenAI Deep Research API/Parallel Task API。插件实现了专业服务接口,但安装插件或在提示词里写“Deep Research”不会自动启用账户访问。实际是否可用,以当前配置和服务调用结果为准。特定宿主的专用命令,例如已加载的 Claude `/deep-research`,还要按该命令的调用方式启动。
|
|
32
|
+
|
|
33
|
+
交给专业服务时,插件把明确的研究问题与选定原 URL 整理成请求;画布语境由宿主用于构造问题,本机目录不会自动变成云端可读资料。服务返回的报告进入证据档案,所引原页仍需核验,不能用一份外部报告代替整包覆盖检查。
|
|
34
|
+
|
|
35
|
+
**研究深度与研究范围分别决定。** 只查一个书签就处理该书签;研究指定卡片就保留该卡片的范围;要求“研究整个包”时,默认保留整包全部原始 URL 和每个重复书签的语境。分批、子代理数量和搜索结果页数都不能缩小这个范围。深度研究中也会反复使用直接读取和主动搜索。
|
|
36
|
+
|
|
37
|
+
目录、ZIP 和单卡经过同一套接入程序。书签提供要读的 URL,卡片说明、文件夹、分组和连线提供研究语境;它们保存在本地索引中。仅问“某个书签在哪张卡片”时,查本地数据即可。接入包本身不会自动开始联网研究。
|
|
38
|
+
|
|
39
|
+
下面两张图对应当前 0.4.0 实现。宿主负责理解问题、模型推理、子代理或已有工作流;Plugin 提供安装封装,Skill 提供方法指令,Python 提供实际工具。CLI 和 MCP 共用同一套实现,也可以配置为共用本地数据。实线表示调用或数据流,虚线表示指令或配置影响。
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
flowchart TB
|
|
43
|
+
User["用户<br/>自然语言问题与数据包路径"] --> Host["AI 宿主<br/>Codex / Claude Code / Pi / DSH<br/>模型推理、任务组织与审阅"]
|
|
44
|
+
|
|
45
|
+
subgraph Plugin["Bookmark Research Plugin"]
|
|
46
|
+
Skill["Skill:Markdown 指令<br/>查询方法、研究规则与宿主路由"]
|
|
47
|
+
MCP["本地 MCP 入口<br/>src/mcp_server.py · 35 个工具"]
|
|
48
|
+
CLI["Python CLI 入口<br/>src/cli.py"]
|
|
49
|
+
Core["共用 Python 运行时<br/>Python 3.9+ 标准库"]
|
|
50
|
+
Sources["来源接入、增量同步与本地查询"]
|
|
51
|
+
Research["搜索、正文读取与研究记录"]
|
|
52
|
+
Knowledge["Wiki 保存、引用核验与质量评测"]
|
|
53
|
+
MCP --> Core
|
|
54
|
+
CLI --> Core
|
|
55
|
+
Core --> Sources
|
|
56
|
+
Core --> Research
|
|
57
|
+
Core --> Knowledge
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
Skill -.->|提供方法指令| Host
|
|
61
|
+
Host -->|工具调用| MCP
|
|
62
|
+
Host -->|命令调用| CLI
|
|
63
|
+
Settings["用户配置<br/>settings.json"] -.->|服务选择与存储位置| Core
|
|
64
|
+
Input["用户的画布数据<br/>目录 / ZIP / 单卡 JSON"] --> Sources
|
|
65
|
+
Research --> Remote["外部服务<br/>搜索、正文读取与可选研究 API"]
|
|
66
|
+
|
|
67
|
+
subgraph Local["本地持久化数据:位于原包和插件缓存之外"]
|
|
68
|
+
DB[("SQLite 查询索引<br/>index.sqlite3")]
|
|
69
|
+
Snapshots["来源版本快照<br/>index.sqlite3.sources/"]
|
|
70
|
+
Pages["网页响应与正文<br/>knowledge/"]
|
|
71
|
+
Runs["研究清单、证据、覆盖与报告<br/>research/"]
|
|
72
|
+
Wiki["Wiki 页面与不可变修订<br/>wiki/"]
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
Sources --> DB
|
|
76
|
+
Sources --> Snapshots
|
|
77
|
+
Research -->|读取书签与关系| DB
|
|
78
|
+
Research --> Pages
|
|
79
|
+
Research --> Runs
|
|
80
|
+
Knowledge -->|读取已审阅证据| Runs
|
|
81
|
+
Knowledge --> Wiki
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
各宿主的接入方式有所不同:Codex、Claude Code 使用 Skill + MCP;Pi 使用 Skill + CLI/stdio 桥,子代理工作流依赖已有扩展;DSH 使用 MCP 适配,并配置 Skill 发现和工作流服务。图中的宿主能力取决于实际安装与配置,适配实现及验证范围见[宿主支持说明](details.en.md#client-support)。
|
|
85
|
+
|
|
86
|
+
SQLite 是随 Python 工具读写的本地数据库文件,用来查询书签、栏目、文件夹和画布关系,并记录来源与同步状态。它可以从来源快照重建,不需要单独启动数据库服务器。
|
|
87
|
+
|
|
88
|
+
默认数据目录为 `~/.local/share/bookmark-research/`,默认配置文件为 `~/.config/bookmark-research/settings.json`。安装插件提供工具与默认设置;首次接入用户数据后才建立来源记录。本地查询无需 API 密钥,网络服务按各自的认证要求配置。
|
|
89
|
+
|
|
90
|
+
数据接入与同步的关键是把**输入载体**和**来源寿命**分开。单卡中的“永久/临时”是内容类型;`snapshot`/`live` 决定后续怎样更新。
|
|
91
|
+
|
|
92
|
+
```mermaid
|
|
93
|
+
flowchart TB
|
|
94
|
+
Export["手动导出目录<br/>JSON + .canvas"] --> Read
|
|
95
|
+
Zip["ZIP 数据包<br/>含完整包或单卡"] --> Read
|
|
96
|
+
Card["单个卡片 JSON<br/>永久卡片 / 临时卡片"] --> Read
|
|
97
|
+
Git["GitHub 等现有同步工具"] -->|将变化同步到磁盘| Directory["长期保留的本地目录"]
|
|
98
|
+
Directory --> Read
|
|
99
|
+
|
|
100
|
+
Read["统一读取与校验<br/>source_inputs.py"] --> Register["来源登记<br/>source_manager.py<br/>source_id、路径别名、mode、completeness"]
|
|
101
|
+
Register --> Mode{"来源寿命"}
|
|
102
|
+
Mode -->|snapshot| Fixed["固定快照<br/>新导出需主动重新接入"]
|
|
103
|
+
Mode -->|live:仅目录| Live["持续目录<br/>首次接入及后续变化检查"]
|
|
104
|
+
Trigger["更新触发<br/>MCP 进程内轮询 / CLI watch<br/>查询前补检查"] --> Live
|
|
105
|
+
|
|
106
|
+
Fixed --> Sync["增量索引<br/>bookmark_index.py<br/>文件哈希比较与事务写入"]
|
|
107
|
+
Live --> Sync
|
|
108
|
+
Sync --> DB[("SQLite<br/>当前有效索引与来源状态")]
|
|
109
|
+
Sync --> Versions["来源版本快照<br/>package/:必要原始协议文件<br/>manifest.json:哈希、路径与关系"]
|
|
110
|
+
Versions -->|选择历史版本重新导入| Read
|
|
111
|
+
DB --> Query["本地书签查询与画布关系查询"]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
新的普通导出默认使用 `snapshot`,Git 仓库内目录默认使用 `live`;已登记来源沿用原模式。同一画布换路径导出时显式沿用 `source_id`,以后记住路径别名;不同画布不会因标题或 URL 相同而合并。
|
|
115
|
+
|
|
116
|
+
两种模式都会保存版本快照。局部导入保留下来的旧栏目也进入快照,因此删除原下载包后仍可使用已接入的 snapshot,并能从保存的版本恢复。默认 `completeness=partial` 保留此次未提供的文件;明确指定 `complete` 才按完整镜像删除缺失文件。已提供栏目内删除的书签仍会同步,单卡固定使用 `partial`。
|
|
117
|
+
|
|
118
|
+
`live` 的后台检查跟随 MCP 进程:默认每 1 秒检查,普通变化稳定 2 秒后同步,整文件删除等待 5 秒。关闭进程后停止,重连和查询时补查。一次性 CLI 命令执行完即退出,持续监控需要运行前台 `watch`。Git 拉取、推送和登录由原有同步工具或宿主承担。
|
|
119
|
+
|
|
120
|
+
无效 JSON、目录暂时消失等情况会保留上次有效索引,并返回待更新或错误状态。这部分借鉴 CodeGraph 的增量更新和恢复机制,CodeGraph 本身不是运行依赖。详细参数与恢复命令见[来源生命周期说明](../skills/bookmark-research/references/source-lifecycle.md)。
|
|
121
|
+
|
|
122
|
+
普通书签查询和单个 URL 读取可以直接调用工具,无需先建立正式研究任务。正式全包研究中的搜索摘要、外部研究报告不能自动算作原始页面已读;覆盖不足时继续补查,或保存明确标记为未完成的报告。质量评测依据显式标注和运行数据,方法见[Wiki 与评测说明](wiki-quality.md)。
|
|
123
|
+
|
|
124
|
+
**自动更新的边界:`live` 目录在检查时同步本地索引,不会自动抓网页、调用 LLM 或改写 Wiki。** 研究状态检查会比较冻结输入与当前索引;发生变化时提示 `source_freshness.requires_review`,Wiki 读取/核验会标记 `needs_review`。宿主据此发起补充调查和修订,旧正文、研究清单与 Wiki 修订继续保留。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# `bookmark-research` 命令与跨平台安装计划
|
|
2
|
+
|
|
3
|
+
日期:2026-09-24。目标:像 `claude`、`codex` 一样,在终端输入 `bookmark-research` 即可安装、配置、检查和更新插件;macOS、Linux、Windows 原生均可用。
|
|
4
|
+
|
|
5
|
+
## 决策
|
|
6
|
+
|
|
7
|
+
| 问题 | 决定 | 理由 |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| 分发途径 | **npm 为主入口,GitHub 为源码与备选入口** | npm 在三个系统上自动生成可执行命令;Pi、DSH、Codex 用户基本已有 Node。`curl \| bash` 保留给不想用 Node 的 macOS/Linux 用户。 |
|
|
10
|
+
| 包名 | `bookmark-research`(2026-09-24 查询 npm 未被占用) | 与插件名一致。 |
|
|
11
|
+
| 运行时 | npm 包只是薄入口,调用包内 Python(3.9+,含 FTS5) | 不重写已测试的 Python 安装器与 MCP。 |
|
|
12
|
+
| 发布前 | `npx github:Browser-bookmark-hub/Bookmark-Research` 可直接从 GitHub 运行 | 不依赖 npm 账号即可试用。 |
|
|
13
|
+
|
|
14
|
+
## 命令设计
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
bookmark-research 终端中打开主菜单;非终端输出 JSON 状态
|
|
18
|
+
bookmark-research install [HOST…] 安装到一个或多个宿主(无参数时进入向导)
|
|
19
|
+
bookmark-research update [HOST…] 更新已安装宿主(默认全部)
|
|
20
|
+
bookmark-research verify [HOST…] 验证已安装宿主
|
|
21
|
+
bookmark-research setup 配置向导(偏好、服务、隐藏输入 Key、可用性检查)
|
|
22
|
+
bookmark-research status 已安装宿主、服务与 Key 状态(JSON)
|
|
23
|
+
bookmark-research config show|set 查看或修改偏好(set 从 --input 读取 JSON)
|
|
24
|
+
bookmark-research doctor 检查 Python 与 SQLite FTS5
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
规则:
|
|
28
|
+
|
|
29
|
+
1. 命令不绑定版本号。所有操作都用 npm 包自带(或 checkout 中)的 Python 源码;配置与 Key 属于用户级数据,与宿主安装分离。
|
|
30
|
+
2. 已安装宿主从安装记录读取:Codex 读 `codex plugin list`,其他宿主读 `~/.local/share/bookmark-research/installations/*/receipt.json`。
|
|
31
|
+
3. 非终端(agent/CI)不弹菜单;需要的参数必须显式传入,输出 JSON。
|
|
32
|
+
4. API Key 仍只允许隐藏输入或环境变量,不接受命令参数与 JSON。
|
|
33
|
+
|
|
34
|
+
## Windows 原生适配
|
|
35
|
+
|
|
36
|
+
| 位置 | 问题 | 改法 |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `src/tui.py` | 用 `termios` 读按键 | Windows 用 `msvcrt.getwch()`,方向键前缀 `\xe0`/`\x00`;启用 VT 输��。无法读键时退回纯文本模式。 |
|
|
39
|
+
| `src/onboarding.py` | 从 `/dev/tty` 打开终端 | Windows 用 `CONIN$`/`CONOUT$`。 |
|
|
40
|
+
| `scripts/host_install.py` | `fcntl` 安装锁 | Windows 用 `msvcrt.locking`(与 `src/settings.py` 相同做法)。 |
|
|
41
|
+
| MCP 启动命令 | 写死 `python3` | 导出与安装时写入实际解析到的 Python(`python3` → `python` → `py -3`);Codex 仓库清单保持 `python3`,Windows 上由安装器改写本地导出。 |
|
|
42
|
+
| 入口 | bash 脚本 | npm `bin` 为 Node 脚本,查找 Python 后转发参数。 |
|
|
43
|
+
|
|
44
|
+
## 实施与验收
|
|
45
|
+
|
|
46
|
+
1. `bin/bookmark-research.js`(Node)+ 根目录 `package.json` 的 `bin`/`files`;查找 Python,版本不足时给出安装说明。
|
|
47
|
+
2. `scripts/launcher.py`:子命令分派与主菜单,复用 `install.py`、`cli.py`。
|
|
48
|
+
3. Windows 适配(上表)。
|
|
49
|
+
4. 测试:launcher 分派、Python 探测、非终端行为;跨平台逻辑单元测试;GitHub Actions 矩阵(ubuntu / macos / windows)。本机只能验证 macOS。
|
|
50
|
+
5. README:安装、后续配置、插件包含的 MCP 与 Skill。
|
|
51
|
+
|
|
52
|
+
完成标准:本机全量测试通过;`npm pack` 后用 `npx ./bookmark-research-*.tgz` 在隔离目录跑通 `status`、`install --dry-run`;Windows 仅以 CI 配置和单元测试覆盖,真实 Windows 验证待 CI 运行。
|
|
53
|
+
|
|
54
|
+
## 完成情况(2026-09-24)
|
|
55
|
+
|
|
56
|
+
- 已实现:`bin/bookmark-research.js`、根目录 `package.json`(含 `bin` 与 `pi.skills`)、`scripts/launcher.py` 主菜单与子命令、Windows 按键/控制台/安装锁/Python 路径适配、`.github/workflows/test.yml` 三系统矩阵、README 与安装文档。
|
|
57
|
+
- 已验证(macOS):全量 450 个测试通过;`npm pack` 后全局安装的 `bookmark-research` 真实完成 Claude Code 安装、`status`、`verify`(36 个 MCP 工具);主菜单在伪终端中可用。
|
|
58
|
+
- 待验证:Windows 原生只由 CI 配置与模拟单元测试覆盖,需推送后看 CI;npm 包尚未发布;Codex 在 Windows 上仍使用仓库 manifest 中的 `python3` 启动 MCP,若系统没有 `python3` 命令需另行处理。
|