mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-06 00:03:42 +00:00
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:
@@ -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");
|
||||
|
||||
@@ -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 ────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user