@inkeep/agents-work-apps 0.70.3 → 0.70.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.
- package/dist/env.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/tokenExchange.d.ts +2 -2
- package/dist/github/routes/webhooks.d.ts +2 -2
- package/dist/slack/mcp/index.d.ts +2 -2
- package/dist/slack/middleware/permissions.js +1 -1
- package/dist/slack/routes/workspaces.js +25 -34
- package/dist/slack/services/events/utils.d.ts +1 -1
- package/dist/slack/services/link-prompt.d.ts +2 -2
- 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";
|
|
18
17
|
trace: "trace";
|
|
19
18
|
debug: "debug";
|
|
20
19
|
info: "info";
|
|
21
20
|
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>;
|
|
@@ -45,7 +45,7 @@ declare const envSchema: z.ZodObject<{
|
|
|
45
45
|
declare const env: {
|
|
46
46
|
NODE_ENV: "development" | "production" | "test";
|
|
47
47
|
ENVIRONMENT: "development" | "production" | "test" | "pentest";
|
|
48
|
-
LOG_LEVEL: "
|
|
48
|
+
LOG_LEVEL: "trace" | "debug" | "info" | "warn" | "error";
|
|
49
49
|
INKEEP_AGENTS_RUN_DATABASE_URL?: string | undefined;
|
|
50
50
|
INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
|
|
51
51
|
GITHUB_APP_ID?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types6 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
|
-
},
|
|
11
|
+
}, hono_types6.BlankSchema, "/">;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types7 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_types7.BlankEnv, hono_types7.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types9 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_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
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types5 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
|
-
},
|
|
21
|
+
}, hono_types5.BlankSchema, "/">;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { ChannelInfo, app as default, pruneStaleChannelIds };
|
|
@@ -58,7 +58,7 @@ const requireWorkspaceAdmin = () => {
|
|
|
58
58
|
await next();
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
const teamId = c.req.param("teamId")
|
|
61
|
+
const teamId = c.req.param("teamId");
|
|
62
62
|
if (teamId && !c.get("tenantRole")) await resolveWorkAppTenantContext(c, teamId, userId);
|
|
63
63
|
const tenantId = c.get("tenantId");
|
|
64
64
|
const tenantRole = c.get("tenantRole");
|
|
@@ -42,6 +42,12 @@ function verifyTenantOwnership(c, workspaceTenantId) {
|
|
|
42
42
|
return sessionTenantId === workspaceTenantId;
|
|
43
43
|
}
|
|
44
44
|
const app = new OpenAPIHono();
|
|
45
|
+
const SlackTeamIdSchema = z.string().regex(/^T[A-Z0-9]+$/, "teamId must be a raw Slack team ID (e.g. T012AB3C4)").openapi({ example: "T012AB3C4" });
|
|
46
|
+
const WorkspaceTeamIdParams = z.object({ teamId: SlackTeamIdSchema });
|
|
47
|
+
const WorkspaceTeamAndChannelIdParams = z.object({
|
|
48
|
+
teamId: SlackTeamIdSchema,
|
|
49
|
+
channelId: z.string()
|
|
50
|
+
});
|
|
45
51
|
const WorkspaceSettingsResponseSchema = z.object({ defaultAgent: WorkAppSlackAgentConfigRequestSchema.optional() });
|
|
46
52
|
const WorkspaceSettingsRequestSchema = z.object({ defaultAgent: WorkAppSlackAgentConfigRequestSchema.optional() });
|
|
47
53
|
const JoinFromWorkspaceSettingsSchema = z.object({ shouldAllowJoinFromWorkspace: z.boolean() });
|
|
@@ -120,7 +126,7 @@ app.openapi(createProtectedRoute({
|
|
|
120
126
|
"Workspaces"
|
|
121
127
|
],
|
|
122
128
|
permission: inheritedWorkAppsAuth(),
|
|
123
|
-
request: { params:
|
|
129
|
+
request: { params: WorkspaceTeamIdParams },
|
|
124
130
|
responses: {
|
|
125
131
|
200: {
|
|
126
132
|
description: "Workspace details",
|
|
@@ -162,7 +168,7 @@ app.openapi(createProtectedRoute({
|
|
|
162
168
|
"Workspaces"
|
|
163
169
|
],
|
|
164
170
|
permission: inheritedWorkAppsAuth(),
|
|
165
|
-
request: { params:
|
|
171
|
+
request: { params: WorkspaceTeamIdParams },
|
|
166
172
|
responses: { 200: {
|
|
167
173
|
description: "Workspace settings",
|
|
168
174
|
content: { "application/json": { schema: WorkspaceSettingsResponseSchema } }
|
|
@@ -193,7 +199,7 @@ app.openapi(createProtectedRoute({
|
|
|
193
199
|
],
|
|
194
200
|
permission: requireWorkspaceAdmin(),
|
|
195
201
|
request: {
|
|
196
|
-
params:
|
|
202
|
+
params: WorkspaceTeamIdParams,
|
|
197
203
|
body: { content: { "application/json": { schema: WorkspaceSettingsRequestSchema } } }
|
|
198
204
|
},
|
|
199
205
|
responses: {
|
|
@@ -252,7 +258,7 @@ app.openapi(createProtectedRoute({
|
|
|
252
258
|
"Workspaces"
|
|
253
259
|
],
|
|
254
260
|
permission: inheritedWorkAppsAuth(),
|
|
255
|
-
request: { params:
|
|
261
|
+
request: { params: WorkspaceTeamIdParams },
|
|
256
262
|
responses: {
|
|
257
263
|
200: {
|
|
258
264
|
description: "Join from workspace setting",
|
|
@@ -281,7 +287,7 @@ app.openapi(createProtectedRoute({
|
|
|
281
287
|
],
|
|
282
288
|
permission: requireWorkspaceAdmin(),
|
|
283
289
|
request: {
|
|
284
|
-
params:
|
|
290
|
+
params: WorkspaceTeamIdParams,
|
|
285
291
|
body: { content: { "application/json": { schema: JoinFromWorkspaceSettingsSchema } } }
|
|
286
292
|
},
|
|
287
293
|
responses: {
|
|
@@ -327,7 +333,7 @@ app.openapi(createProtectedRoute({
|
|
|
327
333
|
method: "delete",
|
|
328
334
|
path: "/{teamId}",
|
|
329
335
|
summary: "Uninstall Workspace",
|
|
330
|
-
description: "Uninstall Slack app from workspace.
|
|
336
|
+
description: "Uninstall the Inkeep Slack app from a workspace. The path parameter must be the raw Slack team ID (e.g. T012AB3C4).",
|
|
331
337
|
operationId: "slack-delete-workspace",
|
|
332
338
|
tags: [
|
|
333
339
|
"Work Apps",
|
|
@@ -335,25 +341,19 @@ app.openapi(createProtectedRoute({
|
|
|
335
341
|
"Workspaces"
|
|
336
342
|
],
|
|
337
343
|
permission: requireWorkspaceAdmin(),
|
|
338
|
-
request: { params:
|
|
344
|
+
request: { params: WorkspaceTeamIdParams },
|
|
339
345
|
responses: {
|
|
340
346
|
200: {
|
|
341
347
|
description: "Workspace uninstalled",
|
|
342
348
|
content: { "application/json": { schema: z.object({ success: z.boolean() }) } }
|
|
343
349
|
},
|
|
344
|
-
|
|
350
|
+
403: { description: "Access denied" },
|
|
345
351
|
404: { description: "Workspace not found" },
|
|
346
352
|
500: { description: "Failed to uninstall workspace" }
|
|
347
353
|
}
|
|
348
354
|
}), async (c) => {
|
|
349
|
-
const { teamId
|
|
350
|
-
let teamId;
|
|
355
|
+
const { teamId } = c.req.valid("param");
|
|
351
356
|
try {
|
|
352
|
-
if (workspaceIdentifier.includes(":")) {
|
|
353
|
-
const teamMatch = workspaceIdentifier.match(/T:([A-Z0-9]+)/);
|
|
354
|
-
if (!teamMatch) return c.json({ error: "Invalid connectionId format" }, 400);
|
|
355
|
-
teamId = teamMatch[1];
|
|
356
|
-
} else teamId = workspaceIdentifier;
|
|
357
357
|
const workspace = await findWorkspaceConnectionByTeamId(teamId);
|
|
358
358
|
if (!workspace) return c.json({ error: "Workspace not found" }, 404);
|
|
359
359
|
if (!verifyTenantOwnership(c, workspace.tenantId)) return c.json({ error: "Access denied" }, 403);
|
|
@@ -367,7 +367,7 @@ app.openapi(createProtectedRoute({
|
|
|
367
367
|
} catch (error) {
|
|
368
368
|
logger.error({
|
|
369
369
|
error,
|
|
370
|
-
|
|
370
|
+
teamId
|
|
371
371
|
}, "Failed to uninstall workspace");
|
|
372
372
|
return c.json({ error: "Failed to uninstall workspace" }, 500);
|
|
373
373
|
}
|
|
@@ -385,7 +385,7 @@ app.openapi(createProtectedRoute({
|
|
|
385
385
|
],
|
|
386
386
|
permission: inheritedWorkAppsAuth(),
|
|
387
387
|
request: {
|
|
388
|
-
params:
|
|
388
|
+
params: WorkspaceTeamIdParams,
|
|
389
389
|
query: z.object({
|
|
390
390
|
limit: z.coerce.number().optional().default(100),
|
|
391
391
|
cursor: z.string().optional(),
|
|
@@ -469,10 +469,7 @@ app.openapi(createProtectedRoute({
|
|
|
469
469
|
"Channels"
|
|
470
470
|
],
|
|
471
471
|
permission: inheritedWorkAppsAuth(),
|
|
472
|
-
request: { params:
|
|
473
|
-
teamId: z.string(),
|
|
474
|
-
channelId: z.string()
|
|
475
|
-
}) },
|
|
472
|
+
request: { params: WorkspaceTeamAndChannelIdParams },
|
|
476
473
|
responses: { 200: {
|
|
477
474
|
description: "Channel settings",
|
|
478
475
|
content: { "application/json": { schema: z.object({
|
|
@@ -514,10 +511,7 @@ app.openapi(createProtectedRoute({
|
|
|
514
511
|
],
|
|
515
512
|
permission: requireChannelMemberOrAdmin(),
|
|
516
513
|
request: {
|
|
517
|
-
params:
|
|
518
|
-
teamId: z.string(),
|
|
519
|
-
channelId: z.string()
|
|
520
|
-
}),
|
|
514
|
+
params: WorkspaceTeamAndChannelIdParams,
|
|
521
515
|
body: { content: { "application/json": { schema: z.object({
|
|
522
516
|
agentConfig: WorkAppSlackAgentConfigRequestSchema,
|
|
523
517
|
channelName: z.string().optional(),
|
|
@@ -597,7 +591,7 @@ app.openapi(createProtectedRoute({
|
|
|
597
591
|
],
|
|
598
592
|
permission: requireWorkspaceAdmin(),
|
|
599
593
|
request: {
|
|
600
|
-
params:
|
|
594
|
+
params: WorkspaceTeamIdParams,
|
|
601
595
|
body: { content: { "application/json": { schema: z.object({
|
|
602
596
|
channelIds: z.array(z.string()).min(1),
|
|
603
597
|
agentConfig: WorkAppSlackAgentConfigRequestSchema
|
|
@@ -712,7 +706,7 @@ app.openapi(createProtectedRoute({
|
|
|
712
706
|
],
|
|
713
707
|
permission: requireWorkspaceAdmin(),
|
|
714
708
|
request: {
|
|
715
|
-
params:
|
|
709
|
+
params: WorkspaceTeamIdParams,
|
|
716
710
|
body: { content: { "application/json": { schema: z.object({ channelIds: z.array(z.string()).min(1) }) } } }
|
|
717
711
|
},
|
|
718
712
|
responses: { 200: {
|
|
@@ -759,10 +753,7 @@ app.openapi(createProtectedRoute({
|
|
|
759
753
|
"Channels"
|
|
760
754
|
],
|
|
761
755
|
permission: requireChannelMemberOrAdmin(),
|
|
762
|
-
request: { params:
|
|
763
|
-
teamId: z.string(),
|
|
764
|
-
channelId: z.string()
|
|
765
|
-
}) },
|
|
756
|
+
request: { params: WorkspaceTeamAndChannelIdParams },
|
|
766
757
|
responses: { 200: {
|
|
767
758
|
description: "Channel config removed",
|
|
768
759
|
content: { "application/json": { schema: z.object({ success: z.boolean() }) } }
|
|
@@ -795,7 +786,7 @@ app.openapi(createProtectedRoute({
|
|
|
795
786
|
"Users"
|
|
796
787
|
],
|
|
797
788
|
permission: inheritedWorkAppsAuth(),
|
|
798
|
-
request: { params:
|
|
789
|
+
request: { params: WorkspaceTeamIdParams },
|
|
799
790
|
responses: { 200: {
|
|
800
791
|
description: "List of linked users",
|
|
801
792
|
content: { "application/json": { schema: z.object({ linkedUsers: z.array(z.object({
|
|
@@ -846,7 +837,7 @@ app.openapi(createProtectedRoute({
|
|
|
846
837
|
"Workspaces"
|
|
847
838
|
],
|
|
848
839
|
permission: inheritedWorkAppsAuth(),
|
|
849
|
-
request: { params:
|
|
840
|
+
request: { params: WorkspaceTeamIdParams },
|
|
850
841
|
responses: {
|
|
851
842
|
200: {
|
|
852
843
|
description: "Health check result",
|
|
@@ -944,7 +935,7 @@ app.openapi(createProtectedRoute({
|
|
|
944
935
|
],
|
|
945
936
|
permission: requireWorkspaceAdmin(),
|
|
946
937
|
request: {
|
|
947
|
-
params:
|
|
938
|
+
params: WorkspaceTeamIdParams,
|
|
948
939
|
body: { content: { "application/json": { schema: z.object({
|
|
949
940
|
channelId: z.string(),
|
|
950
941
|
message: z.string().optional()
|
|
@@ -12,9 +12,9 @@ declare function findCachedUserMapping(tenantId: string, slackUserId: string, te
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
slackUserId: 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
|
|
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<
|
|
25
|
+
declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder0.SlackMessageDto>;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { LinkPromptResult, ResolveLinkActionParams, buildLinkPromptMessage, resolveUnlinkedUserAction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-work-apps",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.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.70.
|
|
38
|
+
"@inkeep/agents-core": "0.70.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@hono/zod-openapi": "^1.1.5",
|