Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ode",
"version": "0.0.86",
"version": "0.0.87",
"description": "Coding anywhere with your coding agents connected",
"module": "packages/core/index.ts",
"type": "module",
Expand Down
44 changes: 38 additions & 6 deletions packages/ims/discord/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ const DISCORD_LAUNCHER_COMMANDS = [
name: "setting",
description: "Open Ode settings",
},
{
name: "settings",
description: "Open Ode settings",
},
] as const;

const discordClients = new Map<string, Client>();
Expand Down Expand Up @@ -273,7 +277,7 @@ async function renameDiscordThread(

function parseLauncherCommand(text: string): "setting" | null {
const trimmed = text.trim().toLowerCase();
if (/^\/setting\b/.test(trimmed)) return "setting";
if (/^\/?settings?\b/.test(trimmed)) return "setting";
return null;
}

Expand Down Expand Up @@ -319,6 +323,19 @@ function buildLauncherReplyPayload(params: {
};
}

async function sendLauncherReplyForMessage(params: {
message: any;
command: LauncherCommand;
channelId: string;
}): Promise<void> {
const payload = buildLauncherReplyPayload({
command: params.command,
userId: params.message.author.id,
channelId: params.channelId,
});
await params.message.reply(payload);
}

function getModalValue(interaction: any, fieldId: string): string {
return interaction.fields.getTextInputValue(fieldId) || "";
}
Expand Down Expand Up @@ -913,7 +930,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
const text = message.content.trim();
const launcherCommand = parseLauncherCommand(text);
if (launcherCommand) {
log.debug("Ignoring Discord message command in thread; slash command handles it", {
await sendLauncherReplyForMessage({
message,
command: launcherCommand,
channelId: parentId,
});
log.debug("Handled Discord message settings command in thread", {
command: launcherCommand,
threadId,
});
Expand Down Expand Up @@ -948,7 +970,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {

const parentLauncherCommand = parseLauncherCommand(message.content);
if (parentLauncherCommand) {
log.debug("Ignoring Discord message command in parent channel; slash command handles it", {
await sendLauncherReplyForMessage({
message,
command: parentLauncherCommand,
channelId: parentId,
});
log.debug("Handled Discord message settings command in parent channel", {
command: parentLauncherCommand,
channelId: parentId,
});
Expand All @@ -961,7 +988,12 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {
const cleaned = cleanBotMention(message.content, client.user.id);
const cleanedLauncherCommand = parseLauncherCommand(cleaned);
if (cleanedLauncherCommand) {
log.debug("Ignoring Discord mention command; slash command handles it", {
await sendLauncherReplyForMessage({
message,
command: cleanedLauncherCommand,
channelId: parentId,
});
log.debug("Handled Discord mention settings command", {
command: cleanedLauncherCommand,
channelId: parentId,
});
Expand Down Expand Up @@ -1011,10 +1043,10 @@ export async function startDiscordRuntime(reason: string): Promise<boolean> {

if (!interaction.isChatInputCommand || !interaction.isChatInputCommand()) return;
const commandName = String(interaction.commandName || "").toLowerCase();
if (commandName !== "setting") return;
if (commandName !== "setting" && commandName !== "settings") return;

const payload = buildLauncherReplyPayload({
command: commandName as LauncherCommand,
command: "setting",
userId: interaction.user.id,
channelId: getResolvedChannelId(interaction),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ims/lark/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function parseLarkText(content: string | undefined): string {

function isSettingsCommand(text: string): boolean {
const normalized = text.trim().replace(/^//, "/");
return /^\/?setting(?:\s|$)/i.test(normalized);
return /^\/?settings?(?:\s|$)/i.test(normalized);
}

function getLocalSettingsUrl(): string {
Expand Down