Skip to content

Commands

pawaca edited this page Aug 30, 2026 · 2 revisions

Commands

Edge adaptation of the upstream slash command registry and execution system.

Upstream reference: Commands

What Upstream Provides

The commands subsystem (dsh-commands) enables direct execution of plugin-registered slash commands against a specific agent without creating model messages:

  • CommandRegistry — plugins register named commands with a handler, description, and optional input descriptor (hint text, image support). Commands can be global or agent-scoped.
  • Execution flowparseCommand() resolves the slash prefix, the registry validates input and image admission, lifecycle events (command/run, command/done) bracket the handler invocation, and results render directly to UI without model involvement.
  • Discovery — adapters query the registry for CommandDescriptor objects (handlers excluded). commands/change events notify clients when commands are registered or unregistered.
  • Relationship with Skills — skill invocation via /name in the composer goes through the command system: dsh-tool-skill registers a command handler that loads the skill content and injects it as model context.

Current Edge State

Edge does not install the upstream dsh-commands CommandRegistry plugin. No slash commands are registered on the server side.

The client-side dsh-client-ui-commands plugin is included in the 33-plugin bundle. It renders the commands menu in the composer and queries commands/list for available commands.

Edge handles the commands/list RPC via a manual stub in handleEdgeRemote() (edge-remotes.ts) that always returns an empty array. This stub exists because:

  • The client UI always queries commands/list on connection
  • Without a response, the client would show an error
  • The Typert gateway cannot auto-route it because the upstream CommandService lacks @Remote decorators

What Edge Did NOT Change

  • Client-side command UI (composer menu, command input bubble)
  • Command lifecycle event format (command/run, command/done)

Architecture Summary

Component Category Status
CommandRegistry (server) Not installed Empty catalog stub
Client UI (ui-commands) Reuse Renders commands menu
commands/list RPC Stub Returns [] via handleEdgeRemote

Key observation: Commands are closely tied to Skills — the primary use case for slash commands is /skill-name invocation. Once Skills are merged from feat/tool-skill (#103), the command system becomes meaningful. The handleEdgeRemote stub (#95) can then be evaluated for replacement.

TODO

(#109) Install CommandRegistry after Skills merge. Once feat/tool-skill is merged (#103) and SkillRegistry is active, install the upstream dsh-commands plugin so skill-invocation slash commands appear in the composer menu. The handleEdgeRemote stub (#95) may then be removable if the Typert gateway or apiproxy covers commands/list.

English

中文

Clone this wiki locally