Skip to content

Commit 5213e17

Browse files
committed
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.
1 parent 3f59761 commit 5213e17

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

extensions/mattermost/src/mattermost/slash-commands.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ describe("slash-commands", () => {
108108
).toEqual(["oc_model", "oc_models"]);
109109
});
110110

111+
it("registers the queue command mapped to the core /queue directive", () => {
112+
const queueSpec = DEFAULT_COMMAND_SPECS.find((spec) => spec.trigger === "oc_queue");
113+
expect(queueSpec?.originalName).toBe("queue");
114+
const triggerMap = new Map<string, string>([["oc_queue", "queue"]]);
115+
expect(resolveCommandText("oc_queue", " collect drop:summarize ", triggerMap)).toBe(
116+
"/queue collect drop:summarize",
117+
);
118+
});
119+
111120
it("normalizes callback path in slash config", () => {
112121
const config = resolveSlashCommandConfig({ callbackPath: "api/channels/mattermost/command" });
113122
expect(config.callbackPath).toBe("/api/channels/mattermost/command");

extensions/mattermost/src/mattermost/slash-commands.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ export const DEFAULT_COMMAND_SPECS: MattermostCommandSpec[] = [
172172
autoComplete: true,
173173
autoCompleteHint: "[on|off]",
174174
},
175+
{
176+
trigger: "oc_queue",
177+
originalName: "queue",
178+
description: "Adjust active-run queue behavior",
179+
autoComplete: true,
180+
autoCompleteHint: "[steer|followup|collect|interrupt] [debounce:2s] [cap:N] [drop:old|new|summarize]",
181+
},
175182
];
176183

177184
// ─── Command registration ────────────────────────────────────────────────────

0 commit comments

Comments
 (0)