smart-web-mcp 0.33.1 → 0.35.0
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 +18 -0
- package/README.md +9 -6
- package/dist/cli.js +46 -8
- package/dist/cli.js.map +1 -1
- package/dist/extraction/budget.js +16 -1
- package/dist/extraction/budget.js.map +1 -1
- package/dist/mcp-server.js +50 -9
- package/dist/mcp-server.js.map +1 -1
- package/dist/shared.d.ts +21 -0
- package/dist/shared.js.map +1 -1
- package/dist/smartcrawl.d.ts +4 -1
- package/dist/smartcrawl.js +96 -0
- package/dist/smartcrawl.js.map +1 -1
- package/dist/smartfetch/pipeline.d.ts +2 -2
- package/dist/smartfetch.js +142 -16
- package/dist/smartfetch.js.map +1 -1
- package/dist/smartsearch.d.ts +2 -0
- package/dist/smartsearch.js +104 -0
- package/dist/smartsearch.js.map +1 -1
- package/package.json +1 -1
- package/python/requirements-undetected-chromedriver.txt +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -73,6 +73,9 @@ The format is based on Keep a Changelog[^1] and this project uses SemVer.
|
|
|
73
73
|
- Added ordered `recommended_resources` to `smartcrawl-resource-handles.json`, pointing hosts at the summary, resource-handle manifest, and first Markdown document without requiring role-order heuristics.
|
|
74
74
|
- Expanded provider benchmark corpus coverage across static articles, JS-rendered pages, authwalls, long docs/Wikipedia, Naver Blog/Cafe/Map, Hacker News, YouTube, BOJ/Codeforces, relay and docs export surfaces.
|
|
75
75
|
- Added a deterministic smartsearch quality benchmark (`npm run benchmark:smartsearch`, `benchmark:smartsearch:json`) covering no-key site-native routing without live network access, plus MDN and crates.io native search fallbacks.
|
|
76
|
+
- Added compact/balanced/full MCP budget controls for `smartsearch` and `smartcrawl` summary outputs so search/crawl structuredContent is token-bounded by default, not only the rendered text channel.
|
|
77
|
+
- Added `smartfetch` `pipeline.acquire.attempt_map` so default structured output shows provider seed, direct/impit, Jina Reader, archive, and browser fallback phases with succeeded/failed/skipped status.
|
|
78
|
+
- Added compact `smartfetch.research_handoff` metadata for blocked, partial, or low-confidence results so downstream research workers and editable report renderers can consume the source URL plus projected `structuredContent` evidence without a new smart-web mode.
|
|
76
79
|
|
|
77
80
|
### Changed
|
|
78
81
|
|
|
@@ -98,6 +101,7 @@ The format is based on Keep a Changelog[^1] and this project uses SemVer.
|
|
|
98
101
|
- Documented `smartfetch` output-budget settings and the compact MCP text default in the README and configuration guide.
|
|
99
102
|
- `smartfetch` MCP budget resolution now uses a single exported resolver with precedence: `output_budget` → `preferred_budget_chars` → `headroom_tokens` → `context_mode` → compact default; `context_mode` is treated as a backward-compatible alias and not the primary control.
|
|
100
103
|
- `smartfetch` MCP responses now record the selected output budget, winning control, and resolver reason under `evidence.selected_output_budget*` for clearer v0.x budget/control migration debugging.
|
|
104
|
+
- `smartfetch` MCP descriptions and docs now frame smart-web as the unified retrieval kernel whose evidence bundle is consumed downstream, rather than adding a separate retrieval mode or tool.
|
|
101
105
|
|
|
102
106
|
### Fixed
|
|
103
107
|
|
|
@@ -148,6 +152,20 @@ The format is based on Keep a Changelog[^1] and this project uses SemVer.
|
|
|
148
152
|
- Korean public API helpers now validate outbound URLs and redirects before fetching, blocking localhost, private, and reserved targets unless `network.allowPrivateHosts` is explicitly enabled.
|
|
149
153
|
- CI now declares read-only default repository permissions, Dependabot auto-merge pins the reusable workflow without forwarding all caller secrets, and the workflow check enforces those guards.
|
|
150
154
|
|
|
155
|
+
## [0.35.0](https://github.com/jojo-labs/smart-web/compare/v0.34.0...v0.35.0) (2026-06-24)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
* expose default smartfetch retrieval evidence ([#386](https://github.com/jojo-labs/smart-web/issues/386)) ([fc8c635](https://github.com/jojo-labs/smart-web/commit/fc8c6351b654bd8ceccf99e1644c1c1fd896a219))
|
|
161
|
+
|
|
162
|
+
## [0.34.0](https://github.com/jojo-labs/smart-web/compare/v0.33.1...v0.34.0) (2026-06-22)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Features
|
|
166
|
+
|
|
167
|
+
* budget search and crawl outputs ([#380](https://github.com/jojo-labs/smart-web/issues/380)) ([0246bde](https://github.com/jojo-labs/smart-web/commit/0246bde9f81d963c8f282c9d4ac9b562019f1bba))
|
|
168
|
+
|
|
151
169
|
## [0.33.1](https://github.com/jojo-labs/smart-web/compare/v0.33.0...v0.33.1) (2026-06-22)
|
|
152
170
|
|
|
153
171
|
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ If `smart-web` returns reproducible incorrect or misleading output, open a GitHu
|
|
|
24
24
|
|
|
25
25
|
- one local MCP instead of separate search, fetch, and crawl servers
|
|
26
26
|
- explicit routing: URL → `smartfetch`, query → `smartsearch`, known site → `smartcrawl`
|
|
27
|
-
- up-front smartfetch acquisition lanes instead of broad direct → browser retry chains
|
|
27
|
+
- up-front smartfetch acquisition lanes instead of broad direct → browser retry chains, with `pipeline.acquire.attempt_map` showing seed/direct/relay/archive/browser phases and skip/failure reasons
|
|
28
28
|
- optional Jina Reader relay for weak generic/article fetches when you explicitly enable it, with JSON mode and alternate-link preservation
|
|
29
29
|
- shared document extraction for article-like pages keeps browser primary content separate from raw shell HTML, preserving headings, links, blocks, and Markdown when requested
|
|
30
30
|
- docs export manifests are versioned and include per-document SHA-256 hashes plus resource-handle manifests for stable local Markdown mirrors; resource-handle manifests include both exported documents and metadata handles for the summary/manifest files, and successful export `structuredContent` embeds the same handle manifest for host follow-up calls
|
|
@@ -35,7 +35,7 @@ If `smart-web` returns reproducible incorrect or misleading output, open a GitHu
|
|
|
35
35
|
- legal paper fallback for academic URLs: DOI-aware OpenAlex, Unpaywall, Semantic Scholar, CORE discovery, and Europe PMC enrichment plus bioRxiv/medRxiv API fallback when a direct paper page is thin or blocked
|
|
36
36
|
- site-native public search fallbacks cover Reddit, GitHub repository discovery/repo-docs queries, npm search/exact packages, Hacker News, Stack Exchange, Wikipedia, Velog, MDN, and crates.io when a matching `site:` query is available
|
|
37
37
|
- YouTube watch, shorts, embed, live, and youtu.be video URLs get best-effort public caption enrichment by default while non-video YouTube pages stay on the generic fetch path
|
|
38
|
-
- structured output with `assessment` and `
|
|
38
|
+
- structured output with `assessment`, `pipeline`, and partial-result `research_handoff` fields for host-side decision making
|
|
39
39
|
- local-first defaults with privacy-aware search/fetch behavior
|
|
40
40
|
- useful normalization for common public surfaces instead of raw HTML dumps
|
|
41
41
|
- social unavailable shells such as Threads generic join/login pages stay partial and chrome-free instead of masquerading as verified post content
|
|
@@ -59,7 +59,8 @@ If `smart-web` returns reproducible incorrect or misleading output, open a GitHu
|
|
|
59
59
|
All three tools are shaped for agent consumption. Common high-signal fields include:
|
|
60
60
|
|
|
61
61
|
- `assessment`: confidence, block/auth hints, recommended handoff
|
|
62
|
-
- `pipeline`: resolve/acquire/normalize/assess stages, plus policy metadata for relay-style usage and authwall likelihood
|
|
62
|
+
- `pipeline`: resolve/acquire/normalize/assess stages, plus policy metadata for relay-style usage and authwall likelihood; `pipeline.acquire.attempt_map` describes the default seed, direct/impit, Jina Reader, archive, and browser phases as succeeded, failed, or skipped
|
|
63
|
+
- `research_handoff`: compact metadata on blocked or partial `smartfetch` results telling downstream research workers and editable report renderers which evidence fields to consume
|
|
63
64
|
- `budget`: output projection metadata showing which fields were truncated and by how much; use `smartfetch` `output_budget: "compact"` for token-sensitive MCP hosts, `preferred_budget_chars` for host-budget-aware routing, and `"full"` when larger structured payloads are explicitly needed
|
|
64
65
|
- `evidence.selected_output_budget*`: the selected `smartfetch` budget preset, winning control, and resolver reason so hosts can see which v0.x compatibility hint actually took effect
|
|
65
66
|
- `errors`: structured failure reasons
|
|
@@ -70,9 +71,11 @@ This lets hosts decide whether deterministic retrieval was good enough or whethe
|
|
|
70
71
|
|
|
71
72
|
For `smartfetch`, MCP `structuredContent` always carries the projected JSON result. MCP calls default to `output_budget: "compact"` so agent hosts do not ingest large page/thread/link payloads unless they ask for them. The human-readable `content[0].text` defaults to compact text instead of duplicating that JSON payload, with separate caps for long body text, result, comment, link, and asset sections. Omitted counts are reported in the text view while the projected fields remain available through `structuredContent`; set `format: "json"` only when a host needs JSON repeated in the text channel. Set `output_budget: "balanced"` or `"full"` only for follow-up calls that explicitly need more structured content. For host-side integration, prefer `preferred_budget_chars`; use `context_mode` only as a backward-compatible coarse alias when numeric hints are not supplied. If neither is present, `headroom_tokens` keeps compact output by default and uses `balanced` only when there is enough room. `format: "markdown"` keeps the compact response shape and requests Markdown extraction when available.
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
When a `smartfetch` result is blocked, partial, or low-confidence, `structuredContent.research_handoff` stays small and metadata-only. It points downstream tools at the source URL and the projected evidence bundle: `pipeline`, `assessment`, `errors`, `assets`, `outbound_links`, and the full projected `structuredContent`. Heavy research agents or editable report/rendering tools can consume that bundle downstream, but `smart-web` itself remains the unified retrieval kernel and does not spawn those tools.
|
|
74
75
|
|
|
75
|
-
For `
|
|
76
|
+
For `smartsearch`, MCP calls now project both `structuredContent` and rendered text through the same compact/balanced/full budget controls. Compact search keeps enough ranked links for first-pass discovery while capping long snippets, notes, and search-to-crawl handoff items; `contextMaxCharacters` remains a final text-channel cap for legacy hosts. Use `output_budget: "full"` only for a known follow-up when the host really wants every returned snippet/result in `structuredContent`.
|
|
77
|
+
|
|
78
|
+
For `smartcrawl`, MCP summary calls now project both `structuredContent` and rendered text through compact/balanced/full budget controls, so broad docs/forum crawls do not flood agent context with every page, candidate, note, or error by default. `output_dir` export mode remains handle-first: successful export responses embed `resource_handle_manifest` in `structuredContent`, and export summaries include file:// re-open guidance for the summary, manifest, resource-handle JSON, and first Markdown document so agent hosts can resume from handles without parsing the full JSON first. The resource-handle manifest also carries ordered `recommended_resources` for hosts that need a ready-to-open summary, manifest, and first document without inferring role priority. Blocked exports label those paths as planned/unwritten and include retry guidance instead of presenting false file handles. Set `format: "json"` only for hosts that cannot consume `structuredContent` and intentionally need JSON repeated in the text channel.
|
|
76
79
|
|
|
77
80
|
Use budget presets this way:
|
|
78
81
|
|
|
@@ -80,7 +83,7 @@ Use budget presets this way:
|
|
|
80
83
|
- `balanced`: follow-up when the first pass found the right page but omitted useful body, result, comment, or link detail.
|
|
81
84
|
- `full`: explicit retrieval pass for a known relevant URL when the host can afford the larger `structuredContent` payload.
|
|
82
85
|
|
|
83
|
-
When compact output omits needed content, make a follow-up
|
|
86
|
+
When compact output omits needed content, make a follow-up call for the same URL/query/start site with a larger budget control instead of asking the model to infer from the compact text. Prefer `preferred_budget_chars` when the host knows its available response budget, or use `output_budget: "balanced"` / `"full"` for manual retries.
|
|
84
87
|
|
|
85
88
|
## Supported high-signal surfaces
|
|
86
89
|
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
-
import { renderSmartcrawl, runSmartcrawl } from "./smartcrawl.js";
|
|
4
|
-
import { renderSmartfetch, runSmartfetch } from "./smartfetch.js";
|
|
5
|
-
import { renderSmartsearch, runSmartsearch } from "./smartsearch.js";
|
|
3
|
+
import { projectSmartcrawlOutput, renderSmartcrawl, runSmartcrawl } from "./smartcrawl.js";
|
|
4
|
+
import { renderSmartfetch, resolveSmartfetchOutputBudget, runSmartfetch } from "./smartfetch.js";
|
|
5
|
+
import { projectSmartsearchOutput, renderSmartsearch, runSmartsearch } from "./smartsearch.js";
|
|
6
6
|
import { runBrowserSession } from "./browser-session.js";
|
|
7
7
|
import { sanitizeSmartWebTempEnv } from "./runtime-temp.js";
|
|
8
8
|
import { configureSettingsPath } from "./settings.js";
|
|
@@ -42,6 +42,17 @@ function intFlag(flags, key, fallback) {
|
|
|
42
42
|
const n = parseInt(v, 10);
|
|
43
43
|
return Number.isFinite(n) ? n : fallback;
|
|
44
44
|
}
|
|
45
|
+
function optionalIntFlag(flags, key) {
|
|
46
|
+
const v = flags[key];
|
|
47
|
+
if (v === undefined)
|
|
48
|
+
return undefined;
|
|
49
|
+
const n = parseInt(v, 10);
|
|
50
|
+
return Number.isFinite(n) ? n : undefined;
|
|
51
|
+
}
|
|
52
|
+
function budgetFlag(flags) {
|
|
53
|
+
const raw = strFlag(flags, "output-budget") || strFlag(flags, "budget");
|
|
54
|
+
return raw === "compact" || raw === "balanced" || raw === "full" ? raw : undefined;
|
|
55
|
+
}
|
|
45
56
|
// ---------------------------------------------------------------------------
|
|
46
57
|
// Help
|
|
47
58
|
// ---------------------------------------------------------------------------
|
|
@@ -57,7 +68,8 @@ Usage:
|
|
|
57
68
|
Search options:
|
|
58
69
|
--num <n> Number of results (default: 5)
|
|
59
70
|
--type <type> auto | fast | deep (default: auto)
|
|
60
|
-
--max-chars <n> Max
|
|
71
|
+
--max-chars <n> Max text characters (default: 10000)
|
|
72
|
+
--budget <preset> compact | balanced | full structured/text projection (default: compact)
|
|
61
73
|
|
|
62
74
|
Fetch options:
|
|
63
75
|
--target <target> auto | reddit_post | x_post | youtube_video | ... (default: auto)
|
|
@@ -65,6 +77,7 @@ Fetch options:
|
|
|
65
77
|
--timeout <ms> Timeout in milliseconds (default: 25000)
|
|
66
78
|
--download Prefer downloadable asset
|
|
67
79
|
--force-dynamic Skip light fetches, use Playwright
|
|
80
|
+
--budget <preset> compact | balanced | full structured/text projection (default: compact)
|
|
68
81
|
|
|
69
82
|
Crawl options:
|
|
70
83
|
--query <topic> Topic filter for ranking results
|
|
@@ -73,6 +86,7 @@ Crawl options:
|
|
|
73
86
|
--max-pages <n> Max pages to visit (default: 5)
|
|
74
87
|
--max-depth <n> Max recursive depth (default: 2)
|
|
75
88
|
--timeout <ms> Per-page timeout (default: 30000)
|
|
89
|
+
--budget <preset> compact | balanced | full structured/text projection (default: compact)
|
|
76
90
|
|
|
77
91
|
Global options:
|
|
78
92
|
--json Output raw JSON instead of rendered text
|
|
@@ -82,12 +96,19 @@ Global options:
|
|
|
82
96
|
// Commands
|
|
83
97
|
// ---------------------------------------------------------------------------
|
|
84
98
|
async function cmdSearch(query, flags) {
|
|
85
|
-
const
|
|
99
|
+
const budgetDecision = resolveSmartfetchOutputBudget({
|
|
100
|
+
outputBudget: budgetFlag(flags),
|
|
101
|
+
preferredBudgetChars: optionalIntFlag(flags, "preferred-budget-chars"),
|
|
102
|
+
headroomTokens: optionalIntFlag(flags, "headroom-tokens"),
|
|
103
|
+
});
|
|
104
|
+
const rawResponse = await runSmartsearch({
|
|
86
105
|
query,
|
|
87
106
|
numResults: intFlag(flags, "num", 5),
|
|
88
107
|
searchType: strFlag(flags, "type") || "auto",
|
|
89
108
|
contextMaxCharacters: intFlag(flags, "max-chars", 10000),
|
|
90
109
|
});
|
|
110
|
+
const response = projectSmartsearchOutput(rawResponse, budgetDecision.preset);
|
|
111
|
+
response.budget = { ...response.budget, source: budgetDecision.source, reason: budgetDecision.reason };
|
|
91
112
|
if (flags.json !== undefined) {
|
|
92
113
|
console.log(JSON.stringify(response, null, 2));
|
|
93
114
|
}
|
|
@@ -97,14 +118,24 @@ async function cmdSearch(query, flags) {
|
|
|
97
118
|
}
|
|
98
119
|
async function cmdFetch(url, flags) {
|
|
99
120
|
const format = strFlag(flags, "format") || "markdown";
|
|
100
|
-
const
|
|
121
|
+
const options = {
|
|
101
122
|
url,
|
|
102
123
|
target: strFlag(flags, "target") || "auto",
|
|
103
124
|
timeoutMs: intFlag(flags, "timeout", 25000),
|
|
104
125
|
download: strFlag(flags, "download") !== undefined,
|
|
105
126
|
forceDynamic: strFlag(flags, "force-dynamic") !== undefined,
|
|
106
127
|
includeMarkdown: format === "markdown",
|
|
107
|
-
}
|
|
128
|
+
};
|
|
129
|
+
const outputBudgetPreset = budgetFlag(flags);
|
|
130
|
+
const preferredBudgetChars = optionalIntFlag(flags, "preferred-budget-chars");
|
|
131
|
+
const headroomTokens = optionalIntFlag(flags, "headroom-tokens");
|
|
132
|
+
if (outputBudgetPreset !== undefined)
|
|
133
|
+
options.outputBudgetPreset = outputBudgetPreset;
|
|
134
|
+
if (preferredBudgetChars !== undefined)
|
|
135
|
+
options.preferredBudgetChars = preferredBudgetChars;
|
|
136
|
+
if (headroomTokens !== undefined)
|
|
137
|
+
options.headroomTokens = headroomTokens;
|
|
138
|
+
const output = await runSmartfetch(options, { runBrowserSession, runSmartsearch });
|
|
108
139
|
if (flags.json !== undefined) {
|
|
109
140
|
console.log(JSON.stringify(output, null, 2));
|
|
110
141
|
}
|
|
@@ -124,7 +155,14 @@ async function cmdCrawl(url, flags) {
|
|
|
124
155
|
const crawlQuery = strFlag(flags, "query");
|
|
125
156
|
if (crawlQuery)
|
|
126
157
|
opts.query = crawlQuery;
|
|
127
|
-
const
|
|
158
|
+
const rawResponse = await runSmartcrawl(opts);
|
|
159
|
+
const budgetDecision = resolveSmartfetchOutputBudget({
|
|
160
|
+
outputBudget: budgetFlag(flags),
|
|
161
|
+
preferredBudgetChars: optionalIntFlag(flags, "preferred-budget-chars"),
|
|
162
|
+
headroomTokens: optionalIntFlag(flags, "headroom-tokens"),
|
|
163
|
+
});
|
|
164
|
+
const response = projectSmartcrawlOutput(rawResponse, budgetDecision.preset);
|
|
165
|
+
response.budget = { ...response.budget, source: budgetDecision.source, reason: budgetDecision.reason };
|
|
128
166
|
if (flags.json !== undefined) {
|
|
129
167
|
console.log(JSON.stringify(response, null, 2));
|
|
130
168
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,gBAAgB,EAAE,6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AAsC,CAAC,CAAC;gBAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAAC,CAAC;YACpF,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAC1B,MAAK;QAEP,KAAK,OAAO;YACV,IAAI,CAAC,GAAG,EAAE,CAAC;gBAAC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;gBAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAAC,CAAC;YACpF,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YAC1B,MAAK;QAEP;YACE,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAA;YAC9C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAA;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -131,7 +131,22 @@ export function projectSmartfetchOutput(output, policy = resolveSmartfetchBudget
|
|
|
131
131
|
outbound_links: [...output.outbound_links],
|
|
132
132
|
evidence: { ...output.evidence },
|
|
133
133
|
...(output.assessment ? { assessment: { ...output.assessment, signals: [...output.assessment.signals] } } : {}),
|
|
134
|
-
...(output.pipeline ? {
|
|
134
|
+
...(output.pipeline ? {
|
|
135
|
+
pipeline: {
|
|
136
|
+
...output.pipeline,
|
|
137
|
+
acquire: {
|
|
138
|
+
...output.pipeline.acquire,
|
|
139
|
+
...(output.pipeline.acquire.attempt_map ? { attempt_map: output.pipeline.acquire.attempt_map.map((item) => ({ ...item })) } : {}),
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
} : {}),
|
|
143
|
+
...(output.research_handoff ? {
|
|
144
|
+
research_handoff: {
|
|
145
|
+
...output.research_handoff,
|
|
146
|
+
downstream: [...output.research_handoff.downstream],
|
|
147
|
+
consume: [...output.research_handoff.consume],
|
|
148
|
+
},
|
|
149
|
+
} : {}),
|
|
135
150
|
};
|
|
136
151
|
if (next.post) {
|
|
137
152
|
for (const [field, maxChars] of [["text", policy.maxPostTextChars], ["selftext", policy.maxPostTextChars], ["markdown", policy.maxPostMarkdownChars]]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budget.js","sourceRoot":"","sources":["../../src/extraction/budget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAiC5C,MAAM,yBAAyB,GAA2D;IACxF,OAAO,EAAE;QACP,IAAI,EAAE,oBAAoB;QAC1B,gBAAgB,EAAE,IAAI;QACtB,oBAAoB,EAAE,IAAI;QAC1B,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAAE,EAAE;QACpB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,GAAG;QACtB,gBAAgB,EAAE,GAAG;KACtB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,qBAAqB;QAC3B,gBAAgB,EAAE,KAAK;QACvB,oBAAoB,EAAE,KAAK;QAC3B,cAAc,EAAE,EAAE;QAClB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,GAAG;QACrB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,IAAI;KACvB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,KAAK;QACvB,oBAAoB,EAAE,KAAK;QAC3B,cAAc,EAAE,GAAG;QACnB,eAAe,EAAE,GAAG;QACpB,gBAAgB,EAAE,GAAG;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Q,IAAI,IAAI,CAAC,UAAU;QAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAA;IAC5E,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/mcp-server.js
CHANGED
|
@@ -2,7 +2,9 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { SMART_WEB_PROFILE_NAME_DESCRIPTION, SMART_WEB_PROFILE_NAME_PATTERN } from "./browser-session.js";
|
|
4
4
|
import { SMARTFETCH_TARGETS } from "./smartfetch/targets.js";
|
|
5
|
+
import { projectSmartcrawlOutput } from "./smartcrawl.js";
|
|
5
6
|
import { resolveSmartfetchOutputBudget } from "./smartfetch.js";
|
|
7
|
+
import { projectSmartsearchOutput } from "./smartsearch.js";
|
|
6
8
|
import { renderCoupang, renderDart, renderDrugSafety, renderFineDust, renderFoodSafety, renderGeeknews, renderLaw, renderNaverNews, renderNaverShopping, renderPublicRestroom, renderRealEstate, renderSpellCheck, renderStock, renderSubway, renderWeather, renderZipcode, runCoupang, runDart, runDrugSafety, runFineDust, runFoodSafety, runGeeknews, runLaw, runNaverNews, runNaverShopping, runPublicRestroom, runRealEstate, runSpellCheck, runStock, runSubway, runWeather, runZipcode, } from "./korea/index.js";
|
|
7
9
|
const ISSUE_REPORT_GUIDANCE = "If smart-web returns reproducible incorrect or misleading output, open a GitHub issue on jojo-labs/smart-web with the exact input, arguments, observed output, expected behavior, and version. Skip obvious transient network/auth/rate-limit failures unless smart-web misclassified them.";
|
|
8
10
|
function capMcpText(text, maxCharacters, label) {
|
|
@@ -21,7 +23,11 @@ export function createSmartWebServer(version, runtime) {
|
|
|
21
23
|
query: z.string().min(1).describe("Search-engine style query. Use this when the user gave a topic or keywords rather than a direct URL."),
|
|
22
24
|
numResults: z.number().int().min(1).max(20).optional().describe("Number of search results to return"),
|
|
23
25
|
type: z.enum(["auto", "fast", "deep"]).optional().describe("Search depth hint"),
|
|
24
|
-
contextMaxCharacters: z.number().int().min(1000).max(20000).optional().describe("Maximum
|
|
26
|
+
contextMaxCharacters: z.number().int().min(1000).max(20000).optional().describe("Maximum text content cap for legacy hosts; output_budget/preferred_budget_chars also project structuredContent."),
|
|
27
|
+
output_budget: z.enum(["compact", "balanced", "full"]).optional().describe("Explicit search output projection. Defaults to compact; use full only when the host really wants all result snippets and crawl handoff items."),
|
|
28
|
+
preferred_budget_chars: z.number().int().min(0).optional().describe("Preferred host/RPC budget hint. Projects search structuredContent and text to compact/balanced/full before rendering."),
|
|
29
|
+
context_mode: z.enum(["compact", "balanced", "full"]).optional().describe("Coarse alias/backcompat fallback when no numeric budget control is supplied."),
|
|
30
|
+
headroom_tokens: z.number().int().min(0).optional().describe("Approximate remaining host context tokens. Uses compact/balanced fallback only; request full explicitly with output_budget or preferred_budget_chars."),
|
|
25
31
|
site_crawl: z.boolean().optional().describe("After search, hand off into smartcrawl when a crawl_url or site: operator is available"),
|
|
26
32
|
crawl_url: z.string().optional().describe("Optional starting URL for the smartcrawl handoff"),
|
|
27
33
|
crawl_mode: z.enum(["auto", "board", "docs"]).optional().describe("Traversal hint for the smartcrawl handoff"),
|
|
@@ -37,8 +43,14 @@ export function createSmartWebServer(version, runtime) {
|
|
|
37
43
|
idempotentHint: true,
|
|
38
44
|
openWorldHint: true,
|
|
39
45
|
},
|
|
40
|
-
}, async ({ query, numResults, type, contextMaxCharacters, site_crawl, crawl_url, crawl_mode, crawl_limit, crawl_max_pages, crawl_max_depth, crawl_timeout_ms }) => {
|
|
41
|
-
const
|
|
46
|
+
}, async ({ query, numResults, type, contextMaxCharacters, output_budget, preferred_budget_chars, context_mode, headroom_tokens, site_crawl, crawl_url, crawl_mode, crawl_limit, crawl_max_pages, crawl_max_depth, crawl_timeout_ms }) => {
|
|
47
|
+
const budgetDecision = resolveSmartfetchOutputBudget({
|
|
48
|
+
outputBudget: output_budget,
|
|
49
|
+
preferredBudgetChars: preferred_budget_chars,
|
|
50
|
+
contextMode: context_mode,
|
|
51
|
+
headroomTokens: headroom_tokens,
|
|
52
|
+
});
|
|
53
|
+
const rawOutput = await runtime.runSmartsearch({
|
|
42
54
|
query,
|
|
43
55
|
...(numResults === undefined ? {} : { numResults }),
|
|
44
56
|
...(type === undefined ? {} : { searchType: type }),
|
|
@@ -51,6 +63,16 @@ export function createSmartWebServer(version, runtime) {
|
|
|
51
63
|
...(crawl_max_depth === undefined ? {} : { crawlMaxDepth: crawl_max_depth }),
|
|
52
64
|
...(crawl_timeout_ms === undefined ? {} : { crawlTimeoutMs: crawl_timeout_ms }),
|
|
53
65
|
});
|
|
66
|
+
const projectedOutput = projectSmartsearchOutput(rawOutput, budgetDecision.preset);
|
|
67
|
+
const output = {
|
|
68
|
+
...projectedOutput,
|
|
69
|
+
source: "smartsearch",
|
|
70
|
+
budget: {
|
|
71
|
+
...projectedOutput.budget,
|
|
72
|
+
source: budgetDecision.source,
|
|
73
|
+
reason: budgetDecision.reason,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
54
76
|
const rendered = await runtime.renderSmartsearch(output);
|
|
55
77
|
return {
|
|
56
78
|
structuredContent: output,
|
|
@@ -74,7 +96,11 @@ export function createSmartWebServer(version, runtime) {
|
|
|
74
96
|
follow_pagination: z.boolean().optional().describe("Follow next or more-style pagination links during exploration"),
|
|
75
97
|
scroll_steps: z.number().int().min(0).max(12).optional().describe("How many scroll attempts to use for scroll-driven pages"),
|
|
76
98
|
timeout_ms: z.number().int().min(3000).max(120000).optional().describe("Crawl timeout budget per page"),
|
|
77
|
-
|
|
99
|
+
output_budget: z.enum(["compact", "balanced", "full"]).optional().describe("Explicit summary output projection. Defaults to compact; output_dir export mode still returns resource handles rather than inline documents."),
|
|
100
|
+
preferred_budget_chars: z.number().int().min(0).optional().describe("Preferred host/RPC budget hint. Projects summary structuredContent and text to compact/balanced/full."),
|
|
101
|
+
context_mode: z.enum(["compact", "balanced", "full"]).optional().describe("Coarse alias/backcompat fallback when no numeric budget control is supplied."),
|
|
102
|
+
headroom_tokens: z.number().int().min(0).optional().describe("Approximate remaining host context tokens. Uses compact/balanced fallback only; request full explicitly with output_budget or preferred_budget_chars."),
|
|
103
|
+
format: z.enum(["json", "text", "markdown"]).optional().describe("Text rendering format for the human-readable content. Defaults to compact rendered text while structuredContent carries the projected result; use json only when the host needs JSON duplicated in content[0].text."),
|
|
78
104
|
},
|
|
79
105
|
annotations: {
|
|
80
106
|
title: "Smart Crawl",
|
|
@@ -83,7 +109,7 @@ export function createSmartWebServer(version, runtime) {
|
|
|
83
109
|
idempotentHint: false,
|
|
84
110
|
openWorldHint: true,
|
|
85
111
|
},
|
|
86
|
-
}, async ({ url, output_dir, query, mode, limit, max_pages, max_depth, include_patterns, exclude_patterns, same_origin_only, follow_pagination, scroll_steps, timeout_ms, format }) => {
|
|
112
|
+
}, async ({ url, output_dir, query, mode, limit, max_pages, max_depth, include_patterns, exclude_patterns, same_origin_only, follow_pagination, scroll_steps, timeout_ms, output_budget, preferred_budget_chars, context_mode, headroom_tokens, format }) => {
|
|
87
113
|
if (output_dir === undefined && max_pages !== undefined && max_pages > 20) {
|
|
88
114
|
throw new Error("smartcrawl summary mode supports max_pages up to 20; set output_dir to use docs export budgets");
|
|
89
115
|
}
|
|
@@ -117,7 +143,13 @@ export function createSmartWebServer(version, runtime) {
|
|
|
117
143
|
content: [{ type: "text", text: requestedFormat === "json" ? JSON.stringify(structuredContent, null, 2) : await runtime.renderSmartcrawlExport(output) }],
|
|
118
144
|
};
|
|
119
145
|
}
|
|
120
|
-
const
|
|
146
|
+
const budgetDecision = resolveSmartfetchOutputBudget({
|
|
147
|
+
outputBudget: output_budget,
|
|
148
|
+
preferredBudgetChars: preferred_budget_chars,
|
|
149
|
+
contextMode: context_mode,
|
|
150
|
+
headroomTokens: headroom_tokens,
|
|
151
|
+
});
|
|
152
|
+
const rawOutput = await runtime.runSmartcrawl({
|
|
121
153
|
url,
|
|
122
154
|
...(query === undefined ? {} : { query }),
|
|
123
155
|
...(mode === undefined ? {} : { mode }),
|
|
@@ -132,15 +164,24 @@ export function createSmartWebServer(version, runtime) {
|
|
|
132
164
|
...(timeout_ms === undefined ? {} : { timeoutMs: timeout_ms }),
|
|
133
165
|
});
|
|
134
166
|
const requestedFormat = format || "text";
|
|
135
|
-
const
|
|
167
|
+
const projectedOutput = projectSmartcrawlOutput(rawOutput, budgetDecision.preset);
|
|
168
|
+
const structuredContent = {
|
|
169
|
+
...projectedOutput,
|
|
170
|
+
mode: "summary",
|
|
171
|
+
budget: {
|
|
172
|
+
...projectedOutput.budget,
|
|
173
|
+
source: budgetDecision.source,
|
|
174
|
+
reason: budgetDecision.reason,
|
|
175
|
+
},
|
|
176
|
+
};
|
|
136
177
|
return {
|
|
137
178
|
structuredContent,
|
|
138
|
-
content: [{ type: "text", text: requestedFormat === "json" ? JSON.stringify(structuredContent, null, 2) : await runtime.renderSmartcrawl(
|
|
179
|
+
content: [{ type: "text", text: requestedFormat === "json" ? JSON.stringify(structuredContent, null, 2) : await runtime.renderSmartcrawl(projectedOutput, requestedFormat) }],
|
|
139
180
|
};
|
|
140
181
|
});
|
|
141
182
|
server.registerTool("smartfetch", {
|
|
142
183
|
title: "Smart Fetch",
|
|
143
|
-
description: `Fetch and normalize one known URL or shortlink. Use this first for direct user-supplied URLs, browser-rendered pages, social posts, and videos; YouTube watch/short/embed links get best-effort transcript enrichment when public captions are available. Do not use smartsearch when the user already provided the URL, and use smartcrawl only when you need multiple pages from the same site. Use exactly one budget control per call: output_budget, preferred_budget_chars, context_mode, or headroom_tokens. ${ISSUE_REPORT_GUIDANCE}`,
|
|
184
|
+
description: `Fetch and normalize one known URL or shortlink. Use this first for direct user-supplied URLs, browser-rendered pages, social posts, and videos; YouTube watch/short/embed links get best-effort transcript enrichment when public captions are available. smartfetch is the unified retrieval kernel: default structuredContent carries pipeline acquire attempt_map, assessment, and research_handoff metadata for downstream evidence/report consumers when results are partial or blocked. Do not use smartsearch when the user already provided the URL, and use smartcrawl only when you need multiple pages from the same site. Use exactly one budget control per call: output_budget, preferred_budget_chars, context_mode, or headroom_tokens. ${ISSUE_REPORT_GUIDANCE}`,
|
|
144
185
|
inputSchema: {
|
|
145
186
|
url: z.string().min(1).describe("Direct URL or shortlink to fetch. Prefer this tool when the user already supplied a URL."),
|
|
146
187
|
target: z.enum(SMARTFETCH_TARGETS).optional().describe("Content type hint. Leave auto for normal use; youtube_video is for actual video routes such as watch, shorts, embed, live, or youtu.be links."),
|