@inkeep/agents-api 0.0.0-dev-20260302213646 → 0.0.0-dev-20260303010841
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/.well-known/workflow/v1/manifest.json +5 -5
- package/dist/createApp.js +2 -2
- package/dist/data/db/manageDbClient.d.ts +2 -2
- package/dist/data/db/runDbClient.d.ts +2 -2
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/manage/routes/availableAgents.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/invitations.d.ts +2 -2
- package/dist/domains/manage/routes/users.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/agents/relationTools.d.ts +2 -2
- package/dist/domains/run/utils/token-estimator.d.ts +2 -2
- package/dist/domains/run/workflow/steps/scheduledTriggerSteps.d.ts +5 -5
- package/dist/factory.d.ts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/middleware/evalsAuth.d.ts +2 -2
- package/dist/middleware/index.d.ts +2 -2
- package/dist/middleware/index.js +2 -2
- package/dist/middleware/manageAuth.d.ts +10 -6
- package/dist/middleware/manageAuth.js +13 -19
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/runAuth.js +5 -0
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/dist/middleware/workAppsAuth.js +4 -4
- package/dist/routes/capabilities.js +2 -2
- package/package.json +4 -4
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"stepId": "step//./src/domains/evals/workflow/functions/runDatasetItem//logStep"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"node_modules/.pnpm/workflow@4.1.0-beta.54_@aws-sdk+client-sts@3.970.0_@nestjs+common@11.1.13_reflect-metad_f85281f2580d7065fc514e637f5f5e1f/node_modules/workflow/dist/stdlib.js": {
|
|
19
|
+
"fetch": {
|
|
20
|
+
"stepId": "step//workflow@4.1.0-beta.54//fetch"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
18
23
|
"node_modules/.pnpm/workflow@4.1.0-beta.54_@aws-sdk+client-sts@3.970.0_@nestjs+common@11.1.13_reflect-metad_f85281f2580d7065fc514e637f5f5e1f/node_modules/workflow/dist/internal/builtins.js": {
|
|
19
24
|
"__builtin_response_array_buffer": {
|
|
20
25
|
"stepId": "__builtin_response_array_buffer"
|
|
@@ -26,11 +31,6 @@
|
|
|
26
31
|
"stepId": "__builtin_response_text"
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
|
-
"node_modules/.pnpm/workflow@4.1.0-beta.54_@aws-sdk+client-sts@3.970.0_@nestjs+common@11.1.13_reflect-metad_f85281f2580d7065fc514e637f5f5e1f/node_modules/workflow/dist/stdlib.js": {
|
|
30
|
-
"fetch": {
|
|
31
|
-
"stepId": "step//workflow@4.1.0-beta.54//fetch"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
34
|
"src/domains/evals/workflow/functions/evaluateConversation.ts": {
|
|
35
35
|
"executeEvaluatorStep": {
|
|
36
36
|
"stepId": "step//./src/domains/evals/workflow/functions/evaluateConversation//executeEvaluatorStep"
|
package/dist/createApp.js
CHANGED
|
@@ -5,7 +5,7 @@ import { workflowRoutes } from "./domains/evals/workflow/routes.js";
|
|
|
5
5
|
import { authCorsConfig, defaultCorsConfig, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./middleware/cors.js";
|
|
6
6
|
import { errorHandler } from "./middleware/errorHandler.js";
|
|
7
7
|
import { sessionContext } from "./middleware/sessionAuth.js";
|
|
8
|
-
import {
|
|
8
|
+
import { manageBearerOrSessionAuth } from "./middleware/manageAuth.js";
|
|
9
9
|
import { runApiKeyAuth, runApiKeyAuthExcept } from "./middleware/runAuth.js";
|
|
10
10
|
import { requireTenantAccess } from "./middleware/tenantAccess.js";
|
|
11
11
|
import { workAppsAuth } from "./middleware/workAppsAuth.js";
|
|
@@ -112,7 +112,7 @@ function createAgentsHono(config) {
|
|
|
112
112
|
app.use("*", sessionContext());
|
|
113
113
|
app.route("/", healthChecksHandler);
|
|
114
114
|
app.route("/", workflowProcessHandler);
|
|
115
|
-
app.use("/manage/tenants/*",
|
|
115
|
+
app.use("/manage/tenants/*", manageBearerOrSessionAuth());
|
|
116
116
|
app.use("/manage/tenants/:tenantId/*", requireTenantAccess());
|
|
117
117
|
app.use("*", async (_c, next) => {
|
|
118
118
|
await next();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _inkeep_agents_core1 from "@inkeep/agents-core";
|
|
2
2
|
|
|
3
3
|
//#region src/data/db/manageDbClient.d.ts
|
|
4
|
-
declare const manageDbClient:
|
|
4
|
+
declare const manageDbClient: _inkeep_agents_core1.AgentsManageDatabaseClient;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { manageDbClient as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _inkeep_agents_core2 from "@inkeep/agents-core";
|
|
2
2
|
|
|
3
3
|
//#region src/data/db/runDbClient.d.ts
|
|
4
|
-
declare const runDbClient:
|
|
4
|
+
declare const runDbClient: _inkeep_agents_core2.AgentsRunDatabaseClient;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { runDbClient as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono4 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/datasetTriggers.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono4.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono8 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono8.Env, {}, "/">;
|
|
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_types11 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/workflow/routes.d.ts
|
|
5
|
-
declare const workflowRoutes: Hono<
|
|
5
|
+
declare const workflowRoutes: Hono<hono_types11.BlankEnv, hono_types11.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { workflowRoutes };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono0 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/availableAgents.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono0.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono2 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono2.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono1 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono1.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types10 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/invitations.d.ts
|
|
6
6
|
declare const invitationsRoutes: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types10.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { invitationsRoutes as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types6 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/users.d.ts
|
|
6
6
|
declare const usersRoutes: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types6.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { usersRoutes as default };
|
|
@@ -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/domains/mcp/routes/mcp.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 { AgentConfig, DelegateRelation } from "./Agent.js";
|
|
2
2
|
import { InternalRelation } from "../utils/project.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _inkeep_agents_core0 from "@inkeep/agents-core";
|
|
4
4
|
import { CredentialStoreRegistry, FullExecutionContext } from "@inkeep/agents-core";
|
|
5
5
|
import * as ai0 from "ai";
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@ declare function createDelegateToAgentTool({
|
|
|
44
44
|
message: string;
|
|
45
45
|
}, {
|
|
46
46
|
toolCallId: any;
|
|
47
|
-
result:
|
|
47
|
+
result: _inkeep_agents_core0.Message | _inkeep_agents_core0.Task;
|
|
48
48
|
}>;
|
|
49
49
|
/**
|
|
50
50
|
* Parameters for building a transfer relation config
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _inkeep_agents_core3 from "@inkeep/agents-core";
|
|
2
2
|
import { BreakdownComponentDef, ContextBreakdown, calculateBreakdownTotal, createEmptyBreakdown } from "@inkeep/agents-core";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/run/utils/token-estimator.d.ts
|
|
@@ -17,7 +17,7 @@ interface AssembleResult {
|
|
|
17
17
|
/** The assembled prompt string */
|
|
18
18
|
prompt: string;
|
|
19
19
|
/** Token breakdown for each component */
|
|
20
|
-
breakdown:
|
|
20
|
+
breakdown: _inkeep_agents_core3.ContextBreakdown;
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
export { AssembleResult, type BreakdownComponentDef, type ContextBreakdown, calculateBreakdownTotal, createEmptyBreakdown, estimateTokens };
|
|
@@ -107,7 +107,7 @@ declare function createInvocationIdempotentStep(params: {
|
|
|
107
107
|
projectId: string;
|
|
108
108
|
tenantId: string;
|
|
109
109
|
id: string;
|
|
110
|
-
status: "pending" | "
|
|
110
|
+
status: "pending" | "completed" | "failed" | "running" | "cancelled";
|
|
111
111
|
resolvedPayload?: Record<string, unknown> | null | undefined;
|
|
112
112
|
};
|
|
113
113
|
alreadyExists: boolean;
|
|
@@ -147,7 +147,7 @@ declare function markRunningStep(params: {
|
|
|
147
147
|
projectId: string;
|
|
148
148
|
tenantId: string;
|
|
149
149
|
id: string;
|
|
150
|
-
status: "pending" | "
|
|
150
|
+
status: "pending" | "completed" | "failed" | "running" | "cancelled";
|
|
151
151
|
resolvedPayload?: Record<string, unknown> | null | undefined;
|
|
152
152
|
}>;
|
|
153
153
|
/**
|
|
@@ -174,7 +174,7 @@ declare function addConversationIdStep(params: {
|
|
|
174
174
|
projectId: string;
|
|
175
175
|
tenantId: string;
|
|
176
176
|
id: string;
|
|
177
|
-
status: "pending" | "
|
|
177
|
+
status: "pending" | "completed" | "failed" | "running" | "cancelled";
|
|
178
178
|
resolvedPayload?: Record<string, unknown> | null | undefined;
|
|
179
179
|
} | undefined>;
|
|
180
180
|
/**
|
|
@@ -199,7 +199,7 @@ declare function markCompletedStep(params: {
|
|
|
199
199
|
projectId: string;
|
|
200
200
|
tenantId: string;
|
|
201
201
|
id: string;
|
|
202
|
-
status: "pending" | "
|
|
202
|
+
status: "pending" | "completed" | "failed" | "running" | "cancelled";
|
|
203
203
|
resolvedPayload?: Record<string, unknown> | null | undefined;
|
|
204
204
|
} | undefined>;
|
|
205
205
|
/**
|
|
@@ -224,7 +224,7 @@ declare function markFailedStep(params: {
|
|
|
224
224
|
projectId: string;
|
|
225
225
|
tenantId: string;
|
|
226
226
|
id: string;
|
|
227
|
-
status: "pending" | "
|
|
227
|
+
status: "pending" | "completed" | "failed" | "running" | "cancelled";
|
|
228
228
|
resolvedPayload?: Record<string, unknown> | null | undefined;
|
|
229
229
|
} | undefined>;
|
|
230
230
|
/**
|
package/dist/factory.d.ts
CHANGED
|
@@ -1170,25 +1170,25 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth9
|
|
|
1170
1170
|
ac: better_auth_plugins35.AccessControl;
|
|
1171
1171
|
roles: {
|
|
1172
1172
|
member: {
|
|
1173
|
-
authorize<K_1 extends "
|
|
1174
|
-
actions: better_auth_plugins35.Subset<"
|
|
1173
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
|
|
1174
|
+
actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
|
|
1175
1175
|
connector: "OR" | "AND";
|
|
1176
1176
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
|
|
1177
|
-
statements: better_auth_plugins35.Subset<"
|
|
1177
|
+
statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
|
|
1178
1178
|
};
|
|
1179
1179
|
admin: {
|
|
1180
|
-
authorize<K_1 extends "
|
|
1181
|
-
actions: better_auth_plugins35.Subset<"
|
|
1180
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
|
|
1181
|
+
actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
|
|
1182
1182
|
connector: "OR" | "AND";
|
|
1183
1183
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
|
|
1184
|
-
statements: better_auth_plugins35.Subset<"
|
|
1184
|
+
statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
|
|
1185
1185
|
};
|
|
1186
1186
|
owner: {
|
|
1187
|
-
authorize<K_1 extends "
|
|
1188
|
-
actions: better_auth_plugins35.Subset<"
|
|
1187
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key] | {
|
|
1188
|
+
actions: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>[key];
|
|
1189
1189
|
connector: "OR" | "AND";
|
|
1190
1190
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
|
|
1191
|
-
statements: better_auth_plugins35.Subset<"
|
|
1191
|
+
statements: better_auth_plugins35.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins35.Statements>;
|
|
1192
1192
|
};
|
|
1193
1193
|
};
|
|
1194
1194
|
creatorRole: "admin";
|
package/dist/index.d.ts
CHANGED
|
@@ -1170,25 +1170,25 @@ declare const auth: better_auth0.Auth<{
|
|
|
1170
1170
|
ac: better_auth_plugins0.AccessControl;
|
|
1171
1171
|
roles: {
|
|
1172
1172
|
member: {
|
|
1173
|
-
authorize<K_1 extends "
|
|
1174
|
-
actions: better_auth_plugins0.Subset<"
|
|
1173
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1174
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
|
|
1175
1175
|
connector: "OR" | "AND";
|
|
1176
1176
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1177
|
-
statements: better_auth_plugins0.Subset<"
|
|
1177
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
|
|
1178
1178
|
};
|
|
1179
1179
|
admin: {
|
|
1180
|
-
authorize<K_1 extends "
|
|
1181
|
-
actions: better_auth_plugins0.Subset<"
|
|
1180
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1181
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
|
|
1182
1182
|
connector: "OR" | "AND";
|
|
1183
1183
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1184
|
-
statements: better_auth_plugins0.Subset<"
|
|
1184
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
|
|
1185
1185
|
};
|
|
1186
1186
|
owner: {
|
|
1187
|
-
authorize<K_1 extends "
|
|
1188
|
-
actions: better_auth_plugins0.Subset<"
|
|
1187
|
+
authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1188
|
+
actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
|
|
1189
1189
|
connector: "OR" | "AND";
|
|
1190
1190
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1191
|
-
statements: better_auth_plugins0.Subset<"
|
|
1191
|
+
statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
|
|
1192
1192
|
};
|
|
1193
1193
|
};
|
|
1194
1194
|
creatorRole: "admin";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono5 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/evalsAuth.d.ts
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import * as hono0 from "hono";
|
|
|
7
7
|
* Middleware to authenticate API requests using Bearer token authentication
|
|
8
8
|
* First checks if token matches INKEEP_AGENTS_EVAL_API_BYPASS_SECRET,
|
|
9
9
|
*/
|
|
10
|
-
declare const evalApiKeyAuth: () =>
|
|
10
|
+
declare const evalApiKeyAuth: () => hono5.MiddlewareHandler<{
|
|
11
11
|
Variables: {
|
|
12
12
|
executionContext: BaseExecutionContext;
|
|
13
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./cors.js";
|
|
2
2
|
import { errorHandler } from "./errorHandler.js";
|
|
3
|
-
import {
|
|
3
|
+
import { manageBearerAuth, manageBearerOrSessionAuth } from "./manageAuth.js";
|
|
4
4
|
import { runApiKeyAuth, runApiKeyAuthExcept, runOptionalAuth } from "./runAuth.js";
|
|
5
5
|
import { sessionAuth } from "./sessionAuth.js";
|
|
6
6
|
import { requireTenantAccess } from "./tenantAccess.js";
|
|
7
7
|
import { workAppsAuth } from "./workAppsAuth.js";
|
|
8
|
-
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed,
|
|
8
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageBearerAuth, manageBearerOrSessionAuth, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsAuth, workAppsCorsConfig };
|
package/dist/middleware/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./cors.js";
|
|
2
2
|
import { errorHandler } from "./errorHandler.js";
|
|
3
3
|
import { sessionAuth } from "./sessionAuth.js";
|
|
4
|
-
import {
|
|
4
|
+
import { manageBearerAuth, manageBearerOrSessionAuth } from "./manageAuth.js";
|
|
5
5
|
import { runApiKeyAuth, runApiKeyAuthExcept, runOptionalAuth } from "./runAuth.js";
|
|
6
6
|
import { requireTenantAccess } from "./tenantAccess.js";
|
|
7
7
|
import { workAppsAuth } from "./workAppsAuth.js";
|
|
8
8
|
|
|
9
|
-
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed,
|
|
9
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageBearerAuth, manageBearerOrSessionAuth, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsAuth, workAppsCorsConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono6 from "hono";
|
|
3
3
|
import { createAuth } from "@inkeep/agents-core/auth";
|
|
4
4
|
|
|
5
5
|
//#region src/middleware/manageAuth.d.ts
|
|
@@ -9,10 +9,13 @@ import { createAuth } from "@inkeep/agents-core/auth";
|
|
|
9
9
|
* Authentication priority:
|
|
10
10
|
* 1. Bypass secret (INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET)
|
|
11
11
|
* 2. Better-auth session token (from device authorization flow)
|
|
12
|
-
* 3.
|
|
12
|
+
* 3. Slack user JWT token (for Slack work app delegation)
|
|
13
13
|
* 4. Internal service token
|
|
14
|
+
*
|
|
15
|
+
* NOTE: Database API keys are intentionally NOT accepted on manage endpoints.
|
|
16
|
+
* API keys are restricted to the run domain only (chat, agent execution).
|
|
14
17
|
*/
|
|
15
|
-
declare const
|
|
18
|
+
declare const manageBearerAuth: () => hono6.MiddlewareHandler<{
|
|
16
19
|
Variables: {
|
|
17
20
|
executionContext: BaseExecutionContext;
|
|
18
21
|
userId?: string;
|
|
@@ -23,8 +26,9 @@ declare const manageApiKeyAuth: () => hono4.MiddlewareHandler<{
|
|
|
23
26
|
}, string, {}, Response>;
|
|
24
27
|
/**
|
|
25
28
|
* Middleware that gates a route with manage-domain authentication.
|
|
26
|
-
* Uses Bearer token →
|
|
29
|
+
* Uses Bearer token → manage bearer auth (bypass secret, session, Slack JWT, internal service),
|
|
30
|
+
* otherwise falls back to session auth.
|
|
27
31
|
*/
|
|
28
|
-
declare const
|
|
32
|
+
declare const manageBearerOrSessionAuth: () => hono6.MiddlewareHandler<any, string, {}, Response>;
|
|
29
33
|
//#endregion
|
|
30
|
-
export {
|
|
34
|
+
export { manageBearerAuth, manageBearerOrSessionAuth };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { env } from "../env.js";
|
|
2
|
-
import runDbClient_default from "../data/db/runDbClient.js";
|
|
3
2
|
import { sessionAuth } from "./sessionAuth.js";
|
|
4
|
-
import { getLogger, isInternalServiceToken, isSlackUserToken,
|
|
3
|
+
import { getLogger, isInternalServiceToken, isSlackUserToken, verifyInternalServiceAuthHeader, verifySlackUserToken } from "@inkeep/agents-core";
|
|
5
4
|
import { registerAuthzMeta } from "@inkeep/agents-core/middleware";
|
|
6
5
|
import { createMiddleware } from "hono/factory";
|
|
7
6
|
import { HTTPException } from "hono/http-exception";
|
|
@@ -13,10 +12,13 @@ const logger = getLogger("env-key-auth");
|
|
|
13
12
|
* Authentication priority:
|
|
14
13
|
* 1. Bypass secret (INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET)
|
|
15
14
|
* 2. Better-auth session token (from device authorization flow)
|
|
16
|
-
* 3.
|
|
15
|
+
* 3. Slack user JWT token (for Slack work app delegation)
|
|
17
16
|
* 4. Internal service token
|
|
17
|
+
*
|
|
18
|
+
* NOTE: Database API keys are intentionally NOT accepted on manage endpoints.
|
|
19
|
+
* API keys are restricted to the run domain only (chat, agent execution).
|
|
18
20
|
*/
|
|
19
|
-
const
|
|
21
|
+
const manageBearerAuth = () => createMiddleware(async (c, next) => {
|
|
20
22
|
const authHeader = c.req.header("Authorization");
|
|
21
23
|
if (!authHeader || !authHeader.startsWith("Bearer ")) throw new HTTPException(401, { message: "Missing or invalid authorization header. Expected: Bearer <api_key>" });
|
|
22
24
|
const token = authHeader.substring(7);
|
|
@@ -49,16 +51,7 @@ const manageApiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
53
|
} catch (error) {
|
|
52
|
-
logger.debug({ error }, "Better-auth session validation failed, trying
|
|
53
|
-
}
|
|
54
|
-
const validatedKey = await validateAndGetApiKey(token, runDbClient_default);
|
|
55
|
-
if (validatedKey) {
|
|
56
|
-
logger.info({ keyId: validatedKey.id }, "API key authenticated successfully");
|
|
57
|
-
c.set("userId", `apikey:${validatedKey.id}`);
|
|
58
|
-
c.set("userEmail", `apikey-${validatedKey.id}@internal`);
|
|
59
|
-
c.set("tenantId", validatedKey.tenantId);
|
|
60
|
-
await next();
|
|
61
|
-
return;
|
|
54
|
+
logger.debug({ error }, "Better-auth session validation failed, trying other auth methods");
|
|
62
55
|
}
|
|
63
56
|
if (isSlackUserToken(token)) {
|
|
64
57
|
const result = await verifySlackUserToken(token);
|
|
@@ -94,24 +87,25 @@ const manageApiKeyAuth = () => createMiddleware(async (c, next) => {
|
|
|
94
87
|
});
|
|
95
88
|
/**
|
|
96
89
|
* Middleware that gates a route with manage-domain authentication.
|
|
97
|
-
* Uses Bearer token →
|
|
90
|
+
* Uses Bearer token → manage bearer auth (bypass secret, session, Slack JWT, internal service),
|
|
91
|
+
* otherwise falls back to session auth.
|
|
98
92
|
*/
|
|
99
|
-
const
|
|
93
|
+
const manageBearerOrSessionAuth = () => {
|
|
100
94
|
const mw = createMiddleware(async (c, next) => {
|
|
101
95
|
if (env.ENVIRONMENT === "test") {
|
|
102
96
|
await next();
|
|
103
97
|
return;
|
|
104
98
|
}
|
|
105
|
-
if (c.req.header("Authorization")?.startsWith("Bearer ")) return
|
|
99
|
+
if (c.req.header("Authorization")?.startsWith("Bearer ")) return manageBearerAuth()(c, next);
|
|
106
100
|
return sessionAuth()(c, next);
|
|
107
101
|
});
|
|
108
102
|
registerAuthzMeta(mw, {
|
|
109
103
|
resource: "organization",
|
|
110
104
|
permission: "member",
|
|
111
|
-
description: "Requires session cookie
|
|
105
|
+
description: "Requires session cookie authentication"
|
|
112
106
|
});
|
|
113
107
|
return mw;
|
|
114
108
|
};
|
|
115
109
|
|
|
116
110
|
//#endregion
|
|
117
|
-
export {
|
|
111
|
+
export { manageBearerAuth, manageBearerOrSessionAuth };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseExecutionContext, ResolvedRef } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono9 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:
|
|
8
|
+
declare const projectConfigMiddleware: hono9.MiddlewareHandler<{
|
|
9
9
|
Variables: {
|
|
10
10
|
executionContext: BaseExecutionContext;
|
|
11
11
|
resolvedRef: ResolvedRef;
|
|
@@ -15,7 +15,7 @@ declare const projectConfigMiddleware: hono1.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) =>
|
|
18
|
+
declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono9.MiddlewareHandler<{
|
|
19
19
|
Variables: {
|
|
20
20
|
executionContext: BaseExecutionContext;
|
|
21
21
|
resolvedRef: ResolvedRef;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono13 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/runAuth.d.ts
|
|
5
|
-
declare const runApiKeyAuth: () =>
|
|
5
|
+
declare const runApiKeyAuth: () => hono13.MiddlewareHandler<{
|
|
6
6
|
Variables: {
|
|
7
7
|
executionContext: BaseExecutionContext;
|
|
8
8
|
};
|
|
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono7.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) =>
|
|
14
|
+
declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono13.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: () =>
|
|
23
|
+
declare const runOptionalAuth: () => hono13.MiddlewareHandler<{
|
|
24
24
|
Variables: {
|
|
25
25
|
executionContext?: BaseExecutionContext;
|
|
26
26
|
};
|
|
@@ -40,6 +40,11 @@ function extractRequestData(c) {
|
|
|
40
40
|
*/
|
|
41
41
|
function buildExecutionContext(authResult, reqData) {
|
|
42
42
|
const agentId = authResult.metadata?.teamDelegation && reqData.agentId ? reqData.agentId : authResult.agentId;
|
|
43
|
+
if (!authResult.metadata?.teamDelegation && reqData.agentId && reqData.agentId !== authResult.agentId && authResult.apiKeyId && !authResult.apiKeyId.startsWith("temp-") && authResult.apiKeyId !== "bypass" && authResult.apiKeyId !== "slack-user-token" && authResult.apiKeyId !== "team-agent-token" && authResult.apiKeyId !== "test-key") logger.warn({
|
|
44
|
+
requestedAgentId: reqData.agentId,
|
|
45
|
+
apiKeyAgentId: authResult.agentId,
|
|
46
|
+
apiKeyId: authResult.apiKeyId
|
|
47
|
+
}, "API key agent scope mismatch: ignoring x-inkeep-agent-id header, using key-bound agent");
|
|
43
48
|
return createBaseExecutionContext({
|
|
44
49
|
apiKey: authResult.apiKey,
|
|
45
50
|
tenantId: authResult.tenantId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono16 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/sessionAuth.d.ts
|
|
4
4
|
|
|
@@ -7,11 +7,11 @@ import * as hono10 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: () =>
|
|
10
|
+
declare const sessionAuth: () => hono16.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: () =>
|
|
15
|
+
declare const sessionContext: () => hono16.MiddlewareHandler<any, string, {}, Response>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { sessionAuth, sessionContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono18 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/tenantAccess.d.ts
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ import * as hono13 from "hono";
|
|
|
12
12
|
* - API key user: Access only to the tenant associated with the API key
|
|
13
13
|
* - Session user: Access based on organization membership
|
|
14
14
|
*/
|
|
15
|
-
declare const requireTenantAccess: () =>
|
|
15
|
+
declare const requireTenantAccess: () => hono18.MiddlewareHandler<{
|
|
16
16
|
Variables: {
|
|
17
17
|
userId: string;
|
|
18
18
|
tenantId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as hono11 from "hono";
|
|
2
2
|
|
|
3
3
|
//#region src/middleware/tracing.d.ts
|
|
4
|
-
declare const otelBaggageMiddleware: () =>
|
|
5
|
-
declare const executionBaggageMiddleware: () =>
|
|
4
|
+
declare const otelBaggageMiddleware: () => hono11.MiddlewareHandler<any, string, {}, Response>;
|
|
5
|
+
declare const executionBaggageMiddleware: () => hono11.MiddlewareHandler<any, string, {}, Response>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { executionBaggageMiddleware, otelBaggageMiddleware };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { env } from "../env.js";
|
|
2
2
|
import { sessionAuth } from "./sessionAuth.js";
|
|
3
|
-
import {
|
|
3
|
+
import { manageBearerAuth } from "./manageAuth.js";
|
|
4
4
|
import { createApiError } from "@inkeep/agents-core";
|
|
5
5
|
|
|
6
6
|
//#region src/middleware/workAppsAuth.ts
|
|
7
7
|
/**
|
|
8
8
|
* Work Apps Authentication Middleware
|
|
9
9
|
*
|
|
10
|
-
* Shared session/
|
|
10
|
+
* Shared session/bearer token auth for protected work app routes (Slack, GitHub, etc.).
|
|
11
11
|
* Most work app routes are unauthenticated (events, commands, webhooks),
|
|
12
12
|
* but workspace management and user endpoints require session auth.
|
|
13
13
|
*
|
|
14
14
|
* Auth flow:
|
|
15
15
|
* 1. Test environment → bypass
|
|
16
16
|
* 2. Dev localhost → bypass with dev-user context
|
|
17
|
-
* 3. Bearer token →
|
|
17
|
+
* 3. Bearer token → manageBearerAuth (bypass secret, session, Slack JWT, internal service)
|
|
18
18
|
* 4. Session cookie → sessionAuth
|
|
19
19
|
*/
|
|
20
20
|
const isTestEnvironment = () => env.ENVIRONMENT === "test";
|
|
@@ -45,7 +45,7 @@ const workAppsAuth = async (c, next) => {
|
|
|
45
45
|
}
|
|
46
46
|
} catch {}
|
|
47
47
|
}
|
|
48
|
-
if (c.req.header("Authorization")?.startsWith("Bearer ")) return
|
|
48
|
+
if (c.req.header("Authorization")?.startsWith("Bearer ")) return manageBearerAuth()(c, next);
|
|
49
49
|
await sessionAuth()(c, async () => {
|
|
50
50
|
const session = c.get("session");
|
|
51
51
|
if (!session?.activeOrganizationId) throw createApiError({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { manageBearerOrSessionAuth } from "../middleware/manageAuth.js";
|
|
2
2
|
import "../middleware/index.js";
|
|
3
3
|
import { OpenAPIHono, z } from "@hono/zod-openapi";
|
|
4
4
|
import { createProtectedRoute } from "@inkeep/agents-core/middleware";
|
|
@@ -16,7 +16,7 @@ capabilitiesHandler.openapi(createProtectedRoute({
|
|
|
16
16
|
operationId: "capabilities",
|
|
17
17
|
summary: "Get server capabilities",
|
|
18
18
|
description: "Get information about optional server-side capabilities and configuration.",
|
|
19
|
-
permission:
|
|
19
|
+
permission: manageBearerOrSessionAuth(),
|
|
20
20
|
responses: { 200: {
|
|
21
21
|
description: "Server capabilities",
|
|
22
22
|
content: { "application/json": { schema: CapabilitiesResponseSchema } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-api",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260303010841",
|
|
4
4
|
"description": "Unified Inkeep Agents API - combines management, runtime, and evaluation capabilities",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"openid-client": "^6.8.1",
|
|
71
71
|
"pg": "^8.16.3",
|
|
72
72
|
"workflow": "^4.1.0-beta.54",
|
|
73
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
74
|
-
"@inkeep/agents-mcp": "^0.0.0-dev-
|
|
75
|
-
"@inkeep/agents-work-apps": "^0.0.0-dev-
|
|
73
|
+
"@inkeep/agents-core": "^0.0.0-dev-20260303010841",
|
|
74
|
+
"@inkeep/agents-mcp": "^0.0.0-dev-20260303010841",
|
|
75
|
+
"@inkeep/agents-work-apps": "^0.0.0-dev-20260303010841"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@hono/zod-openapi": "^1.1.5",
|