Grilling: config surface for endpoint and token #5
Notifications
Due Date
No due date set.
Depends on
#2 Research: verified opencode v2 plugin API
haylan/fastcrw-opencode-websearch
#3 Research: fastCRW /v1/search API contract
haylan/fastcrw-opencode-websearch
Reference: haylan/fastcrw-opencode-websearch#5
Reference in new issue
Block a user
Map: #1
Question
Given the verified plugin options mechanism, finalise the config surface: option names, defaults, env var names and precedence (options > env > default), validation, how the token is supplied without living in
opencode.json,limitclamping, and behaviour when endpoint/token are missing. Decided direction: options with env fallback.Resolved with the user. Glossary in CONTEXT.md.
Options:
baseURL,apiKey,limit,lang,tbs. Env:CRW_API_URL,CRW_API_KEY. Precedence options > env > default.http://localhost:3000; trailing slash stripped.limitdefault 8, clamped 1..20; invalid falls back to 8, never throws.lang/tbsexposed, omitted from the request when unset;tbsinqdr:h|d|w|m|y.setup; malformedbaseURL, badtbsor non-stringlangmakessetupthrow loudly, naming the option and value.fastcrw(display "fastCRW"); user chose the plain id knowingly over a namespaced one. Plugin id left to the packaging ticket.fastcrwthe default and only provider; no fallback to built-ins.Runtime checks for the spec (docs silent): (1) can built-in providers be removed/disabled, else fall back to
"websearch": false+ explicitfastcrw; (2) a throwingsetupdisables only this plugin, not opencode startup; (3) configwebsearch.providervseditor.default.setprecedence.