@blxzer/cursor-trellis 0.1.2 → 0.2.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/CHANGELOG.md +58 -0
- package/README.md +45 -21
- package/dist/configurators/workflow.d.ts +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +20 -9
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.1.3.json +9 -0
- package/dist/migrations/manifests/0.1.4.json +9 -0
- package/dist/templates/cursor/rules/retrieval-routing.mdc +9 -7
- package/dist/templates/markdown/agents.md +1 -1
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +1 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/prompts/run-semantic-slice-12.md.txt +13 -29
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +0 -49
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +0 -85
- package/dist/templates/markdown/spec/guides/cursor-semantic-compliance.md.txt +7 -21
- package/dist/templates/markdown/spec/guides/cursor-subagent-policy.md.txt +6 -10
- package/dist/templates/markdown/spec/guides/retrieval-daily-guide.md.txt +17 -18
- package/dist/templates/shared-hooks/inject-retrieval-plan.py +42 -23
- package/dist/templates/shared-hooks/inject-subagent-context.py +6 -2
- package/dist/templates/shared-hooks/session-start.py +17 -9
- package/dist/templates/trellis/index.d.ts +8 -4
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +13 -7
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/codebase_retrieval_router.py +80 -31
- package/dist/templates/trellis/scripts/common/config.py +1 -1
- package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +92 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +27 -15
- package/dist/templates/trellis/scripts/common/retrieval_adapter_metadata.py +100 -9
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +76 -31
- package/dist/templates/trellis/scripts/common/retrieval_tool_classification.py +18 -3
- package/dist/templates/trellis/scripts/common/semantic_plan_gate.py +19 -0
- package/dist/templates/trellis/scripts/common/smart_search_evidence.py +5 -2
- package/dist/templates/trellis/scripts/common/smart_search_resolve.py +28 -3
- package/dist/templates/trellis/scripts/common/task_gates.py +372 -73
- package/dist/templates/trellis/scripts/common/task_map.py +29 -1
- package/dist/templates/trellis/scripts/cursor_retrieval_probe.py +396 -0
- package/dist/templates/trellis/scripts/cursor_retrieval_probe_prompt.md +300 -0
- package/dist/templates/trellis/scripts/retrieval_probe_matrix_template.json +126 -0
- package/dist/templates/trellis/workflow.md +9 -53
- package/dist/utils/codebase-retrieval-router.d.ts +5 -0
- package/dist/utils/codebase-retrieval-router.d.ts.map +1 -1
- package/dist/utils/codebase-retrieval-router.js +48 -28
- package/dist/utils/codebase-retrieval-router.js.map +1 -1
- package/dist/utils/cursor-retrieval-env.d.ts +28 -0
- package/dist/utils/cursor-retrieval-env.d.ts.map +1 -0
- package/dist/utils/cursor-retrieval-env.js +89 -0
- package/dist/utils/cursor-retrieval-env.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +22 -15
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.d.ts.map +1 -1
- package/dist/utils/retrieval-agent-instructions.js +37 -21
- package/dist/utils/retrieval-agent-instructions.js.map +1 -1
- package/dist/utils/retrieval-tool-classification.d.ts +2 -0
- package/dist/utils/retrieval-tool-classification.d.ts.map +1 -1
- package/dist/utils/retrieval-tool-classification.js +10 -2
- package/dist/utils/retrieval-tool-classification.js.map +1 -1
- package/dist/utils/semantic-plan-gate.d.ts +8 -0
- package/dist/utils/semantic-plan-gate.d.ts.map +1 -0
- package/dist/utils/semantic-plan-gate.js +42 -0
- package/dist/utils/semantic-plan-gate.js.map +1 -0
- package/package.json +5 -43
- package/bin/smart-search.js +0 -79
- package/dist/templates/trellis/scripts/aggregate_retrieval_telemetry.py +0 -342
- package/dist/templates/trellis/scripts/batch_plan_envelope.py +0 -105
- package/vendor/smart-search/LICENSE +0 -21
- package/vendor/smart-search/README.md +0 -412
- package/vendor/smart-search/README.zh-CN.md +0 -430
- package/vendor/smart-search/npm/bin/smart-search.js +0 -63
- package/vendor/smart-search/npm/scripts/postinstall.js +0 -87
- package/vendor/smart-search/npm/scripts/resolve-prerelease-version.js +0 -108
- package/vendor/smart-search/npm/scripts/set-package-version.js +0 -35
- package/vendor/smart-search/npm/scripts/sync-python-version.js +0 -22
- package/vendor/smart-search/npm/scripts/test-wrapper-repair.js +0 -99
- package/vendor/smart-search/npm/scripts/test.js +0 -85
- package/vendor/smart-search/package.json +0 -42
- package/vendor/smart-search/pyproject.toml +0 -37
- package/vendor/smart-search/skills/smart-search-cli/SKILL.md +0 -387
- package/vendor/smart-search/skills/smart-search-cli/agents/openai.yaml +0 -3
- package/vendor/smart-search/skills/smart-search-cli/examples/batch-search.md +0 -98
- package/vendor/smart-search/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
- package/vendor/smart-search/skills/smart-search-cli/references/cli-contract.md +0 -337
- package/vendor/smart-search/src/smart_search/__init__.py +0 -1
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/SKILL.md +0 -387
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/agents/openai.yaml +0 -3
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/batch-search.md +0 -98
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/examples/evidence-gathering.md +0 -89
- package/vendor/smart-search/src/smart_search/assets/skills/smart-search-cli/references/cli-contract.md +0 -337
- package/vendor/smart-search/src/smart_search/cli.py +0 -2003
- package/vendor/smart-search/src/smart_search/config.py +0 -580
- package/vendor/smart-search/src/smart_search/logger.py +0 -43
- package/vendor/smart-search/src/smart_search/providers/__init__.py +0 -16
- package/vendor/smart-search/src/smart_search/providers/base.py +0 -41
- package/vendor/smart-search/src/smart_search/providers/context7.py +0 -141
- package/vendor/smart-search/src/smart_search/providers/exa.py +0 -206
- package/vendor/smart-search/src/smart_search/providers/jina.py +0 -136
- package/vendor/smart-search/src/smart_search/providers/openai_compatible.py +0 -370
- package/vendor/smart-search/src/smart_search/providers/zhipu.py +0 -143
- package/vendor/smart-search/src/smart_search/service.py +0 -2865
- package/vendor/smart-search/src/smart_search/sources.py +0 -429
- package/vendor/smart-search/src/smart_search/utils.py +0 -220
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
# smart-search
|
|
2
|
-
|
|
3
|
-
[简体中文](README.zh-CN.md) | English
|
|
4
|
-
|
|
5
|
-
CLI-first, skill-driven web research for AI agents and terminal users. `smart-search` gives AI tools one reproducible command layer for live search, source discovery, page fetching, site mapping, provider diagnostics, and live Deep Research execution.
|
|
6
|
-
|
|
7
|
-
<p>
|
|
8
|
-
<a href="https://www.npmjs.com/package/@konbakuyomu/smart-search">
|
|
9
|
-
<img src="https://img.shields.io/npm/v/@konbakuyomu/smart-search?label=npm%20latest" alt="npm latest">
|
|
10
|
-
</a>
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
## What It Is
|
|
16
|
-
|
|
17
|
-
`smart-search` is not an MCP server. It is a normal CLI that AI agents can call through a skill:
|
|
18
|
-
|
|
19
|
-
```powershell
|
|
20
|
-
smart-search search "latest OpenAI Responses API changes" --format json
|
|
21
|
-
smart-search fetch "https://example.com/article" --format markdown
|
|
22
|
-
smart-search research "Compare Responses API web_search with Chat Completions search" --format markdown
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The current architecture has two layers:
|
|
26
|
-
|
|
27
|
-
| Layer | Responsibility |
|
|
28
|
-
| --- | --- |
|
|
29
|
-
| CLI executor | Runs deterministic commands, provider routing, fallback, JSON/Markdown output, local config |
|
|
30
|
-
| Skill / AI orchestration | Infers user intent, chooses normal search vs Deep Research, executes planned CLI steps, writes final source-backed answers |
|
|
31
|
-
|
|
32
|
-
Default `smart-search search` stays fast and live. `smart-search research` is the live Deep Research executor: it builds an internal plan, then runs discovery, fetch/read, gap check, and evidence-only synthesis.
|
|
33
|
-
|
|
34
|
-
## Install
|
|
35
|
-
|
|
36
|
-
Stable channel:
|
|
37
|
-
|
|
38
|
-
```powershell
|
|
39
|
-
npm install -g @konbakuyomu/smart-search@latest
|
|
40
|
-
smart-search --version
|
|
41
|
-
smart-search setup
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Test channel:
|
|
45
|
-
|
|
46
|
-
```powershell
|
|
47
|
-
npm install -g @konbakuyomu/smart-search@next
|
|
48
|
-
smart-search --version
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The npm package creates an isolated Python runtime during install. You still use the single `smart-search` command.
|
|
52
|
-
|
|
53
|
-
Prerequisites:
|
|
54
|
-
|
|
55
|
-
- Node.js / npm.
|
|
56
|
-
- Python 3.10 or newer available as `python`, `python3`, or `py -3` on Windows.
|
|
57
|
-
|
|
58
|
-
## Quick Start
|
|
59
|
-
|
|
60
|
-
1. Configure providers:
|
|
61
|
-
|
|
62
|
-
```powershell
|
|
63
|
-
smart-search setup
|
|
64
|
-
smart-search doctor --format json
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
2. If OpenAI-compatible `search` hangs or times out, generate the short troubleshooting report:
|
|
68
|
-
|
|
69
|
-
```powershell
|
|
70
|
-
smart-search doctor --format markdown
|
|
71
|
-
smart-search diagnose openai-compatible --format markdown
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
3. Run a normal live search:
|
|
75
|
-
|
|
76
|
-
```powershell
|
|
77
|
-
smart-search search "today's important AI news" --validation balanced --extra-sources 2 --format json
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
4. Fetch exact page evidence:
|
|
81
|
-
|
|
82
|
-
```powershell
|
|
83
|
-
smart-search fetch "https://example.com/source" --format markdown --output evidence.md
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
5. Run live Deep Research when you want the CLI to execute the staged workflow:
|
|
87
|
-
|
|
88
|
-
```powershell
|
|
89
|
-
smart-search research "Deep research recent Bitcoin market movement" --budget deep --format markdown
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Current Architecture
|
|
93
|
-
|
|
94
|
-
| Capability | Main commands | Providers | Role |
|
|
95
|
-
| --- | --- | --- | --- |
|
|
96
|
-
| `main_search` | `search` | OpenAI-compatible Chat Completions | Broad answer generation and synthesis |
|
|
97
|
-
| `docs_search` | `context7-library`, `context7-docs`, `exa-search` | Context7, Exa | Official docs, SDKs, APIs, framework/library evidence |
|
|
98
|
-
| `web_search` | Bilingual source discovery inside `search`; `zhipu-search` only for deprecated manual compatibility | Tavily, Firecrawl; Zhipu Web Search API only when explicitly requested | Chinese and English web discovery for every normal research question |
|
|
99
|
-
| `web_fetch` | `fetch` | Tavily, Jina Reader, Firecrawl | Exact URL content extraction for evidence |
|
|
100
|
-
| `site_map` | `map` | Tavily | Site/documentation structure discovery |
|
|
101
|
-
| `research_executor` | `research` / `rs` | Registered providers by capability | Live staged research: plan, discover, fetch/read, gap check, evidence-only synthesis |
|
|
102
|
-
|
|
103
|
-
Fallback is same-capability only:
|
|
104
|
-
|
|
105
|
-
| Capability | Fallback chain |
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| `main_search` | OpenAI-compatible |
|
|
108
|
-
| `docs_search` | Context7 for library/API/docs intent; Exa for official domains, papers, product pages, and trusted-site discovery |
|
|
109
|
-
| `web_search` | Tavily -> Firecrawl; Zhipu only when explicitly selected for the deprecated legacy command |
|
|
110
|
-
| `web_fetch` | Tavily -> Jina Reader with `JINA_API_KEY` -> Firecrawl |
|
|
111
|
-
|
|
112
|
-
Jina Reader is a `web_fetch` provider only. `JINA_API_KEY` is required before Jina satisfies `SMART_SEARCH_MINIMUM_PROFILE=standard`; anonymous `r.jina.ai` behavior is treated as explicit/experimental fetch behavior and must not weaken fail-closed setup checks.
|
|
113
|
-
|
|
114
|
-
The CLI exposes observability fields such as `routing_decision`, `provider_attempts`, `providers_used`, `fallback_used`, `primary_sources`, `extra_sources`, and `source_warning`.
|
|
115
|
-
|
|
116
|
-
Default `balanced` and `strict` `search` run bilingual `web_search` source discovery through Tavily / Firecrawl when configured: one Chinese-source query and one English-source query for the same user question. `--validation fast` skips supplemental discovery. Strict queries without primary, docs, fetch, or explicit source evidence can still return `evidence_error`; use `--extra-sources N`, source-first commands such as `exa-search`, or `fetch` when citable evidence is required. Docs supplemental routing stays keyword-based for explicit docs/API/library/framework intent.
|
|
117
|
-
|
|
118
|
-
`extra_sources` are explicit discovery candidates from `--extra-sources N`, which defaults to `0`. For high-risk claims, news, policy, finance, health, selection decisions, and serious reviews, fetch key pages first and cite fetched text rather than treating a broad search answer as proof.
|
|
119
|
-
|
|
120
|
-
Routing rule of thumb: start with `search` for broad bilingual discovery and synthesis; use `research` when you want the CLI to execute the deeper evidence workflow; use Context7 first for library/API/framework docs; use Exa for official domains, papers, product pages, trusted sites, and low-noise discovery; use Tavily/Firecrawl for bilingual web discovery and URL/page evidence; use Jina for known-URL extraction. Zhipu is retained only as a deprecated manual compatibility command, not a default route.
|
|
121
|
-
|
|
122
|
-
## Deep Research
|
|
123
|
-
|
|
124
|
-
Use normal search when you want a fast answer:
|
|
125
|
-
|
|
126
|
-
```powershell
|
|
127
|
-
smart-search search "React useEffect cleanup docs" --format json
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Use live Deep Research execution when you want the CLI to run the staged workflow:
|
|
131
|
-
|
|
132
|
-
```powershell
|
|
133
|
-
smart-search research "OpenAI Responses API web_search vs Chat Completions search: which should I use?" --budget deep --fallback auto --format json
|
|
134
|
-
smart-search rs "https://example.com/source" --fallback off --format markdown
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
`research` builds an internal Deep Research plan, then runs plan -> discover -> fetch/read -> gap check -> evidence-only synthesis. The plan stage produces:
|
|
138
|
-
|
|
139
|
-
- `intent_signals`, such as recency, docs/API intent, known URL, claim risk, source authority, and cross-validation need;
|
|
140
|
-
- `decomposition`, with 1-6 subquestions depending on budget and difficulty;
|
|
141
|
-
- `capability_plan`, choosing from existing CLI blocks;
|
|
142
|
-
- `steps[]`, each with `tool`, `purpose`, `command`, `output_path`, and `subquestion_id`;
|
|
143
|
-
- `evidence_policy="fetch_before_claim"`;
|
|
144
|
-
- `gap_check`, which fetches missing evidence or downgrades unsupported claims.
|
|
145
|
-
|
|
146
|
-
Deep Research is not a fixed topic recipe system. Market research, product comparison, technical docs, news or policy, claim verification, and URL-first prompts are examples of user language, not required schema enums.
|
|
147
|
-
|
|
148
|
-
The plan only composes existing CLI blocks:
|
|
149
|
-
|
|
150
|
-
```text
|
|
151
|
-
search, exa-search, exa-similar, context7-library, context7-docs, fetch, map
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
`doctor` is preflight, not a research step.
|
|
155
|
-
|
|
156
|
-
`research` defaults to `--fallback auto`, which permits same-capability fallback even when a normal `search` configuration is conservative. `--fallback off` tries only the first provider selected inside each capability, which is useful for debugging provider behavior.
|
|
157
|
-
|
|
158
|
-
Research JSON includes `final_answer`, `citations`, `evidence_items`, `gap_check`, `provider_attempts`, `fallback_used`, `degraded`, `route_policy_version`, and `evidence_dir`. Discovery snippets are candidates only; citations are produced only from fetched/read evidence. If fallback cannot close a gap, `research` finishes degraded and lists unsupported gaps instead of inventing evidence.
|
|
159
|
-
|
|
160
|
-
The research router is capability-first plus provider-advantage:
|
|
161
|
-
|
|
162
|
-
- Context7 first for library/API/framework docs, with Exa as official-domain, paper, product, or trusted low-noise discovery.
|
|
163
|
-
- Tavily / Firecrawl for bilingual Chinese and English broad source discovery. Zhipu is deprecated from default routing and is not used for Chinese/current/domestic searches unless explicitly requested through the legacy command.
|
|
164
|
-
- Jina is favored for known public URLs, PDFs, and arXiv extraction; ReaderLM-v2 still requires `JINA_API_KEY`.
|
|
165
|
-
- Firecrawl is favored for JS-heavy, dynamic, browser-like, OCR/PDF, or robust fallback extraction.
|
|
166
|
-
|
|
167
|
-
Advanced routing overrides are available through `SMART_SEARCH_RESEARCH_PREFERRED_PROVIDERS` and `SMART_SEARCH_RESEARCH_DISABLED_PROVIDERS`. They can reorder or disable registered providers inside their supported capability, but they cannot move a provider across capability boundaries.
|
|
168
|
-
|
|
169
|
-
Good user-facing research prompts:
|
|
170
|
-
|
|
171
|
-
```powershell
|
|
172
|
-
smart-search research "深度搜索一下最近的比特币行情" --format json
|
|
173
|
-
smart-search research "OpenAI Responses API web_search 和 Chat Completions 联网搜索怎么选" --budget deep --format json
|
|
174
|
-
smart-search research "帮我核验这个说法是真是假:某某工具已经完全替代 Tavily 做 AI 搜索了" --format json
|
|
175
|
-
smart-search research "https://example.com/source" --format json
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Provider And API Key Guide
|
|
179
|
-
|
|
180
|
-
Use `smart-search setup` for normal configuration. Environment variables remain supported for CI and advanced users.
|
|
181
|
-
|
|
182
|
-
| Provider / route | Used for | Main config keys | Official docs | Key / dashboard |
|
|
183
|
-
| --- | --- | --- | --- | --- |
|
|
184
|
-
| OpenAI-compatible Chat Completions | Primary live search through OpenAI or a compatible relay | `OPENAI_COMPATIBLE_API_URL`, `OPENAI_COMPATIBLE_API_KEY`, `OPENAI_COMPATIBLE_MODEL`, `OPENAI_COMPATIBLE_STREAM` | [OpenAI platform docs](https://platform.openai.com/docs) | [OpenAI API keys](https://platform.openai.com/api-keys) or your relay provider |
|
|
185
|
-
| Exa | Low-noise official docs, API, paper, product, trusted-page discovery | `EXA_API_KEY` | [Exa docs](https://docs.exa.ai/) | [Exa API keys](https://dashboard.exa.ai/api-keys) |
|
|
186
|
-
| Context7 | SDK, library, framework, and API documentation fallback | `CONTEXT7_API_KEY`, `CONTEXT7_BASE_URL` | [Context7 docs](https://context7.com/docs) | [Context7](https://context7.com/) |
|
|
187
|
-
| Zhipu Web Search API | Deprecated manual `zhipu-search` compatibility only; not used by default routing | `ZHIPU_API_KEY`, `ZHIPU_API_URL`, `ZHIPU_SEARCH_ENGINE` | [Zhipu web search docs](https://docs.bigmodel.cn/cn/guide/tools/web-search) | [Zhipu API keys](https://open.bigmodel.cn/usercenter/apikeys) |
|
|
188
|
-
| Tavily | Extra web sources, URL fetch, and site map | `TAVILY_API_URL`, `TAVILY_API_KEY` | [Tavily docs](https://docs.tavily.com/) | [Tavily app](https://app.tavily.com/home) |
|
|
189
|
-
| Jina Reader | Known URL page extraction for `web_fetch`; key required for standard minimum profile | `JINA_API_KEY`, `JINA_READER_API_URL`, `JINA_RESPOND_WITH`, `JINA_TIMEOUT_SECONDS` | [Jina Reader](https://jina.ai/reader/) | [Jina AI](https://jina.ai/) |
|
|
190
|
-
| Firecrawl | Fetch fallback and supplementary web sources | `FIRECRAWL_API_URL`, `FIRECRAWL_API_KEY` | [Firecrawl docs](https://docs.firecrawl.dev/) | [Firecrawl API keys](https://www.firecrawl.dev/app/api-keys) |
|
|
191
|
-
|
|
192
|
-
Important boundaries:
|
|
193
|
-
|
|
194
|
-
- OpenAI-compatible relays and gateways use the Chat Completions `/chat/completions` route through `OPENAI_COMPATIBLE_*`.
|
|
195
|
-
- `OPENAI_COMPATIBLE_STREAM=true` or `smart-search search --stream` sets `stream=true` only for OpenAI-compatible `search` and provider-side `fetch` calls. It is a relay compatibility switch for long requests and does not change URL description or source ranking.
|
|
196
|
-
- Legacy `SMART_SEARCH_API_URL`, `SMART_SEARCH_API_KEY`, `SMART_SEARCH_API_MODE`, and `SMART_SEARCH_MODEL` are not supported config keys. Use `OPENAI_COMPATIBLE_*` explicitly.
|
|
197
|
-
- Default web discovery is bilingual Tavily / Firecrawl. `zhipu-search` is retained only as a deprecated manual compatibility command and is not used by normal `search` or `research` routing.
|
|
198
|
-
- `zhipu-search` support is the Web Search API route, not Zhipu Chat Completions `tools=[web_search]`, not Search Agent, and not the MCP Server.
|
|
199
|
-
- Jina Reader is not a general search provider. `JINA_API_KEY` is required for Jina to count toward `standard`; `JINA_RESPOND_WITH=readerlm-v2` also requires `JINA_API_KEY`.
|
|
200
|
-
- `ZHIPU_SEARCH_ENGINE` defaults to `search_std`. Supported official values include `search_std`, `search_pro`, `search_pro_sogou`, and `search_pro_quark`; custom values remain allowed for future services.
|
|
201
|
-
- `TAVILY_API_URL` affects Tavily only. It does not proxy Zhipu. For Tavily Hikari / pooled endpoints, use `https://<host>/api/tavily`; setup normalizes root-host or `/mcp` inputs to that REST base.
|
|
202
|
-
- `FIRECRAWL_API_URL` defaults to `https://api.firecrawl.dev/v2`.
|
|
203
|
-
|
|
204
|
-
Non-interactive setup example:
|
|
205
|
-
|
|
206
|
-
```powershell
|
|
207
|
-
smart-search setup --non-interactive `
|
|
208
|
-
--openai-compatible-api-url "https://api.openai.com/v1" `
|
|
209
|
-
--openai-compatible-api-key "your-openai-or-relay-key" `
|
|
210
|
-
--openai-compatible-model "gpt-4.1" `
|
|
211
|
-
--openai-compatible-stream "false" `
|
|
212
|
-
--validation-level "balanced" `
|
|
213
|
-
--fallback-mode "auto" `
|
|
214
|
-
--minimum-profile "standard" `
|
|
215
|
-
--exa-key "your-exa-key" `
|
|
216
|
-
--context7-key "your-context7-key" `
|
|
217
|
-
--jina-key "your-jina-key" `
|
|
218
|
-
--tavily-api-url "https://api.tavily.com" `
|
|
219
|
-
--tavily-key "your-tavily-key" `
|
|
220
|
-
--firecrawl-api-url "https://api.firecrawl.dev/v2" `
|
|
221
|
-
--firecrawl-key "your-firecrawl-key"
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
For explicit legacy Zhipu compatibility only, `smart-search setup --non-interactive --zhipu-key "your-zhipu-key" --zhipu-api-url "https://open.bigmodel.cn/api" --zhipu-search-engine "search_pro_sogou"` still saves the deprecated manual route.
|
|
225
|
-
|
|
226
|
-
Minimum profile defaults to `standard`, requiring at least:
|
|
227
|
-
|
|
228
|
-
- one `main_search` provider: OpenAI-compatible;
|
|
229
|
-
- one `docs_search` provider: Exa or Context7;
|
|
230
|
-
- one `web_fetch` provider: Tavily, Jina with `JINA_API_KEY`, or Firecrawl.
|
|
231
|
-
|
|
232
|
-
Missing required capabilities fail closed with a configuration error. Use `SMART_SEARCH_MINIMUM_PROFILE=off` only for local experiments.
|
|
233
|
-
|
|
234
|
-
Local config and evidence paths:
|
|
235
|
-
|
|
236
|
-
- Windows default: `%LOCALAPPDATA%\smart-search\config.json`.
|
|
237
|
-
- Linux/macOS default: `~/.config/smart-search/config.json`.
|
|
238
|
-
- `SMART_SEARCH_CONFIG_DIR` is an advanced override for CI, containers, sandboxes, or portable installs.
|
|
239
|
-
- `research` evidence defaults to `evidence` under the active config directory, for example `%LOCALAPPDATA%\smart-search\evidence` on Windows.
|
|
240
|
-
- `SMART_SEARCH_EVIDENCE_DIR` overrides the evidence root. Relative values resolve under the active config directory; absolute values are used as-is.
|
|
241
|
-
- `SMART_SEARCH_RESEARCH_PREFERRED_PROVIDERS` and `SMART_SEARCH_RESEARCH_DISABLED_PROVIDERS` are advanced `research` routing overrides. They accept provider CSV values and can only reorder or disable providers inside existing capability boundaries.
|
|
242
|
-
- Earlier Windows source builds defaulted to `~\.config\smart-search\config.json`, while some installs were already pinned to `%LOCALAPPDATA%\smart-search` through `SMART_SEARCH_CONFIG_DIR`. If the new Windows default file is missing but the old home config exists, Smart Search reads the old file as `legacy_windows_home` so upgrades do not lose configuration. `config path` and `doctor` report the active/default/legacy config paths, `SMART_SEARCH_CONFIG_DIR`, `SMART_SEARCH_EVIDENCE_DIR`, and the resolved evidence root.
|
|
243
|
-
|
|
244
|
-
Provider timeouts:
|
|
245
|
-
|
|
246
|
-
- `TAVILY_TIMEOUT_SECONDS` controls the Tavily `doctor` connectivity check timeout and defaults to `60`.
|
|
247
|
-
- Raise it for slower Tavily Hikari / pooled / community endpoints before treating the provider as unhealthy.
|
|
248
|
-
|
|
249
|
-
## Commands
|
|
250
|
-
|
|
251
|
-
| Command | Alias | Purpose |
|
|
252
|
-
| --- | --- | --- |
|
|
253
|
-
| `search` | `s` | Fast live search and broad synthesis |
|
|
254
|
-
| `research` | `rs` | Live Deep Research execution |
|
|
255
|
-
| `fetch` | `f` | Fetch one URL as JSON, Markdown, or content |
|
|
256
|
-
| `map` | `m` | Map a website structure |
|
|
257
|
-
| `exa-search` | `exa`, `x` | Exa source discovery |
|
|
258
|
-
| `exa-similar` | `xs` | Similar pages from one URL |
|
|
259
|
-
| `zhipu-search` | `z`, `zp` | Deprecated legacy Zhipu Web Search API |
|
|
260
|
-
| `context7-library` | `c7`, `ctx7` | Resolve Context7 library candidates |
|
|
261
|
-
| `context7-docs` | `c7d`, `c7docs`, `ctx7-docs` | Fetch Context7 docs |
|
|
262
|
-
| `doctor` | `d` | Masked config and connectivity check |
|
|
263
|
-
| `diagnose` | `diag` | Focused OpenAI-compatible troubleshooting report |
|
|
264
|
-
| `setup` | `init` | Interactive or scripted setup |
|
|
265
|
-
| `config` | `cfg` | Local config read/write |
|
|
266
|
-
|
|
267
|
-
Useful examples:
|
|
268
|
-
|
|
269
|
-
```powershell
|
|
270
|
-
smart-search search "query" --validation balanced --extra-sources 3 --timeout 90 --format json --output result.json
|
|
271
|
-
smart-search research "query" --budget deep --fallback auto --format json --output research.json
|
|
272
|
-
smart-search search "query" --stream --format json
|
|
273
|
-
smart-search search "query" --no-stream --format json
|
|
274
|
-
smart-search search "nba report" --format content
|
|
275
|
-
smart-search exa-search "OpenAI Responses API documentation" --include-domains platform.openai.com developers.openai.com --num-results 5 --include-text --format json
|
|
276
|
-
smart-search context7-library "react" "hooks" --format json
|
|
277
|
-
smart-search context7-docs "/facebook/react" "useEffect cleanup" --format json
|
|
278
|
-
smart-search exa-similar "https://example.com/source" --num-results 5 --format json
|
|
279
|
-
smart-search fetch "https://example.com/source" --format markdown --output page.md
|
|
280
|
-
smart-search map "https://docs.example.com" --instructions "Find API reference pages" --max-depth 1 --limit 50 --format json
|
|
281
|
-
smart-search doctor --format markdown
|
|
282
|
-
smart-search diagnose openai-compatible --format markdown
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
## Output And Evidence Policy
|
|
286
|
-
|
|
287
|
-
Use JSON for agents and scripts:
|
|
288
|
-
|
|
289
|
-
```powershell
|
|
290
|
-
smart-search search "query" --format json
|
|
291
|
-
smart-search doctor --format json
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
Use Markdown for human-readable reports, detailed diagnostics, source lists, and fetched page text:
|
|
295
|
-
|
|
296
|
-
```powershell
|
|
297
|
-
smart-search doctor --format markdown
|
|
298
|
-
smart-search diagnose openai-compatible --format markdown
|
|
299
|
-
smart-search exa-search "OpenAI Responses API documentation" --format markdown
|
|
300
|
-
smart-search fetch "https://example.com" --format markdown
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Use `content` for compact terminal reading:
|
|
304
|
-
|
|
305
|
-
```powershell
|
|
306
|
-
smart-search search "nba report" --format content
|
|
307
|
-
smart-search doctor --format content
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
`content` is intentionally brief. Use `doctor --format markdown` for general human troubleshooting, `diagnose openai-compatible --format markdown` for OpenAI-compatible search hangs/timeouts, and JSON formats for complete machine-readable contracts.
|
|
311
|
-
|
|
312
|
-
Save multi-source evidence under a stable folder:
|
|
313
|
-
|
|
314
|
-
```powershell
|
|
315
|
-
$Config = smart-search config path --format json | ConvertFrom-Json
|
|
316
|
-
$EvidenceDir = Join-Path $Config.resolved_evidence_dir "iran-hormuz"
|
|
317
|
-
New-Item -ItemType Directory -Force -Path $EvidenceDir | Out-Null
|
|
318
|
-
smart-search exa-search "Reuters Iran Hormuz latest" --format json --output (Join-Path $EvidenceDir "01-exa.json")
|
|
319
|
-
smart-search fetch "https://example.com/source" --format markdown --output (Join-Path $EvidenceDir "02-fetch.md")
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
For claim-level evidence:
|
|
323
|
-
|
|
324
|
-
1. Discover candidate URLs with bilingual `search`, `exa-search`, or `exa-similar`.
|
|
325
|
-
2. Fetch exact URLs with `fetch`.
|
|
326
|
-
3. Cite fetched text in the final answer.
|
|
327
|
-
4. Unsupported key claims must be fetched or downgraded to unverified candidates.
|
|
328
|
-
|
|
329
|
-
## Troubleshooting
|
|
330
|
-
|
|
331
|
-
If `doctor` reports `config_error`:
|
|
332
|
-
|
|
333
|
-
```powershell
|
|
334
|
-
smart-search setup
|
|
335
|
-
smart-search config list --format json
|
|
336
|
-
smart-search doctor --format markdown
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
If OpenAI-compatible `search` hangs or times out after `doctor` passes:
|
|
340
|
-
|
|
341
|
-
```powershell
|
|
342
|
-
smart-search doctor --format markdown
|
|
343
|
-
smart-search diagnose openai-compatible --format markdown
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
The diagnose report masks the API key and says whether the problem is missing config, the upstream/relay hanging on the real Smart Search prompt, or a stream/no-stream compatibility mismatch.
|
|
347
|
-
|
|
348
|
-
If search is slow:
|
|
349
|
-
|
|
350
|
-
- reduce `--extra-sources`;
|
|
351
|
-
- split broad questions into smaller queries;
|
|
352
|
-
- use bilingual `search` or `exa-search` for source discovery, then `fetch` key pages.
|
|
353
|
-
|
|
354
|
-
If installed CLI health is uncertain:
|
|
355
|
-
|
|
356
|
-
```powershell
|
|
357
|
-
smart-search --help
|
|
358
|
-
smart-search --version
|
|
359
|
-
smart-search doctor --format json
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
On Windows npm/mise installs, verify non-ASCII JSON piping:
|
|
363
|
-
|
|
364
|
-
```powershell
|
|
365
|
-
smart-search search "深度搜索一下最近的比特币行情" --format json | ConvertFrom-Json
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
## Development
|
|
369
|
-
|
|
370
|
-
```powershell
|
|
371
|
-
.\.venv\Scripts\python.exe -m compileall -q src tests
|
|
372
|
-
.\.venv\Scripts\python.exe -m pytest tests -q
|
|
373
|
-
npm test
|
|
374
|
-
npm pack --dry-run
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
## Latest stable release notes
|
|
378
|
-
|
|
379
|
-
### v0.1.14
|
|
380
|
-
|
|
381
|
-
This stable patch release moves the tested `0.1.13-beta.4` CLI and bundled skill contract into npm `latest`.
|
|
382
|
-
|
|
383
|
-
- `smart-search diagnose openai-compatible --format markdown` produces a focused, copy-pasteable troubleshooting report for OpenAI-compatible search hangs/timeouts.
|
|
384
|
-
- Docs/API routing now prefers Context7 for library/framework documentation and keeps Exa for official domains, papers, product pages, and trusted-site discovery.
|
|
385
|
-
- README, bundled skill assets, release notes, and tests now document and verify the exact stable package behavior.
|
|
386
|
-
|
|
387
|
-
## Release lanes
|
|
388
|
-
|
|
389
|
-
Stable releases use Git tags and npm `latest`:
|
|
390
|
-
|
|
391
|
-
```powershell
|
|
392
|
-
git tag v0.1.14
|
|
393
|
-
git push origin v0.1.14
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
Test releases use npm prereleases and do not move `latest`. A push to `main` publishes the next `<package.json version>-beta.N` version under npm dist-tag `next`; `N` resets for each stable base version. To avoid publishing an unwanted beta for a stable bump, the `chore(release): bump version to X.Y.Z` branch commit is skipped by the workflow and the matching `vX.Y.Z` tag publishes npm `latest`. For example, after `0.1.10-beta.1` and `0.1.10-beta.2`, the next `main` publish is `0.1.10-beta.3`.
|
|
397
|
-
|
|
398
|
-
GitHub Actions also supports manual backfill for historical test builds through `workflow_dispatch`. Use an explicit `target_ref` plus an exact version such as `0.1.9-beta.1`, and publish it with a non-`latest` tag such as `backfill`. npm versions are immutable: old `*-dev.*` packages cannot be renamed in place, only superseded by new `*-beta.N` packages and optionally deprecated later with npm owner credentials.
|
|
399
|
-
|
|
400
|
-
Stable GitHub releases read optional body text from `.github/releases/vX.Y.Z.md` and append npm package, dist-tag, and workflow-run metadata automatically. Add that file before tagging a stable version so the GitHub Release page explains what changed instead of only listing package metadata.
|
|
401
|
-
|
|
402
|
-
Release closeout checklist:
|
|
403
|
-
|
|
404
|
-
1. Verify the registry and tags before changing anything: `npm view @konbakuyomu/smart-search versions --json`, `npm view @konbakuyomu/smart-search dist-tags --json`, and `gh release list --repo konbakuyomu/smartsearch --limit 100`.
|
|
405
|
-
2. For historical beta backfill, publish the replacement `*-beta.N` package through Actions with `create_github_release=false` if the workflow token cannot create releases, then create the missing GitHub prerelease locally with `gh release create vX.Y.Z-beta.N --target <commit> --prerelease --latest=false`.
|
|
406
|
-
3. Treat npm `E409` during parallel backfills as a registry concurrency failure, not a version-design failure. Re-run the affected version serially after checking whether the package already exists.
|
|
407
|
-
4. Do a machine-readable gap check: expected beta versions minus npm versions must be empty, and expected `v*beta*` releases minus GitHub prereleases must be empty.
|
|
408
|
-
5. Install the selected test build explicitly, for example `mise use -g "npm:@konbakuyomu/smart-search@0.1.10-beta.3" -y --pin`, then run `mise reshim`, `where.exe smart-search`, `smart-search --version`, `smart-search doctor --format json`, and a non-ASCII JSON pipe such as `smart-search search "深度搜索一下最近的比特币行情" --format json | ConvertFrom-Json`.
|
|
409
|
-
|
|
410
|
-
## License
|
|
411
|
-
|
|
412
|
-
MIT
|