@inkeep/agents-work-apps 0.68.3 → 0.68.4

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_types0 from "hono/types";
7
+ import * as hono_types3 from "hono/types";
8
8
 
9
9
  //#region src/github/index.d.ts
10
- declare function createGithubRoutes(): Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
11
- declare const githubRoutes: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
10
+ declare function createGithubRoutes(): Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
11
+ declare const githubRoutes: Hono<hono_types3.BlankEnv, hono_types3.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 hono2 from "hono";
1
+ import * as hono0 from "hono";
2
2
 
3
3
  //#region src/github/mcp/auth.d.ts
4
- declare const githubMcpAuth: () => hono2.MiddlewareHandler<{
4
+ declare const githubMcpAuth: () => hono0.MiddlewareHandler<{
5
5
  Variables: {
6
6
  toolId: string;
7
7
  tenantId: string;
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types9 from "hono/types";
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<{
@@ -8,6 +8,6 @@ declare const app: Hono<{
8
8
  tenantId: string;
9
9
  projectId: string;
10
10
  };
11
- }, hono_types9.BlankSchema, "/">;
11
+ }, hono_types7.BlankSchema, "/">;
12
12
  //#endregion
13
13
  export { app as default };
@@ -76,8 +76,8 @@ declare const ChangedFileSchema: z.ZodObject<{
76
76
  path: z.ZodString;
77
77
  status: z.ZodEnum<{
78
78
  added: "added";
79
- removed: "removed";
80
79
  modified: "modified";
80
+ removed: "removed";
81
81
  renamed: "renamed";
82
82
  copied: "copied";
83
83
  changed: "changed";
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types3 from "hono/types";
2
+ import * as hono_types8 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types5 from "hono/types";
2
+ import * as hono_types0 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types5.BlankEnv, hono_types5.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types7 from "hono/types";
2
+ import * as hono_types1 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_types7.BlankEnv, hono_types7.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
@@ -1,7 +1,7 @@
1
- import * as hono0 from "hono";
1
+ import * as hono2 from "hono";
2
2
 
3
3
  //#region src/slack/mcp/auth.d.ts
4
- declare const slackMcpAuth: () => hono0.MiddlewareHandler<{
4
+ declare const slackMcpAuth: () => hono2.MiddlewareHandler<{
5
5
  Variables: {
6
6
  toolId: string;
7
7
  tenantId: string;
@@ -10,9 +10,9 @@ import { AgentOption } from "../modals.js";
10
10
  */
11
11
  declare function findCachedUserMapping(tenantId: string, slackUserId: string, teamId: string, clientId?: string): Promise<{
12
12
  slackUserId: string;
13
+ id: string;
13
14
  createdAt: string;
14
15
  updatedAt: string;
15
- id: string;
16
16
  tenantId: string;
17
17
  clientId: string;
18
18
  slackTeamId: string;
@@ -1,7 +1,7 @@
1
1
  import { env } from "../../env.js";
2
2
  import { getLogger } from "../../logger.js";
3
3
  import { findWorkspaceConnectionByTeamId } from "./nango.js";
4
- import { formatChannelContext, formatSlackQuery, generateSlackConversationId, sendResponseUrlMessage } from "./events/utils.js";
4
+ import { formatChannelContext, formatSlackQuery, generateSlackConversationId, getThreadContext, sendResponseUrlMessage } from "./events/utils.js";
5
5
  import { resolveEffectiveAgent } from "./agent-resolution.js";
6
6
  import { createContextBlock } from "./blocks/index.js";
7
7
  import { getSlackChannelInfo, getSlackClient, getSlackUserInfo } from "./client.js";
@@ -99,14 +99,16 @@ async function resumeMention(intent, slackClient, tokenCtx, teamId, tenantId) {
99
99
  await postErrorToChannel(slackClient, intent.channelId, slackUserId, void 0, "We couldn't resume your question due to a technical issue. Please try mentioning @Inkeep again.");
100
100
  return;
101
101
  }
102
- const [agentConfig, channelInfo, userInfo] = await Promise.all([
102
+ const isInThread = Boolean(intent.threadTs && intent.threadTs !== intent.messageTs);
103
+ const [agentConfig, channelInfo, userInfo, threadContext] = await Promise.all([
103
104
  resolveEffectiveAgent({
104
105
  tenantId,
105
106
  teamId,
106
107
  channelId: intent.channelId
107
108
  }),
108
109
  getSlackChannelInfo(slackClient, intent.channelId),
109
- getSlackUserInfo(slackClient, slackUserId)
110
+ getSlackUserInfo(slackClient, slackUserId),
111
+ isInThread && intent.threadTs ? getThreadContext(slackClient, intent.channelId, intent.threadTs) : Promise.resolve("")
110
112
  ]);
111
113
  const channelContext = formatChannelContext(channelInfo);
112
114
  const userName = userInfo?.displayName || "User";
@@ -114,6 +116,7 @@ async function resumeMention(intent, slackClient, tokenCtx, teamId, tenantId) {
114
116
  text: intent.question,
115
117
  channelContext,
116
118
  userName,
119
+ threadContext: threadContext || void 0,
117
120
  messageTs: intent.messageTs || replyThreadTs,
118
121
  senderTimezone: userInfo?.tz ?? void 0
119
122
  });
@@ -160,12 +163,14 @@ async function resumeDirectMessage(intent, slackClient, tokenCtx, teamId) {
160
163
  await postErrorToChannel(slackClient, intent.channelId, slackUserId);
161
164
  return;
162
165
  }
163
- const userInfo = await getSlackUserInfo(slackClient, slackUserId);
166
+ const isInThread = Boolean(intent.threadTs && intent.threadTs !== intent.messageTs);
167
+ const [userInfo, threadContext] = await Promise.all([getSlackUserInfo(slackClient, slackUserId), isInThread && intent.threadTs ? getThreadContext(slackClient, intent.channelId, intent.threadTs) : Promise.resolve("")]);
164
168
  const userName = userInfo?.displayName || "User";
165
169
  const formattedQuestion = formatSlackQuery({
166
170
  text: intent.question,
167
171
  channelContext: "a Slack direct message",
168
172
  userName,
173
+ threadContext: threadContext || void 0,
169
174
  messageTs: intent.messageTs || void 0,
170
175
  senderTimezone: userInfo?.tz ?? void 0
171
176
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.68.3",
3
+ "version": "0.68.4",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -35,7 +35,7 @@
35
35
  "minimatch": "^10.2.1",
36
36
  "oxfmt": "^0.42.0",
37
37
  "slack-block-builder": "^2.8.0",
38
- "@inkeep/agents-core": "0.68.3"
38
+ "@inkeep/agents-core": "0.68.4"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@hono/zod-openapi": "^1.1.5",