@inkeep/agents-api 0.0.0-dev-20260204175538 → 0.0.0-dev-20260204182014

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.
Files changed (41) hide show
  1. package/dist/.well-known/workflow/v1/manifest.debug.json +19 -19
  2. package/dist/.well-known/workflow/v1/step.cjs +569 -232
  3. package/dist/createApp.d.ts +2 -2
  4. package/dist/createApp.js +46 -1
  5. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  6. package/dist/domains/evals/routes/index.d.ts +2 -2
  7. package/dist/domains/evals/services/EvaluationService.d.ts +0 -5
  8. package/dist/domains/evals/services/EvaluationService.js +2 -51
  9. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  10. package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
  11. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  12. package/dist/domains/manage/routes/index.d.ts +2 -2
  13. package/dist/domains/manage/routes/invitations.d.ts +2 -2
  14. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  15. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  16. package/dist/domains/manage/routes/userOrganizations.d.ts +2 -2
  17. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  18. package/dist/domains/work-apps/index.d.ts +13 -0
  19. package/dist/domains/work-apps/index.js +23 -0
  20. package/dist/domains/work-apps/types.d.ts +7 -0
  21. package/dist/domains/work-apps/types.js +1 -0
  22. package/dist/factory.d.ts +18 -18
  23. package/dist/index.d.ts +18 -18
  24. package/dist/middleware/cors.d.ts +6 -1
  25. package/dist/middleware/cors.js +27 -1
  26. package/dist/middleware/evalsAuth.d.ts +2 -2
  27. package/dist/middleware/index.d.ts +2 -2
  28. package/dist/middleware/index.js +2 -2
  29. package/dist/middleware/manageAuth.d.ts +2 -2
  30. package/dist/middleware/manageAuth.js +16 -1
  31. package/dist/middleware/projectAccess.d.ts +2 -2
  32. package/dist/middleware/projectConfig.d.ts +3 -3
  33. package/dist/middleware/requirePermission.d.ts +2 -2
  34. package/dist/middleware/runAuth.d.ts +4 -4
  35. package/dist/middleware/runAuth.js +48 -1
  36. package/dist/middleware/sessionAuth.d.ts +3 -3
  37. package/dist/middleware/tenantAccess.d.ts +2 -2
  38. package/dist/middleware/tracing.d.ts +3 -3
  39. package/dist/openapi.d.ts +8 -0
  40. package/dist/openapi.js +9 -1
  41. package/package.json +10 -5
@@ -1,5 +1,5 @@
1
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
- import * as hono18 from "hono";
2
+ import * as hono13 from "hono";
3
3
  import { createAuth } from "@inkeep/agents-core/auth";
4
4
 
5
5
  //#region src/middleware/manageAuth.d.ts
@@ -12,7 +12,7 @@ import { createAuth } from "@inkeep/agents-core/auth";
12
12
  * 3. Database API key
13
13
  * 4. Internal service token
14
14
  */
15
- declare const manageApiKeyAuth: () => hono18.MiddlewareHandler<{
15
+ declare const manageApiKeyAuth: () => hono13.MiddlewareHandler<{
16
16
  Variables: {
17
17
  executionContext: BaseExecutionContext;
18
18
  userId?: string;
@@ -1,6 +1,6 @@
1
1
  import { env } from "../env.js";
2
2
  import runDbClient_default from "../data/db/runDbClient.js";
3
- import { getLogger, isInternalServiceToken, validateAndGetApiKey, verifyInternalServiceAuthHeader } from "@inkeep/agents-core";
3
+ import { getLogger, isInternalServiceToken, isSlackUserToken, validateAndGetApiKey, verifyInternalServiceAuthHeader, verifySlackUserToken } from "@inkeep/agents-core";
4
4
  import { createMiddleware } from "hono/factory";
5
5
  import { HTTPException } from "hono/http-exception";
6
6
 
@@ -58,6 +58,21 @@ const manageApiKeyAuth = () => createMiddleware(async (c, next) => {
58
58
  await next();
59
59
  return;
60
60
  }
61
+ if (isSlackUserToken(token)) {
62
+ const result = await verifySlackUserToken(token);
63
+ if (!result.valid || !result.payload) throw new HTTPException(401, { message: result.error || "Invalid Slack user token" });
64
+ logger.info({
65
+ inkeepUserId: result.payload.sub,
66
+ tenantId: result.payload.tenantId,
67
+ slackTeamId: result.payload.slack.teamId,
68
+ slackUserId: result.payload.slack.userId
69
+ }, "Slack user JWT authenticated successfully");
70
+ c.set("userId", result.payload.sub);
71
+ if (result.payload.slack.email) c.set("userEmail", result.payload.slack.email);
72
+ c.set("tenantId", result.payload.tenantId);
73
+ await next();
74
+ return;
75
+ }
61
76
  if (isInternalServiceToken(token)) {
62
77
  const result = await verifyInternalServiceAuthHeader(authHeader);
63
78
  if (!result.valid || !result.payload) throw new HTTPException(401, { message: result.error || "Invalid internal service token" });
@@ -1,6 +1,6 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
2
  import { ProjectPermissionLevel } from "@inkeep/agents-core";
3
- import * as hono2 from "hono";
3
+ import * as hono14 from "hono";
4
4
 
5
5
  //#region src/middleware/projectAccess.d.ts
6
6
  /**
@@ -10,6 +10,6 @@ declare const requireProjectPermission: <Env$1 extends {
10
10
  Variables: ManageAppVariables;
11
11
  } = {
12
12
  Variables: ManageAppVariables;
13
- }>(permission?: ProjectPermissionLevel) => hono2.MiddlewareHandler<Env$1, string, {}, Response>;
13
+ }>(permission?: ProjectPermissionLevel) => hono14.MiddlewareHandler<Env$1, string, {}, Response>;
14
14
  //#endregion
15
15
  export { requireProjectPermission };
@@ -1,11 +1,11 @@
1
1
  import { BaseExecutionContext, ResolvedRef } from "@inkeep/agents-core";
2
- import * as hono8 from "hono";
2
+ import * as hono16 from "hono";
3
3
 
4
4
  //#region src/middleware/projectConfig.d.ts
5
5
  /**
6
6
  * Middleware that fetches the full project definition from the Management API
7
7
  */
8
- declare const projectConfigMiddleware: hono8.MiddlewareHandler<{
8
+ declare const projectConfigMiddleware: hono16.MiddlewareHandler<{
9
9
  Variables: {
10
10
  executionContext: BaseExecutionContext;
11
11
  resolvedRef: ResolvedRef;
@@ -15,7 +15,7 @@ declare const projectConfigMiddleware: hono8.MiddlewareHandler<{
15
15
  * Creates a middleware that applies project config fetching except for specified route patterns
16
16
  * @param skipRouteCheck - Function that returns true if the route should skip the middleware
17
17
  */
18
- declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono8.MiddlewareHandler<{
18
+ declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono16.MiddlewareHandler<{
19
19
  Variables: {
20
20
  executionContext: BaseExecutionContext;
21
21
  resolvedRef: ResolvedRef;
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono13 from "hono";
2
+ import * as hono0 from "hono";
3
3
 
4
4
  //#region src/middleware/requirePermission.d.ts
5
5
  type Permission = {
@@ -9,6 +9,6 @@ declare const requirePermission: <Env$1 extends {
9
9
  Variables: ManageAppVariables;
10
10
  } = {
11
11
  Variables: ManageAppVariables;
12
- }>(permissions: Permission) => hono13.MiddlewareHandler<Env$1, string, {}, Response>;
12
+ }>(permissions: Permission) => hono0.MiddlewareHandler<Env$1, string, {}, Response>;
13
13
  //#endregion
14
14
  export { requirePermission };
@@ -1,8 +1,8 @@
1
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
- import * as hono10 from "hono";
2
+ import * as hono2 from "hono";
3
3
 
4
4
  //#region src/middleware/runAuth.d.ts
5
- declare const runApiKeyAuth: () => hono10.MiddlewareHandler<{
5
+ declare const runApiKeyAuth: () => hono2.MiddlewareHandler<{
6
6
  Variables: {
7
7
  executionContext: BaseExecutionContext;
8
8
  };
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono10.MiddlewareHandler<{
11
11
  * Creates a middleware that applies API key authentication except for specified route patterns
12
12
  * @param skipRouteCheck - Function that returns true if the route should skip authentication
13
13
  */
14
- declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono10.MiddlewareHandler<{
14
+ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono2.MiddlewareHandler<{
15
15
  Variables: {
16
16
  executionContext: BaseExecutionContext;
17
17
  };
@@ -20,7 +20,7 @@ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) =
20
20
  * Helper middleware for endpoints that optionally support API key authentication
21
21
  * If no auth header is present, it continues without setting the executionContext
22
22
  */
23
- declare const runOptionalAuth: () => hono10.MiddlewareHandler<{
23
+ declare const runOptionalAuth: () => hono2.MiddlewareHandler<{
24
24
  Variables: {
25
25
  executionContext?: BaseExecutionContext;
26
26
  };
@@ -2,7 +2,7 @@ import { getLogger as getLogger$1 } from "../logger.js";
2
2
  import { env } from "../env.js";
3
3
  import runDbClient_default from "../data/db/runDbClient.js";
4
4
  import { createBaseExecutionContext } from "../types/runExecutionContext.js";
5
- import { canUseProjectStrict, validateAndGetApiKey, validateTargetAgent, verifyServiceToken, verifyTempToken } from "@inkeep/agents-core";
5
+ import { canUseProjectStrict, isSlackUserToken, validateAndGetApiKey, validateTargetAgent, verifyServiceToken, verifySlackUserToken, verifyTempToken } from "@inkeep/agents-core";
6
6
  import { createMiddleware } from "hono/factory";
7
7
  import { HTTPException } from "hono/http-exception";
8
8
 
@@ -125,6 +125,50 @@ async function tryApiKeyAuth(apiKey) {
125
125
  };
126
126
  }
127
127
  /**
128
+ * Authenticate using a Slack user JWT token (for Slack work app delegation)
129
+ */
130
+ async function trySlackUserJwtAuth(token, reqData) {
131
+ if (!isSlackUserToken(token)) return { authResult: null };
132
+ const result = await verifySlackUserToken(token);
133
+ if (!result.valid || !result.payload) {
134
+ logger.warn({ error: result.error }, "Invalid Slack user JWT token");
135
+ return {
136
+ authResult: null,
137
+ failureMessage: `Invalid Slack user token: ${result.error || "Invalid token"}`
138
+ };
139
+ }
140
+ const payload = result.payload;
141
+ if (!reqData.projectId || !reqData.agentId) {
142
+ logger.warn({
143
+ hasProjectId: !!reqData.projectId,
144
+ hasAgentId: !!reqData.agentId
145
+ }, "Slack user JWT requires x-inkeep-project-id and x-inkeep-agent-id headers");
146
+ return {
147
+ authResult: null,
148
+ failureMessage: "Slack user token requires x-inkeep-project-id and x-inkeep-agent-id headers"
149
+ };
150
+ }
151
+ logger.info({
152
+ inkeepUserId: payload.sub,
153
+ tenantId: payload.tenantId,
154
+ slackTeamId: payload.slack.teamId,
155
+ slackUserId: payload.slack.userId,
156
+ projectId: reqData.projectId,
157
+ agentId: reqData.agentId
158
+ }, "Slack user JWT token authenticated successfully");
159
+ return { authResult: {
160
+ apiKey: "slack-user-jwt",
161
+ tenantId: payload.tenantId,
162
+ projectId: reqData.projectId,
163
+ agentId: reqData.agentId,
164
+ apiKeyId: "slack-user-token",
165
+ metadata: { initiatedBy: {
166
+ type: "user",
167
+ id: payload.sub
168
+ } }
169
+ } };
170
+ }
171
+ /**
128
172
  * Authenticate using a team agent JWT token (for intra-tenant delegation)
129
173
  */
130
174
  async function tryTeamAgentAuth(token, expectedSubAgentId) {
@@ -210,6 +254,9 @@ async function authenticateRequest(reqData) {
210
254
  if (jwtResult) return { authResult: jwtResult };
211
255
  const bypassResult = tryBypassAuth(apiKey, reqData);
212
256
  if (bypassResult) return { authResult: bypassResult };
257
+ const slackAttempt = await trySlackUserJwtAuth(apiKey, reqData);
258
+ if (slackAttempt.authResult) return { authResult: slackAttempt.authResult };
259
+ if (slackAttempt.failureMessage) return slackAttempt;
213
260
  const apiKeyResult = await tryApiKeyAuth(apiKey);
214
261
  if (apiKeyResult) return { authResult: apiKeyResult };
215
262
  const teamAttempt = await tryTeamAgentAuth(apiKey, subAgentId);
@@ -1,4 +1,4 @@
1
- import * as hono0 from "hono";
1
+ import * as hono11 from "hono";
2
2
 
3
3
  //#region src/middleware/sessionAuth.d.ts
4
4
 
@@ -7,11 +7,11 @@ import * as hono0 from "hono";
7
7
  * Requires that a user has already been authenticated via Better Auth session.
8
8
  * Used primarily for manage routes that require an active user session.
9
9
  */
10
- declare const sessionAuth: () => hono0.MiddlewareHandler<any, string, {}, Response>;
10
+ declare const sessionAuth: () => hono11.MiddlewareHandler<any, string, {}, Response>;
11
11
  /**
12
12
  * Global session middleware - sets user and session in context for all routes
13
13
  * Used for all routes that require an active user session.
14
14
  */
15
- declare const sessionContext: () => hono0.MiddlewareHandler<any, string, {}, Response>;
15
+ declare const sessionContext: () => hono11.MiddlewareHandler<any, string, {}, Response>;
16
16
  //#endregion
17
17
  export { sessionAuth, sessionContext };
@@ -1,4 +1,4 @@
1
- import * as hono3 from "hono";
1
+ import * as hono1 from "hono";
2
2
 
3
3
  //#region src/middleware/tenantAccess.d.ts
4
4
 
@@ -11,7 +11,7 @@ import * as hono3 from "hono";
11
11
  * - API key user: Access only to the tenant associated with the API key
12
12
  * - Session user: Access based on organization membership
13
13
  */
14
- declare const requireTenantAccess: () => hono3.MiddlewareHandler<{
14
+ declare const requireTenantAccess: () => hono1.MiddlewareHandler<{
15
15
  Variables: {
16
16
  userId: string;
17
17
  tenantId: string;
@@ -1,7 +1,7 @@
1
- import * as hono4 from "hono";
1
+ import * as hono7 from "hono";
2
2
 
3
3
  //#region src/middleware/tracing.d.ts
4
- declare const otelBaggageMiddleware: () => hono4.MiddlewareHandler<any, string, {}, Response>;
5
- declare const executionBaggageMiddleware: () => hono4.MiddlewareHandler<any, string, {}, Response>;
4
+ declare const otelBaggageMiddleware: () => hono7.MiddlewareHandler<any, string, {}, Response>;
5
+ declare const executionBaggageMiddleware: () => hono7.MiddlewareHandler<any, string, {}, Response>;
6
6
  //#endregion
7
7
  export { executionBaggageMiddleware, otelBaggageMiddleware };
package/dist/openapi.d.ts CHANGED
@@ -8,6 +8,7 @@ declare const TagToDescription: {
8
8
  Agents: string;
9
9
  'Artifact Components': string;
10
10
  Branches: string;
11
+ Channels: string;
11
12
  CLI: string;
12
13
  Chat: string;
13
14
  'Context Configs': string;
@@ -20,6 +21,7 @@ declare const TagToDescription: {
20
21
  'Function Tools': string;
21
22
  Functions: string;
22
23
  GitHub: string;
24
+ Invitations: string;
23
25
  MCP: string;
24
26
  'MCP Catalog': string;
25
27
  OAuth: string;
@@ -27,13 +29,19 @@ declare const TagToDescription: {
27
29
  'Project Permissions': string;
28
30
  Projects: string;
29
31
  Refs: string;
32
+ Resources: string;
33
+ Slack: string;
30
34
  SubAgents: string;
31
35
  'Third-Party MCP Servers': string;
32
36
  Tools: string;
33
37
  Triggers: string;
38
+ 'User Organizations': string;
34
39
  'User Project Memberships': string;
40
+ Users: string;
35
41
  Webhooks: string;
42
+ 'Work Apps': string;
36
43
  Workflows: string;
44
+ Workspaces: string;
37
45
  };
38
46
  declare function setupOpenAPIRoutes<E extends Env = Env>(app: OpenAPIHono<E>): void;
39
47
  //#endregion
package/dist/openapi.js CHANGED
@@ -7,6 +7,7 @@ const TagToDescription = {
7
7
  Agents: "Operations for managing agents",
8
8
  "Artifact Components": "Operations for managing artifact components",
9
9
  Branches: "Operations for managing branches",
10
+ Channels: "Operations for managing Slack channels",
10
11
  CLI: "CLI authentication endpoints",
11
12
  Chat: "Chat completions endpoints",
12
13
  "Context Configs": "Operations for managing context configurations",
@@ -19,6 +20,7 @@ const TagToDescription = {
19
20
  "Function Tools": "Operations for managing function tools",
20
21
  Functions: "Operations for managing functions",
21
22
  GitHub: "GitHub App integration endpoints",
23
+ Invitations: "Operations for managing invitations",
22
24
  MCP: "MCP (Model Context Protocol) endpoints",
23
25
  "MCP Catalog": "Operations for MCP catalog",
24
26
  OAuth: "OAuth authentication endpoints",
@@ -26,13 +28,19 @@ const TagToDescription = {
26
28
  "Project Permissions": "Operations for managing project permissions",
27
29
  Projects: "Operations for managing projects",
28
30
  Refs: "Operations for the resolved ref (branch name, tag name, or commit hash)",
31
+ Resources: "Operations for fetching resources and data",
32
+ Slack: "Slack App integration endpoints",
29
33
  SubAgents: "Operations for managing sub agents",
30
34
  "Third-Party MCP Servers": "Operations for managing third-party MCP servers",
31
35
  Tools: "Operations for managing MCP tools",
32
36
  Triggers: "Operations for managing triggers",
37
+ "User Organizations": "Operations for managing user organizations",
33
38
  "User Project Memberships": "Operations for managing user project memberships",
39
+ Users: "Operations for managing users",
34
40
  Webhooks: "Webhook endpoints",
35
- Workflows: "Workflow trigger endpoints"
41
+ "Work Apps": "Work app integrations (Slack, Teams, etc.)",
42
+ Workflows: "Workflow trigger endpoints",
43
+ Workspaces: "Operations for managing Slack workspaces"
36
44
  };
37
45
  function setupOpenAPIRoutes(app) {
38
46
  app.get("/openapi.json", (c) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-api",
3
- "version": "0.0.0-dev-20260204175538",
3
+ "version": "0.0.0-dev-20260204182014",
4
4
  "description": "Unified Inkeep Agents API - combines management, runtime, and evaluation capabilities",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -37,6 +37,7 @@
37
37
  "@hono/swagger-ui": "^0.5.1",
38
38
  "@hono/zod-openapi": "^1.1.5",
39
39
  "@modelcontextprotocol/sdk": "^1.25.2",
40
+ "@nangohq/node": "^0.69.20",
40
41
  "@opentelemetry/api": "^1.9.0",
41
42
  "@opentelemetry/auto-instrumentations-node": "^0.64.1",
42
43
  "@opentelemetry/baggage-span-processor": "^0.4.0",
@@ -47,6 +48,8 @@
47
48
  "@opentelemetry/sdk-node": "^0.205.0",
48
49
  "@opentelemetry/sdk-trace-base": "^2.1.0",
49
50
  "@opentelemetry/semantic-conventions": "^1.37.0",
51
+ "@slack/bolt": "^4.6.0",
52
+ "@slack/web-api": "^7.13.0",
50
53
  "@vercel/functions": "^1.4.0",
51
54
  "@vercel/sandbox": "^0.0.24",
52
55
  "@workflow/builders": "4.0.1-beta.27",
@@ -65,11 +68,12 @@
65
68
  "llm-info": "^1.0.69",
66
69
  "openid-client": "^6.8.1",
67
70
  "pg": "^8.16.3",
71
+ "slack-block-builder": "^2.8.0",
68
72
  "workflow": "4.0.1-beta.33",
69
- "@inkeep/agents-core": "^0.0.0-dev-20260204175538",
70
- "@inkeep/agents-work-apps": "^0.0.0-dev-20260204175538",
71
- "@inkeep/agents-manage-mcp": "^0.0.0-dev-20260204175538",
72
- "@inkeep/agents-mcp": "^0.0.0-dev-20260204175538"
73
+ "@inkeep/agents-core": "^0.0.0-dev-20260204182014",
74
+ "@inkeep/agents-manage-mcp": "^0.0.0-dev-20260204182014",
75
+ "@inkeep/agents-mcp": "^0.0.0-dev-20260204182014",
76
+ "@inkeep/agents-work-apps": "^0.0.0-dev-20260204182014"
73
77
  },
74
78
  "peerDependencies": {
75
79
  "@hono/zod-openapi": "^1.1.5",
@@ -79,6 +83,7 @@
79
83
  "@hono/vite-dev-server": "^0.20.1",
80
84
  "@opentelemetry/exporter-trace-otlp-proto": "^0.203.0",
81
85
  "@opentelemetry/sdk-metrics": "^2.1.0",
86
+ "@slack/types": "^2.19.0",
82
87
  "@types/jmespath": "^0.15.2",
83
88
  "@types/node": "^20.11.24",
84
89
  "@types/pg": "^8.15.6",