feat(mattermost): register /oc_queue as a native slash command · openclaw/openclaw@2b92706
amknight
·
2026-06-22
·
via Recent Commits to openclaw:main
File tree
extensions/mattermost/src/mattermost
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,6 +108,15 @@ describe("slash-commands", () => {
|
108 | 108 | ).toEqual(["oc_model", "oc_models"]); |
109 | 109 | }); |
110 | 110 | |
| 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 | + |
111 | 120 | it("normalizes callback path in slash config", () => { |
112 | 121 | const config = resolveSlashCommandConfig({ callbackPath: "api/channels/mattermost/command" }); |
113 | 122 | expect(config.callbackPath).toBe("/api/channels/mattermost/command"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -172,6 +172,13 @@ export const DEFAULT_COMMAND_SPECS: MattermostCommandSpec[] = [
|
172 | 172 | autoComplete: true, |
173 | 173 | autoCompleteHint: "[on|off]", |
174 | 174 | }, |
| 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 | +}, |
175 | 182 | ]; |
176 | 183 | |
177 | 184 | // ─── Command registration ──────────────────────────────────────────────────── |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。