@inkeep/agents-work-apps 0.0.0-dev-20260225221013 → 0.0.0-dev-20260225231647
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/env.d.ts +2 -2
- package/dist/github/mcp/auth.d.ts +2 -2
- package/dist/github/mcp/index.d.ts +2 -2
- package/dist/github/routes/setup.d.ts +2 -2
- package/dist/github/routes/setup.js +1 -1
- package/dist/github/routes/tokenExchange.d.ts +2 -2
- package/dist/github/routes/tokenExchange.js +1 -1
- package/dist/github/routes/webhooks.d.ts +2 -2
- package/dist/github/routes/webhooks.js +1 -1
- package/dist/slack/services/commands/index.js +2 -1
- package/dist/slack/services/events/app-mention.js +4 -2
- package/dist/slack/services/events/block-actions.js +3 -1
- package/dist/slack/services/events/direct-message.js +2 -1
- package/dist/slack/services/events/execution.d.ts +3 -1
- package/dist/slack/services/events/execution.js +2 -1
- package/dist/slack/services/events/modal-submission.js +2 -1
- package/dist/slack/services/events/streaming.d.ts +1 -0
- package/dist/slack/services/events/streaming.js +4 -2
- package/dist/slack/services/events/utils.d.ts +1 -1
- package/dist/slack/services/resume-intent.js +9 -5
- package/package.json +2 -2
package/dist/env.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ declare const envSchema: z.ZodObject<{
|
|
|
14
14
|
pentest: "pentest";
|
|
15
15
|
}>>;
|
|
16
16
|
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
17
|
+
error: "error";
|
|
17
18
|
trace: "trace";
|
|
18
19
|
debug: "debug";
|
|
19
20
|
info: "info";
|
|
20
21
|
warn: "warn";
|
|
21
|
-
error: "error";
|
|
22
22
|
}>>;
|
|
23
23
|
INKEEP_AGENTS_RUN_DATABASE_URL: z.ZodOptional<z.ZodString>;
|
|
24
24
|
INKEEP_AGENTS_MANAGE_UI_URL: z.ZodOptional<z.ZodString>;
|
|
@@ -44,7 +44,7 @@ declare const envSchema: z.ZodObject<{
|
|
|
44
44
|
declare const env: {
|
|
45
45
|
NODE_ENV: "development" | "production" | "test";
|
|
46
46
|
ENVIRONMENT: "development" | "production" | "test" | "pentest";
|
|
47
|
-
LOG_LEVEL: "
|
|
47
|
+
LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
|
|
48
48
|
INKEEP_AGENTS_RUN_DATABASE_URL?: string | undefined;
|
|
49
49
|
INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
|
|
50
50
|
GITHUB_APP_ID?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono1 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/github/mcp/auth.d.ts
|
|
4
|
-
declare const githubMcpAuth: () =>
|
|
4
|
+
declare const githubMcpAuth: () => hono1.MiddlewareHandler<{
|
|
5
5
|
Variables: {
|
|
6
6
|
toolId: string;
|
|
7
7
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types7 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/github/mcp/index.d.ts
|
|
5
5
|
declare const app: Hono<{
|
|
6
6
|
Variables: {
|
|
7
7
|
toolId: string;
|
|
8
8
|
};
|
|
9
|
-
},
|
|
9
|
+
}, hono_types7.BlankSchema, "/">;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types5 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/github/routes/setup.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types5.BlankEnv, hono_types5.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { env } from "../../env.js";
|
|
2
2
|
import { getLogger } from "../../logger.js";
|
|
3
|
-
import { getStateSigningSecret, isStateSigningConfigured } from "../config.js";
|
|
4
3
|
import runDbClient_default from "../../db/runDbClient.js";
|
|
4
|
+
import { getStateSigningSecret, isStateSigningConfigured } from "../config.js";
|
|
5
5
|
import { createAppJwt, determineStatus, fetchInstallationDetails, fetchInstallationRepositories } from "../installation.js";
|
|
6
6
|
import { createInstallation, generateId, getInstallationByGitHubId, listProjectsMetadata, setProjectAccessMode, syncRepositories, updateInstallationStatusByGitHubId } from "@inkeep/agents-core";
|
|
7
7
|
import { Hono } from "hono";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types8 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/github/routes/tokenExchange.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLogger } from "../../logger.js";
|
|
2
|
-
import { isGitHubAppConfigured } from "../config.js";
|
|
3
2
|
import runDbClient_default from "../../db/runDbClient.js";
|
|
3
|
+
import { isGitHubAppConfigured } from "../config.js";
|
|
4
4
|
import { generateInstallationAccessToken, lookupInstallationForRepo } from "../installation.js";
|
|
5
5
|
import { validateOidcToken } from "../oidcToken.js";
|
|
6
6
|
import { checkProjectRepositoryAccess, getInstallationByGitHubId } from "@inkeep/agents-core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types3 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<
|
|
10
|
+
declare const app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { WebhookVerificationResult, app as default, verifyWebhookSignature };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLogger } from "../../logger.js";
|
|
2
|
-
import { getWebhookSecret, isWebhookConfigured } from "../config.js";
|
|
3
2
|
import runDbClient_default from "../../db/runDbClient.js";
|
|
3
|
+
import { getWebhookSecret, isWebhookConfigured } from "../config.js";
|
|
4
4
|
import { addRepositories, deleteInstallation, getInstallationByGitHubId, removeRepositories, updateInstallationStatusByGitHubId } from "@inkeep/agents-core";
|
|
5
5
|
import { Hono } from "hono";
|
|
6
6
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -262,7 +262,8 @@ async function handleQuestionCommand(payload, question, _dashboardUrl, tenantId,
|
|
|
262
262
|
agentId: resolvedAgent.agentId,
|
|
263
263
|
agentName: resolvedAgent.agentName || resolvedAgent.agentId,
|
|
264
264
|
question,
|
|
265
|
-
conversationId
|
|
265
|
+
conversationId,
|
|
266
|
+
entryPoint: "slash_command"
|
|
266
267
|
}).catch(async (error) => {
|
|
267
268
|
logger.error({ error }, "Background execution promise rejected");
|
|
268
269
|
if (payload.responseUrl) try {
|
|
@@ -238,7 +238,8 @@ Respond naturally as if you're joining the conversation to help.`;
|
|
|
238
238
|
agentId: agentConfig.agentId,
|
|
239
239
|
agentName: agentDisplayName,
|
|
240
240
|
question: threadQuery,
|
|
241
|
-
conversationId: conversationId$1
|
|
241
|
+
conversationId: conversationId$1,
|
|
242
|
+
entryPoint: "app_mention"
|
|
242
243
|
});
|
|
243
244
|
span.end();
|
|
244
245
|
return;
|
|
@@ -308,7 +309,8 @@ Respond naturally as if you're joining the conversation to help.`;
|
|
|
308
309
|
agentId: agentConfig.agentId,
|
|
309
310
|
agentName: agentDisplayName,
|
|
310
311
|
question: queryText,
|
|
311
|
-
conversationId
|
|
312
|
+
conversationId,
|
|
313
|
+
entryPoint: "app_mention"
|
|
312
314
|
});
|
|
313
315
|
span.end();
|
|
314
316
|
} catch (error) {
|
|
@@ -71,7 +71,9 @@ async function handleToolApproval(params) {
|
|
|
71
71
|
"Content-Type": "application/json",
|
|
72
72
|
Authorization: `Bearer ${slackUserToken}`,
|
|
73
73
|
"x-inkeep-project-id": projectId,
|
|
74
|
-
"x-inkeep-agent-id": agentId
|
|
74
|
+
"x-inkeep-agent-id": agentId,
|
|
75
|
+
"x-inkeep-invocation-type": "slack",
|
|
76
|
+
"x-inkeep-invocation-entry-point": "tool_approval"
|
|
75
77
|
},
|
|
76
78
|
body: JSON.stringify({
|
|
77
79
|
conversationId,
|
|
@@ -118,7 +118,8 @@ async function handleDirectMessage(params) {
|
|
|
118
118
|
agentId: defaultAgent.agentId,
|
|
119
119
|
agentName: agentDisplayName,
|
|
120
120
|
question: queryText,
|
|
121
|
-
conversationId
|
|
121
|
+
conversationId,
|
|
122
|
+
entryPoint: "direct_message"
|
|
122
123
|
});
|
|
123
124
|
span.end();
|
|
124
125
|
} catch (error) {
|
|
@@ -2,6 +2,7 @@ import { getSlackClient } from "../client.js";
|
|
|
2
2
|
import { StreamResult } from "./streaming.js";
|
|
3
3
|
|
|
4
4
|
//#region src/slack/services/events/execution.d.ts
|
|
5
|
+
type SlackEntryPoint = 'app_mention' | 'direct_message' | 'slash_command' | 'message_shortcut' | 'modal_submission' | 'smart_link_resume' | 'tool_approval';
|
|
5
6
|
interface PublicExecutionParams {
|
|
6
7
|
slackClient: ReturnType<typeof getSlackClient>;
|
|
7
8
|
channel: string;
|
|
@@ -14,7 +15,8 @@ interface PublicExecutionParams {
|
|
|
14
15
|
agentName: string;
|
|
15
16
|
question: string;
|
|
16
17
|
conversationId: string;
|
|
18
|
+
entryPoint?: SlackEntryPoint;
|
|
17
19
|
}
|
|
18
20
|
declare function executeAgentPublicly(params: PublicExecutionParams): Promise<StreamResult>;
|
|
19
21
|
//#endregion
|
|
20
|
-
export { PublicExecutionParams, executeAgentPublicly };
|
|
22
|
+
export { PublicExecutionParams, SlackEntryPoint, executeAgentPublicly };
|
|
@@ -94,7 +94,8 @@ async function handleModalSubmission(view) {
|
|
|
94
94
|
agentId,
|
|
95
95
|
agentName: agentDisplayName,
|
|
96
96
|
question: fullQuestion,
|
|
97
|
-
conversationId
|
|
97
|
+
conversationId,
|
|
98
|
+
entryPoint: metadata.messageContext ? "message_shortcut" : "modal_submission"
|
|
98
99
|
});
|
|
99
100
|
logger.info({
|
|
100
101
|
agentId,
|
|
@@ -62,7 +62,7 @@ async function cleanupThinkingMessage(params) {
|
|
|
62
62
|
}
|
|
63
63
|
async function streamAgentResponse(params) {
|
|
64
64
|
return tracer.startActiveSpan(SLACK_SPAN_NAMES.STREAM_AGENT_RESPONSE, async (span) => {
|
|
65
|
-
const { slackClient, channel, threadTs, thinkingMessageTs, slackUserId, teamId, jwtToken, projectId, agentId, question, agentName, conversationId } = params;
|
|
65
|
+
const { slackClient, channel, threadTs, thinkingMessageTs, slackUserId, teamId, jwtToken, projectId, agentId, question, agentName, conversationId, entryPoint } = params;
|
|
66
66
|
const threadParam = threadTs ? { thread_ts: threadTs } : {};
|
|
67
67
|
const cleanupParams = {
|
|
68
68
|
slackClient,
|
|
@@ -109,7 +109,9 @@ async function streamAgentResponse(params) {
|
|
|
109
109
|
"Content-Type": "application/json",
|
|
110
110
|
Authorization: `Bearer ${jwtToken}`,
|
|
111
111
|
"x-inkeep-project-id": projectId,
|
|
112
|
-
"x-inkeep-agent-id": agentId
|
|
112
|
+
"x-inkeep-agent-id": agentId,
|
|
113
|
+
"x-inkeep-invocation-type": "slack",
|
|
114
|
+
...entryPoint && { "x-inkeep-invocation-entry-point": entryPoint }
|
|
113
115
|
},
|
|
114
116
|
body: JSON.stringify({
|
|
115
117
|
messages: [{
|
|
@@ -8,12 +8,12 @@ import { AgentOption } from "../modals.js";
|
|
|
8
8
|
* Called on every @mention and /inkeep command — caching avoids redundant DB queries.
|
|
9
9
|
*/
|
|
10
10
|
declare function findCachedUserMapping(tenantId: string, slackUserId: string, teamId: string, clientId?: string): Promise<{
|
|
11
|
+
slackUserId: string;
|
|
11
12
|
createdAt: string;
|
|
12
13
|
updatedAt: string;
|
|
13
14
|
id: string;
|
|
14
15
|
tenantId: string;
|
|
15
16
|
clientId: string;
|
|
16
|
-
slackUserId: string;
|
|
17
17
|
slackTeamId: string;
|
|
18
18
|
slackEnterpriseId: string | null;
|
|
19
19
|
inkeepUserId: string;
|
|
@@ -7,7 +7,7 @@ import { createContextBlock } from "./blocks/index.js";
|
|
|
7
7
|
import { getSlackClient } from "./client.js";
|
|
8
8
|
import { streamAgentResponse } from "./events/streaming.js";
|
|
9
9
|
import { executeAgentPublicly } from "./events/execution.js";
|
|
10
|
-
import { signSlackUserToken } from "@inkeep/agents-core";
|
|
10
|
+
import { getInProcessFetch, signSlackUserToken } from "@inkeep/agents-core";
|
|
11
11
|
|
|
12
12
|
//#region src/slack/services/resume-intent.ts
|
|
13
13
|
const logger = getLogger("slack-resume-intent");
|
|
@@ -130,7 +130,8 @@ async function resumeMention(intent, slackClient, tokenCtx, teamId, tenantId) {
|
|
|
130
130
|
agentId: intent.agentId,
|
|
131
131
|
question: intent.question,
|
|
132
132
|
agentName: intent.agentId,
|
|
133
|
-
conversationId
|
|
133
|
+
conversationId,
|
|
134
|
+
entryPoint: "smart_link_resume"
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
async function resumeDirectMessage(intent, slackClient, tokenCtx, teamId) {
|
|
@@ -166,7 +167,8 @@ async function resumeDirectMessage(intent, slackClient, tokenCtx, teamId) {
|
|
|
166
167
|
agentId: intent.agentId,
|
|
167
168
|
agentName: intent.agentId,
|
|
168
169
|
question: intent.question,
|
|
169
|
-
conversationId
|
|
170
|
+
conversationId,
|
|
171
|
+
entryPoint: "smart_link_resume"
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
async function resumeCommand(intent, slackClient, tokenCtx, teamId, tenantId) {
|
|
@@ -291,13 +293,15 @@ async function executeAndDeliver(params) {
|
|
|
291
293
|
const timeout = setTimeout(() => controller.abort(), 3e4);
|
|
292
294
|
let response;
|
|
293
295
|
try {
|
|
294
|
-
response = await
|
|
296
|
+
response = await getInProcessFetch()(`${apiBaseUrl}/run/api/chat`, {
|
|
295
297
|
method: "POST",
|
|
296
298
|
headers: {
|
|
297
299
|
"Content-Type": "application/json",
|
|
298
300
|
Authorization: `Bearer ${slackUserToken}`,
|
|
299
301
|
"x-inkeep-project-id": projectId,
|
|
300
|
-
"x-inkeep-agent-id": agentId
|
|
302
|
+
"x-inkeep-agent-id": agentId,
|
|
303
|
+
"x-inkeep-invocation-type": "slack",
|
|
304
|
+
"x-inkeep-invocation-entry-point": "smart_link_resume"
|
|
301
305
|
},
|
|
302
306
|
body: JSON.stringify({
|
|
303
307
|
messages: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-work-apps",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260225231647",
|
|
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.0.0-dev-
|
|
36
|
+
"@inkeep/agents-core": "0.0.0-dev-20260225231647"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@hono/zod-openapi": "^1.1.5",
|