@inkeep/agents-work-apps 0.53.2 → 0.53.3
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.
- package/dist/github/mcp/index.d.ts +2 -2
- package/dist/github/routes/setup.d.ts +2 -2
- package/dist/github/routes/tokenExchange.d.ts +2 -2
- package/dist/github/routes/webhooks.d.ts +2 -2
- package/dist/slack/dispatcher.js +54 -40
- package/dist/slack/i18n/strings.d.ts +6 -5
- package/dist/slack/i18n/strings.js +7 -10
- package/dist/slack/routes/events.js +1 -1
- package/dist/slack/services/blocks/index.d.ts +3 -35
- package/dist/slack/services/blocks/index.js +5 -42
- package/dist/slack/services/commands/index.js +42 -104
- package/dist/slack/services/events/app-mention.js +8 -31
- package/dist/slack/services/events/block-actions.d.ts +1 -11
- package/dist/slack/services/events/block-actions.js +6 -49
- package/dist/slack/services/events/direct-message.d.ts +11 -0
- package/dist/slack/services/events/direct-message.js +148 -0
- package/dist/slack/services/events/execution.d.ts +20 -0
- package/dist/slack/services/events/execution.js +46 -0
- package/dist/slack/services/events/index.d.ts +5 -3
- package/dist/slack/services/events/index.js +5 -3
- package/dist/slack/services/events/modal-submission.d.ts +1 -21
- package/dist/slack/services/events/modal-submission.js +14 -294
- package/dist/slack/services/events/streaming.d.ts +1 -1
- package/dist/slack/services/events/streaming.js +69 -70
- package/dist/slack/services/events/utils.d.ts +2 -14
- package/dist/slack/services/events/utils.js +2 -13
- package/dist/slack/services/index.d.ts +7 -5
- package/dist/slack/services/index.js +8 -6
- package/dist/slack/services/modals.d.ts +1 -18
- package/dist/slack/services/modals.js +1 -48
- package/dist/slack/services/resume-intent.js +43 -3
- package/dist/slack/socket-mode.js +1 -1
- package/dist/slack/tracer.d.ts +2 -4
- package/dist/slack/tracer.js +1 -3
- package/package.json +2 -2
|
@@ -276,20 +276,9 @@ async function sendResponseUrlMessage(responseUrl, message) {
|
|
|
276
276
|
logger.error({ errorMessage }, "Failed to send response_url message");
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Generate a deterministic conversation ID for Slack threads/DMs.
|
|
281
|
-
* This ensures the same thread + agent combination gets the same conversation ID,
|
|
282
|
-
* allowing the agent to maintain conversation history.
|
|
283
|
-
*
|
|
284
|
-
* Including agentId ensures switching agents in the same thread starts a fresh
|
|
285
|
-
* conversation, avoiding sub-agent conflicts when the Run API tries to resume
|
|
286
|
-
* a conversation that was started by a different agent.
|
|
287
|
-
*
|
|
288
|
-
* Format: slack-thread-{teamId}-{identifier}[-{agentId}]
|
|
289
|
-
*/
|
|
290
279
|
function generateSlackConversationId(params) {
|
|
291
|
-
const { teamId,
|
|
292
|
-
const base = isDM ?
|
|
280
|
+
const { teamId, messageTs, isDM, agentId } = params;
|
|
281
|
+
const base = `${isDM ? "slack-dm" : "slack-trigger"}-${teamId}-${messageTs}`;
|
|
293
282
|
return agentId ? `${base}-${agentId}` : base;
|
|
294
283
|
}
|
|
295
284
|
/**
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { AgentResolutionParams, ResolvedAgentConfig, getAgentConfigSources, resolveEffectiveAgent } from "./agent-resolution.js";
|
|
2
|
-
import { AgentConfigSources, ContextBlockParams,
|
|
2
|
+
import { AgentConfigSources, ContextBlockParams, ToolApprovalButtonValue, ToolApprovalButtonValueSchema, buildCitationsBlock, buildDataArtifactBlocks, buildDataComponentBlocks, buildSummaryBreadcrumbBlock, buildToolApprovalBlocks, buildToolApprovalDoneBlocks, buildToolApprovalExpiredBlocks, buildToolOutputErrorBlock, createAlreadyLinkedMessage, createContextBlock, createCreateInkeepAccountMessage, createErrorMessage, createNotLinkedMessage, createSmartLinkMessage, 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
6
|
import { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
|
|
7
|
-
import { AgentOption, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams,
|
|
7
|
+
import { AgentOption, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ModalMetadata, buildAgentSelectorModal, buildMessageShortcutModal } from "./modals.js";
|
|
8
8
|
import { SlackErrorType, checkIfBotThread, classifyError, extractApiErrorMessage, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, generateSlackConversationId, getChannelAgentConfig, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, markdownToMrkdwn, sendResponseUrlMessage } from "./events/utils.js";
|
|
9
9
|
import { InlineSelectorMetadata, handleAppMention } from "./events/app-mention.js";
|
|
10
|
-
import { handleMessageShortcut, handleOpenAgentSelectorModal,
|
|
11
|
-
import {
|
|
10
|
+
import { handleMessageShortcut, handleOpenAgentSelectorModal, handleToolApproval } from "./events/block-actions.js";
|
|
11
|
+
import { handleDirectMessage } from "./events/direct-message.js";
|
|
12
12
|
import { StreamResult, streamAgentResponse } from "./events/streaming.js";
|
|
13
|
+
import { PublicExecutionParams, executeAgentPublicly } from "./events/execution.js";
|
|
14
|
+
import { handleModalSubmission } from "./events/modal-submission.js";
|
|
13
15
|
import "./events/index.js";
|
|
14
16
|
import { parseSlackCommandBody, parseSlackEventBody, verifySlackRequest } from "./security.js";
|
|
15
17
|
import { getBotTokenForTeam, setBotTokenForTeam } from "./workspace-tokens.js";
|
|
16
|
-
export { AgentConfigSources, AgentOption, AgentResolutionParams, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ContextBlockParams, DefaultAgentConfig,
|
|
18
|
+
export { AgentConfigSources, AgentOption, AgentResolutionParams, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ContextBlockParams, DefaultAgentConfig, InlineSelectorMetadata, ModalMetadata, PublicExecutionParams, ResolvedAgentConfig, SlackCommandPayload, SlackCommandResponse, SlackErrorType, SlackWorkspaceConnection, StreamResult, ToolApprovalButtonValue, ToolApprovalButtonValueSchema, WorkspaceInstallData, buildAgentSelectorModal, buildCitationsBlock, buildDataArtifactBlocks, buildDataComponentBlocks, buildMessageShortcutModal, buildSummaryBreadcrumbBlock, buildToolApprovalBlocks, buildToolApprovalDoneBlocks, buildToolApprovalExpiredBlocks, buildToolOutputErrorBlock, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createCreateInkeepAccountMessage, createErrorMessage, createNotLinkedMessage, createSmartLinkMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, executeAgentPublicly, extractApiErrorMessage, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentPickerCommand, handleAppMention, handleCommand, handleDirectMessage, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleQuestionCommand, handleStatusCommand, handleToolApproval, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./nango.js";
|
|
2
2
|
import { SlackErrorType, checkIfBotThread, classifyError, extractApiErrorMessage, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, generateSlackConversationId, getChannelAgentConfig, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, markdownToMrkdwn, sendResponseUrlMessage } from "./events/utils.js";
|
|
3
3
|
import { getAgentConfigSources, resolveEffectiveAgent } from "./agent-resolution.js";
|
|
4
|
-
import { ToolApprovalButtonValueSchema, buildCitationsBlock,
|
|
4
|
+
import { ToolApprovalButtonValueSchema, buildCitationsBlock, buildDataArtifactBlocks, buildDataComponentBlocks, buildSummaryBreadcrumbBlock, buildToolApprovalBlocks, buildToolApprovalDoneBlocks, buildToolApprovalExpiredBlocks, buildToolOutputErrorBlock, createAlreadyLinkedMessage, createContextBlock, createCreateInkeepAccountMessage, createErrorMessage, createNotLinkedMessage, createSmartLinkMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage } from "./blocks/index.js";
|
|
5
5
|
import { checkUserIsChannelMember, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackTeamInfo, getSlackUserInfo, postMessage, postMessageInThread, revokeSlackToken } from "./client.js";
|
|
6
|
-
import { buildAgentSelectorModal, buildFollowUpModal, buildMessageShortcutModal } from "./modals.js";
|
|
7
|
-
import { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
|
|
8
6
|
import { streamAgentResponse } from "./events/streaming.js";
|
|
7
|
+
import { executeAgentPublicly } from "./events/execution.js";
|
|
8
|
+
import { buildAgentSelectorModal, buildMessageShortcutModal } from "./modals.js";
|
|
9
|
+
import { handleAgentPickerCommand, handleCommand, handleHelpCommand, handleLinkCommand, handleQuestionCommand, handleStatusCommand, handleUnlinkCommand } from "./commands/index.js";
|
|
9
10
|
import { handleAppMention } from "./events/app-mention.js";
|
|
10
|
-
import { handleMessageShortcut, handleOpenAgentSelectorModal,
|
|
11
|
-
import {
|
|
11
|
+
import { handleMessageShortcut, handleOpenAgentSelectorModal, handleToolApproval } from "./events/block-actions.js";
|
|
12
|
+
import { handleDirectMessage } from "./events/direct-message.js";
|
|
13
|
+
import { handleModalSubmission } from "./events/modal-submission.js";
|
|
12
14
|
import "./events/index.js";
|
|
13
15
|
import { parseSlackCommandBody, parseSlackEventBody, verifySlackRequest } from "./security.js";
|
|
14
16
|
import { getBotTokenForTeam, setBotTokenForTeam } from "./workspace-tokens.js";
|
|
15
17
|
|
|
16
|
-
export { SlackErrorType, ToolApprovalButtonValueSchema, buildAgentSelectorModal, buildCitationsBlock,
|
|
18
|
+
export { SlackErrorType, ToolApprovalButtonValueSchema, buildAgentSelectorModal, buildCitationsBlock, buildDataArtifactBlocks, buildDataComponentBlocks, buildMessageShortcutModal, buildSummaryBreadcrumbBlock, buildToolApprovalBlocks, buildToolApprovalDoneBlocks, buildToolApprovalExpiredBlocks, buildToolOutputErrorBlock, checkIfBotThread, checkUserIsChannelMember, classifyError, clearWorkspaceConnectionCache, computeWorkspaceConnectionId, createAlreadyLinkedMessage, createConnectSession, createContextBlock, createCreateInkeepAccountMessage, createErrorMessage, createNotLinkedMessage, createSmartLinkMessage, createStatusMessage, createUnlinkSuccessMessage, createUpdatedHelpMessage, deleteWorkspaceInstallation, executeAgentPublicly, extractApiErrorMessage, fetchAgentsForProject, fetchProjectsForTenant, findCachedUserMapping, findWorkspaceConnectionByTeamId, generateSlackConversationId, getAgentConfigSources, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackChannelInfo, getSlackChannels, getSlackClient, getSlackIntegrationId, getSlackNango, getSlackTeamInfo, getSlackUserInfo, getThreadContext, getUserFriendlyErrorMessage, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, handleAgentPickerCommand, handleAppMention, handleCommand, handleDirectMessage, handleHelpCommand, handleLinkCommand, handleMessageShortcut, handleModalSubmission, handleOpenAgentSelectorModal, handleQuestionCommand, handleStatusCommand, handleToolApproval, handleUnlinkCommand, listWorkspaceInstallations, markdownToMrkdwn, parseSlackCommandBody, parseSlackEventBody, postMessage, postMessageInThread, resolveEffectiveAgent, revokeSlackToken, sendResponseUrlMessage, setBotTokenForTeam, setWorkspaceDefaultAgent, storeWorkspaceInstallation, streamAgentResponse, updateConnectionMetadata, verifySlackRequest };
|
|
@@ -21,16 +21,6 @@ interface ModalMetadata {
|
|
|
21
21
|
buttonResponseUrl?: string;
|
|
22
22
|
messageContext?: string;
|
|
23
23
|
}
|
|
24
|
-
interface FollowUpModalMetadata {
|
|
25
|
-
conversationId: string;
|
|
26
|
-
agentId: string;
|
|
27
|
-
agentName?: string;
|
|
28
|
-
projectId: string;
|
|
29
|
-
tenantId: string;
|
|
30
|
-
teamId: string;
|
|
31
|
-
slackUserId: string;
|
|
32
|
-
channel: string;
|
|
33
|
-
}
|
|
34
24
|
interface BuildAgentSelectorModalParams {
|
|
35
25
|
projects: Array<{
|
|
36
26
|
id: string;
|
|
@@ -53,13 +43,6 @@ interface BuildAgentSelectorModalParams {
|
|
|
53
43
|
* All responses from this modal are private (ephemeral).
|
|
54
44
|
*/
|
|
55
45
|
declare function buildAgentSelectorModal(params: BuildAgentSelectorModalParams): ModalView;
|
|
56
|
-
/**
|
|
57
|
-
* Build a follow-up modal for continuing a conversation.
|
|
58
|
-
*
|
|
59
|
-
* Shows only a prompt input. Agent and project are carried from the previous turn
|
|
60
|
-
* via metadata. The conversationId ensures the agent has full history.
|
|
61
|
-
*/
|
|
62
|
-
declare function buildFollowUpModal(metadata: FollowUpModalMetadata): ModalView;
|
|
63
46
|
interface BuildMessageShortcutModalParams {
|
|
64
47
|
projects: Array<{
|
|
65
48
|
id: string;
|
|
@@ -84,4 +67,4 @@ interface BuildMessageShortcutModalParams {
|
|
|
84
67
|
*/
|
|
85
68
|
declare function buildMessageShortcutModal(params: BuildMessageShortcutModalParams): ModalView;
|
|
86
69
|
//#endregion
|
|
87
|
-
export { AgentOption, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams,
|
|
70
|
+
export { AgentOption, BuildAgentSelectorModalParams, BuildMessageShortcutModalParams, ModalMetadata, buildAgentSelectorModal, buildMessageShortcutModal };
|
|
@@ -164,53 +164,6 @@ function buildAgentSelectorModal(params) {
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
|
-
* Build a follow-up modal for continuing a conversation.
|
|
168
|
-
*
|
|
169
|
-
* Shows only a prompt input. Agent and project are carried from the previous turn
|
|
170
|
-
* via metadata. The conversationId ensures the agent has full history.
|
|
171
|
-
*/
|
|
172
|
-
function buildFollowUpModal(metadata) {
|
|
173
|
-
const blocks = [{
|
|
174
|
-
type: "input",
|
|
175
|
-
block_id: "question_block",
|
|
176
|
-
element: {
|
|
177
|
-
type: "plain_text_input",
|
|
178
|
-
action_id: "question_input",
|
|
179
|
-
multiline: true,
|
|
180
|
-
placeholder: {
|
|
181
|
-
type: "plain_text",
|
|
182
|
-
text: SlackStrings.placeholders.enterPrompt
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
label: {
|
|
186
|
-
type: "plain_text",
|
|
187
|
-
text: SlackStrings.labels.prompt,
|
|
188
|
-
emoji: true
|
|
189
|
-
}
|
|
190
|
-
}];
|
|
191
|
-
return {
|
|
192
|
-
type: "modal",
|
|
193
|
-
callback_id: "follow_up_modal",
|
|
194
|
-
private_metadata: JSON.stringify(metadata),
|
|
195
|
-
title: {
|
|
196
|
-
type: "plain_text",
|
|
197
|
-
text: SlackStrings.modals.followUp,
|
|
198
|
-
emoji: true
|
|
199
|
-
},
|
|
200
|
-
submit: {
|
|
201
|
-
type: "plain_text",
|
|
202
|
-
text: SlackStrings.buttons.send,
|
|
203
|
-
emoji: true
|
|
204
|
-
},
|
|
205
|
-
close: {
|
|
206
|
-
type: "plain_text",
|
|
207
|
-
text: SlackStrings.buttons.cancel,
|
|
208
|
-
emoji: true
|
|
209
|
-
},
|
|
210
|
-
blocks
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
167
|
* Build the modal for message shortcut (context menu on a message).
|
|
215
168
|
*
|
|
216
169
|
* Shows:
|
|
@@ -354,4 +307,4 @@ function buildMessageShortcutModal(params) {
|
|
|
354
307
|
}
|
|
355
308
|
|
|
356
309
|
//#endregion
|
|
357
|
-
export { buildAgentSelectorModal,
|
|
310
|
+
export { buildAgentSelectorModal, buildMessageShortcutModal };
|
|
@@ -6,6 +6,7 @@ import { resolveEffectiveAgent } from "./agent-resolution.js";
|
|
|
6
6
|
import { createContextBlock } from "./blocks/index.js";
|
|
7
7
|
import { getSlackClient } from "./client.js";
|
|
8
8
|
import { streamAgentResponse } from "./events/streaming.js";
|
|
9
|
+
import { executeAgentPublicly } from "./events/execution.js";
|
|
9
10
|
import { signSlackUserToken } from "@inkeep/agents-core";
|
|
10
11
|
|
|
11
12
|
//#region src/slack/services/resume-intent.ts
|
|
@@ -54,6 +55,11 @@ async function resumeSmartLinkIntent(params) {
|
|
|
54
55
|
deliveryMethod = intent.responseUrl ? "response_url" : "bot_token";
|
|
55
56
|
await resumeRunCommand(intent, slackClient, tokenCtx, teamId, tenantId);
|
|
56
57
|
break;
|
|
58
|
+
case "dm":
|
|
59
|
+
resolvedAgentId = intent.agentId;
|
|
60
|
+
deliveryMethod = "streaming";
|
|
61
|
+
await resumeDirectMessage(intent, slackClient, tokenCtx, teamId);
|
|
62
|
+
break;
|
|
57
63
|
}
|
|
58
64
|
const durationMs = Date.now() - startTime;
|
|
59
65
|
logger.info({
|
|
@@ -109,9 +115,7 @@ async function resumeMention(intent, slackClient, tokenCtx, teamId, tenantId) {
|
|
|
109
115
|
});
|
|
110
116
|
const conversationId = generateSlackConversationId({
|
|
111
117
|
teamId,
|
|
112
|
-
|
|
113
|
-
channel: intent.channelId,
|
|
114
|
-
isDM: false,
|
|
118
|
+
messageTs: intent.messageTs || replyThreadTs,
|
|
115
119
|
agentId: intent.agentId
|
|
116
120
|
});
|
|
117
121
|
await streamAgentResponse({
|
|
@@ -129,6 +133,42 @@ async function resumeMention(intent, slackClient, tokenCtx, teamId, tenantId) {
|
|
|
129
133
|
conversationId
|
|
130
134
|
});
|
|
131
135
|
}
|
|
136
|
+
async function resumeDirectMessage(intent, slackClient, tokenCtx, teamId) {
|
|
137
|
+
const { slackUserId } = tokenCtx;
|
|
138
|
+
if (!intent.agentId || !intent.projectId) {
|
|
139
|
+
logger.error({
|
|
140
|
+
entryPoint: intent.entryPoint,
|
|
141
|
+
channelId: intent.channelId,
|
|
142
|
+
hasAgentId: !!intent.agentId,
|
|
143
|
+
hasProjectId: !!intent.projectId
|
|
144
|
+
}, "DM intent missing agentId or projectId");
|
|
145
|
+
await postErrorToChannel(slackClient, intent.channelId, slackUserId);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const slackUserToken = await signSlackUserToken({
|
|
149
|
+
...tokenCtx,
|
|
150
|
+
slackAuthorized: false
|
|
151
|
+
});
|
|
152
|
+
const conversationId = generateSlackConversationId({
|
|
153
|
+
teamId,
|
|
154
|
+
messageTs: intent.messageTs || "",
|
|
155
|
+
agentId: intent.agentId,
|
|
156
|
+
isDM: true
|
|
157
|
+
});
|
|
158
|
+
await executeAgentPublicly({
|
|
159
|
+
slackClient,
|
|
160
|
+
channel: intent.channelId,
|
|
161
|
+
threadTs: intent.messageTs,
|
|
162
|
+
slackUserId,
|
|
163
|
+
teamId,
|
|
164
|
+
jwtToken: slackUserToken,
|
|
165
|
+
projectId: intent.projectId,
|
|
166
|
+
agentId: intent.agentId,
|
|
167
|
+
agentName: intent.agentId,
|
|
168
|
+
question: intent.question,
|
|
169
|
+
conversationId
|
|
170
|
+
});
|
|
171
|
+
}
|
|
132
172
|
async function resumeCommand(intent, slackClient, tokenCtx, teamId, tenantId) {
|
|
133
173
|
const { slackUserId } = tokenCtx;
|
|
134
174
|
const resolvedAgent = await resolveEffectiveAgent({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __toESM } from "../_virtual/rolldown_runtime.js";
|
|
2
2
|
import { getLogger } from "../logger.js";
|
|
3
|
-
import { handleCommand } from "./services/commands/index.js";
|
|
4
3
|
import { SLACK_SPAN_KEYS, SLACK_SPAN_NAMES, tracer } from "./tracer.js";
|
|
4
|
+
import { handleCommand } from "./services/commands/index.js";
|
|
5
5
|
import "./services/index.js";
|
|
6
6
|
import { dispatchSlackEvent } from "./dispatcher.js";
|
|
7
7
|
import { flushTraces } from "@inkeep/agents-core";
|
package/dist/slack/tracer.d.ts
CHANGED
|
@@ -6,15 +6,13 @@ declare const tracer: _opentelemetry_api0.Tracer;
|
|
|
6
6
|
declare const SLACK_SPAN_NAMES: {
|
|
7
7
|
readonly WEBHOOK: "slack.webhook";
|
|
8
8
|
readonly APP_MENTION: "slack.app_mention";
|
|
9
|
+
readonly DIRECT_MESSAGE: "slack.direct_message";
|
|
9
10
|
readonly BLOCK_ACTION: "slack.block_action";
|
|
10
11
|
readonly MODAL_SUBMISSION: "slack.modal_submission";
|
|
11
|
-
readonly FOLLOW_UP_SUBMISSION: "slack.follow_up_submission";
|
|
12
12
|
readonly MESSAGE_SHORTCUT: "slack.message_shortcut";
|
|
13
13
|
readonly STREAM_AGENT_RESPONSE: "slack.stream_agent_response";
|
|
14
14
|
readonly OPEN_AGENT_SELECTOR_MODAL: "slack.open_agent_selector_modal";
|
|
15
|
-
readonly OPEN_FOLLOW_UP_MODAL: "slack.open_follow_up_modal";
|
|
16
15
|
readonly PROJECT_SELECT_UPDATE: "slack.project_select_update";
|
|
17
|
-
readonly CALL_AGENT_API: "slack.call_agent_api";
|
|
18
16
|
readonly TOOL_APPROVAL: "slack.tool_approval";
|
|
19
17
|
};
|
|
20
18
|
declare const SLACK_SPAN_KEYS: {
|
|
@@ -40,6 +38,6 @@ declare const SLACK_SPAN_KEYS: {
|
|
|
40
38
|
readonly AUTHORIZED: "slack.authorized";
|
|
41
39
|
readonly AUTH_SOURCE: "slack.auth_source";
|
|
42
40
|
};
|
|
43
|
-
type SlackOutcome = 'handled' | 'ignored_bot_message' | 'ignored_edited_message' | 'ignored_unknown_event' | 'ignored_no_action_match' | 'ignored_slack_retry' | 'url_verification' | 'validation_error' | 'signature_invalid' | 'error';
|
|
41
|
+
type SlackOutcome = 'handled' | 'ignored_bot_message' | 'ignored_edited_message' | 'ignored_unknown_event' | 'ignored_no_action_match' | 'ignored_slack_retry' | 'ignored_duplicate_event' | 'url_verification' | 'validation_error' | 'signature_invalid' | 'error';
|
|
44
42
|
//#endregion
|
|
45
43
|
export { SLACK_SPAN_KEYS, SLACK_SPAN_NAMES, SlackOutcome, setSpanWithError, tracer };
|
package/dist/slack/tracer.js
CHANGED
|
@@ -5,15 +5,13 @@ const tracer = getTracer("agents-work-apps-slack");
|
|
|
5
5
|
const SLACK_SPAN_NAMES = {
|
|
6
6
|
WEBHOOK: "slack.webhook",
|
|
7
7
|
APP_MENTION: "slack.app_mention",
|
|
8
|
+
DIRECT_MESSAGE: "slack.direct_message",
|
|
8
9
|
BLOCK_ACTION: "slack.block_action",
|
|
9
10
|
MODAL_SUBMISSION: "slack.modal_submission",
|
|
10
|
-
FOLLOW_UP_SUBMISSION: "slack.follow_up_submission",
|
|
11
11
|
MESSAGE_SHORTCUT: "slack.message_shortcut",
|
|
12
12
|
STREAM_AGENT_RESPONSE: "slack.stream_agent_response",
|
|
13
13
|
OPEN_AGENT_SELECTOR_MODAL: "slack.open_agent_selector_modal",
|
|
14
|
-
OPEN_FOLLOW_UP_MODAL: "slack.open_follow_up_modal",
|
|
15
14
|
PROJECT_SELECT_UPDATE: "slack.project_select_update",
|
|
16
|
-
CALL_AGENT_API: "slack.call_agent_api",
|
|
17
15
|
TOOL_APPROVAL: "slack.tool_approval"
|
|
18
16
|
};
|
|
19
17
|
const SLACK_SPAN_KEYS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-work-apps",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.3",
|
|
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.53.
|
|
36
|
+
"@inkeep/agents-core": "0.53.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@hono/zod-openapi": "^1.1.5",
|