Conversation
Collapse the per-vertical search types into a single `search` that sends no search_type, so an unscoped query routes across the web and every dataset the plan covers. Scoping becomes explicit and validated: --include-source and --exclude-source are checked against the live catalog (unknown ids come back with suggestions), alongside --source-bias, date, country, -n 1-100 and a character-count --response-length (default 4000, held locally). Add `sources [need]` to rank the catalog for the data needed, with example queries and plan coverage. Slim `contents` to summary, response length, extract effort and screenshot. Align `deepresearch`: fast by default, PDF opt-in, --workflow templates, `status [id] --wait`, `steer`, explicit `share --off`, a --yes guard on delete outside a terminal, checkpoint hand-back when `watch` is not interactive, retries on transient status errors, and no agent transcript in status output. Fix the interactive checkpoint reply shapes for planning questions and source review. API error messages now say what to do next while keeping http_<status> codes. Search and contents JSON carry a `hint` only when results need explaining. `answer`, `batch` and `workflows` stay callable but leave the main help. The agent skill, references and README are rewritten to match.
Treat a leading search type as legacy only when the form is unambiguous (a quoted or piped query), so `valyu search news today` keeps both words. Accept dataset ids the plan lists even when the catalog does not, and suggest them for typos. Leave structured records whole when holding content to --response-length, since trials arrive as JSON strings. Give a bare 403 Forbidden the rejected-key advice, keep key=value values with leading zeros as strings, stop --summary from swallowing a following URL, add the checkpoint hint to `deepresearch status` JSON, report unreadable --file paths plainly, and fix a help-text line continuation.
Scripts written against earlier versions should not break on upgrade, so the old forms stay accepted without appearing in --help or the skill: - `valyu search <type> <query>` sends exactly the request it used to, with the same fixed scope and default length, and prints a note to stderr. - --max-price, --relevance-threshold, --search-type, --instructions, --fast-mode, --url-only and --no-tool-call pass through as before. - Named lengths (short, medium, large, max) work for search and contents, and contents keeps --length, --max-price-dollars and --structured. - deepresearch create keeps --output-format, --no-pdf and --alert-email-url. - `sources categories` lists the catalog. The compatibility code lives in src/lib/compat.ts.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the CLI's tools into a smaller surface, in which each command has one clear job:
valyu search <query>valyu sources [need]valyu contents <url>...valyu deepresearch ...Nothing about scripting changes: JSON when piped or with
-q, stdin input,{"error":{"message","code"}}on stderr, exit code 1 on error.Why
The default search never reached the specialised datasets. With no type given,
valyu search "<q>"sentsearch_type: "web". The same query ("GLP-1 receptor agonists cardiovascular outcomes" -n 5):main:results_by_source: {"web": 5, "proprietary": 0}, first result 24,991 charactersThe search types overlapped and went stale.
paper/bio/finance/sec/patent/economics/newseach hardcoded a list of sources. A question about a biotech's trial pipeline legitimately matches four of them, and a fixed list can't track a catalog that keeps changing. Routing already picks corpora per query, so the types are no longer part of the surface (old scripts still work, see Compatibility) and scoping is an explicit, validated option.Output was larger than it needed to be:
-lto change)valyu sources -qdeepresearch status -qon a sample completed taskmessagestranscript is dropped)What changed
searchsearch_typeis sent, so an unscoped search covers the web plus every dataset on the plan and can never fail on access.--include-source,--exclude-source,--source-bias,--start-date,--end-date,--country.valyu/valyu-fedwatch) aren't in the catalog.pubmedis rejected withdid you mean: valyu/valyu-pubmed?rather than silently rewritten.--exclude-sourceare refused, because the API doesn't expand them there.-naccepts 1-100.-l, --response-lengthtakes a character count (500-100000, default 4000). Text content is held to it locally, since some corpora return longer chunks than requested. Structured records (e.g. clinical trials, which arrive as JSON strings) are left whole so they still parse.hintonly when the results need explaining:sourcesvalyu sources "<the data you need>"ranks the catalog and shows each dataset's example queries. It falls back to local ranking if the ranking endpoint is unavailable.valyu sourceslists the catalog grouped by category. Datasets outside the plan are marked LOCKED (lockedin JSON), and the plan name is shown.contents--summary [instructions],-l, --response-length <chars>(default 30000),--extract-effort,--screenshot. At most 10 URLs; URLs can be piped in.--summary https://...no longer swallows the URL as the instruction (this was already broken onmain).total_cost_dollars.hintappears when nothing could be extracted or pages were truncated.deepresearchcreate:--modedefaults tofast.--pdf.--charts.--workflow <slug> -P key=value [--workflow-version n]to run a saved template (the template's own mode applies unless--modeis passed). Values with leading zeros (a CIK,0700) stay strings.status [id]:hintwith the exactrespondpayload.--wait <s>blocks up to that long and returns early when the task finishes or pauses at a checkpoint.watch:-q, a task paused at a checkpoint returns its status with ahintnaming the exactrespondpayload. It used to fall into interactive prompts.maxmode.steer <id> <instruction>replacesupdate(kept as an alias).share <id>publishes andshare <id> --offunpublishes. It used to toggle, which isn't safe to repeat.deleteoutside a terminal requires--yesinstead of waiting on a prompt.cancel,steer,deleteandsharenow print JSON in JSON mode.answersas[{question, answer}], the documented shape (it was an object keyedq0,q1, ...)included_domainsalongsideexcluded_domainsErrors
API errors keep their
http_<status>codes, and the message now says what to do next:Forbidden: re-loginA 403 that is a limit (e.g. more than 20 results) is passed through as-is instead of being blamed on the key.
Kept, but out of the main help
answer,batchandworkflowsstill work unchanged but are hidden fromvalyu --helpand the agent skill. Answers are best written from search results, templates now run throughdeepresearch create --workflow, and batches are many deepresearch tasks. Whether to remove them or bring them back is a follow-up decision.Docs
SKILL.mdis rewritten around the four commands. It covers when to scope, query-writing rules, readinghint, and when not to start deep research.references/search.md,contents.md,deepresearch.mdanderror-codes.mdare updated, andreferences/sources.mdis new.answer.mdandworkflows.mdare removed from the skill.Compatibility
Scripts written against earlier versions keep working after an upgrade: every old form is still accepted, just no longer shown in
--helpor the skill. The compatibility code lives insrc/lib/compat.ts.Still accepted, and sending the same request as before:
valyu search <type> <query>: all eight types. Same fixed scope and default length as before, plus a note on stderr.searchflags:--max-price,--relevance-threshold,--search-type,--instructions,--fast-mode,--url-only,--no-tool-call.short/medium/large/maxfor-lon search and contents.contentsflags:--length,--max-price-dollars,--structured,--structured-file.deepresearch createflags:--output-format,--no-pdf,--alert-email-url.deepresearch update(alias ofsteer),sources list,sources categories, andanswer/batch/workflows.I checked this by running v1.2.3 and this branch side by side on 27 old-style invocations with
fetchmocked, and diffing the request bodies. Every one exits 0, and all of them send the same request except these deliberate default changes:valyu search "<q>"search_type: web, API default lengthvalyu contents <url>response_length: medium(50,000)valyu deepresearch create "<brief>"standard, markdown + PDFfast, markdownBehaviour that did change:
sharepublishes rather than toggles. Useshare --offto unpublish.--yesoutside a terminal.deepresearch deletethere requires--yesinstead of waiting on a prompt.deepresearch status/watchno longer includemessages.sources categoriesreturns the catalog listing. It used to return the bare category list.contents --async/--watch/--webhook-urlandcontents jobsare gone, and a call takes at most 10 URLs.Decisions made along the way
valyu search paper "..."is a scope the caller chose, so it's honoured exactly. The new surface just stops advertising it.hintis additive. It's absent when there's nothing to say, sojq '.results'pipelines are unaffected.--response-lengthis honoured in the JSON output (except for structured records), so the flag means what it says.--include-sourceis not validated locally. Deep research can use datasets that plain search can't reach, so a search-side check would reject valid ids.Test plan
pnpm typecheck,pnpm test(82 tests; new: source resolution, ranking, plan coverage, hints, clipping, parsers, error messages, the non-interactive checkpoint path, transcript stripping),pnpm buildvalyu-fedwatch), domain-scoped, stdin, old typed forms, old flags and named lengthssources: ranked (semantic), full listing,--category,sources list,sources categories, terminal renderingcontents: full text,--summarywith an instruction,--summary <url>, stdin, a 404 URL, the 11-URL limit, and the old--length/ named sizes /--max-price-dollarsfetchmocked: 27 old-style invocations across all commands, including hiddenanswer/workflows run/batch createdeepresearch:create(piped brief,--metadata)statuswith and without an idsteer,updatealias,cancel,watchto completiondeleteguard without--yesshare, because it publishes a public linkdelete --yes, because it's irreversiblewatch, because afasttask with--hitl plan-reviewcompleted without pausing (unit-tested)