Repo rules (CONTRIBUTING.md)
The project root CONTRIBUTING.md defines the basics: fork
develop, branch off it, and open pull requests against
develop. For customisation and third-party extensions,
see the rest of this documentation. For adding built-in engines or
bang commands, follow the patterns in the codebase (see below). If you
use AI, have your code reviewed and ensure it meets the coding
standards and is not overly engineered.
Coding standards
These are summarised from CONTRIBUTING.md. Follow them so
contributions stay consistent.
-
Functions that return a value — use arrow functions
(e.g.
const getX = () => value,const map = (x) => x.id). -
Functions that do not return (side-effect only) —
use regular
functiondeclarations (e.g.function init() { ... }). -
Internal / private helpers — prepend with
_(e.g._parseQuery,_formatDate). This applies to functions or symbols that are not part of the public API of a module. -
CSS — Reuse existing app classes where possible so
plugins and themes match the UI. See
Styling
for a list of classes and variables. Prefer CSS variables (e.g.
var(--text-primary),var(--bg-light)) so themes and light/dark mode work. -
Structure — Keep everything modular. Follow the
current folder structure: one folder per plugin (with
index.js/index.ts, optionaltemplate.html,style.css,script.js); engines as single files or one folder per engine under the engines directory.
Built-in plugins (commands and slots)
Built-ins live in
src/server/extensions/commands/builtins/. Each built-in
is a folder (e.g. help, ip,
ai-summary) with the same structure as
plugins in data/plugins/:
-
index.jsorindex.ts— entry point (required). -
Optional:
template.html,style.css,script.js.
Export a bang command (as export default or
export const command) or a slot /
slotPlugin — same contract as
plugin bang commands and
slot plugins. The app
scans src/server/extensions/commands/builtins/ at
startup.
Built-in engines
Built-in engines live in
src/server/extensions/engines/ as TypeScript (or
JavaScript) files or folders. Use the same contract as
custom engines: name,
executeSearch, optional bangShortcut,
settingsSchema, configure,
outgoingHosts. Register the engine in the registry so it
appears in Settings → Engines and in search.