@inkeep/agents-api 0.0.0-dev-20260204170416 → 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.
- package/dist/.well-known/workflow/v1/step.cjs +569 -232
- package/dist/createApp.js +46 -1
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/services/EvaluationService.d.ts +0 -5
- package/dist/domains/evals/services/EvaluationService.js +2 -51
- 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/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/userOrganizations.d.ts +2 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/work-apps/index.d.ts +13 -0
- package/dist/domains/work-apps/index.js +23 -0
- package/dist/domains/work-apps/types.d.ts +7 -0
- package/dist/domains/work-apps/types.js +1 -0
- package/dist/factory.d.ts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/middleware/cors.d.ts +6 -1
- package/dist/middleware/cors.js +27 -1
- 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 +2 -2
- package/dist/middleware/manageAuth.js +16 -1
- package/dist/middleware/projectAccess.d.ts +2 -2
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/runAuth.js +48 -1
- 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/openapi.d.ts +8 -0
- package/dist/openapi.js +9 -1
- package/package.json +10 -5
package/dist/createApp.js
CHANGED
|
@@ -7,7 +7,8 @@ import { manageRoutes } from "./domains/manage/index.js";
|
|
|
7
7
|
import mcp_default from "./domains/mcp/routes/mcp.js";
|
|
8
8
|
import { flushBatchProcessor } from "./instrumentation.js";
|
|
9
9
|
import { runRoutes } from "./domains/run/index.js";
|
|
10
|
-
import {
|
|
10
|
+
import { workAppsRoutes } from "./domains/work-apps/index.js";
|
|
11
|
+
import { authCorsConfig, defaultCorsConfig, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./middleware/cors.js";
|
|
11
12
|
import { errorHandler } from "./middleware/errorHandler.js";
|
|
12
13
|
import { manageApiKeyAuth } from "./middleware/manageAuth.js";
|
|
13
14
|
import { manageRefMiddleware, oauthRefMiddleware, runRefMiddleware, writeProtectionMiddleware } from "./middleware/ref.js";
|
|
@@ -52,9 +53,11 @@ function createAgentsHono(config) {
|
|
|
52
53
|
app.use("/run/*", cors(runCorsConfig));
|
|
53
54
|
app.use("/manage/tenants/*/playground/token", cors(playgroundCorsConfig));
|
|
54
55
|
app.use("/manage/tenants/*/signoz/*", cors(signozCorsConfig));
|
|
56
|
+
app.use("/work-apps/*", cors(workAppsCorsConfig));
|
|
55
57
|
app.use("*", async (c, next) => {
|
|
56
58
|
if (auth && c.req.path.startsWith("/api/auth/")) return next();
|
|
57
59
|
if (c.req.path.startsWith("/run/")) return next();
|
|
60
|
+
if (c.req.path.startsWith("/work-apps/")) return next();
|
|
58
61
|
if (c.req.path.includes("/playground/token")) return next();
|
|
59
62
|
if (c.req.path.includes("/signoz/")) return next();
|
|
60
63
|
if (c.req.path.includes("/work-apps/github/")) return next();
|
|
@@ -185,6 +188,48 @@ function createAgentsHono(config) {
|
|
|
185
188
|
});
|
|
186
189
|
app.route("/evals", evalRoutes);
|
|
187
190
|
app.route("/work-apps/github", githubRoutes);
|
|
191
|
+
app.use("/work-apps/*", async (c, next) => {
|
|
192
|
+
c.set("auth", auth);
|
|
193
|
+
await next();
|
|
194
|
+
});
|
|
195
|
+
app.use("/work-apps/slack/workspaces/*", async (c, next) => {
|
|
196
|
+
if (c.req.method === "GET" || isTestEnvironment()) {
|
|
197
|
+
await next();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const origin = c.req.header("Origin");
|
|
201
|
+
if (origin && env.ENVIRONMENT !== "production") try {
|
|
202
|
+
const originUrl = new URL(origin);
|
|
203
|
+
if (originUrl.hostname === "localhost" || originUrl.hostname === "127.0.0.1") {
|
|
204
|
+
c.set("userId", "dev-user");
|
|
205
|
+
c.set("tenantId", "default");
|
|
206
|
+
c.set("tenantRole", "owner");
|
|
207
|
+
await next();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
} catch {}
|
|
211
|
+
if (c.req.header("Authorization")?.startsWith("Bearer ")) return manageApiKeyAuth()(c, next);
|
|
212
|
+
return sessionAuth()(c, next);
|
|
213
|
+
});
|
|
214
|
+
app.use("/work-apps/slack/users/*", async (c, next) => {
|
|
215
|
+
if (c.req.method === "GET" || isTestEnvironment()) {
|
|
216
|
+
await next();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const origin = c.req.header("Origin");
|
|
220
|
+
if (origin && env.ENVIRONMENT !== "production") try {
|
|
221
|
+
const originUrl = new URL(origin);
|
|
222
|
+
if (originUrl.hostname === "localhost" || originUrl.hostname === "127.0.0.1") {
|
|
223
|
+
c.set("userId", "dev-user");
|
|
224
|
+
c.set("tenantId", "default");
|
|
225
|
+
await next();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
} catch {}
|
|
229
|
+
if (c.req.header("Authorization")?.startsWith("Bearer ")) return manageApiKeyAuth()(c, next);
|
|
230
|
+
return sessionAuth()(c, next);
|
|
231
|
+
});
|
|
232
|
+
app.route("/work-apps", workAppsRoutes);
|
|
188
233
|
app.route("/mcp", mcp_default);
|
|
189
234
|
setupOpenAPIRoutes(app);
|
|
190
235
|
app.use("/run/*", async (_c, next) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono9 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/datasetTriggers.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono9.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 hono10 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono10.Env, {}, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -43,11 +43,6 @@ declare class EvaluationService {
|
|
|
43
43
|
* Extract messages from dataset item input
|
|
44
44
|
*/
|
|
45
45
|
private extractMessagesFromDatasetItem;
|
|
46
|
-
/**
|
|
47
|
-
* Parse SSE (Server-Sent Events) response from chat API
|
|
48
|
-
* Handles text deltas, error operations, and other data operations
|
|
49
|
-
*/
|
|
50
|
-
private parseSSEResponse;
|
|
51
46
|
/**
|
|
52
47
|
* Run an evaluation job based on an evaluation job config
|
|
53
48
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
@@ -3,7 +3,7 @@ import { env } from "../../../env.js";
|
|
|
3
3
|
import manageDbClient_default from "../../../data/db/manageDbClient.js";
|
|
4
4
|
import manageDbPool_default from "../../../data/db/manageDbPool.js";
|
|
5
5
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
6
|
-
import { ModelFactory, createEvaluationResult, createEvaluationRun, filterConversationsForJob, generateId, getConversationHistory, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluatorById, getFullAgent, getProjectScopedRef, resolveRef, updateEvaluationResult, withRef } from "@inkeep/agents-core";
|
|
6
|
+
import { ModelFactory, createEvaluationResult, createEvaluationRun, filterConversationsForJob, generateId, getConversationHistory, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluatorById, getFullAgent, getProjectScopedRef, parseSSEResponse, resolveRef, updateEvaluationResult, withRef } from "@inkeep/agents-core";
|
|
7
7
|
import { generateObject, generateText } from "ai";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
@@ -145,8 +145,7 @@ var EvaluationService = class {
|
|
|
145
145
|
error: `Chat API error: ${response.status} ${response.statusText}`
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
const
|
|
149
|
-
const parseResult = this.parseSSEResponse(responseText);
|
|
148
|
+
const parseResult = parseSSEResponse(await response.text());
|
|
150
149
|
if (parseResult.error) {
|
|
151
150
|
logger.error({
|
|
152
151
|
datasetItemId: datasetItem.id,
|
|
@@ -354,54 +353,6 @@ Generate the next user message:`;
|
|
|
354
353
|
return null;
|
|
355
354
|
}
|
|
356
355
|
/**
|
|
357
|
-
* Parse SSE (Server-Sent Events) response from chat API
|
|
358
|
-
* Handles text deltas, error operations, and other data operations
|
|
359
|
-
*/
|
|
360
|
-
parseSSEResponse(sseText) {
|
|
361
|
-
let textContent = "";
|
|
362
|
-
let hasError = false;
|
|
363
|
-
let errorMessage = "";
|
|
364
|
-
const lines = sseText.split("\n").filter((line) => line.startsWith("data: "));
|
|
365
|
-
for (const line of lines) try {
|
|
366
|
-
const data = JSON.parse(line.slice(6));
|
|
367
|
-
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
368
|
-
const delta = data.choices[0].delta;
|
|
369
|
-
if (delta.content) textContent += delta.content;
|
|
370
|
-
if (delta.content && typeof delta.content === "string") try {
|
|
371
|
-
const parsedContent = JSON.parse(delta.content);
|
|
372
|
-
if (parsedContent.type === "data-operation" && parsedContent.data?.type === "error") {
|
|
373
|
-
hasError = true;
|
|
374
|
-
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
375
|
-
logger.warn({
|
|
376
|
-
errorMessage,
|
|
377
|
-
errorData: parsedContent.data
|
|
378
|
-
}, "Received error operation from chat API");
|
|
379
|
-
}
|
|
380
|
-
} catch {}
|
|
381
|
-
} else if (data.type === "text-delta" && data.delta) textContent += data.delta;
|
|
382
|
-
else if (data.type === "data-operation" && data.data?.type === "error") {
|
|
383
|
-
hasError = true;
|
|
384
|
-
errorMessage = data.data.message || "Unknown error occurred";
|
|
385
|
-
logger.warn({
|
|
386
|
-
errorMessage,
|
|
387
|
-
errorData: data.data
|
|
388
|
-
}, "Received error operation from chat API");
|
|
389
|
-
} else if (data.type === "error") {
|
|
390
|
-
hasError = true;
|
|
391
|
-
errorMessage = data.message || "Unknown error occurred";
|
|
392
|
-
logger.warn({
|
|
393
|
-
errorMessage,
|
|
394
|
-
errorData: data
|
|
395
|
-
}, "Received error event from chat API");
|
|
396
|
-
} else if (data.content) textContent += typeof data.content === "string" ? data.content : JSON.stringify(data.content);
|
|
397
|
-
} catch {}
|
|
398
|
-
if (hasError) return {
|
|
399
|
-
text: textContent.trim(),
|
|
400
|
-
error: errorMessage
|
|
401
|
-
};
|
|
402
|
-
return { text: textContent.trim() };
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
356
|
* Run an evaluation job based on an evaluation job config
|
|
406
357
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
407
358
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types10 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_types10.BlankEnv, hono_types10.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 hono15 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/availableAgents.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono15.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 hono5 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono5.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 hono6 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono6.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_types4 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_types4.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { invitationsRoutes as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types6 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/mcp.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
|
|
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_types3 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/signoz.d.ts
|
|
6
6
|
declare const app: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types3.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
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_types5 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/userOrganizations.d.ts
|
|
6
6
|
declare const userOrganizationsRoutes: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types5.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { userOrganizationsRoutes 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 };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WorkAppsVariables } from "./types.js";
|
|
2
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
3
|
+
|
|
4
|
+
//#region src/domains/work-apps/index.d.ts
|
|
5
|
+
|
|
6
|
+
declare function createWorkAppsRoutes(): OpenAPIHono<{
|
|
7
|
+
Variables: WorkAppsVariables;
|
|
8
|
+
}, {}, "/">;
|
|
9
|
+
declare const workAppsRoutes: OpenAPIHono<{
|
|
10
|
+
Variables: WorkAppsVariables;
|
|
11
|
+
}, {}, "/">;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { createWorkAppsRoutes, workAppsRoutes };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { slackRoutes } from "@inkeep/agents-work-apps/slack";
|
|
3
|
+
|
|
4
|
+
//#region src/domains/work-apps/index.ts
|
|
5
|
+
/**
|
|
6
|
+
* Work Apps Domain
|
|
7
|
+
*
|
|
8
|
+
* Modular integration layer for third-party work applications (Slack, GitHub, etc.)
|
|
9
|
+
* Work app implementations are in @inkeep/agents-work-apps package.
|
|
10
|
+
*
|
|
11
|
+
* Each work app is mounted as a sub-route:
|
|
12
|
+
* - /work-apps/slack/* - Slack workspace installation, user linking, commands
|
|
13
|
+
* - /work-apps/github/* - GitHub integration (mounted separately in createApp)
|
|
14
|
+
*/
|
|
15
|
+
function createWorkAppsRoutes() {
|
|
16
|
+
const app = new OpenAPIHono();
|
|
17
|
+
app.route("/slack", slackRoutes);
|
|
18
|
+
return app;
|
|
19
|
+
}
|
|
20
|
+
const workAppsRoutes = createWorkAppsRoutes();
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { createWorkAppsRoutes, workAppsRoutes };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/factory.d.ts
CHANGED
|
@@ -794,25 +794,25 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
|
|
|
794
794
|
ac: better_auth_plugins0.AccessControl;
|
|
795
795
|
roles: {
|
|
796
796
|
member: {
|
|
797
|
-
authorize<K_1 extends "
|
|
798
|
-
actions: better_auth_plugins0.Subset<"
|
|
797
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
798
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
799
799
|
connector: "OR" | "AND";
|
|
800
800
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
801
|
-
statements: better_auth_plugins0.Subset<"
|
|
801
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
802
802
|
};
|
|
803
803
|
admin: {
|
|
804
|
-
authorize<K_1 extends "
|
|
805
|
-
actions: better_auth_plugins0.Subset<"
|
|
804
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
805
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
806
806
|
connector: "OR" | "AND";
|
|
807
807
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
808
|
-
statements: better_auth_plugins0.Subset<"
|
|
808
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
809
809
|
};
|
|
810
810
|
owner: {
|
|
811
|
-
authorize<K_1 extends "
|
|
812
|
-
actions: better_auth_plugins0.Subset<"
|
|
811
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
812
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
813
813
|
connector: "OR" | "AND";
|
|
814
814
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
815
|
-
statements: better_auth_plugins0.Subset<"
|
|
815
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
816
816
|
};
|
|
817
817
|
};
|
|
818
818
|
creatorRole: "admin";
|
|
@@ -1104,25 +1104,25 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
|
|
|
1104
1104
|
ac: better_auth_plugins0.AccessControl;
|
|
1105
1105
|
roles: {
|
|
1106
1106
|
member: {
|
|
1107
|
-
authorize<K_1 extends "
|
|
1108
|
-
actions: better_auth_plugins0.Subset<"
|
|
1107
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
1108
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
1109
1109
|
connector: "OR" | "AND";
|
|
1110
1110
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1111
|
-
statements: better_auth_plugins0.Subset<"
|
|
1111
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
1112
1112
|
};
|
|
1113
1113
|
admin: {
|
|
1114
|
-
authorize<K_1 extends "
|
|
1115
|
-
actions: better_auth_plugins0.Subset<"
|
|
1114
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
1115
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
1116
1116
|
connector: "OR" | "AND";
|
|
1117
1117
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1118
|
-
statements: better_auth_plugins0.Subset<"
|
|
1118
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
1119
1119
|
};
|
|
1120
1120
|
owner: {
|
|
1121
|
-
authorize<K_1 extends "
|
|
1122
|
-
actions: better_auth_plugins0.Subset<"
|
|
1121
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
|
|
1122
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
|
|
1123
1123
|
connector: "OR" | "AND";
|
|
1124
1124
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1125
|
-
statements: better_auth_plugins0.Subset<"
|
|
1125
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins0.Statements>;
|
|
1126
1126
|
};
|
|
1127
1127
|
};
|
|
1128
1128
|
creatorRole: "admin";
|
package/dist/index.d.ts
CHANGED
|
@@ -795,25 +795,25 @@ declare const auth: better_auth78.Auth<{
|
|
|
795
795
|
ac: better_auth_plugins69.AccessControl;
|
|
796
796
|
roles: {
|
|
797
797
|
member: {
|
|
798
|
-
authorize<K_1 extends "
|
|
799
|
-
actions: better_auth_plugins69.Subset<"
|
|
798
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
799
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
800
800
|
connector: "OR" | "AND";
|
|
801
801
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
802
|
-
statements: better_auth_plugins69.Subset<"
|
|
802
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
803
803
|
};
|
|
804
804
|
admin: {
|
|
805
|
-
authorize<K_1 extends "
|
|
806
|
-
actions: better_auth_plugins69.Subset<"
|
|
805
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
806
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
807
807
|
connector: "OR" | "AND";
|
|
808
808
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
809
|
-
statements: better_auth_plugins69.Subset<"
|
|
809
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
810
810
|
};
|
|
811
811
|
owner: {
|
|
812
|
-
authorize<K_1 extends "
|
|
813
|
-
actions: better_auth_plugins69.Subset<"
|
|
812
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
813
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
814
814
|
connector: "OR" | "AND";
|
|
815
815
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
816
|
-
statements: better_auth_plugins69.Subset<"
|
|
816
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
817
817
|
};
|
|
818
818
|
};
|
|
819
819
|
creatorRole: "admin";
|
|
@@ -1105,25 +1105,25 @@ declare const auth: better_auth78.Auth<{
|
|
|
1105
1105
|
ac: better_auth_plugins69.AccessControl;
|
|
1106
1106
|
roles: {
|
|
1107
1107
|
member: {
|
|
1108
|
-
authorize<K_1 extends "
|
|
1109
|
-
actions: better_auth_plugins69.Subset<"
|
|
1108
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
1109
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
1110
1110
|
connector: "OR" | "AND";
|
|
1111
1111
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1112
|
-
statements: better_auth_plugins69.Subset<"
|
|
1112
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
1113
1113
|
};
|
|
1114
1114
|
admin: {
|
|
1115
|
-
authorize<K_1 extends "
|
|
1116
|
-
actions: better_auth_plugins69.Subset<"
|
|
1115
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
1116
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
1117
1117
|
connector: "OR" | "AND";
|
|
1118
1118
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1119
|
-
statements: better_auth_plugins69.Subset<"
|
|
1119
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
1120
1120
|
};
|
|
1121
1121
|
owner: {
|
|
1122
|
-
authorize<K_1 extends "
|
|
1123
|
-
actions: better_auth_plugins69.Subset<"
|
|
1122
|
+
authorize<K_1 extends "project" | "organization" | "team" | "member" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key] | {
|
|
1123
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>[key];
|
|
1124
1124
|
connector: "OR" | "AND";
|
|
1125
1125
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1126
|
-
statements: better_auth_plugins69.Subset<"
|
|
1126
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "team" | "member" | "ac" | "invitation", better_auth_plugins69.Statements>;
|
|
1127
1127
|
};
|
|
1128
1128
|
};
|
|
1129
1129
|
creatorRole: "admin";
|
|
@@ -32,5 +32,10 @@ declare const runCorsConfig: CorsOptions;
|
|
|
32
32
|
* CORS configuration for SigNoz proxy routes
|
|
33
33
|
*/
|
|
34
34
|
declare const signozCorsConfig: CorsOptions;
|
|
35
|
+
/**
|
|
36
|
+
* CORS configuration for work-apps routes (Slack, etc.)
|
|
37
|
+
* Needs to allow cross-origin requests with credentials for dashboard integration
|
|
38
|
+
*/
|
|
39
|
+
declare const workAppsCorsConfig: CorsOptions;
|
|
35
40
|
//#endregion
|
|
36
|
-
export { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig };
|
|
41
|
+
export { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig };
|
package/dist/middleware/cors.js
CHANGED
|
@@ -126,6 +126,32 @@ const signozCorsConfig = {
|
|
|
126
126
|
maxAge: 600,
|
|
127
127
|
credentials: true
|
|
128
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* CORS configuration for work-apps routes (Slack, etc.)
|
|
131
|
+
* Needs to allow cross-origin requests with credentials for dashboard integration
|
|
132
|
+
*/
|
|
133
|
+
const workAppsCorsConfig = {
|
|
134
|
+
origin: originHandler,
|
|
135
|
+
allowHeaders: [
|
|
136
|
+
"content-type",
|
|
137
|
+
"Content-Type",
|
|
138
|
+
"authorization",
|
|
139
|
+
"Authorization",
|
|
140
|
+
"User-Agent",
|
|
141
|
+
"Cookie"
|
|
142
|
+
],
|
|
143
|
+
allowMethods: [
|
|
144
|
+
"GET",
|
|
145
|
+
"POST",
|
|
146
|
+
"PUT",
|
|
147
|
+
"DELETE",
|
|
148
|
+
"OPTIONS",
|
|
149
|
+
"PATCH"
|
|
150
|
+
],
|
|
151
|
+
exposeHeaders: ["Content-Length"],
|
|
152
|
+
maxAge: 600,
|
|
153
|
+
credentials: true
|
|
154
|
+
};
|
|
129
155
|
|
|
130
156
|
//#endregion
|
|
131
|
-
export { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig };
|
|
157
|
+
export { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono18 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/evalsAuth.d.ts
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import * as hono1 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: () => hono18.MiddlewareHandler<{
|
|
11
11
|
Variables: {
|
|
12
12
|
executionContext: BaseExecutionContext;
|
|
13
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig } from "./cors.js";
|
|
1
|
+
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./cors.js";
|
|
2
2
|
import { errorHandler } from "./errorHandler.js";
|
|
3
3
|
import { manageApiKeyAuth } from "./manageAuth.js";
|
|
4
4
|
import { oauthRefMiddleware } from "./ref.js";
|
|
5
5
|
import { runApiKeyAuth, runApiKeyAuthExcept, runOptionalAuth } from "./runAuth.js";
|
|
6
6
|
import { sessionAuth } from "./sessionAuth.js";
|
|
7
7
|
import { requireTenantAccess } from "./tenantAccess.js";
|
|
8
|
-
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig };
|
|
8
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsCorsConfig };
|
package/dist/middleware/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { sessionAuth } from "./sessionAuth.js";
|
|
2
|
-
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig } from "./cors.js";
|
|
2
|
+
import { authCorsConfig, defaultCorsConfig, getBaseDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig } from "./cors.js";
|
|
3
3
|
import { errorHandler } from "./errorHandler.js";
|
|
4
4
|
import { manageApiKeyAuth } from "./manageAuth.js";
|
|
5
5
|
import { oauthRefMiddleware } from "./ref.js";
|
|
6
6
|
import { runApiKeyAuth, runApiKeyAuthExcept, runOptionalAuth } from "./runAuth.js";
|
|
7
7
|
import { requireTenantAccess } from "./tenantAccess.js";
|
|
8
8
|
|
|
9
|
-
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig };
|
|
9
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsCorsConfig };
|