Files
e48591bd82 feat: bot message policy, message lifecycle hooks, command routing and Chat rename (supersedes #2831, #2833) (#2966)
* feat(bot): support direct binding of plugin commands (LANG-240)

Co-authored-by: multica-agent <github@multica.ai>

* fix(bot): address review feedback on command routing and migration (LANG-240)

- Remove redundant cmd_mgr.is_admin call in routing layer
- Move legacy YAML command config migration to startup build_app stage with idempotency flag
- Validate that command_settings.plugins are installed in current workspace
- Cache bot command_settings in memory via platform_mgr helper
- Wrap command matching and execution inside _run_event_delivery for cloud tenant scope
- Preserve original launcher_id type in session resolution

Co-authored-by: multica-agent <github@multica.ai>

* style(bot): apply ruff format to command routing changes (LANG-240)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* wip(command): command processor instances and per-command config (LANG-238)

Work in progress handed off for completion; backend and tests are done,
web pieces are partially written and not yet type-checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(command): complete command processor configuration UI

Co-authored-by: multica-agent <github@multica.ai>

* fix(command): retain saved bot command settings when editing

Co-authored-by: multica-agent <github@multica.ai>

* test(command): exclude command instances from runner operations

Co-authored-by: multica-agent <github@multica.ai>

* test(command): verify bot prefixes and manage async test lifecycle

Co-authored-by: multica-agent <github@multica.ai>

* feat(platform): register Telegram and Discord plugin commands

Co-authored-by: multica-agent <github@multica.ai>

* fix(platform): align registration metadata and selected command diagnostics

Co-authored-by: multica-agent <github@multica.ai>

* fix(plugin): keep platform command refresh best-effort after runner refresh

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* refactor(web): simplify bot event routing card with tabs

Split routes, plugin commands and plugin processors into tabs, collapse
the supported events panel into a dialog, keep rule rows on a stable
two-line grid, and show bound commands as compact chips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* refactor(web): move command prefixes behind a small popover button

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* refactor(web): show commands, routes and plugin processors as separate routing layers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(command): record command processor runs and support debugging

Bot command executions and debug runs are written to the run ledger as
command_processor runs, so processors get run history and traces. Debug
runs a command line once with admin privilege without platform delivery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): command processor logs, debug and plugin marketplace select

Group plugin processors and command processors under a From plugin option
on the processor creation page, redraw the processor type diagrams, add
logs and debugging to the command processor detail page, list installed
and marketplace command plugins with one-click install, and use a Remix
icon for command processors in the sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(web): count new command processor locale keys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): illustrate processor types with animated scenes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* revert(web): restore original processor line diagrams and add a command one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(web): count command diagram locale keys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): progressive plugin options and a code-bearing plugin processor diagram

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): command plugin wording in the plugin selector

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(web): count command plugin selector locale keys

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(pipeline): pin outer-stage behaviour before moving it to the message policy

Baseline cases state a legacy pipeline config and the behaviour it must
produce (group respond rules, access control, ignore rules, content filter,
rate limit, long text, sending, user notices, aggregation). They reach the
stages only through outer_stage_harness, so the same cases keep guarding
behaviour once the configuration moves to the bot.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(message-policy): add the bot message policy schema, runtime and manager

A message policy says which messages a bot answers (trigger), what is checked
on the way in and out (safety) and how replies are sent (output). It keeps the
key names these settings had inside a Messaging (pipeline) config.

- schema: neutral and default policies, bot + route merge, validation, and the
  single legacy conversion (split_legacy_config / restore_legacy_config).
- runtime: the logic of the outer stages, compiled per effective policy
  (admission, group rules, rate limit, content filter, long text, sending).
- manager: resolves the policy of a bot route and caches the compiled runtime
  per bot and route; the debug chat and unknown bots get the neutral policy.

Group respond rules and the rate limit gain an explicit enabled switch so a
policy can express "do nothing"; converted legacy settings state it as on.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(message-policy): store policies on bots and migrate them out of Messaging

- bots.message_policy (JSON) and an optional policy override on each route in
  event_bindings; BotService validates both. A route resubmitted without the
  policy key keeps its stored override, so older clients cannot drop it.
- Migration 0049: existing bots get the neutral policy and every route to a
  Messaging processor receives that processor's former settings as its
  override; the moved keys are kept verbatim in
  legacy_pipelines.message_policy_backup and restored on downgrade.
- Messaging writes accept and ignore trigger / safety / general output keys;
  its template and form metadata keep only AI, speech and AI-specific output.
- New bots start with the defaults new Messaging processors used to get.
- GET /api/v1/platform/bots/_/message-policy/metadata serves the form metadata;
  MCP bot tools describe message_policy and route overrides.
- The group-filter migration helper reads and updates the route policy.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* refactor(pipeline): run the outer stages through the message policy runtime

Stage order and position are unchanged. The group rule, access control,
content filter, rate limit, long text and send stages become thin shells over
the policy runtime of the route a message matched; user notices and the
scheduler's steering gate use it too. The effective policy is laid over
query.pipeline_config under the legacy key names, so plugins reading those
keys keep working. Message aggregation reads the policy as well.

The matched route id travels from routing through the aggregator to the query
(_message_route_id, host-reserved). Messages that reach Messaging without one
(web page widget, form callbacks) use the bot's first route to that processor.

The baseline cases now run on legacy configs converted the way the migration
converts them.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* chore(persistence): renumber message policy migrations after master (0054-0056)

Master added 0047-0053, so the bot command settings, platform command sync
and bot message policy migrations now follow 0053_knowledge_artifact_sources.
Also bind a message policy in the agent run recovery test, whose replayed
output stages now read output and safety settings from the bot route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(sdk): expose command processor configuration in execution contexts

Co-authored-by: multica-agent <github@multica.ai>

* feat(bot): dispatch plugin lifecycle hooks with route-scoped query and policy

Co-authored-by: multica-agent <github@multica.ai>

* fix(messaging): dispatch received hooks for direct pipeline queries

Co-authored-by: multica-agent <github@multica.ai>

* fix(messaging): tolerate queries without bound plugins in the received-hook fallback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(messaging): apply bot policies to agent delivery

Co-authored-by: multica-agent <github@multica.ai>

* feat(web): bot plugins and message policy tabs, Chat rename

- Bot event routing becomes three tabs: Routes, Plugins, Message policy.
- Plugins tab: message lifecycle strip (received → command → admission →
  before reply → process → after reply → send) with the enabled plugins
  acting at each step; one row per plugin with its switch, command tags and
  hook tags. Hooks a route cannot use are struck through with the reason
  (prompt hooks on Agent routes, observe-only after-reply hook when
  streaming). Enable-all switch plus manual selection, as on Chat. Command
  settings and plugin processors live in the same tab.
- Message policy tab: entry / safety / reply forms from the policy metadata,
  bot default or per-route override (use default / custom), route overview,
  "make bot default" which also clears routes left identical to it.
- New routes show a hint that they inherit the bot policy.
- Chat editor drops Trigger and Safety; Output keeps AI-only options with a
  pointer to the bot policy; the plugin list is "Tools the AI can call".
- Installing a plugin with commands or listeners reports on how many bots it
  is enabled, or offers to go enable it.
- User-visible "Pipeline/流水线" renamed to "Chat/聊天" in all eight WebUI
  locales (identifiers, paths and keys unchanged).
- plugin-registrations (HTTP and MCP) accepts include_disabled to list every
  installed plugin for the editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(i18n): call the pipeline Chat in backend user-facing text

Default name, runner authorization notice, operation catalog labels and
summaries, alert email rule label, adapter streaming descriptions and
MCP tool descriptions say Chat (pipeline). Identifiers keep pipeline.
The group filter migration tools describe the message-policy at-bot rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): finish the Chat rename in locales and the migration dialog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* chore(sdk): regenerate workspace proxy for monitoring.sessions launcher_id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* docs: message lifecycle events, bot message policy and the Chat rename

- Plugin docs: 'Pipeline events' become message lifecycle events with
  the lifecycle order, where plugins are enabled, which processors each
  hook applies to, known limits and platform notifications.
- Command docs: matching before routes, route policy, *CommandSent.
- Bots page: event routing tabs, plugin enablement, message policy.
- Chat page and the rest of docs/ (zh/en/ja, regenerated recipes) use
  Chat instead of Pipeline; URLs and identifiers are unchanged.
- langbot-mcp-ops skill, ARCHITECTURE.md and dev-docs/architecture/
  message-policy.md describe the new contracts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(bot): keep the platform command clear in update_bot after the master merge

The merge carried the branch's platform-command check into master's new
_apply_bot_configuration, where update_data does not exist, so every
runtime-affecting bot update returned 500. Run the check in update_bot
before applying. Command admin checks now pass the sender ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(persistence): register all entities in the startup command migration test

The test created bots without the tables its foreign keys reference and
only passed when other tests had imported those entities first. Also
apply prettier to AgentCreateContent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(messaging): use one listener list per query when no bot policy applies

Queries entering a Chat without a bot (debug chat, pipeline.run) bound
the neutral policy, so later hooks went to every plugin while the
fallback *MessageReceived used the Chat's plugin list. Use the Chat's
list for all hooks there. The contract test now carries the plugin
selection the way migration 0060 stores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): move plugin command settings into the plugin list

Drop the separate plugin command binding section from the bot's Plugins tab.
The command switch and prefixes now sit in the plugin list header, per-bot
command settings open from a plugin's row (only when its commands declare
spec.config), and platform command registration follows the enabled plugins.

Duplicate command names now resolve in the order of the bot's effective plugin
list, the same order lifecycle hooks run in; the WebUI keeps that list in
display order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): mark plugin hook badges with the event listener icon

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): explain AI routes versus plugin handling on the bot tabs

Routes now say they send events to configurable LangBot processors that use
AI, and that a plugin-only bot can delete or disable its routes. The Plugins
tab explains that plugins handle their lifecycle steps as each plugin defines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): optional route notes and auto-described routes

Routes get an optional note, edited in the route's expanded panel and shown
under the route. Wherever routes are listed (scope picker, policy route list)
a second line now says when the route applies, derived from its conditions,
plus its target when the name is a note, so routes stay distinguishable
without any user input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): compact route cards and labelled message template routes

Saved routes collapse to a two-line summary (note or processor, then event,
conditions and target); event, conditions, processor and note are edited in
the expanded card. Unsaved routes open expanded. The "Reply to messages"
template and the setup wizard now label their routes as private messages and
group messages that mention the bot.

Also move the plugin processor compatibility e2e onto the Plugins tab, where
plugin processors live since the message policy refactor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): keep bot-wide command settings read-only on route scope

The plugin command switch, prefixes and per-plugin command settings apply to
the whole bot, so they are read-only (with a hint) while a route is selected.
Turning commands off crosses out every command badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* style(bots): make the crossed-out command badges easier to see

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(agents): stop offering command processors on the create page

Command settings are created from a plugin's row on the bot's Plugins tab.
The "From plugin" card now selects plugin processors directly; existing
command processors keep their detail page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): install plugin processors from the marketplace in place

The add-plugin-processor dialog's new-configuration tab keeps the installed
processor list (with event compatibility) and adds a marketplace picker for
plugins that declare processor support; installing one selects it. Bound and
existing processors show their plugin icon, and the empty state points to the
marketplace. Plugin-subscription e2e now opens the Plugins tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(plugins): point command and listener plugins to bots after install

Commands and event listeners are enabled on a bot's Plugins tab now, so the
post-install next step for them links to bots; tools still lead to a Chat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(bots): pick plugin processors from a single picker

The new-configuration tab drops the separate installed-processor list: one
picker lists installed processors and marketplace plugins (installable in
place), and the chosen processor's events and compatibility show below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(plugins): show next steps on first visit and reload after confirming permissions

- The plugin detail page opens a next-steps dialog the first time a ready
  plugin is visited (remembered per plugin).
- After permissions are confirmed, the page polls until the plugin is mounted
  and remounts its settings, readme and log panels, so no manual refresh is
  needed.
- The install dialog shows next steps under the permission-review link
  instead of hiding them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(plugins): say why plugin settings and docs are unavailable

While a plugin waits for permission confirmation its settings and docs cannot
load; show a dedicated notice pointing to Plugin permissions (or a starting
indicator while it boots) instead of the generic load error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(plugins): confirm permissions inside the install dialog

A plugin awaiting permission review now shows the permission card in the
install dialog; granting there opens the usual confirmation, and the dialog
then switches to the success banner with its next steps. The first-visit
next-steps popup on the plugin page is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): show next steps right after granting in the install dialog

The plugin restarts after a grant, so re-reading it could fail or still report
pending, leaving the dialog on the review banner. Trust the successful grant,
keep the already loaded manifest, and retry loading it if it was missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): treat initialized plugins as running on the detail page

The runtime moves plugins unmounted -> mounted -> initialized; initialized is
the ready state. The detail page only accepted mounted, so running plugins
showed "starting" forever. Also fix the misspelled status in the type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): re-read the plugin until it lists components before showing install next steps

A plugin awaiting permissions is not started and reports no components, so
the post-grant guide stayed empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): add bot plugins from a list and the Marketplace; rename event listeners to chat event hooks

The bot Plugins tab now lists added plugins as cards (all of them when
'enable all' is on) instead of per-plugin switches, with an Add plugin
dialog for installed plugins and Marketplace plugins that provide commands
or chat event hooks. EventListener is shown as 'Chat event hook' in the UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): with all plugins enabled, the bot plugin list offers installing new plugins only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): bot plugin Marketplace tab lists only uninstalled or updatable plugins

Installed plugins with a newer Marketplace version get an inline Update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): no 'not enabled on any bot' toast for plugins installed from a bot's plugin list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): move plugin dev docs link from the routing help popover to the Plugins tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): open a plugin's settings page from its card in the bot plugin list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): describe commands, chat event hooks and plugin processors by how each handles events

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): drop the route overview list from the bot message policy tab

The scope selector already marks which routes are customised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): regroup bot message policy settings by what the owner decides

The policy tab now groups settings into who gets replies, how messages are
read, safety and rate limits, how the bot replies, and what happens on
errors. Each setting shows a plain-language summary and expands to purpose-
built controls; stored trigger/safety/output keys are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* refactor(web): use shadcn Button and Label for this branch's new UI

Replace raw button, link and label elements added on this branch with
shadcn Button (ghost / link / asChild) and Label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(commands): add bot system commands and sender permissions

Co-authored-by: multica-agent <github@multica.ai>

* fix(commands): honor session model, replay text turns and gate denial replies

Co-authored-by: multica-agent <github@multica.ai>

* feat(web): one-page Chat settings with prompt, tools and knowledge up front

Replace the Chat editor's section tabs with a single page: the runner,
then primary blocks for model, prompt, tools (summary + side sheet) and
knowledge, then folded rows with one-line summaries for context, run
limits, sandbox, speech, reply content, notices, advanced and manage.
Runner fields are placed by type and name, so any runner works; values and
stored keys are unchanged. Folded rows stay mounted so invalid drafts still
block saving. SettingRow/SettingGroup are shared with the bot policy tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): keep folded setting rows mounted but hidden

Radix forceMount forces content open; render the row body ourselves with
the hidden attribute so folded rows stay collapsed while their fields keep
validating.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): system commands and command permissions in the bot Plugins tab

A small 'System commands · n/m' entry in the command bar opens a sheet with
the admin list (person_ IDs, /whoami hint), the no-permission reply, every
built-in command's switch and permission grouped by session/info/admin,
and per-command permissions for enabled plugins' commands. Admin-only plugin
commands show a lock on their chips; the lifecycle Command step marks the
system commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): one-page Agent settings matching the Chat layout

Replace the Agent editor's Runner / Events & tools tabs with one page: the
runner, then model and prompt, the events the Agent handles, a tool access
summary (editing in a side sheet), knowledge and runner settings, then
folded rows for context, run limits, sandbox and advanced fields. The
runner field layout is shared with Chat (runner-layout/RunnerConfigLayout).
Loading fills the active runner's schema defaults before the clean snapshot,
so required-field status and revert-to-clean keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): 'Plugins & commands' tab with its own Commands section

Rename the bot tab to Plugins & commands. Commands get their own section
above plugins: one global switch, the shared prefixes (with an example, as
they apply to system and plugin commands alike), the system commands entry
and the plugin command list. Admins are no longer edited in the system
commands sheet; it shows the bot admin count and links to the session
monitor where admins are managed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): give system and plugin commands their own sheets

The System commands sheet now lists only built-in commands; plugin command
access moves to a 'Set access' sheet on the plugin commands row. Admins and
the no-permission reply apply to both kinds, so they become rows of the
Commands section instead of living in the system sheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): keep dividers between command access rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): link plugin processor dev docs from the processors section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(commands): use session monitoring admins for command permissions

Co-authored-by: multica-agent <github@multica.ai>

* chore(web): drop retired command_settings.admins from the bot command type

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* Record message policy decisions and add workspace upgrade checks

Co-authored-by: multica-agent <github@multica.ai>

* fix(message-policy): queue EssentialCommands uninstall through plugin.delete task

The upgrade-check action called the plugin connector directly, skipping the
tenant-scoped fence and task tracking used by the regular uninstall path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): message policy monitoring badges, timeline, route counts and upgrade checks

- Monitoring: handling badges (system/plugin command, denied, policy drop,
  plugin interception), a handling filter (AI / command / plugin / policy)
  and a message policy timeline in the execution detail.
- Backend: executions accept handling= (HTTP + MCP, not plugin-visible) and
  rows carry handling, policy_layer/item, command and hook facts.
- Bot routes show last-24h handling counts.
- Upgrade check banner + Sheet on bot and Chat pages with one-click
  actions, per-item and acknowledge-all; eight locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(monitoring): name layer and rule for policy drops recorded before structured fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): name command/policy/plugin ingress rows and dedupe output actions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(message-policy): preserve drop notices, Windows fallback, 0060 enabled filter, and ignore-rules hint

Co-authored-by: multica-agent <github@multica.ai>

* docs(message-policy): update trilingual user, upgrade, telemetry and command docs

Co-authored-by: multica-agent <github@multica.ai>

* Document bot command permissions and Chat event hooks in skills

Co-authored-by: multica-agent <github@multica.ai>

* Distinguish Chat debugging from bot admission tests

Co-authored-by: multica-agent <github@multica.ai>

* Navigate to Chats from Processors in skills and QA flows

Co-authored-by: multica-agent <github@multica.ai>

* Restore bot ingress tracing and align CI with route-owned message policies

Co-authored-by: multica-agent <github@multica.ai>

* fix(web): stop the bot plugins tab crashing without runtime registrations; align e2e with the Chat UI

pluginCommandList read descriptorMap before its declaration, so the Plugins &
commands tab threw a TDZ error whenever an enabled plugin had no Runtime
registration (older Runtimes). Compute it after the map.

Update stale Playwright specs to the current UI: Chat migration labels,
one-page Chat editor (no AI tab, Runner field), 'Create processor' heading,
and the in-dialog permission review after plugin installation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(telemetry): count builtin_disabled_bots only for built-ins turned off from their default

/model is off by default, so counting any disabled built-in counted every
bot and the heartbeat field carried no signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(migration): preserve empty legacy chat settings on downgrade

Co-authored-by: multica-agent <github@multica.ai>

* fix(migration): initialize bot policies when resuming 0059

Co-authored-by: multica-agent <github@multica.ai>

* test(commands): exercise LocalAgent over signed HTTP ingress

Co-authored-by: multica-agent <github@multica.ai>

* fix(api): report ignored legacy settings in chat copy requests

Co-authored-by: multica-agent <github@multica.ai>

* test(commands): cover alternate prefixes and unrouted group commands

Co-authored-by: multica-agent <github@multica.ai>

* fix(web): policy timeline says MessageReceived already ran when admission blocks

MessageReceived fires at the bot entry before admission, so a policy drop
still ran it. The hooks step now says so instead of 'not run'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(commands): consume silently denied commands before primary routing

Co-authored-by: multica-agent <github@multica.ai>

* Test upgrade assistant actions and command telemetry against a local Core

Co-authored-by: multica-agent <github@multica.ai>

* Verify lifecycle hooks and command bypass during message aggregation

Co-authored-by: multica-agent <github@multica.ai>

* Verify native Agent reply chunks and proactive delivery through signed callbacks

Co-authored-by: multica-agent <github@multica.ai>

* Cover subscriber replies on denied ingress and concurrent command rate limits

Co-authored-by: multica-agent <github@multica.ai>

* Verify LocalAgent records missing model failures for signed messages

Co-authored-by: multica-agent <github@multica.ai>

* Skip runtime synchronization for empty event selections after validating workspace scope

Co-authored-by: multica-agent <github@multica.ai>

* Verify route access overrides, removal and telemetry using signed bot messages

Co-authored-by: multica-agent <github@multica.ai>

* Exercise signed command admission and reply policies in a running Core

Co-authored-by: multica-agent <github@multica.ai>

* Compare dashboard debug chat with signed messages on the same Chat

Co-authored-by: multica-agent <github@multica.ai>

* Validate unavailable Agent runners and verify native quotes and Agent policy traces

Co-authored-by: multica-agent <github@multica.ai>

* Correlate successful Agent output with telemetry and exercise command hook order

Co-authored-by: multica-agent <github@multica.ai>

* Honor Chat exception policy for Runner failures and verify streaming observers

Co-authored-by: multica-agent <github@multica.ai>

* Verify OneBot membership events bypass message admission and reply policies

Co-authored-by: multica-agent <github@multica.ai>

* Exercise command name precedence and processor instance isolation in runtime

Co-authored-by: multica-agent <github@multica.ai>

* Accept ISO source times in runner events and verify long-text boundaries

Co-authored-by: multica-agent <github@multica.ai>

* Compare Chat output filtering on OneBot and HTTP Bot

Co-authored-by: multica-agent <github@multica.ai>

* Trace matched deliveries intercepted by message listeners

Co-authored-by: multica-agent <github@multica.ai>

* Record Chat execution owner with the first success update

Co-authored-by: multica-agent <github@multica.ai>

* Admit matched commands before recording listener interception

Co-authored-by: multica-agent <github@multica.ai>

* Handle stop on a Chat without a Runner and verify built-in command permissions

Co-authored-by: multica-agent <github@multica.ai>

* Link command processor runs to ingress routes and identify denied plugin commands

Co-authored-by: multica-agent <github@multica.ai>

* Report ignored legacy operation keys and limit Runner error replies to a redacted summary

Co-authored-by: multica-agent <github@multica.ai>

* style(web): wrap long monitoring timeline strings for prettier

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* Dispatch QA Runner by envelope type and verify remaining command conflicts after uninstall

Co-authored-by: multica-agent <github@multica.ai>

* fix(persistence): chain bot command settings after master's 0057 migration

master added 0057_agent_event_index on top of 0056, which left two Alembic
heads. Run 0057_bot_command_settings after it; revision ids are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 08:20:44 +08:00

314 lines
31 KiB
Plaintext

---
title: Workspace API
description: Read and manage Agents, Chats, bots, models, knowledge bases and more from a plugin.
---
The Workspace API lets a plugin work with the Workspace it is installed in: list and edit Agents and Chats, look up bots, manage models and knowledge bases, read monitoring data, and so on. It exposes the same operations as LangBot's HTTP API, MCP server and Workspace assistant, so a plugin can automate anything a member could do through those interfaces, within the limits the member grants.
Every operation has a stable ID, such as `pipeline.list` or `knowledge.base.retrieve`. A plugin can only call operations it [declares in its manifest](/en/plugin/dev/permissions#declare-permissions) and a member has granted to its installation.
Plugins may explicitly request `artifact.create`, `artifact.get`, `artifact.read`, `artifact.read_content`, `artifact.retain`, `artifact.release` and `artifact.delete`. List the seven needed operation IDs individually: `artifact.*` is rejected because it also includes account-only publication and Skill-source operations. Typed calls use `self.plugin.workspace.artifact.<method>(...)`, or the run-bound `ctx.api.workspace` proxy.
These Artifacts belong to the installation UUID, not the plugin's author/name, an account or a run. Every operation rechecks the current enabled installation and effective grants; a revoked grant or reinstallation with a new UUID cannot access old assets. Knowing an ID or retaining it does not share access. Account uploads, Skill sources and run handles cannot be imported through these plugin operations. `artifact.skill_resource.create` and `artifact.publication.get/set/disable` remain account/API-key only. See [Artifact API](/en/develop/artifacts).
For the JSON RPC path, create with `filename`, `content_base64`, optional `mime_type` and `ttl_seconds`. The decoded input is limited to 256 KiB; plugin raw reads use the same 256 KiB ceiling and return `metadata` plus `content_base64`. Prefer `read_content` for bounded text/structured media. This smaller transport limit does not change existing authenticated HTTP upload/download contracts. Retain/release concern this installation's pin; deletion refuses active business references.
## Calling an operation
From any component, use `self.plugin.workspace`. Each operation has a typed method named after its ID:
```python
from langbot_plugin.api.definition.components.tool.tool import Tool
class WorkspaceSummary(Tool):
async def call(self, params, session, query_id):
result = await self.plugin.workspace.pipeline.list()
if not result["ok"]:
return f"Could not list pipelines: {result['error']['message']}"
names = [pipeline["name"] for pipeline in result["result"]]
return "Pipelines: " + ", ".join(names)
```
Methods take keyword arguments that match the operation's input schema, and editors show their types and documentation. A few names are adjusted to be valid Python: a segment that is a Python keyword gets a trailing underscore (for example `import_`), and other invalid characters become underscores. The arguments are still sent under their original names.
If you prefer to choose the operation at runtime, call it by ID. Both forms behave identically:
```python
result = await self.plugin.workspace.call("knowledge.base.retrieve", kb_uuid=kb_uuid, query="refund policy")
```
`await self.plugin.workspace.list()` returns the operations granted to the installation, with their input schemas, grouped into `domains`. It is useful for building a dynamic tool list or checking a grant before offering a feature.
### Inside a Runner
A Runner receives a run-bound proxy as `ctx.api.workspace`. It offers the same methods and is authorized by the same installation grants; the difference is that LangBot records each call against the current run.
The Agent or Chat that started the run may restrict which workspace operations the model should see. That selection is delivered in `ctx.resources.workspace_operations`. A Runner that exposes workspace operations to a model as tools should offer only those, and offer none when the list is empty. LangBot's built-in LocalAgent does exactly this.
## Results and errors
Workspace calls never raise for business errors. They always return a dictionary:
```python
# Success
{"ok": True, "result": ..., "operation": {"id": "pipeline.list", ...}}
# Failure
{"ok": False, "error": {"code": "permission_denied", "message": "...", "details": {...}}}
```
Check `ok` before reading `result`. Common error codes:
| Code | Meaning |
| --- | --- |
| `permission_denied` | The operation is not granted to this installation, or the installation is disabled. `details.denied_operations` lists the missing IDs. |
| `invalid_input` | The arguments do not match the operation's input schema. |
| `not_found` | The referenced resource does not exist in this Workspace. |
| `application_error` | The operation ran and failed; `message` explains why. |
A denied operation is an expected outcome, because members may grant only part of what a plugin declares. Handle it by explaining what is missing rather than failing the whole command or run.
## Choosing operations to declare
Operations carry a risk level that the member sees when confirming:
- **Read** operations only return data, such as `pipeline.list` or `stats.basic`.
- **Write** operations change Workspace configuration, such as `pipeline.update` or `knowledge.file.store`.
- **High-risk** operations delete resources, reach outside LangBot, or consume significant resources, such as `bot.delete` or `pipeline.chat.broadcast`. The confirmation dialog highlights them.
The member who grants an operation must hold its permission themselves (the last column below). Ask only for what your plugin needs; a request for many high-risk operations is likely to be declined or trimmed.
Wildcards such as `knowledge.*` request every operation under a prefix. Not every prefix can be used this way; see [Wildcards](/en/plugin/dev/permissions#wildcards).
## Operation reference
This reference covers every operation a plugin can request in the current LangBot version, grouped by domain. Methods are shown on `workspace`, which is `self.plugin.workspace` in components and `ctx.api.workspace` in a Runner. The SDK's typed methods are generated from this catalog, so every operation listed here is available as a method.
### Adapter (`adapter`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Adapter<br/>Get configuration schema and requirements for an adapter. | `adapter.get`<br/>`workspace.adapter.get()` | Read | `resource.view` |
| List Adapters<br/>List available chat platform adapters in the workspace. | `adapter.list`<br/>`workspace.adapter.list()` | Read | `resource.view` |
### Agent (`agent`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Create Agent<br/>Create a new autonomous AI agent in the workspace. | `agent.create`<br/>`workspace.agent.create()` | Write | `resource.manage` |
| Debug Agent<br/>Execute a test turn on an agent for debugging purposes. | `agent.debug`<br/>`workspace.agent.debug()` | Write | `runtime.operate` |
| Delete Agent<br/>Delete an autonomous AI agent from the workspace. | `agent.delete`<br/>`workspace.agent.delete()` | High risk | `resource.manage` |
| Get Agent<br/>Get full configuration and parameters for an AI agent. | `agent.get`<br/>`workspace.agent.get()` | Read | `resource.view` |
| List Agents<br/>List all autonomous AI agents configured in the workspace. | `agent.list`<br/>`workspace.agent.list()` | Read | `resource.view` |
| Agent Metadata<br/>Get supported agent capabilities, model types, and schemas. | `agent.metadata`<br/>`workspace.agent.metadata()` | Read | `resource.view` |
| Get Run Events<br/>Fetch step-by-step trace events for an agent execution run. | `agent.runs.events`<br/>`workspace.agent.runs.events()` | Read | `resource.view` |
| List Agent Runs<br/>List historical execution runs for an agent or processor. | `agent.runs.list`<br/>`workspace.agent.runs.list()` | Read | `resource.view` |
| Update Agent<br/>Update configuration, model, or prompts of an agent. | `agent.update`<br/>`workspace.agent.update()` | Write | `resource.manage` |
### Bot (`bot`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| List Bot Admins<br/>List platform users configured as administrators for a bot. | `bot.admins.list`<br/>`workspace.bot.admins.list()` | Read | `resource.view` |
| Create Bot<br/>Create a new chat bot connected to an IM adapter. | `bot.create`<br/>`workspace.bot.create()` | Write | `resource.manage` |
| Delete Bot<br/>Delete a chat bot and remove its adapter connection. | `bot.delete`<br/>`workspace.bot.delete()` | High risk | `resource.manage` |
| Get Bot<br/>Get detailed configuration and status for a specific bot. | `bot.get`<br/>`workspace.bot.get()` | Read | `resource.view` |
| Apply Group Filter<br/>Apply group filtering rules to enable or disable Chats. | `bot.group_filter.apply`<br/>`workspace.bot.group_filter.apply()` | Write | `resource.manage` |
| Preview Group Filter<br/>Preview chat group filtering rules for a bot. | `bot.group_filter.preview`<br/>`workspace.bot.group_filter.preview()` | Read | `resource.manage` |
| List Bots<br/>List all configured chat bots in the workspace. | `bot.list`<br/>`workspace.bot.list()` | Read | `resource.view` |
| Bot Logs<br/>Fetch runtime connection logs and events for a bot. | `bot.logs`<br/>`workspace.bot.logs()` | Read | `resource.view` |
| Send Bot Message<br/>Send an outbound message to a chat user or group via a bot. | `bot.message.send`<br/>`workspace.bot.message.send()` | High risk | `runtime.operate` |
| Test Bot Message<br/>Test bot messaging capability by sending a test message. | `bot.message.test`<br/>`workspace.bot.message.test()` | Write | `resource.manage` |
| Preview Routes<br/>Preview message routing decisions for a simulated event. | `bot.routes.preview`<br/>`workspace.bot.routes.preview()` | Read | `resource.manage` |
| Routing Status<br/>Get active message routing bindings and rules for a bot. | `bot.routes.status`<br/>`workspace.bot.routes.status()` | Read | `resource.view` |
| Bot Runtime Status<br/>Inspect live connection state and health of a bot. | `bot.runtime.get`<br/>`workspace.bot.runtime.get()` | Read | `resource.view` |
| Update Bot<br/>Update settings or Chat bindings for an existing bot. | `bot.update`<br/>`workspace.bot.update()` | Write | `resource.manage` |
### Extension (`extension`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| List All Extensions<br/>List all available plugins, MCP servers, and skills combined. | `extension.list`<br/>`workspace.extension.list()` | Read | `resource.view` |
### Knowledge Base (`knowledge`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Create Knowledge Base<br/>Create a new knowledge base with storage and vector engine. | `knowledge.base.create`<br/>`workspace.knowledge.base.create()` | Write | `resource.manage` |
| Delete Knowledge Base<br/>Permanently delete a knowledge base and indexed documents. | `knowledge.base.delete`<br/>`workspace.knowledge.base.delete()` | High risk | `resource.manage` |
| Get Knowledge Base<br/>Get configuration and indexing status of a knowledge base. | `knowledge.base.get`<br/>`workspace.knowledge.base.get()` | Read | `resource.view` |
| List Knowledge Bases<br/>List all knowledge bases configured in the workspace. | `knowledge.base.list`<br/>`workspace.knowledge.base.list()` | Read | `resource.view` |
| Retrieve Knowledge Chunks<br/>Search and retrieve relevant text chunks from knowledge base. | `knowledge.base.retrieve`<br/>`workspace.knowledge.base.retrieve()` | Read | `resource.view` |
| Update Knowledge Base<br/>Update configuration or description of a knowledge base. | `knowledge.base.update`<br/>`workspace.knowledge.base.update()` | Write | `resource.manage` |
| Engine Creation Schema<br/>Get configuration schema required to create an engine. | `knowledge.engine.creation_schema`<br/>`workspace.knowledge.engine.creation_schema()` | Read | `resource.view` |
| List Knowledge Engines<br/>List available storage and vector retrieval engine types. | `knowledge.engine.list`<br/>`workspace.knowledge.engine.list()` | Read | `resource.view` |
| Engine Retrieval Schema<br/>Get parameter schema for retrieving from an engine. | `knowledge.engine.retrieval_schema`<br/>`workspace.knowledge.engine.retrieval_schema()` | Read | `resource.view` |
| Delete Knowledge File<br/>Delete an indexed document from a knowledge base. | `knowledge.file.delete`<br/>`workspace.knowledge.file.delete()` | High risk | `resource.manage` |
| List Knowledge Files<br/>List all documents indexed within a knowledge base. | `knowledge.file.list`<br/>`workspace.knowledge.file.list()` | Read | `resource.view` |
| Store Knowledge File<br/>Index and store a document into a knowledge base. | `knowledge.file.store`<br/>`workspace.knowledge.file.store()` | Write | `resource.manage` |
| List Document Parsers<br/>List supported document parser formats and capabilities. | `knowledge.parser.list`<br/>`workspace.knowledge.parser.list()` | Read | `resource.view` |
### MCP (`mcp`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| List MCP Resources<br/>List all resources exposed by connected MCP servers. | `mcp.resource.list`<br/>`workspace.mcp.resource.list()` | Read | `resource.view` |
| Read MCP Resource<br/>Read contents of a specific resource from an MCP server. | `mcp.resource.read`<br/>`workspace.mcp.resource.read()` | Read | `resource.view` |
| List MCP Resource Templates<br/>List parameterized resource URI templates from MCP servers. | `mcp.resource.templates`<br/>`workspace.mcp.resource.templates()` | Read | `resource.view` |
| Delete MCP Server<br/>Disconnect and delete an MCP server from the workspace. | `mcp.server.delete`<br/>`workspace.mcp.server.delete()` | High risk | `resource.manage` |
| Get MCP Server<br/>Get configuration and parameters of a specific MCP server. | `mcp.server.get`<br/>`workspace.mcp.server.get()` | Read | `resource.view` |
| List MCP Servers<br/>List configured Model Context Protocol (MCP) servers. | `mcp.server.list`<br/>`workspace.mcp.server.list()` | Read | `resource.view` |
| MCP Server Logs<br/>Retrieve communication and error logs for an MCP server. | `mcp.server.logs`<br/>`workspace.mcp.server.logs()` | Read | `audit.view` |
| MCP Server Runtime<br/>Inspect live health and session state of an MCP server. | `mcp.server.runtime`<br/>`workspace.mcp.server.runtime()` | Read | `resource.view` |
| Test MCP Server Connection<br/>Test connectivity and ping an MCP server configuration. | `mcp.server.test`<br/>`workspace.mcp.server.test()` | Write | `resource.manage` |
### Model (`model`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Create Embedding Model<br/>Configure and add a new embedding model to the workspace. | `model.embedding.create`<br/>`workspace.model.embedding.create()` | Write | `provider_secret.manage` |
| Delete Embedding Model<br/>Delete an embedding model configuration from the workspace. | `model.embedding.delete`<br/>`workspace.model.embedding.delete()` | High risk | `resource.manage` |
| Get Embedding Model<br/>Get configuration and parameters of an embedding model. | `model.embedding.get`<br/>`workspace.model.embedding.get()` | Read | `resource.view` |
| List Embedding Models<br/>List all text embedding models configured in the workspace. | `model.embedding.list`<br/>`workspace.model.embedding.list()` | Read | `resource.view` |
| List Embeddings by Provider<br/>List embedding models configured under a specific provider. | `model.embedding.list_by_provider`<br/>`workspace.model.embedding.list_by_provider()` | Read | `resource.view` |
| Test Embedding Model<br/>Test vector generation and connectivity for embedding model. | `model.embedding.test`<br/>`workspace.model.embedding.test()` | Write | `provider_secret.manage` |
| Update Embedding Model<br/>Update configuration and parameters of an embedding model. | `model.embedding.update`<br/>`workspace.model.embedding.update()` | Write | `provider_secret.manage` |
| Create LLM Model<br/>Configure and add a new LLM model to the workspace. | `model.llm.create`<br/>`workspace.model.llm.create()` | Write | `provider_secret.manage` |
| Get Default LLM Model<br/>Get workspace default large language model configuration. | `model.llm.default.get`<br/>`workspace.model.llm.default.get()` | Read | `resource.manage` |
| Delete LLM Model<br/>Delete an LLM model configuration from the workspace. | `model.llm.delete`<br/>`workspace.model.llm.delete()` | High risk | `resource.manage` |
| Get LLM Model<br/>Get configuration and parameters of a specific LLM model. | `model.llm.get`<br/>`workspace.model.llm.get()` | Read | `resource.view` |
| List LLM Models<br/>List all configured large language models in the workspace. | `model.llm.list`<br/>`workspace.model.llm.list()` | Read | `resource.view` |
| List LLMs by Provider<br/>List LLM models configured under a specific model provider. | `model.llm.list_by_provider`<br/>`workspace.model.llm.list_by_provider()` | Read | `resource.view` |
| Get Starred LLM Model<br/>Get the starred favorite LLM model of the workspace. | `model.llm.starred.get`<br/>`workspace.model.llm.starred.get()` | Read | `resource.view` |
| Set Starred LLM Model<br/>Designate a specific LLM model as the starred favorite. | `model.llm.starred.set`<br/>`workspace.model.llm.starred.set()` | Write | `provider_secret.manage` |
| Test LLM Model<br/>Test connectivity and response generation for an LLM model. | `model.llm.test`<br/>`workspace.model.llm.test()` | Write | `provider_secret.manage` |
| Update LLM Model<br/>Update configuration and parameters of an LLM model. | `model.llm.update`<br/>`workspace.model.llm.update()` | Write | `provider_secret.manage` |
| Create Rerank Model<br/>Configure and add a new rerank model to the workspace. | `model.rerank.create`<br/>`workspace.model.rerank.create()` | Write | `provider_secret.manage` |
| Delete Rerank Model<br/>Delete a rerank model configuration from the workspace. | `model.rerank.delete`<br/>`workspace.model.rerank.delete()` | High risk | `resource.manage` |
| Get Rerank Model<br/>Get configuration and parameters of a rerank model. | `model.rerank.get`<br/>`workspace.model.rerank.get()` | Read | `resource.view` |
| List Rerank Models<br/>List all document reranking models in the workspace. | `model.rerank.list`<br/>`workspace.model.rerank.list()` | Read | `resource.view` |
| List Reranks by Provider<br/>List rerank models configured under a specific provider. | `model.rerank.list_by_provider`<br/>`workspace.model.rerank.list_by_provider()` | Read | `resource.view` |
| Test Rerank Model<br/>Test connectivity and scoring capability of a rerank model. | `model.rerank.test`<br/>`workspace.model.rerank.test()` | Write | `provider_secret.manage` |
| Update Rerank Model<br/>Update configuration and parameters of a rerank model. | `model.rerank.update`<br/>`workspace.model.rerank.update()` | Write | `provider_secret.manage` |
### Monitoring (`monitoring`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Embedding Call Metrics<br/>Query embedding generation metrics and latency statistics. | `monitoring.embedding_calls`<br/>`workspace.monitoring.embedding_calls()` | Read | `resource.view` |
| Error Logs<br/>Query runtime errors and failures across bots and Chats. | `monitoring.errors`<br/>`workspace.monitoring.errors()` | Read | `resource.view` |
| Execution Details<br/>Get detailed traces and step execution events for a specific execution. | `monitoring.execution.detail`<br/>`workspace.monitoring.execution.detail()` | Read | `resource.view` |
| List Executions<br/>Query execution history records across bots, Chats, and agents. | `monitoring.executions`<br/>`workspace.monitoring.executions()` | Read | `resource.view` |
| List User Feedback<br/>List user ratings and feedback records on bot responses. | `monitoring.feedback.list`<br/>`workspace.monitoring.feedback.list()` | Read | `resource.view` |
| Feedback Statistics<br/>Get aggregated positive and negative user feedback metrics. | `monitoring.feedback.stats`<br/>`workspace.monitoring.feedback.stats()` | Read | `resource.view` |
| In-Flight Executions<br/>Inspect currently active in-flight requests and Chat runs. | `monitoring.inflight`<br/>`workspace.monitoring.inflight()` | Read | `resource.view` |
| LLM Call Metrics<br/>Query model invocation counts, latencies, and token stats. | `monitoring.llm_calls`<br/>`workspace.monitoring.llm_calls()` | Read | `resource.view` |
| Message Details<br/>Retrieve full metadata and trace details for a single message. | `monitoring.message.detail`<br/>`workspace.monitoring.message.detail()` | Read | `resource.view` |
| Query Messages<br/>Query processed chat messages across bot sessions. | `monitoring.messages`<br/>`workspace.monitoring.messages()` | Read | `resource.view` |
| Monitoring Overview<br/>Get aggregated monitoring overview statistics for bots and Chats. | `monitoring.overview`<br/>`workspace.monitoring.overview()` | Read | `resource.view` |
| Session Analysis<br/>Analyze session metrics, duration, and token usage for a session. | `monitoring.session.analysis`<br/>`workspace.monitoring.session.analysis()` | Read | `resource.view` |
| Reset Session<br/>Reset a chat session and clear its context window. | `monitoring.session.reset`<br/>`workspace.monitoring.session.reset()` | High risk | `resource.manage` |
| List Sessions<br/>List active and historical chat sessions across bots. | `monitoring.sessions`<br/>`workspace.monitoring.sessions()` | Read | `resource.view` |
| Token Usage Statistics<br/>Query token consumption metrics aggregated by time buckets. | `monitoring.tokens`<br/>`workspace.monitoring.tokens()` | Read | `resource.view` |
| Tool Call Metrics<br/>Query tool invocation history and execution performance. | `monitoring.tool_calls`<br/>`workspace.monitoring.tool_calls()` | Read | `resource.view` |
### Chat (`pipeline`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Broadcast Chat Message<br/>Broadcast a message to all active Chat debug clients. | `pipeline.chat.broadcast`<br/>`workspace.pipeline.chat.broadcast()` | High risk | `runtime.operate` |
| Chat Connections<br/>Inspect live websocket connection status for Chat debugging. | `pipeline.chat.connections`<br/>`workspace.pipeline.chat.connections()` | Read | `runtime.operate` |
| Chat Debug History<br/>Retrieve debug chat message history for a Chat session. | `pipeline.chat.history`<br/>`workspace.pipeline.chat.history()` | Read | `runtime.operate` |
| Reset Chat Session<br/>Clear memory and chat history for a Chat debug session. | `pipeline.chat.reset`<br/>`workspace.pipeline.chat.reset()` | High risk | `runtime.operate` |
| Copy Chat<br/>Duplicate an existing Chat to create a new copy. | `pipeline.copy`<br/>`workspace.pipeline.copy()` | Write | `resource.manage` |
| Create Chat<br/>Create a new Chat in the workspace. | `pipeline.create`<br/>`workspace.pipeline.create()` | Write | `resource.manage` |
| Chat Defaults<br/>Get template defaults and initial values for new Chats. | `pipeline.defaults`<br/>`workspace.pipeline.defaults()` | Read | `resource.view` |
| Delete Chat<br/>Permanently delete a Chat from the workspace. | `pipeline.delete`<br/>`workspace.pipeline.delete()` | High risk | `resource.manage` |
| Get Chat Extensions<br/>Get bound plugins, MCP servers, and tools for a Chat. | `pipeline.extensions.get`<br/>`workspace.pipeline.extensions.get()` | Read | `resource.view` |
| Update Chat Extensions<br/>Update bound plugins, MCP servers, and tools on a Chat. | `pipeline.extensions.update`<br/>`workspace.pipeline.extensions.update()` | Write | `resource.manage` |
| Get Chat<br/>Get complete definition and node graph of a Chat. | `pipeline.get`<br/>`workspace.pipeline.get()` | Read | `resource.view` |
| List Chats<br/>List all Chats in the workspace. | `pipeline.list`<br/>`workspace.pipeline.list()` | Read | `resource.view` |
| Chat Metadata<br/>Get available component types and node specifications. | `pipeline.metadata`<br/>`workspace.pipeline.metadata()` | Read | `resource.view` |
| Run Chat<br/>Execute a Chat run with custom input data. | `pipeline.run`<br/>`workspace.pipeline.run()` | Write | `runtime.operate` |
| Update Chat<br/>Update topology, nodes, or settings of a Chat. | `pipeline.update`<br/>`workspace.pipeline.update()` | Write | `resource.manage` |
### Plugin (`plugin`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Plugin Config<br/>Get configured parameters and settings for a plugin. | `plugin.config.get`<br/>`workspace.plugin.config.get()` | Read | `resource.view` |
| Plugin Debug Info<br/>Inspect internal plugin runtime process state and memory. | `plugin.debug_info`<br/>`workspace.plugin.debug_info()` | Read | `resource.manage` |
| Get Plugin<br/>Get detailed metadata and manifest for an installed plugin. | `plugin.get`<br/>`workspace.plugin.get()` | Read | `resource.view` |
| Plugin GitHub Assets<br/>List downloadable asset files for a GitHub release. | `plugin.github.assets`<br/>`workspace.plugin.github.assets()` | Read | `resource.view` |
| Plugin GitHub Branches<br/>List branches, tags and the default branch for a repository. | `plugin.github.refs`<br/>`workspace.plugin.github.refs()` | Read | `resource.view` |
| Plugin GitHub Releases<br/>List releases of a plugin repository hosted on GitHub. | `plugin.github.releases`<br/>`workspace.plugin.github.releases()` | Read | `resource.view` |
| Install Plugin from Marketplace<br/>Install a certified plugin from the official marketplace. | `plugin.install.marketplace`<br/>`workspace.plugin.install.marketplace()` | High risk | `resource.manage` |
| List Plugins<br/>List all installed plugins and their running status. | `plugin.list`<br/>`workspace.plugin.list()` | Read | `resource.view` |
| Plugin Logs<br/>Fetch runtime logs and error messages from a plugin. | `plugin.logs`<br/>`workspace.plugin.logs()` | Read | `audit.view` |
| Search Plugin Marketplace<br/>Search the LangBot Plugin Marketplace for installable plugins. | `plugin.marketplace.search`<br/>`workspace.plugin.marketplace.search()` | Read | `resource.view` |
| Plugin Readme<br/>Get documentation and usage instructions for a plugin. | `plugin.readme`<br/>`workspace.plugin.readme()` | Read | `resource.view` |
### Model Provider (`provider`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Create Provider<br/>Add a new model provider and credentials to the workspace. | `provider.create`<br/>`workspace.provider.create()` | Write | `provider_secret.manage` |
| Delete Provider<br/>Delete a model provider and its associated models. | `provider.delete`<br/>`workspace.provider.delete()` | High risk | `resource.manage` |
| Get Provider<br/>Get configuration and credentials of a model provider. | `provider.get`<br/>`workspace.provider.get()` | Read | `resource.view` |
| List Providers<br/>List all configured model providers in the workspace. | `provider.list`<br/>`workspace.provider.list()` | Read | `resource.view` |
| Provider Models Count<br/>Count models configured under a specific model provider. | `provider.models.count`<br/>`workspace.provider.models.count()` | Read | `resource.view` |
| Scan Provider Models<br/>Scan remote provider endpoint for available models. | `provider.models.scan`<br/>`workspace.provider.models.scan()` | Write | `provider_secret.manage` |
| Update Provider<br/>Update credentials or base URL of a model provider. | `provider.update`<br/>`workspace.provider.update()` | Write | `provider_secret.manage` |
### Requester (`requester`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Requester<br/>Get configuration and capabilities of an HTTP requester. | `requester.get`<br/>`workspace.requester.get()` | Read | `resource.view` |
| List Requesters<br/>List HTTP request client adapters used for model calls. | `requester.list`<br/>`workspace.requester.list()` | Read | `resource.view` |
### Skill (`skill`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Create Skill<br/>Create and register a new custom skill package. | `skill.create`<br/>`workspace.skill.create()` | Write | `resource.manage` |
| Delete Skill<br/>Delete a custom skill and remove its code files. | `skill.delete`<br/>`workspace.skill.delete()` | High risk | `resource.manage` |
| List Skill Files<br/>List files and directories within a skill package. | `skill.file.list`<br/>`workspace.skill.file.list()` | Read | `resource.view` |
| Read Skill File<br/>Read the source code or content of a file in a skill. | `skill.file.read`<br/>`workspace.skill.file.read()` | Read | `resource.view` |
| Write Skill File<br/>Write or update a code file inside a skill package. | `skill.file.write`<br/>`workspace.skill.file.write()` | Write | `resource.manage` |
| Get Skill<br/>Get full manifest and metadata for a specific skill. | `skill.get`<br/>`workspace.skill.get()` | Read | `resource.view` |
| Preview GitHub Skill<br/>Preview a skill package from a GitHub repository. | `skill.github.preview`<br/>`workspace.skill.github.preview()` | Read | `resource.manage` |
| List Skills<br/>List all custom skills installed in the workspace. | `skill.list`<br/>`workspace.skill.list()` | Read | `resource.view` |
| Reload Skills<br/>Reload all skill packages and refresh runtime registries. | `skill.reload`<br/>`workspace.skill.reload()` | Write | `resource.manage` |
| Update Skill<br/>Update metadata or configuration of an existing skill. | `skill.update`<br/>`workspace.skill.update()` | Write | `resource.manage` |
### Statistics (`stats`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Basic Statistics<br/>Get workspace overview counters for bots, models, and Chats. | `stats.basic`<br/>`workspace.stats.basic()` | Read | `resource.view` |
### Task (`task`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Task<br/>Get the status of a background task such as a plugin installation. | `task.get`<br/>`workspace.task.get()` | Read | `resource.view` |
### Tool (`tool`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Tool<br/>Get parameter schema and description for a specific tool. | `tool.get`<br/>`workspace.tool.get()` | Read | `resource.view` |
| List Tools<br/>List all registered function tools available for execution. | `tool.list`<br/>`workspace.tool.list()` | Read | `resource.view` |
### Workspace (`workspace`)
| Operation | ID and method | Risk | Granting member needs |
| --- | --- | --- | --- |
| Get Workspace Language<br/>Get the Workspace language used for backend messages and default bot replies. | `workspace.language.get`<br/>`workspace.workspace.language.get()` | Read | `workspace.view` |
`workspace.language.get` returns `{"language": "zh_Hans", "supported_languages": [...]}`. `language` is the Workspace message language set under Workspace settings (default `en_US`), not a member's WebUI language. Plugins and Agents can use it to localize replies and generated content. Changing the language stays with members.