Files
jason.woltjeandClaude Opus 5.5 ae74c25fdd web verbs: grant before the long wait, abort signal to the backend, one query limit (vikunja:19/307, row 145)
Jason-approved merge, rebased: git diff 813671596..6219c5c8c from
work/vikunja-19-307, stacked on 295. Business reviewer verdict 84c9c4be
approve on 6219c5c8c; Jason resolved merge decision 17bb9efc via the CLI.

Conflict resolution only. packages/harness/src/tools.mjs conflicted with
row 132 (0e947c216): both sides add a constant after TASK_PAGE_MAX. Kept
row 132's ORGANIZATION_KEYS, then 307's WEB_QUERY_MAX. Three other paths
that refactor also changed merged without conflict. For each, the +/-
lines on the new base equal the source commit's. The other nine paths are
the source blobs. Filbert reviews the rebased diff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 17:50:59 -05:00

21 lines
1.2 KiB
JavaScript

// The "searxng-url" search-source plug-in (REQ-PLUG-2, decision 0b81b0c5): web_search answered by
// an operator-supplied SearXNG at the business var web.searxng, through packages/discord/src/web.mjs's
// webSearch (query limits, timeout, a capped answer, at most 10 results of title, url, snippet).
//
// search(settings, query, deps) resolves { query, total, results } or throws a WebRefusal.
// settings { searxng: <instance base url> }, from the business var web.searxng
// deps web.mjs's network seams, for tests
// signal (4th argument, { signal }) an AbortSignal the broker fires at its deadline; the request is
// destroyed when it does
import { WEB_REFUSAL, WebRefusal, loadWebConfig, webSearch } from "../../../discord/src/web.mjs";
export const interfaceVersion = 1;
// No web.searxng set is an unavailable source, not a bug.
export function search(settings, query, deps, { signal } = {}) {
if (settings?.searxng === undefined) throw new WebRefusal(WEB_REFUSAL.SEARCH_DOWN);
const config = loadWebConfig({ searxng: settings?.searxng });
const run = { ...config, signal };
return deps === undefined ? webSearch(run, { query }) : webSearch(run, { query }, deps);
}