select workspace

This commit is contained in:
Arjun 2026-02-25 16:29:09 +05:30
parent 36f700cc77
commit 6cd5abce48
7 changed files with 303 additions and 53 deletions

View file

@ -83,13 +83,15 @@ agent-slack canvas get F01234567 --workspace https://team.slack.com
## 3. Multi-Workspace
If the user has multiple workspaces configured, use \`--workspace <url>\` to disambiguate:
**Important:** The user has chosen which workspaces to use. Before your first Slack operation, read \`~/.rowboat/config/slack.json\` to see the selected workspaces. Only interact with workspaces listed in that config — ignore any other authenticated workspaces.
If the selected workspace list contains multiple entries, use \`--workspace <url>\` to disambiguate:
\`\`\`
agent-slack message list "#general" --workspace https://team.slack.com
\`\`\`
Use \`agent-slack auth whoami\` to see all configured workspaces.
If only one workspace is selected, always use \`--workspace\` with its URL to avoid ambiguity with other authenticated workspaces.
---

View file

@ -10,7 +10,7 @@ export interface ISlackConfigRepo {
export class FSSlackConfigRepo implements ISlackConfigRepo {
private readonly configPath = path.join(WorkDir, 'config', 'slack.json');
private readonly defaultConfig: SlackConfig = { enabled: false };
private readonly defaultConfig: SlackConfig = { enabled: false, workspaces: [] };
constructor() {
this.ensureConfigFile();

View file

@ -1,6 +1,13 @@
import z from "zod";
export const SlackWorkspace = z.object({
url: z.string(),
name: z.string(),
});
export type SlackWorkspace = z.infer<typeof SlackWorkspace>;
export const SlackConfig = z.object({
enabled: z.boolean(),
workspaces: z.array(SlackWorkspace).default([]),
});
export type SlackConfig = z.infer<typeof SlackConfig>;

View file

@ -274,16 +274,25 @@ const ipcSchemas = {
req: z.null(),
res: z.object({
enabled: z.boolean(),
workspaces: z.array(z.object({ url: z.string(), name: z.string() })),
}),
},
'slack:setConfig': {
req: z.object({
enabled: z.boolean(),
workspaces: z.array(z.object({ url: z.string(), name: z.string() })),
}),
res: z.object({
success: z.literal(true),
}),
},
'slack:listWorkspaces': {
req: z.null(),
res: z.object({
workspaces: z.array(z.object({ url: z.string(), name: z.string() })),
error: z.string().optional(),
}),
},
'onboarding:getStatus': {
req: z.null(),
res: z.object({