@inkeep/agents-work-apps 0.0.0-dev-20260315043702 → 0.0.0-dev-20260315054254

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.
@@ -1,7 +1,7 @@
1
- import * as hono0 from "hono";
1
+ import * as hono2 from "hono";
2
2
 
3
3
  //#region src/github/mcp/auth.d.ts
4
- declare const githubMcpAuth: () => hono0.MiddlewareHandler<{
4
+ declare const githubMcpAuth: () => hono2.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_types4 from "hono/types";
2
+ import * as hono_types8 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_types4.BlankSchema, "/">;
11
+ }, hono_types8.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_types9 from "hono/types";
2
+ import * as hono_types6 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types7 from "hono/types";
2
+ import * as hono_types9 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types7.BlankEnv, hono_types7.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types9.BlankEnv, hono_types9.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types5 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_types5.BlankEnv, hono_types5.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types3 from "hono/types";
2
+ import * as hono_types0 from "hono/types";
3
3
 
4
4
  //#region src/slack/mcp/index.d.ts
5
5
  interface ChannelInfo {
@@ -18,6 +18,6 @@ declare const app: Hono<{
18
18
  tenantId: string;
19
19
  projectId: string;
20
20
  };
21
- }, hono_types3.BlankSchema, "/">;
21
+ }, hono_types0.BlankSchema, "/">;
22
22
  //#endregion
23
23
  export { ChannelInfo, app as default, pruneStaleChannelIds };
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types.js";
2
- import * as hono1 from "hono";
2
+ import * as hono0 from "hono";
3
3
 
4
4
  //#region src/slack/middleware/permissions.d.ts
5
5
  /**
@@ -14,7 +14,7 @@ declare const requireWorkspaceAdmin: <Env extends {
14
14
  Variables: ManageAppVariables;
15
15
  } = {
16
16
  Variables: ManageAppVariables;
17
- }>() => hono1.MiddlewareHandler<Env, string, {}, Response>;
17
+ }>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
18
18
  /**
19
19
  * Middleware that requires either:
20
20
  * 1. Org admin/owner role (can modify any channel), OR
@@ -26,6 +26,6 @@ declare const requireChannelMemberOrAdmin: <Env extends {
26
26
  Variables: ManageAppVariables;
27
27
  } = {
28
28
  Variables: ManageAppVariables;
29
- }>() => hono1.MiddlewareHandler<Env, string, {}, Response>;
29
+ }>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
30
30
  //#endregion
31
31
  export { isOrgAdmin, requireChannelMemberOrAdmin, requireWorkspaceAdmin };
@@ -13,8 +13,9 @@ interface OAuthState {
13
13
  declare function getStateSigningSecret(): string;
14
14
  declare function createOAuthState(tenantId?: string): string;
15
15
  declare function parseOAuthState(stateStr: string): OAuthState | null;
16
+ declare function sanitizeTenantId(raw: string): string;
16
17
  declare const app: OpenAPIHono<{
17
18
  Variables: WorkAppsVariables;
18
19
  }, {}, "/">;
19
20
  //#endregion
20
- export { createOAuthState, app as default, getBotTokenForTeam, getStateSigningSecret, parseOAuthState, setBotTokenForTeam };
21
+ export { createOAuthState, app as default, getBotTokenForTeam, getStateSigningSecret, parseOAuthState, sanitizeTenantId, setBotTokenForTeam };
@@ -71,6 +71,9 @@ function parseOAuthState(stateStr) {
71
71
  return null;
72
72
  }
73
73
  }
74
+ function sanitizeTenantId(raw) {
75
+ return /^[a-zA-Z0-9_-]+$/.test(raw) ? raw : "";
76
+ }
74
77
  const app = new OpenAPIHono();
75
78
  app.openapi(createProtectedRoute({
76
79
  method: "get",
@@ -123,7 +126,9 @@ app.openapi(createProtectedRoute({
123
126
  }), async (c) => {
124
127
  const { code, error, state: stateParam } = c.req.valid("query");
125
128
  const parsedState = stateParam ? parseOAuthState(stateParam) : null;
126
- const tenantId = parsedState?.tenantId || "";
129
+ const rawTenantId = parsedState?.tenantId || "";
130
+ const tenantId = sanitizeTenantId(rawTenantId);
131
+ if (rawTenantId && !tenantId) logger.warn({ rawTenantId: rawTenantId.slice(0, 50) }, "Rejected invalid tenantId from OAuth state");
127
132
  const dashboardUrl = `${manageUiUrl}/${tenantId}/work-apps/slack`;
128
133
  if (!stateParam || !parsedState) {
129
134
  logger.error({ hasState: !!stateParam }, "Invalid or missing OAuth state parameter");
@@ -327,4 +332,4 @@ app.openapi(createProtectedRoute({
327
332
  var oauth_default = app;
328
333
 
329
334
  //#endregion
330
- export { createOAuthState, oauth_default as default, getBotTokenForTeam, getStateSigningSecret, parseOAuthState, setBotTokenForTeam };
335
+ export { createOAuthState, oauth_default as default, getBotTokenForTeam, getStateSigningSecret, parseOAuthState, sanitizeTenantId, setBotTokenForTeam };
@@ -9,12 +9,12 @@ import { AgentOption } from "../modals.js";
9
9
  * Called on every @mention and /inkeep command — caching avoids redundant DB queries.
10
10
  */
11
11
  declare function findCachedUserMapping(tenantId: string, slackUserId: string, teamId: string, clientId?: string): Promise<{
12
- slackUserId: string;
13
- id: string;
14
12
  createdAt: string;
15
13
  updatedAt: string;
14
+ id: string;
16
15
  tenantId: string;
17
16
  clientId: string;
17
+ slackUserId: string;
18
18
  slackTeamId: string;
19
19
  slackEnterpriseId: string | null;
20
20
  inkeepUserId: string;
@@ -1,5 +1,5 @@
1
1
  import { SlackLinkIntent } from "@inkeep/agents-core";
2
- import * as slack_block_builder7 from "slack-block-builder";
2
+ import * as slack_block_builder0 from "slack-block-builder";
3
3
 
4
4
  //#region src/slack/services/link-prompt.d.ts
5
5
  type LinkPromptResult = {
@@ -22,6 +22,6 @@ interface ResolveLinkActionParams {
22
22
  intent?: SlackLinkIntent;
23
23
  }
24
24
  declare function resolveUnlinkedUserAction(params: ResolveLinkActionParams): Promise<LinkPromptResult>;
25
- declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder7.SlackMessageDto>;
25
+ declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder0.SlackMessageDto>;
26
26
  //#endregion
27
27
  export { LinkPromptResult, ResolveLinkActionParams, buildLinkPromptMessage, resolveUnlinkedUserAction };
@@ -1,7 +1,9 @@
1
1
  import { oauth_config } from "./slack-app-manifest.js";
2
2
 
3
3
  //#region src/slack/slack-scopes.ts
4
- const BOT_SCOPES = oauth_config.scopes.bot;
4
+ const scopes = oauth_config.scopes?.bot;
5
+ if (!Array.isArray(scopes) || scopes.length === 0) throw new Error("slack-app-manifest.json is missing oauth_config.scopes.bot — check the manifest structure");
6
+ const BOT_SCOPES = scopes;
5
7
  const BOT_SCOPES_CSV = BOT_SCOPES.join(",");
6
8
 
7
9
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.0.0-dev-20260315043702",
3
+ "version": "0.0.0-dev-20260315054254",
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.2.1",
35
35
  "slack-block-builder": "^2.8.0",
36
- "@inkeep/agents-core": "0.0.0-dev-20260315043702"
36
+ "@inkeep/agents-core": "0.0.0-dev-20260315054254"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",