Skip to content

Commit 64b3f98

Browse files
authored
feat(copilot): add commands (#2797)
* Slash commands v0 * Web tools * Web * Fix popover * Fix commands ui * Fix for context mentions too * Improvem tool names for options and config * Fix thinking text scroll * Fix ishosted * Ui * Ui * Subagent parallelization * Fix ui * Fix lint * Fix superagent * Dont collapse info and super
1 parent 4be4203 commit 64b3f98

23 files changed

Lines changed: 1522 additions & 530 deletions

File tree

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const ChatMessageSchema = z.object({
9797
})
9898
)
9999
.optional(),
100+
commands: z.array(z.string()).optional(),
100101
})
101102

102103
/**
@@ -132,6 +133,7 @@ export async function POST(req: NextRequest) {
132133
provider,
133134
conversationId,
134135
contexts,
136+
commands,
135137
} = ChatMessageSchema.parse(body)
136138
// Ensure we have a consistent user message ID for this request
137139
const userMessageIdToUse = userMessageId || crypto.randomUUID()
@@ -462,6 +464,7 @@ export async function POST(req: NextRequest) {
462464
...(integrationTools.length > 0 && { tools: integrationTools }),
463465
...(baseTools.length > 0 && { baseTools }),
464466
...(credentials && { credentials }),
467+
...(commands && commands.length > 0 && { commands }),
465468
}
466469

467470
try {

0 commit comments

Comments
 (0)