Default to using Bun instead of Node.js
- Use
bun <file>instead ofnode <file>orts-node <file> - Use
bun testinstead ofjestorvitest - Use
bun build <file.html|file.ts|file.css>instead ofwebpackoresbuild - Use
bun installinstead ofnpm installoryarn installorpnpm install - Use
bun run <script>instead ofnpm run <script>oryarn run <script>orpnpm run <script> - Check
node_modules/bun-types/docs/**.mdfor bun API before use any node API - Bun automatically loads .env, so don't use dotenv
This repository contains an OpenCode plugin that exposes a web search capability as a custom tool
- The primary tool is
websearch_cited - The tool calls provider web search endpoints directly over HTTP
- The tool returns markdown output with inline citations and a Sources list when available
- Keep the implementation minimal and focused on the
websearch_citedtool - Prefer small, single-purpose functions, use aliases when import
- Since we are building a plugin, minimal dependencies will be a better design choice
- Let errors propagate instead of swallowing them, follow the
fast failprincipal, let callers to deal with the error - Do not add comments in code, logs, or exceptions beyond what is strictly necessary
- We must NEVER have type any anywhere, unless absolutely, positively necessary
- If you are working with an external API, check node_modules for the type definitions as needed instead of assuming things
- After any change of code, use
bun checkto passeslintandtsc
Use bun test:agent to run tests, this is specific for agents