@inkeep/agents-work-apps 0.48.7 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,10 +4,10 @@ import "./routes/setup.js";
4
4
  import "./routes/tokenExchange.js";
5
5
  import { WebhookVerificationResult, verifyWebhookSignature } from "./routes/webhooks.js";
6
6
  import { Hono } from "hono";
7
- import * as hono_types4 from "hono/types";
7
+ import * as hono_types6 from "hono/types";
8
8
 
9
9
  //#region src/github/index.d.ts
10
- declare function createGithubRoutes(): Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
11
- declare const githubRoutes: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
10
+ declare function createGithubRoutes(): Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
11
+ declare const githubRoutes: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
12
12
  //#endregion
13
13
  export { GenerateInstallationAccessTokenResult, GenerateTokenError, GenerateTokenResult, GitHubAppConfig, InstallationAccessToken, InstallationInfo, LookupInstallationError, LookupInstallationForRepoResult, LookupInstallationResult, WebhookVerificationResult, clearConfigCache, createAppJwt, createGithubRoutes, determineStatus, fetchInstallationDetails, fetchInstallationRepositories, generateInstallationAccessToken, getGitHubAppConfig, getGitHubAppName, getStateSigningSecret, getWebhookSecret, githubRoutes, isGitHubAppConfigured, isGitHubAppNameConfigured, isStateSigningConfigured, isWebhookConfigured, lookupInstallationForRepo, validateGitHubAppConfigOnStartup, validateGitHubInstallFlowConfigOnStartup, validateGitHubWebhookConfigOnStartup, verifyWebhookSignature };
@@ -1,7 +1,7 @@
1
- import * as hono0 from "hono";
1
+ import * as hono1 from "hono";
2
2
 
3
3
  //#region src/github/mcp/auth.d.ts
4
- declare const githubMcpAuth: () => hono0.MiddlewareHandler<{
4
+ declare const githubMcpAuth: () => hono1.MiddlewareHandler<{
5
5
  Variables: {
6
6
  toolId: string;
7
7
  };
@@ -36,8 +36,8 @@ declare const ChangedFileSchema: z.ZodObject<{
36
36
  path: z.ZodString;
37
37
  status: z.ZodEnum<{
38
38
  added: "added";
39
- modified: "modified";
40
39
  removed: "removed";
40
+ modified: "modified";
41
41
  renamed: "renamed";
42
42
  copied: "copied";
43
43
  changed: "changed";
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types8 from "hono/types";
2
+ import * as hono_types0 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types0 from "hono/types";
2
+ import * as hono_types2 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types2 from "hono/types";
2
+ import * as hono_types4 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/webhooks.d.ts
5
5
  interface WebhookVerificationResult {
@@ -7,6 +7,6 @@ interface WebhookVerificationResult {
7
7
  error?: string;
8
8
  }
9
9
  declare function verifyWebhookSignature(payload: string, signature: string | undefined, secret: string): WebhookVerificationResult;
10
- declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
@@ -57,12 +57,7 @@ declare const SlackStrings: {
57
57
  readonly publicSection: string;
58
58
  readonly privateSection: string;
59
59
  readonly otherCommands: string;
60
- };
61
- readonly agentList: {
62
- readonly title: "šŸ¤– Available Agents";
63
- readonly usage: "Usage:";
64
- readonly runUsage: "`/inkeep run \"agent name\" question` - Run a specific agent";
65
- readonly andMore: (count: number) => string;
60
+ readonly docsLink: "šŸ“– <https://docs.inkeep.com/talk-to-your-agents/slack/overview|Learn more>";
66
61
  };
67
62
  readonly messageContext: {
68
63
  readonly label: "Message:";
@@ -38,7 +38,7 @@ const SlackStrings = {
38
38
  poweredBy: (agentName) => `Powered by *${agentName}* via Inkeep`,
39
39
  privateResponse: "_Private response_"
40
40
  },
41
- usage: { mentionEmpty: "*To use your Inkeep agent, include a message:*\n\n• `@Inkeep <message>` — Send a message to your agent (reply appears in a thread)\n• `@Inkeep <message>` in a thread — Includes the thread as context for your agent\n• `@Inkeep` in a thread — Triggers your agent using the full thread as context\n\nšŸ’” Use `/inkeep help` for all available commands." },
41
+ usage: { mentionEmpty: "*To use your Inkeep agent, include a message:*\n\n• `@Inkeep <message>` — Send a message to the default agent for the channel (reply appears in a thread)\n• `@Inkeep <message>` in a thread — Includes the thread as context for your agent\n• `@Inkeep` in a thread — Triggers your agent using the full thread as context\n\nšŸ’” Use `/inkeep help` for all available commands." },
42
42
  status: {
43
43
  thinking: (agentName) => `_${agentName} is thinking..._`,
44
44
  noAgentsAvailable: "No agents available",
@@ -50,15 +50,10 @@ const SlackStrings = {
50
50
  },
51
51
  help: {
52
52
  title: "Inkeep — How to Use",
53
- publicSection: "šŸ”Š *Public* — everyone in the channel can see the response\n\n• `@Inkeep <message>` — Send a message to your agent\n• `@Inkeep <message>` in a thread — Includes thread as context\n• `@Inkeep` in a thread — Uses the full thread as context",
54
- privateSection: "šŸ”’ *Private* — only you can see the response\n\n• `/inkeep <message>` — Send a message to your agent\n• `/inkeep` — Open the agent picker to choose an agent and prompt",
55
- otherCommands: "āš™ļø *Other Commands*\n\n• `/inkeep run \"agent name\" <message>` — Use a specific agent\n• `/inkeep list` — List available agents\n• `/inkeep status` — Check your connection and agent config\n• `/inkeep link` / `/inkeep unlink` — Manage account connection\n• `/inkeep help` — Show this message"
56
- },
57
- agentList: {
58
- title: "šŸ¤– Available Agents",
59
- usage: "Usage:",
60
- runUsage: "`/inkeep run \"agent name\" question` - Run a specific agent",
61
- andMore: (count) => `...and ${count} more`
53
+ publicSection: "šŸ”Š *Public* — everyone in the channel can see the response\n\n• `@Inkeep <message>` — message the default agent in this channel\n• `@Inkeep <message>` in a thread — Includes thread as context\n• `@Inkeep` in a thread — Uses the full thread as context",
54
+ privateSection: "šŸ”’ *Private* — only you can see the response\n\n• `/inkeep <message>` — message the default agent in this channel\n• `/inkeep` — Open the agent picker to choose an agent and write a prompt",
55
+ otherCommands: "āš™ļø *Other Commands*\n\n• `/inkeep status` — Check your connection and agent config\n• `/inkeep link` / `/inkeep unlink` — Manage account connection\n• `/inkeep help` — Show this message",
56
+ docsLink: "šŸ“– <https://docs.inkeep.com/talk-to-your-agents/slack/overview|Learn more>"
62
57
  },
63
58
  messageContext: { label: "Message:" }
64
59
  };
@@ -43,11 +43,6 @@ declare function buildConversationResponseBlocks(params: {
43
43
  isError: boolean;
44
44
  followUpParams: FollowUpButtonParams;
45
45
  }): any[];
46
- declare function createAgentListMessage(agents: Array<{
47
- id: string;
48
- name: string | null;
49
- projectName: string | null;
50
- }>, dashboardUrl: string): Readonly<slack_block_builder0.SlackMessageDto>;
51
46
  declare function createUpdatedHelpMessage(): Readonly<slack_block_builder0.SlackMessageDto>;
52
47
  declare function createAlreadyLinkedMessage(email: string, linkedAt: string, dashboardUrl: string): Readonly<slack_block_builder0.SlackMessageDto>;
53
48
  declare function createUnlinkSuccessMessage(): Readonly<slack_block_builder0.SlackMessageDto>;
@@ -70,4 +65,4 @@ interface AgentConfigSources {
70
65
  declare function createStatusMessage(email: string, linkedAt: string, dashboardUrl: string, agentConfigs: AgentConfigSources): Readonly<slack_block_builder0.SlackMessageDto>;
71
66
  declare function createJwtLinkMessage(linkUrl: string, expiresInMinutes: number): Readonly<slack_block_builder0.SlackMessageDto>;
72
67
  //#endregion
73
- export { AgentConfigSources, ContextBlockParams, FollowUpButtonParams, buildConversationResponseBlocks, buildFollowUpButton, createAgentListMessage, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage };
68
+ export { AgentConfigSources, ContextBlockParams, FollowUpButtonParams, buildConversationResponseBlocks, buildFollowUpButton, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage };
@@ -65,15 +65,8 @@ function buildConversationResponseBlocks(params) {
65
65
  }
66
66
  return blocks;
67
67
  }
68
- function createAgentListMessage(agents, dashboardUrl) {
69
- const agentList = agents.slice(0, 15).map((a) => `• ${Md.bold(a.name || a.id)} ${a.projectName ? `(${Md.italic(a.projectName)})` : ""}`).join("\n");
70
- const moreText = agents.length > 15 ? `\n\n${SlackStrings.agentList.andMore(agents.length - 15)}` : "";
71
- return Message().blocks(Blocks.Section().text(`${Md.bold(SlackStrings.agentList.title)}\n\n` + agentList + moreText + `
72
-
73
- ${Md.bold(SlackStrings.agentList.usage)}\n• ${SlackStrings.agentList.runUsage}`), Blocks.Actions().elements(Elements.Button().text(SlackStrings.buttons.openDashboard).url(dashboardUrl).actionId("view_agents"))).buildToObject();
74
- }
75
68
  function createUpdatedHelpMessage() {
76
- return Message().blocks(Blocks.Section().text(`${Md.bold(SlackStrings.help.title)}`), Blocks.Section().text(SlackStrings.help.publicSection), Blocks.Divider(), Blocks.Section().text(SlackStrings.help.privateSection), Blocks.Divider(), Blocks.Section().text(SlackStrings.help.otherCommands)).buildToObject();
69
+ return Message().blocks(Blocks.Section().text(`${Md.bold(SlackStrings.help.title)}`), Blocks.Section().text(SlackStrings.help.publicSection), Blocks.Divider(), Blocks.Section().text(SlackStrings.help.privateSection), Blocks.Divider(), Blocks.Section().text(SlackStrings.help.otherCommands), Blocks.Divider(), Blocks.Section().text(SlackStrings.help.docsLink)).buildToObject();
77
70
  }
78
71
  function createAlreadyLinkedMessage(email, linkedAt, dashboardUrl) {
79
72
  return Message().blocks(Blocks.Section().text(Md.bold("āœ… Already Linked!") + "\n\nYour Slack account is already connected to Inkeep.\n\n" + Md.bold("Inkeep Account:") + ` ${email}\n` + Md.bold("Linked:") + ` ${new Date(linkedAt).toLocaleDateString()}\n\nTo switch accounts, first run \`/inkeep unlink\``), Blocks.Actions().elements(Elements.Button().text(SlackStrings.buttons.openDashboard).url(dashboardUrl).actionId("open_dashboard"))).buildToObject();
@@ -100,4 +93,4 @@ function createJwtLinkMessage(linkUrl, expiresInMinutes) {
100
93
  }
101
94
 
102
95
  //#endregion
103
- export { buildConversationResponseBlocks, buildFollowUpButton, createAgentListMessage, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage };
96
+ export { buildConversationResponseBlocks, buildFollowUpButton, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage };
@@ -12,8 +12,6 @@ declare function handleHelpCommand(): Promise<SlackCommandResponse>;
12
12
  */
13
13
  declare function handleAgentPickerCommand(payload: SlackCommandPayload, tenantId: string, workspaceConnection?: SlackWorkspaceConnection | null): Promise<SlackCommandResponse>;
14
14
  declare function handleQuestionCommand(payload: SlackCommandPayload, question: string, _dashboardUrl: string, tenantId: string): Promise<SlackCommandResponse>;
15
- declare function handleRunCommand(payload: SlackCommandPayload, agentIdentifier: string, question: string, _dashboardUrl: string, tenantId: string): Promise<SlackCommandResponse>;
16
- declare function handleAgentListCommand(payload: SlackCommandPayload, dashboardUrl: string, _tenantId: string): Promise<SlackCommandResponse>;
17
15
  declare function handleCommand(payload: SlackCommandPayload): Promise<SlackCommandResponse>;
18
16
  //#endregion
19
- export { handleAgentListCommand, handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand };
17
+ export { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand };
@@ -4,115 +4,16 @@ import runDbClient_default from "../../../db/runDbClient.js";
4
4
  import { findWorkspaceConnectionByTeamId } from "../nango.js";
5
5
  import { resolveEffectiveAgent } from "../agent-resolution.js";
6
6
  import { SlackStrings } from "../../i18n/strings.js";
7
- import { createAgentListMessage, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "../blocks/index.js";
7
+ import { createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "../blocks/index.js";
8
8
  import { getSlackClient } from "../client.js";
9
9
  import { fetchAgentsForProject, fetchProjectsForTenant, getChannelAgentConfig, sendResponseUrlMessage } from "../events/utils.js";
10
10
  import { buildAgentSelectorModal } from "../modals.js";
11
11
  import { deleteWorkAppSlackUserMapping, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingBySlackUser, flushTraces, getWaitUntil, signSlackLinkToken, signSlackUserToken } from "@inkeep/agents-core";
12
12
 
13
13
  //#region src/slack/services/commands/index.ts
14
- /**
15
- * Fetch all agents from the manage API.
16
- * This uses the proper ref-middleware and Dolt branch resolution.
17
- * Requires an auth token to access the manage API.
18
- */
19
- const INTERNAL_FETCH_TIMEOUT_MS = 1e4;
20
- async function fetchAgentsFromManageApi(tenantId, authToken) {
21
- const apiBaseUrl = env.INKEEP_AGENTS_API_URL || "http://localhost:3002";
22
- const controller = new AbortController();
23
- const timeout = setTimeout(() => controller.abort(), INTERNAL_FETCH_TIMEOUT_MS);
24
- try {
25
- const projectsResponse = await fetch(`${apiBaseUrl}/manage/tenants/${tenantId}/projects`, {
26
- method: "GET",
27
- headers: {
28
- "Content-Type": "application/json",
29
- Authorization: `Bearer ${authToken}`
30
- },
31
- signal: controller.signal
32
- });
33
- if (!projectsResponse.ok) {
34
- logger.error({
35
- status: projectsResponse.status,
36
- tenantId
37
- }, "Failed to fetch projects from manage API");
38
- return [];
39
- }
40
- const projectsData = await projectsResponse.json();
41
- const projects = projectsData.data || projectsData || [];
42
- logger.info({
43
- projectCount: projects.length,
44
- tenantId
45
- }, "Fetched projects from manage API");
46
- return (await Promise.all(projects.map(async (project) => {
47
- try {
48
- const agentsResponse = await fetch(`${apiBaseUrl}/manage/tenants/${tenantId}/projects/${project.id}/agents`, {
49
- method: "GET",
50
- headers: {
51
- "Content-Type": "application/json",
52
- Authorization: `Bearer ${authToken}`
53
- },
54
- signal: controller.signal
55
- });
56
- if (agentsResponse.ok) {
57
- const agentsData = await agentsResponse.json();
58
- return (agentsData.data || agentsData || []).map((agent) => ({
59
- id: agent.id,
60
- name: agent.name,
61
- projectId: project.id,
62
- projectName: project.name
63
- }));
64
- }
65
- logger.warn({
66
- status: agentsResponse.status,
67
- projectId: project.id
68
- }, "Failed to fetch agents for project");
69
- return [];
70
- } catch (error) {
71
- logger.error({
72
- error,
73
- projectId: project.id
74
- }, "Failed to fetch agents for project");
75
- return [];
76
- }
77
- }))).flat();
78
- } catch (error) {
79
- logger.error({
80
- error,
81
- tenantId
82
- }, "Failed to fetch agents from manage API");
83
- return [];
84
- } finally {
85
- clearTimeout(timeout);
86
- }
87
- }
88
- /**
89
- * Find an agent by name or ID from the manage API.
90
- */
91
- async function findAgentByIdentifier(tenantId, identifier, authToken) {
92
- return (await fetchAgentsFromManageApi(tenantId, authToken)).find((a) => a.id === identifier || a.name?.toLowerCase() === identifier.toLowerCase()) || null;
93
- }
94
14
  const DEFAULT_CLIENT_ID = "work-apps-slack";
95
15
  const LINK_CODE_TTL_MINUTES = 10;
96
16
  const logger = getLogger("slack-commands");
97
- /**
98
- * Parse agent name and question from command text.
99
- * Agent name must be in quotes: "agent name" question
100
- */
101
- function parseAgentAndQuestion(text) {
102
- if (!text.trim()) return {
103
- agentName: null,
104
- question: null
105
- };
106
- const quotedMatch = text.match(/^["']([^"']+)["']\s+(.+)$/);
107
- if (quotedMatch) return {
108
- agentName: quotedMatch[1].trim(),
109
- question: quotedMatch[2].trim()
110
- };
111
- return {
112
- agentName: null,
113
- question: null
114
- };
115
- }
116
17
  async function handleLinkCommand(payload, dashboardUrl, tenantId) {
117
18
  const existingLink = await findWorkAppSlackUserMapping(runDbClient_default)(tenantId, payload.userId, payload.teamId, DEFAULT_CLIENT_ID);
118
19
  if (existingLink) return {
@@ -325,7 +226,7 @@ async function handleQuestionCommand(payload, question, _dashboardUrl, tenantId)
325
226
  });
326
227
  if (!resolvedAgent) return {
327
228
  response_type: "ephemeral",
328
- ...createErrorMessage("No default agent configured. Ask your admin to set a workspace default in the dashboard.\n\nUse `/inkeep list` to see available agents.")
229
+ ...createErrorMessage("No default agent configured. Ask your admin to set a workspace default in the dashboard.")
329
230
  };
330
231
  const questionWork = executeAgentInBackground(payload, existingLink, {
331
232
  id: resolvedAgent.agentId,
@@ -431,85 +332,6 @@ async function executeAgentInBackground(payload, existingLink, targetAgent, ques
431
332
  });
432
333
  }
433
334
  }
434
- async function handleRunCommand(payload, agentIdentifier, question, _dashboardUrl, tenantId) {
435
- const existingLink = await findWorkAppSlackUserMappingBySlackUser(runDbClient_default)(payload.userId, payload.teamId, DEFAULT_CLIENT_ID);
436
- if (!existingLink) return generateLinkCodeWithIntent(payload, tenantId);
437
- const userTenantId = existingLink.tenantId;
438
- try {
439
- const targetAgent = await findAgentByIdentifier(userTenantId, agentIdentifier, await signSlackUserToken({
440
- inkeepUserId: existingLink.inkeepUserId,
441
- tenantId: userTenantId,
442
- slackTeamId: payload.teamId,
443
- slackUserId: payload.userId,
444
- slackEnterpriseId: payload.enterpriseId
445
- }));
446
- if (!targetAgent) return {
447
- response_type: "ephemeral",
448
- ...createErrorMessage(`Agent "${agentIdentifier}" not found. Use \`/inkeep list\` to see available agents.`)
449
- };
450
- const runWork = executeAgentInBackground(payload, existingLink, targetAgent, question, userTenantId).catch((error) => {
451
- logger.error({ error }, "Background execution promise rejected");
452
- }).finally(() => flushTraces());
453
- const waitUntil = await getWaitUntil();
454
- if (waitUntil) waitUntil(runWork);
455
- return {};
456
- } catch (error) {
457
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
458
- logger.error({
459
- error: errorMessage,
460
- tenantId: userTenantId
461
- }, "Failed to run agent");
462
- return {
463
- response_type: "ephemeral",
464
- ...createErrorMessage("Failed to run agent. Please try again or visit the dashboard.")
465
- };
466
- }
467
- }
468
- async function handleAgentListCommand(payload, dashboardUrl, _tenantId) {
469
- const existingLink = await findWorkAppSlackUserMappingBySlackUser(runDbClient_default)(payload.userId, payload.teamId, DEFAULT_CLIENT_ID);
470
- if (!existingLink) return {
471
- response_type: "ephemeral",
472
- ...createNotLinkedMessage()
473
- };
474
- const userTenantId = existingLink.tenantId;
475
- logger.info({
476
- slackUserId: payload.userId,
477
- existingLinkTenantId: existingLink.tenantId,
478
- existingLinkInkeepUserId: existingLink.inkeepUserId
479
- }, "Found user mapping for list command");
480
- try {
481
- const allAgents = await fetchAgentsFromManageApi(userTenantId, await signSlackUserToken({
482
- inkeepUserId: existingLink.inkeepUserId,
483
- tenantId: userTenantId,
484
- slackTeamId: payload.teamId,
485
- slackUserId: payload.userId,
486
- slackEnterpriseId: payload.enterpriseId
487
- }));
488
- logger.info({
489
- slackUserId: payload.userId,
490
- tenantId: userTenantId,
491
- agentCount: allAgents.length
492
- }, "Listed agents for linked Slack user");
493
- if (allAgents.length === 0) return {
494
- response_type: "ephemeral",
495
- ...createErrorMessage("No agents found. Create an agent in the Inkeep dashboard first.")
496
- };
497
- return {
498
- response_type: "ephemeral",
499
- ...createAgentListMessage(allAgents, dashboardUrl.replace("/work-apps/slack", ""))
500
- };
501
- } catch (error) {
502
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
503
- logger.error({
504
- error: errorMessage,
505
- tenantId: userTenantId
506
- }, "Failed to list agents");
507
- return {
508
- response_type: "ephemeral",
509
- ...createErrorMessage("Failed to list agents. Please try again or visit the dashboard.")
510
- };
511
- }
512
- }
513
335
  async function handleCommand(payload) {
514
336
  const text = payload.text.trim();
515
337
  const subcommand = text.split(/\s+/)[0]?.toLowerCase() || "";
@@ -538,15 +360,6 @@ async function handleCommand(payload) {
538
360
  case "unlink":
539
361
  case "logout":
540
362
  case "disconnect": return handleUnlinkCommand(payload, tenantId);
541
- case "list": return handleAgentListCommand(payload, dashboardUrl, tenantId);
542
- case "run": {
543
- const parsed = parseAgentAndQuestion(text.slice(4).trim());
544
- if (!parsed.agentName || !parsed.question) return {
545
- response_type: "ephemeral",
546
- ...createErrorMessage("Usage: `/inkeep run \"agent name\" [question]`\n\nExample: `/inkeep run \"my agent\" What is the weather?`\n\nAgent name must be in quotes.")
547
- };
548
- return handleRunCommand(payload, parsed.agentName, parsed.question, dashboardUrl, tenantId);
549
- }
550
363
  case "help": return handleHelpCommand();
551
364
  case "": return handleAgentPickerCommand(payload, tenantId, workspaceConnection);
552
365
  default: return handleQuestionCommand(payload, text, dashboardUrl, tenantId);
@@ -554,4 +367,4 @@ async function handleCommand(payload) {
554
367
  }
555
368
 
556
369
  //#endregion
557
- export { handleAgentListCommand, handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand };
370
+ export { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand };
@@ -1,9 +1,9 @@
1
1
  import { AgentResolutionParams, ResolvedAgentConfig, getAgentConfigSources, resolveEffectiveAgent } from "./agent-resolution.js";
2
- import { AgentConfigSources, ContextBlockParams, FollowUpButtonParams, buildConversationResponseBlocks, buildFollowUpButton, createAgentListMessage, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "./blocks/index.js";
2
+ import { AgentConfigSources, ContextBlockParams, FollowUpButtonParams, buildConversationResponseBlocks, buildFollowUpButton, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "./blocks/index.js";
3
3
  import { checkUserIsChannelMember, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackTeamInfo, getSlackUserInfo, postMessage, postMessageInThread, revokeSlackToken } from "./client.js";
4
4
  import { DefaultAgentConfig, SlackWorkspaceConnection, WorkspaceInstallData, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./nango.js";
5
5
  import { SlackCommandPayload, SlackCommandResponse } from "./types.js";
6
- import { handleAgentListCommand, handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
6
+ import { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
7
7
  import { InlineSelectorMetadata, handleAppMention } from "./events/app-mention.js";
8
8
  import { handleMessageShortcut, handleOpenAgentSelectorModal, handleOpenFollowUpModal } from "./events/block-actions.js";
9
9
  import { handleFollowUpSubmission, handleModalSubmission } from "./events/modal-submission.js";
@@ -13,4 +13,4 @@ import { StreamResult, streamAgentResponse } from "./events/streaming.js";
13
13
  import "./events/index.js";
14
14
  import { parseSlackCommandBody, parseSlackEventBody, verifySlackRequest } from "./security.js";
15
15
  import { getBotTokenForTeam, setBotTokenForTeam } from "./workspace-tokens.js";
16
- export { AgentConfigSources, AgentOption, AgentResolutionParams, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ContextBlockParams, DefaultAgentConfig, FollowUpButtonParams, FollowUpModalMetadata, InlineSelectorMetadata, ModalMetadata, ResolvedAgentConfig, SlackCommandPayload, SlackCommandResponse, SlackErrorType, SlackWorkspaceConnection, StreamResult, WorkspaceInstallData, buildAgentSelectorModal, buildConversationResponseBlocks, buildFollowUpButton, buildFollowUpModal, buildMessageShortcutModal, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAgentListMessage, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentListCommand, handleAgentPickerCommand, handleAppMention, handleCommand, handleFollowUpSubmission, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleOpenFollowUpModal, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
16
+ export { AgentConfigSources, AgentOption, AgentResolutionParams, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ContextBlockParams, DefaultAgentConfig, FollowUpButtonParams, FollowUpModalMetadata, InlineSelectorMetadata, ModalMetadata, ResolvedAgentConfig, SlackCommandPayload, SlackCommandResponse, SlackErrorType, SlackWorkspaceConnection, StreamResult, WorkspaceInstallData, buildAgentSelectorModal, buildConversationResponseBlocks, buildFollowUpButton, buildFollowUpModal, buildMessageShortcutModal, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentPickerCommand, handleAppMention, handleCommand, handleFollowUpSubmission, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleOpenFollowUpModal, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
@@ -1,10 +1,10 @@
1
1
  import { clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./nango.js";
2
2
  import { getAgentConfigSources, resolveEffectiveAgent } from "./agent-resolution.js";
3
- import { buildConversationResponseBlocks, buildFollowUpButton, createAgentListMessage, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "./blocks/index.js";
3
+ import { buildConversationResponseBlocks, buildFollowUpButton, createAlreadyLinkedMessage, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "./blocks/index.js";
4
4
  import { checkUserIsChannelMember, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackTeamInfo, getSlackUserInfo, postMessage, postMessageInThread, revokeSlackToken } from "./client.js";
5
5
  import { SlackErrorType, checkIfBotThread, classifyError, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, generateSlackConversationId, getChannelAgentConfig, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, markdownToMrkdwn, sendResponseUrlMessage } from "./events/utils.js";
6
6
  import { buildAgentSelectorModal, buildFollowUpModal, buildMessageShortcutModal } from "./modals.js";
7
- import { handleAgentListCommand, handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
7
+ import { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
8
8
  import { getBotTokenForTeam, setBotTokenForTeam } from "./workspace-tokens.js";
9
9
  import { streamAgentResponse } from "./events/streaming.js";
10
10
  import { handleAppMention } from "./events/app-mention.js";
@@ -13,4 +13,4 @@ import { handleFollowUpSubmission, handleModalSubmission } from "./events/modal-
13
13
  import "./events/index.js";
14
14
  import { parseSlackCommandBody, parseSlackEventBody, verifySlackRequest } from "./security.js";
15
15
 
16
- export { SlackErrorType, buildAgentSelectorModal, buildConversationResponseBlocks, buildFollowUpButton, buildFollowUpModal, buildMessageShortcutModal, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAgentListMessage, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentListCommand, handleAgentPickerCommand, handleAppMention, handleCommand, handleFollowUpSubmission, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleOpenFollowUpModal, handleQuestionCommand, handleRunCommand, handleStatusCommand, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
16
+ export { SlackErrorType, buildAgentSelectorModal, buildConversationResponseBlocks, buildFollowUpButton, buildFollowUpModal, buildMessageShortcutModal, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createErrorMessage, createJwtLinkMessage, createNotLinkedMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentPickerCommand, handleAppMention, handleCommand, handleFollowUpSubmission, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleOpenFollowUpModal, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.48.7",
3
+ "version": "0.49.0",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -33,7 +33,7 @@
33
33
  "jose": "^6.1.0",
34
34
  "minimatch": "^10.1.1",
35
35
  "slack-block-builder": "^2.8.0",
36
- "@inkeep/agents-core": "0.48.7"
36
+ "@inkeep/agents-core": "0.49.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",