feat(mattermost): register /oc_queue as a native slash command

Add oc_queue to DEFAULT_COMMAND_SPECS so the native slash-command registrar exposes /oc_queue, mapped (originalName: queue) to the core /queue directive via the existing trigger-map path. Additive; rides the same registration/callback machinery as the other oc_* commands.
This commit is contained in:
Alex Knight
2026-06-21 21:28:25 +10:00
committed by Alex Knight
parent a9be81d510
commit 2b92706dcf
2 changed files with 16 additions and 0 deletions

View File

@@ -108,6 +108,15 @@ describe("slash-commands", () => {
).toEqual(["oc_model", "oc_models"]);
});
it("registers the queue command mapped to the core /queue directive", () => {
const queueSpec = DEFAULT_COMMAND_SPECS.find((spec) => spec.trigger === "oc_queue");
expect(queueSpec?.originalName).toBe("queue");
const triggerMap = new Map<string, string>([["oc_queue", "queue"]]);
expect(resolveCommandText("oc_queue", " collect drop:summarize ", triggerMap)).toBe(
"/queue collect drop:summarize",
);
});
it("normalizes callback path in slash config", () => {
const config = resolveSlashCommandConfig({ callbackPath: "api/channels/mattermost/command" });
expect(config.callbackPath).toBe("/api/channels/mattermost/command");

View File

@@ -172,6 +172,13 @@ export const DEFAULT_COMMAND_SPECS: MattermostCommandSpec[] = [
autoComplete: true,
autoCompleteHint: "[on|off]",
},
{
trigger: "oc_queue",
originalName: "queue",
description: "Adjust active-run queue behavior",
autoComplete: true,
autoCompleteHint: "[steer|followup|collect|interrupt] [debounce:2s] [cap:N] [drop:old|new|summarize]",
},
];
// ─── Command registration ────────────────────────────────────────────────────