Skip to content

Commit b53e234

Browse files
improvement(slack): rename commands to query and connect
1 parent a2b9234 commit b53e234

9 files changed

Lines changed: 17 additions & 19 deletions

File tree

‎apps/docs/content/docs/search/slack.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Each member then opens **Integrations → Slack → Connect**, chooses what to i
1717
Slack uses the same indexing pipeline as other connected sources. Both the Sim web Assistant and Slack bot search the organization's knowledge base, applying the current person's access permissions. Newly connected content becomes searchable after indexing completes. Connection and sync status appear in Integrations.
1818

1919
- DM **Sim Search**, or mention it in a channel it has joined.
20-
- Use **/sim-search [question]** to start a private DM thread. Channel invocations keep personalized answers and account details in DMs.
21-
- Use **/sim-connect [provider]**, or **Home → Connect sources**, to open your personal Integrations in Sim. OAuth begins only after you click Connect there.
20+
- Use **/query [question]** to start a private DM thread. Channel invocations keep personalized answers and account details in DMs.
21+
- Use **/connect [provider]**, or **Home → Connect sources**, to open your personal Integrations in Sim. OAuth begins only after you click Connect there.
2222
- Follow source links to the original messages. Use Slack's Stop control to cancel the active answer and queued follow-ups.
2323

2424
Existing custom-app installations are not silently converted. To switch to the official app, remove the old Slack Search binding and source app configuration explicitly, install the official app, and have members authorize it afresh. Workflow integrations keep their existing app configuration.

‎apps/sim/lib/knowledge/application/slack-search/commands.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const input = {
2525
user_id: 'U1',
2626
channel_id: 'C1',
2727
trigger_id: 'trigger.1',
28-
command: '/sim-search',
28+
command: '/query',
2929
text: 'release notes',
3030
} as const
3131
const principal = {
@@ -51,7 +51,7 @@ describe('Slack commands', () => {
5151
expect(m.receive).toHaveBeenCalledWith({
5252
principal,
5353
input: expect.objectContaining({
54-
command: '/sim-search',
54+
command: '/query',
5555
messageTs: null,
5656
channelId: 'C1',
5757
userId: 'U1',
@@ -69,7 +69,7 @@ describe('Slack commands', () => {
6969
it('returns an environment-correct personal connection link without OAuth state', async () => {
7070
const result = await receiveSlackSearchCommand.execute({
7171
principal,
72-
input: { ...input, command: '/sim-connect', text: 'slack' },
72+
input: { ...input, command: '/connect', text: 'slack' },
7373
})
7474
expect(result.text).toBe(
7575
'<https://www.sim.ai/o/org/integrations?connectorType=slack|Connect your sources in Sim>'

‎apps/sim/lib/knowledge/application/slack-search/commands.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const receiveSlackSearchCommand: OperationUseCase<
4040
response_type: 'ephemeral',
4141
text: 'An admin needs to enable Sim Search for this Slack workspace.',
4242
}
43-
if (input.command === '/sim-connect') {
43+
if (input.command === '/connect') {
4444
const url = new URL(
4545
organizationRoutes(context.installation.organizationId).integrations,
4646
getBaseUrl()
@@ -60,8 +60,7 @@ export const receiveSlackSearchCommand: OperationUseCase<
6060
return { response_type: 'ephemeral', text: `<${url.href}|Connect your sources in Sim>` }
6161
}
6262
const query = input.text.trim()
63-
if (!query)
64-
return { response_type: 'ephemeral', text: 'Use /sim-search followed by your question.' }
63+
if (!query) return { response_type: 'ephemeral', text: 'Use /query followed by your question.' }
6564
const turnId = await receiveSlackSearchMessage.execute({
6665
principal,
6766
input: {
@@ -70,7 +69,7 @@ export const receiveSlackSearchCommand: OperationUseCase<
7069
eventId: principal.eventId,
7170
userId: input.user_id,
7271
channelId: input.channel_id,
73-
command: '/sim-search',
72+
command: '/query',
7473
messageTs: null,
7574
query: query.length > 2000 ? '' : query,
7675
queryTooLong: query.length > 2000,

‎apps/sim/lib/knowledge/application/slack-search/mention.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ it('creates a real DM root for a slash command and never uses its trigger ID as
113113
channelId: 'C1',
114114
userId: 'U1',
115115
messageTs: null,
116-
command: '/sim-search',
116+
command: '/query',
117117
query: 'Find release notes',
118118
queryTooLong: false,
119119
},

‎apps/sim/lib/knowledge/application/slack-search/mention.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function routeSlackSearchMentionToDm(
1919
input: { job: SlackSearchJob; turnId: string; leaseId: string; signal: AbortSignal }
2020
): Promise<SlackSearchJob> {
2121
const { job, turnId, leaseId, signal } = input
22-
const command = job.message.command === '/sim-search' && job.message.messageTs === null
22+
const command = job.message.command === '/query' && job.message.messageTs === null
2323
if (job.message.channelId.startsWith('D') && !command) return job
2424
if (
2525
(!command && (!job.message.origin || job.message.origin.channelId !== job.message.channelId)) ||

‎apps/sim/lib/slack-search/commands.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const slackSearchCommandSchema = z.object({
77
team_id: id,
88
user_id: id,
99
channel_id: z.string().regex(/^[CGD][A-Z0-9]+$/),
10-
command: z.enum(['/sim-search', '/sim-connect']),
10+
command: z.enum(['/query', '/connect']),
1111
text: z.string().max(40_000),
1212
trigger_id: z.string().min(1).max(200),
1313
})

‎apps/sim/lib/slack-search/manifest.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ it('official app uses the existing personal indexing grants with bot commands',
109109
expect(manifest.oauth_config.scopes.bot).toContain('commands')
110110
expect(manifest.oauth_config.scopes.bot).not.toContain('groups:history')
111111
expect(manifest.features.slash_commands.map((command) => command.command)).toEqual([
112-
'/sim-search',
113-
'/sim-connect',
112+
'/query',
113+
'/connect',
114114
])
115115
expect(
116116
manifest.features.slash_commands.every(

‎apps/sim/lib/slack-search/manifest.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ export function createSharedSlackSearchManifest(origin: string) {
7676
...manifest.features,
7777
slash_commands: [
7878
{
79-
command: '/sim-search',
79+
command: '/query',
8080
description: 'Ask Sim Search a question privately',
8181
usage_hint: '[question]',
8282
url: webhook,
8383
should_escape: false,
8484
},
8585
{
86-
command: '/sim-connect',
86+
command: '/connect',
8787
description: 'Connect your personal sources in Sim',
8888
usage_hint: '[provider]',
8989
url: webhook,

‎apps/sim/lib/slack-search/types.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const slackSearchMessageSchema = z
1919
.string()
2020
.regex(/^\d+\.\d+$/)
2121
.nullable(),
22-
command: z.literal('/sim-search').optional(),
22+
command: z.literal('/query').optional(),
2323
threadTs: z
2424
.string()
2525
.regex(/^\d+\.\d+$/)
@@ -28,8 +28,7 @@ export const slackSearchMessageSchema = z
2828
queryTooLong: z.boolean(),
2929
})
3030
.refine(
31-
(message) =>
32-
message.messageTs !== null || (message.command === '/sim-search' && !message.threadTs),
31+
(message) => message.messageTs !== null || (message.command === '/query' && !message.threadTs),
3332
'Only a queued slash command may lack a Slack message timestamp'
3433
)
3534
export type SlackSearchMessage = z.infer<typeof slackSearchMessageSchema>

0 commit comments

Comments
 (0)