// PART 06
App commands and installs
Two mechanisms connect chat to suite applications: the command catalog (what the model may call) and the install/usage surfaces (what users can add and how popularity is counted). Both are code-defined and both are auditable.
The command catalog
A curated catalog of AppCommand entries
(botserver/src/apps/commands/app_command.rs) describes chat-callable
operations per app:
- each entry carries an app id, a name (
docs.create), a label, a summary, named parameters with free-text descriptions, a deep link and a singleadmin_onlyboolean; - verb-to-route bindings live in
botserver/src/apps/commands/verb_endpoints/…(e.g. the office endpoints table), with composite Docs/Sheet dispatchers inbotserver/src/core/bot/api_catalog/docs_verbs.rsandsheet_verbs.rs.
Reachability is uniform: the model emits a {"__api_call__": {...}} block,
discovers the command with api.find, and executes it with api.exec or the
curated verb. There is no separate editor protocol.
| Example verb family | Representative verbs |
|---|---|
| Docs | docs.list, docs.create, docs.update, docs.get, docs.save, docs.delete, docs.search, docs.outline, docs.track_changes.enable, docs.compare |
| Sheet | sheet.create, sheet.cells.set, sheet.import, sheet.export, sheet.chart.create, sheet.pivot.create |
| Slides | slides.create, slides.slide.add, slides.media.add, slides.theme.set, slides.export |
Parity limits are documented, not hidden: parameters are names + descriptions
(no typed JSON schema), authorization is the single admin_only flag plus
verb-suffix-derived consent classes, and undo is per-request (the editor stack
is recreated on every call), not an agent-batch undo.
Gating
Every __api_call__ runs the consent gate (api_call/handle.rs): the action
is classified by verb suffix and HTTP method, a pending consent card is
created when no grant matches, and destructive classes always prompt. The
catalog filters admin_only entries for non-admin users via
resolve_user_role — the injected manifest shortens per role, and the
executor enforces the same rule server-side.
Installs and usage
| Surface | Behavior | Where |
|---|---|---|
POST /api/apps/install |
records an install; counters are in-process (AppInstallStats.counts) |
apps/install_handler.rs |
GET /api/apps/install/stats |
serves the install counters | apps/mod.rs |
GET /api/commands/stats |
command usage stats feeding the LLM “common commands” tail | apps/command_stats_handler.rs |
top_commands |
ranks usage for the prompt tail | apps/installs.rs |
The counters are deliberately volatile (process lifetime, no persistence);
the frontend overlays per-user state in localStorage. Popularity ranking is
therefore advisory, not an audit record.
Adding a command
- Define the
AppCommandentry (app id, name, params, deep link,admin_onlywhen admin-gated). - Bind the verb to the route in the verb-endpoint table for the app’s domain.
- If the operation is mutating, let the consent classifier see it (verb suffix drives the class); destructive verbs always prompt.
- Register the endpoint in the API command catalog so the LLM manifest
includes it, and seed demo data (
botsampledata) when a fresh drive should exercise it end to end. - Cover it in
bottest(catalog commands tests exist —bottest/tests/catalog_commands.rs).