Skip to content

Commit d140d5a

Browse files
author
Joshua Chittick
committed
fix: handle mentioned settings command and bump version
1 parent 245e4f7 commit d140d5a

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ode",
3-
"version": "0.0.88",
3+
"version": "0.0.89",
44
"description": "Coding anywhere with your coding agents connected",
55
"module": "packages/core/index.ts",
66
"type": "module",

packages/ims/shared/command-router.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ describe("parseIncomingCommand", () => {
66
expect(parseIncomingCommand("/setting")).toBe("setting");
77
expect(parseIncomingCommand("settings")).toBe("setting");
88
expect(parseIncomingCommand("/settings now")).toBe("setting");
9+
expect(parseIncomingCommand("@ode /setting")).toBe("setting");
10+
expect(parseIncomingCommand("<@ou_xxx> settings")).toBe("setting");
911
});
1012

1113
it("returns null for non-command messages", () => {
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
export type IncomingCommand = "setting";
22

33
export function parseIncomingCommand(text: string): IncomingCommand | null {
4-
const normalized = text.trim().replace(/^/, "/").toLowerCase();
4+
const normalized = text
5+
.trim()
6+
.replace(/^/, "/")
7+
.replace(/^(?:<@[^>]+>|@[^\s:,]+)[:,]?\s+/g, "")
8+
.toLowerCase();
59
if (/^\/?settings?\b/.test(normalized)) return "setting";
610
return null;
711
}

0 commit comments

Comments
 (0)