description: "Client command API for the Web GUI: the / command source, three dispatch kinds, the per-session command directory, and popupSelect and action registration for business packages; for users and maintainers of slash commands."
English | 中文
Typing a / command in the composer opens the matching surface — a registered popup, a host command's input, or a direct execution — and a command line is never silently downgraded to a plain prompt. Business packages contribute command surfaces through ctx.commandUi: a popupSelect spec (/model, /permission) or an action (/feedback), registered as a command or decorating an existing host command while the host keeps its catalog row and argument claim. Space and Enter resolve the line against the session's directory: a host descriptor with input is leadingInput, a registered CommandUiSpec is its kind, and everything else is execute.
Mount this plugin alongside ui-input-trigger and ui-conversation; the / source then appears in the trigger menu, and business packages register their command surfaces through ctx.commandUi. Typing /model opens the registered popup; a host command with an argument claim opens its input or executes directly.
A contribution is a client-owned command — a host-name collision fails loud. A decoration adds a bare-invocation popup to an EXISTING host command: the host command keeps its catalog row, its argument claim, and its lifecycle logging, and a decorated name with no host row in the session's directory never fires. Menu queries fuzzy-match ordered, case-insensitive subsequences of command names; prefixes rank first.
When the composer submits with images or generic files, only a host command declaring input.attachments proceeds. Every other command route throws the localized attachmentsUnsupported refusal, rendered as a transient toast while the draft and attachment cards stay in place. Handler errors preserve the same draft state for retry.
Read these pages when the command surface is not enough. They move from the command API to the trigger pipeline and the host command registry.
/ source registers into.Indirectly, through the host command.execute RPC the dispatch paths trigger: each command handler's host package owns any model-visible effect (the /plan handler flips plan mode, whose owning package injects its policy section), while the command line, the detached result, and every menu and notice rendering stay client-side and never enter the session log.
None directly; this package neither assembles nor sends a provider request. Command handlers it triggers may change what the owning host packages contribute to the next request's system prompt — a section appearing or disappearing replaces earlier request tokens and invalidates the provider prefix from that point — but that effect is owned and documented by each command's host package.
These limits define the current command surface. They are current package constraints, not a general command-line comparison or a task backlog.
SessionInput.notify; after session teardown the console line is the only remaining surface.Runtime invariant: No companion is published. A browser-side source over the wire command directory — it emits no cordis events and owns no cross-plugin mutable state; dispatch and cache behavior are asserted by this package's specs.