Saxonberg Server API
    Preparing search index...

    Interface CommandContext

    Read-only reference holder controllers see during execute(). Built by CommandGiverMixin.executeCommand before any controller runs; every field is guaranteed populated by the time a controller inspects it (modulo interactive, which is genuinely optional).

    • commandGiver — the thing executing the command, typed as the general Stuff & CommandGiver. Controllers narrow with MixinApi.isX() predicates or cast to a known concrete type.
    • interactive — the connection/session that originated the input. Optional; absent for cascaded commands.
    • location — the Container the giver is in at dispatch time. Typically a Location (a room), but may be any Stuff & Container — an Avatar inside a Vessel (wardrobe, ship cabin) issues commands from the vessel as the location. Controllers narrow with MixinApi.isX() if they need a specific surface (e.g. isExitable for exit listing).
    • commandText — the original raw input.
    • executionId — per-execution security id (call-stack tracking).
    • commandId — per-execution attribution id stamped onto every frame composed during the synchronous span of the call.
    • verb — the verb the matcher dispatched on.
    • command — the matched YAML view. Useful for controllers that render help text or introspect their own schema.
    interface CommandContext {
        aliasExpansion?: AliasExpansionInfo;
        barId?: string;
        bodyFields?: Record<string, unknown>;
        command: CommandDefinition;
        commandGiver: Stuff & CommandGiver;
        commandId: string;
        commandSource: Stuff;
        commandText: string;
        executionId: string;
        interactive?: default;
        location: Stuff & Container | null;
        verb: string;
        getNotes(): readonly Note[];
        getStatus(): Status;
        note(n: Note): void;
        setStatus(s: Status): void;
    }
    Index

    Properties

    aliasExpansion?: AliasExpansionInfo

    Populated by ShellApi.expandAliases when the command's verb was resolved through one or more alias hops. Absent when the verb was typed directly. Controllers that branch on alias-vs-direct read this; everyone else ignores it.

    barId?: string

    The input region (command bar) this command was submitted from, carried from ExecuteCommandOpts.barId. ModeController reads it to target the right bar's entry in cockpit.inputModes. Defaults to 'main'.

    bodyFields?: Record<string, unknown>

    Structured body side-channel carried from ExecuteCommandOpts. When present, the dispatcher overlays it onto the bound model's payload:/designated body fields (via CommandApi.overlayBodyFields) before resolveModel.

    commandGiver: Stuff & CommandGiver
    commandId: string
    commandSource: Stuff

    The Stuff that afforded the executing command — the giver itself for an innate ('self') verb, or the granting item/peer otherwise. Populated by the dispatcher from the claiming match's affordance record (resolved 'self' → giver). Falls back to the giver on the bound / programmatic dispatch paths where no contextual match step runs. Always a concrete Stuff. The source object's type is the discriminator — there is no provisioning-category tag.

    commandText: string
    executionId: string
    interactive?: default
    location: Stuff & Container | null
    verb: string

    Methods

    • Accumulate a structured note. Auto-escalates status per the autoEscalationFor table unless setStatus was already called explicitly (in which case the explicit value sticks).

      Parameters

      • n: Note

      Returns void