@inkeep/agents-api 0.0.0-dev-20260212083055 → 0.0.0-dev-20260212085218
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.debug.json +19 -19
- package/dist/.well-known/workflow/v1/step.cjs +390 -220
- package/dist/createApp.d.ts +2 -2
- package/dist/createApp.js +12 -1
- package/dist/domains/evals/routes/datasetTriggers.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/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/env.d.ts +2 -2
- package/dist/factory.d.ts +21 -21
- package/dist/index.d.ts +20 -20
- 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 +3 -2
- package/dist/middleware/index.js +3 -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/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/runAuth.js +71 -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/middleware/workAppsAuth.d.ts +7 -0
- package/dist/middleware/workAppsAuth.js +52 -0
- package/dist/openapi.d.ts +5 -0
- package/dist/openapi.js +6 -1
- package/package.json +5 -5
package/dist/createApp.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AppConfig } from "./types/app.js";
|
|
2
2
|
import "./types/index.js";
|
|
3
3
|
import { Hono } from "hono";
|
|
4
|
-
import * as
|
|
4
|
+
import * as hono_types4 from "hono/types";
|
|
5
5
|
|
|
6
6
|
//#region src/createApp.d.ts
|
|
7
7
|
declare const isWebhookRoute: (path: string) => boolean;
|
|
8
|
-
declare function createAgentsHono(config: AppConfig): Hono<
|
|
8
|
+
declare function createAgentsHono(config: AppConfig): Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { createAgentsHono, isWebhookRoute };
|
package/dist/createApp.js
CHANGED
|
@@ -7,12 +7,14 @@ import { flushBatchProcessor } from "./instrumentation.js";
|
|
|
7
7
|
import { manageRoutes } from "./domains/manage/index.js";
|
|
8
8
|
import mcp_default from "./domains/mcp/routes/mcp.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";
|
|
14
15
|
import { runApiKeyAuth, runApiKeyAuthExcept } from "./middleware/runAuth.js";
|
|
15
16
|
import { requireTenantAccess } from "./middleware/tenantAccess.js";
|
|
17
|
+
import { workAppsAuth } from "./middleware/workAppsAuth.js";
|
|
16
18
|
import "./middleware/index.js";
|
|
17
19
|
import { branchScopedDbMiddleware } from "./middleware/branchScopedDb.js";
|
|
18
20
|
import { evalApiKeyAuth } from "./middleware/evalsAuth.js";
|
|
@@ -52,9 +54,11 @@ function createAgentsHono(config) {
|
|
|
52
54
|
app.use("/run/*", cors(runCorsConfig));
|
|
53
55
|
app.use("/manage/tenants/*/playground/token", cors(playgroundCorsConfig));
|
|
54
56
|
app.use("/manage/tenants/*/signoz/*", cors(signozCorsConfig));
|
|
57
|
+
app.use("/work-apps/*", cors(workAppsCorsConfig));
|
|
55
58
|
app.use("*", async (c, next) => {
|
|
56
59
|
if (auth && c.req.path.startsWith("/api/auth/")) return next();
|
|
57
60
|
if (c.req.path.startsWith("/run/")) return next();
|
|
61
|
+
if (c.req.path.startsWith("/work-apps/")) return next();
|
|
58
62
|
if (c.req.path.includes("/playground/token")) return next();
|
|
59
63
|
if (c.req.path.includes("/signoz/")) return next();
|
|
60
64
|
if (c.req.path.includes("/work-apps/github/")) return next();
|
|
@@ -69,6 +73,10 @@ function createAgentsHono(config) {
|
|
|
69
73
|
c.set("auth", auth);
|
|
70
74
|
await next();
|
|
71
75
|
});
|
|
76
|
+
app.use("/work-apps/*", async (c, next) => {
|
|
77
|
+
c.set("auth", auth);
|
|
78
|
+
await next();
|
|
79
|
+
});
|
|
72
80
|
app.use("/run/*", async (c, next) => {
|
|
73
81
|
if (sandboxConfig) c.set("sandboxConfig", sandboxConfig);
|
|
74
82
|
await next();
|
|
@@ -185,6 +193,9 @@ function createAgentsHono(config) {
|
|
|
185
193
|
});
|
|
186
194
|
app.route("/evals", evalRoutes);
|
|
187
195
|
app.route("/work-apps/github", githubRoutes);
|
|
196
|
+
app.use("/work-apps/slack/workspaces/*", workAppsAuth);
|
|
197
|
+
app.use("/work-apps/slack/users/*", workAppsAuth);
|
|
198
|
+
app.route("/work-apps", workAppsRoutes);
|
|
188
199
|
app.route("/mcp", mcp_default);
|
|
189
200
|
setupOpenAPIRoutes(app);
|
|
190
201
|
app.use("/run/*", async (_c, next) => {
|
|
@@ -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/evals/routes/datasetTriggers.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono15.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
|
|
|
@@ -105,8 +105,7 @@ var EvaluationService = class {
|
|
|
105
105
|
error: `Chat API error: ${response.status} ${response.statusText}`
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
const parseResult = this.parseSSEResponse(responseText);
|
|
108
|
+
const parseResult = parseSSEResponse(await response.text());
|
|
110
109
|
if (parseResult.error) {
|
|
111
110
|
logger.error({
|
|
112
111
|
datasetItemId: datasetItem.id,
|
|
@@ -314,54 +313,6 @@ Generate the next user message:`;
|
|
|
314
313
|
return null;
|
|
315
314
|
}
|
|
316
315
|
/**
|
|
317
|
-
* Parse SSE (Server-Sent Events) response from chat API
|
|
318
|
-
* Handles text deltas, error operations, and other data operations
|
|
319
|
-
*/
|
|
320
|
-
parseSSEResponse(sseText) {
|
|
321
|
-
let textContent = "";
|
|
322
|
-
let hasError = false;
|
|
323
|
-
let errorMessage = "";
|
|
324
|
-
const lines = sseText.split("\n").filter((line) => line.startsWith("data: "));
|
|
325
|
-
for (const line of lines) try {
|
|
326
|
-
const data = JSON.parse(line.slice(6));
|
|
327
|
-
if (data.object === "chat.completion.chunk" && data.choices?.[0]?.delta) {
|
|
328
|
-
const delta = data.choices[0].delta;
|
|
329
|
-
if (delta.content) textContent += delta.content;
|
|
330
|
-
if (delta.content && typeof delta.content === "string") try {
|
|
331
|
-
const parsedContent = JSON.parse(delta.content);
|
|
332
|
-
if (parsedContent.type === "data-operation" && parsedContent.data?.type === "error") {
|
|
333
|
-
hasError = true;
|
|
334
|
-
errorMessage = parsedContent.data.message || "Unknown error occurred";
|
|
335
|
-
logger.warn({
|
|
336
|
-
errorMessage,
|
|
337
|
-
errorData: parsedContent.data
|
|
338
|
-
}, "Received error operation from chat API");
|
|
339
|
-
}
|
|
340
|
-
} catch {}
|
|
341
|
-
} else if (data.type === "text-delta" && data.delta) textContent += data.delta;
|
|
342
|
-
else if (data.type === "data-operation" && data.data?.type === "error") {
|
|
343
|
-
hasError = true;
|
|
344
|
-
errorMessage = data.data.message || "Unknown error occurred";
|
|
345
|
-
logger.warn({
|
|
346
|
-
errorMessage,
|
|
347
|
-
errorData: data.data
|
|
348
|
-
}, "Received error operation from chat API");
|
|
349
|
-
} else if (data.type === "error") {
|
|
350
|
-
hasError = true;
|
|
351
|
-
errorMessage = data.message || "Unknown error occurred";
|
|
352
|
-
logger.warn({
|
|
353
|
-
errorMessage,
|
|
354
|
-
errorData: data
|
|
355
|
-
}, "Received error event from chat API");
|
|
356
|
-
} else if (data.content) textContent += typeof data.content === "string" ? data.content : JSON.stringify(data.content);
|
|
357
|
-
} catch {}
|
|
358
|
-
if (hasError) return {
|
|
359
|
-
text: textContent.trim(),
|
|
360
|
-
error: errorMessage
|
|
361
|
-
};
|
|
362
|
-
return { text: textContent.trim() };
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
316
|
* Run an evaluation job based on an evaluation job config
|
|
366
317
|
* Filters conversations based on jobFilters and runs evaluations with configured evaluators
|
|
367
318
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types0 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_types0.BlankEnv, hono_types0.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 hono13 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/availableAgents.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono13.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 hono14 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono14.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 hono17 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono17.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_types6 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_types6.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_types9 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_types9.BlankEnv, hono_types9.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,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types1 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_types1.BlankEnv, hono_types1.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import { WorkAppsVariables } from "@inkeep/agents-work-apps/slack";
|
|
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 };
|
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";
|
|
17
18
|
trace: "trace";
|
|
18
19
|
debug: "debug";
|
|
19
20
|
info: "info";
|
|
20
21
|
warn: "warn";
|
|
21
|
-
error: "error";
|
|
22
22
|
}>>;
|
|
23
23
|
INKEEP_AGENTS_MANAGE_DATABASE_URL: z.ZodString;
|
|
24
24
|
INKEEP_AGENTS_RUN_DATABASE_URL: z.ZodString;
|
|
@@ -59,7 +59,7 @@ declare const envSchema: z.ZodObject<{
|
|
|
59
59
|
declare const env: {
|
|
60
60
|
NODE_ENV: "development" | "production" | "test";
|
|
61
61
|
ENVIRONMENT: "development" | "production" | "test" | "pentest";
|
|
62
|
-
LOG_LEVEL: "
|
|
62
|
+
LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
|
|
63
63
|
INKEEP_AGENTS_MANAGE_DATABASE_URL: string;
|
|
64
64
|
INKEEP_AGENTS_RUN_DATABASE_URL: string;
|
|
65
65
|
INKEEP_AGENTS_API_URL: string;
|
package/dist/factory.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import "./types/index.js";
|
|
|
3
3
|
import { createAgentsHono } from "./createApp.js";
|
|
4
4
|
import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
|
|
5
5
|
import { CredentialStore, ServerConfig } from "@inkeep/agents-core";
|
|
6
|
-
import * as
|
|
6
|
+
import * as hono18 from "hono";
|
|
7
7
|
import * as zod0 from "zod";
|
|
8
8
|
import { SSOProviderConfig, UserAuthConfig } from "@inkeep/agents-core/auth";
|
|
9
|
-
import * as
|
|
9
|
+
import * as hono_types11 from "hono/types";
|
|
10
10
|
import * as better_auth0 from "better-auth";
|
|
11
11
|
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
12
12
|
import * as _better_auth_sso0 from "@better-auth/sso";
|
|
@@ -804,25 +804,25 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
|
|
|
804
804
|
ac: better_auth_plugins0.AccessControl;
|
|
805
805
|
roles: {
|
|
806
806
|
member: {
|
|
807
|
-
authorize<K_1 extends "
|
|
808
|
-
actions: better_auth_plugins0.Subset<"
|
|
807
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
808
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
809
809
|
connector: "OR" | "AND";
|
|
810
810
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
811
|
-
statements: better_auth_plugins0.Subset<"
|
|
811
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
812
812
|
};
|
|
813
813
|
admin: {
|
|
814
|
-
authorize<K_1 extends "
|
|
815
|
-
actions: better_auth_plugins0.Subset<"
|
|
814
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
815
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
816
816
|
connector: "OR" | "AND";
|
|
817
817
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
818
|
-
statements: better_auth_plugins0.Subset<"
|
|
818
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
819
819
|
};
|
|
820
820
|
owner: {
|
|
821
|
-
authorize<K_1 extends "
|
|
822
|
-
actions: better_auth_plugins0.Subset<"
|
|
821
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
822
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
823
823
|
connector: "OR" | "AND";
|
|
824
824
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
825
|
-
statements: better_auth_plugins0.Subset<"
|
|
825
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
826
826
|
};
|
|
827
827
|
};
|
|
828
828
|
creatorRole: "admin";
|
|
@@ -1127,25 +1127,25 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
|
|
|
1127
1127
|
ac: better_auth_plugins0.AccessControl;
|
|
1128
1128
|
roles: {
|
|
1129
1129
|
member: {
|
|
1130
|
-
authorize<K_1 extends "
|
|
1131
|
-
actions: better_auth_plugins0.Subset<"
|
|
1130
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1131
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1132
1132
|
connector: "OR" | "AND";
|
|
1133
1133
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1134
|
-
statements: better_auth_plugins0.Subset<"
|
|
1134
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1135
1135
|
};
|
|
1136
1136
|
admin: {
|
|
1137
|
-
authorize<K_1 extends "
|
|
1138
|
-
actions: better_auth_plugins0.Subset<"
|
|
1137
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1138
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1139
1139
|
connector: "OR" | "AND";
|
|
1140
1140
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1141
|
-
statements: better_auth_plugins0.Subset<"
|
|
1141
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1142
1142
|
};
|
|
1143
1143
|
owner: {
|
|
1144
|
-
authorize<K_1 extends "
|
|
1145
|
-
actions: better_auth_plugins0.Subset<"
|
|
1144
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1145
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1146
1146
|
connector: "OR" | "AND";
|
|
1147
1147
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1148
|
-
statements: better_auth_plugins0.Subset<"
|
|
1148
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1149
1149
|
};
|
|
1150
1150
|
};
|
|
1151
1151
|
creatorRole: "admin";
|
|
@@ -1570,6 +1570,6 @@ declare function createAgentsApp(config?: {
|
|
|
1570
1570
|
credentialStores?: CredentialStore[];
|
|
1571
1571
|
auth?: UserAuthConfig;
|
|
1572
1572
|
sandboxConfig?: SandboxConfig;
|
|
1573
|
-
}):
|
|
1573
|
+
}): hono18.Hono<hono_types11.BlankEnv, hono_types11.BlankSchema, "/">;
|
|
1574
1574
|
//#endregion
|
|
1575
1575
|
export { type SSOProviderConfig, type UserAuthConfig, createAgentsApp, createAgentsAuth, createAgentsHono, createAuth0Provider, createOIDCProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
|
|
|
7
7
|
import { SSOProviderConfig, UserAuthConfig, createAgentsApp } from "./factory.js";
|
|
8
8
|
import { Hono } from "hono";
|
|
9
9
|
import * as zod205 from "zod";
|
|
10
|
-
import * as
|
|
10
|
+
import * as hono_types13 from "hono/types";
|
|
11
11
|
import * as better_auth79 from "better-auth";
|
|
12
12
|
import * as better_auth_plugins69 from "better-auth/plugins";
|
|
13
13
|
import * as _better_auth_sso10 from "@better-auth/sso";
|
|
@@ -805,25 +805,25 @@ declare const auth: better_auth79.Auth<{
|
|
|
805
805
|
ac: better_auth_plugins69.AccessControl;
|
|
806
806
|
roles: {
|
|
807
807
|
member: {
|
|
808
|
-
authorize<K_1 extends "
|
|
809
|
-
actions: better_auth_plugins69.Subset<"
|
|
808
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
809
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
810
810
|
connector: "OR" | "AND";
|
|
811
811
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
812
|
-
statements: better_auth_plugins69.Subset<"
|
|
812
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
813
813
|
};
|
|
814
814
|
admin: {
|
|
815
|
-
authorize<K_1 extends "
|
|
816
|
-
actions: better_auth_plugins69.Subset<"
|
|
815
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
816
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
817
817
|
connector: "OR" | "AND";
|
|
818
818
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
819
|
-
statements: better_auth_plugins69.Subset<"
|
|
819
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
820
820
|
};
|
|
821
821
|
owner: {
|
|
822
|
-
authorize<K_1 extends "
|
|
823
|
-
actions: better_auth_plugins69.Subset<"
|
|
822
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
823
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
824
824
|
connector: "OR" | "AND";
|
|
825
825
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
826
|
-
statements: better_auth_plugins69.Subset<"
|
|
826
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
827
827
|
};
|
|
828
828
|
};
|
|
829
829
|
creatorRole: "admin";
|
|
@@ -1128,25 +1128,25 @@ declare const auth: better_auth79.Auth<{
|
|
|
1128
1128
|
ac: better_auth_plugins69.AccessControl;
|
|
1129
1129
|
roles: {
|
|
1130
1130
|
member: {
|
|
1131
|
-
authorize<K_1 extends "
|
|
1132
|
-
actions: better_auth_plugins69.Subset<"
|
|
1131
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
1132
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
1133
1133
|
connector: "OR" | "AND";
|
|
1134
1134
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1135
|
-
statements: better_auth_plugins69.Subset<"
|
|
1135
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
1136
1136
|
};
|
|
1137
1137
|
admin: {
|
|
1138
|
-
authorize<K_1 extends "
|
|
1139
|
-
actions: better_auth_plugins69.Subset<"
|
|
1138
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
1139
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
1140
1140
|
connector: "OR" | "AND";
|
|
1141
1141
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1142
|
-
statements: better_auth_plugins69.Subset<"
|
|
1142
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
1143
1143
|
};
|
|
1144
1144
|
owner: {
|
|
1145
|
-
authorize<K_1 extends "
|
|
1146
|
-
actions: better_auth_plugins69.Subset<"
|
|
1145
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
1146
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
1147
1147
|
connector: "OR" | "AND";
|
|
1148
1148
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
1149
|
-
statements: better_auth_plugins69.Subset<"
|
|
1149
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
1150
1150
|
};
|
|
1151
1151
|
};
|
|
1152
1152
|
creatorRole: "admin";
|
|
@@ -1566,6 +1566,6 @@ declare const auth: better_auth79.Auth<{
|
|
|
1566
1566
|
}>;
|
|
1567
1567
|
}];
|
|
1568
1568
|
}>;
|
|
1569
|
-
declare const app: Hono<
|
|
1569
|
+
declare const app: Hono<hono_types13.BlankEnv, hono_types13.BlankSchema, "/">;
|
|
1570
1570
|
//#endregion
|
|
1571
1571
|
export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default };
|
|
@@ -37,5 +37,10 @@ declare const runCorsConfig: CorsOptions;
|
|
|
37
37
|
* CORS configuration for SigNoz proxy routes
|
|
38
38
|
*/
|
|
39
39
|
declare const signozCorsConfig: CorsOptions;
|
|
40
|
+
/**
|
|
41
|
+
* CORS configuration for work-apps routes (Slack, etc.)
|
|
42
|
+
* Needs to allow cross-origin requests with credentials for dashboard integration
|
|
43
|
+
*/
|
|
44
|
+
declare const workAppsCorsConfig: CorsOptions;
|
|
40
45
|
//#endregion
|
|
41
|
-
export { authCorsConfig, defaultCorsConfig, getBaseDomain, getRootDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig };
|
|
46
|
+
export { authCorsConfig, defaultCorsConfig, getBaseDomain, getRootDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig };
|
package/dist/middleware/cors.js
CHANGED
|
@@ -141,6 +141,32 @@ const signozCorsConfig = {
|
|
|
141
141
|
maxAge: 600,
|
|
142
142
|
credentials: true
|
|
143
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* CORS configuration for work-apps routes (Slack, etc.)
|
|
146
|
+
* Needs to allow cross-origin requests with credentials for dashboard integration
|
|
147
|
+
*/
|
|
148
|
+
const workAppsCorsConfig = {
|
|
149
|
+
origin: originHandler,
|
|
150
|
+
allowHeaders: [
|
|
151
|
+
"content-type",
|
|
152
|
+
"Content-Type",
|
|
153
|
+
"authorization",
|
|
154
|
+
"Authorization",
|
|
155
|
+
"User-Agent",
|
|
156
|
+
"Cookie"
|
|
157
|
+
],
|
|
158
|
+
allowMethods: [
|
|
159
|
+
"GET",
|
|
160
|
+
"POST",
|
|
161
|
+
"PUT",
|
|
162
|
+
"DELETE",
|
|
163
|
+
"OPTIONS",
|
|
164
|
+
"PATCH"
|
|
165
|
+
],
|
|
166
|
+
exposeHeaders: ["Content-Length"],
|
|
167
|
+
maxAge: 600,
|
|
168
|
+
credentials: true
|
|
169
|
+
};
|
|
144
170
|
|
|
145
171
|
//#endregion
|
|
146
|
-
export { authCorsConfig, defaultCorsConfig, getBaseDomain, getRootDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig };
|
|
172
|
+
export { authCorsConfig, defaultCorsConfig, getBaseDomain, getRootDomain, isOriginAllowed, playgroundCorsConfig, runCorsConfig, signozCorsConfig, workAppsCorsConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseExecutionContext } from "@inkeep/agents-core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono0 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/middleware/evalsAuth.d.ts
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import * as hono2 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: () => hono0.MiddlewareHandler<{
|
|
11
11
|
Variables: {
|
|
12
12
|
executionContext: BaseExecutionContext;
|
|
13
13
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
-
|
|
8
|
+
import { workAppsAuth } from "./workAppsAuth.js";
|
|
9
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsAuth, workAppsCorsConfig };
|
package/dist/middleware/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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
|
+
import { workAppsAuth } from "./workAppsAuth.js";
|
|
8
9
|
|
|
9
|
-
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig };
|
|
10
|
+
export { authCorsConfig, defaultCorsConfig, errorHandler, getBaseDomain, isOriginAllowed, manageApiKeyAuth, oauthRefMiddleware, playgroundCorsConfig, requireTenantAccess, runApiKeyAuth, runApiKeyAuthExcept, runCorsConfig, runOptionalAuth, sessionAuth, signozCorsConfig, workAppsAuth, workAppsCorsConfig };
|