@inkeep/agents-api 0.0.0-dev-20260129102848 → 0.0.0-dev-20260129163144
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 +5 -5
- package/dist/.well-known/workflow/v1/step.cjs +0 -1
- package/dist/createApp.d.ts +2 -2
- package/dist/createApp.js +8 -6
- 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/github/index.d.ts +3 -3
- package/dist/domains/github/routes/tokenExchange.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/evals/evaluationResults.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/projectMembers.js +1 -14
- package/dist/domains/manage/routes/projectPermissions.js +2 -9
- package/dist/domains/manage/routes/projects.js +14 -16
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.js +1 -1
- package/dist/domains/manage/routes/userProjectMemberships.js +1 -2
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/domains/run/context/validation.d.ts +1 -1
- package/dist/domains/run/services/TriggerService.d.ts +1 -1
- package/dist/domains/run/services/TriggerService.js +15 -13
- package/dist/domains/run/utils/token-estimator.d.ts +2 -2
- package/dist/env.d.ts +0 -2
- package/dist/env.js +0 -1
- package/dist/factory.d.ts +29 -29
- package/dist/factory.js +4 -10
- package/dist/index.d.ts +30 -29
- package/dist/index.js +3 -5
- package/dist/middleware/branchScopedDb.d.ts +1 -1
- package/dist/middleware/evalsAuth.d.ts +2 -2
- package/dist/middleware/manageAuth.d.ts +2 -2
- package/dist/middleware/projectAccess.d.ts +2 -11
- package/dist/middleware/projectAccess.js +7 -33
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/ref.d.ts +1 -1
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/requirePermission.js +1 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/sessionAuth.js +1 -2
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/package.json +4 -4
- package/dist/initialization.d.ts +0 -6
- package/dist/initialization.js +0 -72
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"workflows": {
|
|
44
|
-
"src/domains/evals/workflow/functions/evaluateConversation.ts": {
|
|
45
|
-
"_evaluateConversationWorkflow": {
|
|
46
|
-
"workflowId": "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
44
|
"src/domains/evals/workflow/functions/runDatasetItem.ts": {
|
|
50
45
|
"_runDatasetItemWorkflow": {
|
|
51
46
|
"workflowId": "workflow//src/domains/evals/workflow/functions/runDatasetItem.ts//_runDatasetItemWorkflow"
|
|
52
47
|
}
|
|
48
|
+
},
|
|
49
|
+
"src/domains/evals/workflow/functions/evaluateConversation.ts": {
|
|
50
|
+
"_evaluateConversationWorkflow": {
|
|
51
|
+
"workflowId": "workflow//src/domains/evals/workflow/functions/evaluateConversation.ts//_evaluateConversationWorkflow"
|
|
52
|
+
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -212680,7 +212680,6 @@ var envSchema2 = external_exports.object({
|
|
|
212680
212680
|
NANGO_SECRET_KEY: external_exports.string().optional(),
|
|
212681
212681
|
OTEL_BSP_SCHEDULE_DELAY: external_exports.coerce.number().optional().default(500),
|
|
212682
212682
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: external_exports.coerce.number().optional().default(64),
|
|
212683
|
-
DISABLE_AUTH: external_exports.string().optional().default("false").transform((val) => val === "true"),
|
|
212684
212683
|
TENANT_ID: external_exports.string().optional().default("default"),
|
|
212685
212684
|
SIGNOZ_URL: external_exports.string().optional(),
|
|
212686
212685
|
SIGNOZ_API_KEY: external_exports.string().optional(),
|
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_types12 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_types12.BlankEnv, hono_types12.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { createAgentsHono, isWebhookRoute };
|
package/dist/createApp.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLogger } from "./logger.js";
|
|
1
|
+
import { getLogger as getLogger$1 } from "./logger.js";
|
|
2
2
|
import { env } from "./env.js";
|
|
3
3
|
import { evalRoutes } from "./domains/evals/index.js";
|
|
4
4
|
import { workflowRoutes } from "./domains/evals/workflow/routes.js";
|
|
@@ -22,13 +22,14 @@ import { executionBaggageMiddleware } from "./middleware/tracing.js";
|
|
|
22
22
|
import { setupOpenAPIRoutes } from "./openapi.js";
|
|
23
23
|
import { healthChecksHandler } from "./routes/healthChecks.js";
|
|
24
24
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
25
|
+
import { OrgRoles } from "@inkeep/agents-core";
|
|
25
26
|
import { Hono } from "hono";
|
|
26
27
|
import { cors } from "hono/cors";
|
|
27
28
|
import { requestId } from "hono/request-id";
|
|
28
29
|
import { pinoLogger } from "hono-pino";
|
|
29
30
|
|
|
30
31
|
//#region src/createApp.ts
|
|
31
|
-
const logger = getLogger("agents-api");
|
|
32
|
+
const logger = getLogger$1("agents-api");
|
|
32
33
|
const isTestEnvironment = () => env.ENVIRONMENT === "test";
|
|
33
34
|
const isWebhookRoute = (path) => {
|
|
34
35
|
return path.includes("/triggers/") && !path.endsWith("/triggers") && !path.endsWith("/triggers/");
|
|
@@ -82,7 +83,7 @@ function createAgentsHono(config) {
|
|
|
82
83
|
return next();
|
|
83
84
|
});
|
|
84
85
|
app.use(pinoLogger({
|
|
85
|
-
pino: getLogger("agents-api").getPinoInstance(),
|
|
86
|
+
pino: getLogger$1("agents-api").getPinoInstance(),
|
|
86
87
|
http: { onResLevel(c) {
|
|
87
88
|
if (c.res.status >= 500) return "error";
|
|
88
89
|
if (c.req.path.includes("/signoz/")) return "debug";
|
|
@@ -107,7 +108,7 @@ function createAgentsHono(config) {
|
|
|
107
108
|
});
|
|
108
109
|
});
|
|
109
110
|
app.use("/manage/tenants/*", async (c, next) => {
|
|
110
|
-
if (
|
|
111
|
+
if (isTestEnvironment()) {
|
|
111
112
|
await next();
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
@@ -115,7 +116,7 @@ function createAgentsHono(config) {
|
|
|
115
116
|
return sessionAuth()(c, next);
|
|
116
117
|
});
|
|
117
118
|
app.use("/manage/capabilities", async (c, next) => {
|
|
118
|
-
if (!auth ||
|
|
119
|
+
if (!auth || isTestEnvironment()) {
|
|
119
120
|
await next();
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
@@ -140,11 +141,12 @@ function createAgentsHono(config) {
|
|
|
140
141
|
runtime: sandboxConfig.runtime
|
|
141
142
|
} });
|
|
142
143
|
});
|
|
143
|
-
if (
|
|
144
|
+
if (isTestEnvironment()) app.use("/manage/tenants/:tenantId/*", async (c, next) => {
|
|
144
145
|
const tenantId = c.req.param("tenantId");
|
|
145
146
|
if (tenantId) {
|
|
146
147
|
c.set("tenantId", tenantId);
|
|
147
148
|
c.set("userId", "anonymous");
|
|
149
|
+
c.set("tenantRole", OrgRoles.OWNER);
|
|
148
150
|
}
|
|
149
151
|
await next();
|
|
150
152
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _inkeep_agents_core0 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_core0.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 hono10 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/datasetTriggers.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono10.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 hono11 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/evals/routes/index.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono11.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_types6 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_types6.BlankEnv, hono_types6.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { workflowRoutes };
|
|
@@ -3,10 +3,10 @@ import { GenerateInstallationAccessTokenResult, GenerateTokenError, GenerateToke
|
|
|
3
3
|
import { GetJwkResult, JwksError, JwksResult, clearJwksCache, getJwkForToken, getJwksCacheStatus } from "./jwks.js";
|
|
4
4
|
import { GitHubOidcClaims, ValidateOidcTokenResult, ValidateTokenError, ValidateTokenResult, validateOidcToken } from "./oidcToken.js";
|
|
5
5
|
import { Hono } from "hono";
|
|
6
|
-
import * as
|
|
6
|
+
import * as hono_types1 from "hono/types";
|
|
7
7
|
|
|
8
8
|
//#region src/domains/github/index.d.ts
|
|
9
|
-
declare function createGithubRoutes(): Hono<
|
|
10
|
-
declare const githubRoutes: Hono<
|
|
9
|
+
declare function createGithubRoutes(): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
|
|
10
|
+
declare const githubRoutes: Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { type GenerateInstallationAccessTokenResult, type GenerateTokenError, type GenerateTokenResult, type GetJwkResult, type GitHubAppConfig, type GitHubOidcClaims, type InstallationAccessToken, type InstallationInfo, type JwksError, type JwksResult, type LookupInstallationError, type LookupInstallationForRepoResult, type LookupInstallationResult, type ValidateOidcTokenResult, type ValidateTokenError, type ValidateTokenResult, clearJwksCache, createGithubRoutes, generateInstallationAccessToken, getGitHubAppConfig, getJwkForToken, getJwksCacheStatus, githubRoutes, isGitHubAppConfigured, lookupInstallationForRepo, validateOidcToken };
|
|
@@ -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/github/routes/tokenExchange.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,7 +1,7 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono12 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/conversations.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono12.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/evals/evaluationResults.d.ts
|
|
5
|
-
declare const app: OpenAPIHono<
|
|
5
|
+
declare const app: OpenAPIHono<hono17.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 hono13 from "hono";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/index.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 { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types10 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_types10.BlankEnv, hono_types10.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { requireProjectPermission } from "../../../middleware/projectAccess.js";
|
|
2
2
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
3
|
-
import { ProjectRoles, changeProjectRole, commonGetErrorResponses, createApiError, grantProjectAccess,
|
|
3
|
+
import { ProjectRoles, changeProjectRole, commonGetErrorResponses, createApiError, grantProjectAccess, listProjectMembers, revokeProjectAccess } from "@inkeep/agents-core";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/projectMembers.ts
|
|
6
6
|
const app = new OpenAPIHono();
|
|
@@ -51,7 +51,6 @@ app.openapi(createRoute({
|
|
|
51
51
|
}
|
|
52
52
|
}), async (c) => {
|
|
53
53
|
const { projectId, tenantId } = c.req.valid("param");
|
|
54
|
-
if (!isAuthzEnabled()) return c.json({ data: [] });
|
|
55
54
|
const members = await listProjectMembers({
|
|
56
55
|
tenantId,
|
|
57
56
|
projectId
|
|
@@ -83,10 +82,6 @@ app.openapi(createRoute({
|
|
|
83
82
|
}), async (c) => {
|
|
84
83
|
const { projectId, tenantId } = c.req.valid("param");
|
|
85
84
|
const { userId, role } = c.req.valid("json");
|
|
86
|
-
if (!isAuthzEnabled()) throw createApiError({
|
|
87
|
-
code: "bad_request",
|
|
88
|
-
message: "Project member management requires authorization to be enabled (ENABLE_AUTHZ=true)"
|
|
89
|
-
});
|
|
90
85
|
await grantProjectAccess({
|
|
91
86
|
tenantId,
|
|
92
87
|
projectId,
|
|
@@ -120,10 +115,6 @@ app.openapi(createRoute({
|
|
|
120
115
|
}), async (c) => {
|
|
121
116
|
const { projectId, userId, tenantId } = c.req.valid("param");
|
|
122
117
|
const { role: newRole, previousRole } = c.req.valid("json");
|
|
123
|
-
if (!isAuthzEnabled()) throw createApiError({
|
|
124
|
-
code: "bad_request",
|
|
125
|
-
message: "Project member management requires authorization to be enabled (ENABLE_AUTHZ=true)"
|
|
126
|
-
});
|
|
127
118
|
if (!previousRole) throw createApiError({
|
|
128
119
|
code: "bad_request",
|
|
129
120
|
message: "previousRole is required to update a member role"
|
|
@@ -164,10 +155,6 @@ app.openapi(createRoute({
|
|
|
164
155
|
}), async (c) => {
|
|
165
156
|
const { projectId, userId, tenantId } = c.req.valid("param");
|
|
166
157
|
const { role } = c.req.valid("query");
|
|
167
|
-
if (!isAuthzEnabled()) throw createApiError({
|
|
168
|
-
code: "bad_request",
|
|
169
|
-
message: "Project member management requires authorization to be enabled (ENABLE_AUTHZ=true)"
|
|
170
|
-
});
|
|
171
158
|
await revokeProjectAccess({
|
|
172
159
|
tenantId,
|
|
173
160
|
projectId,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { env } from "../../../env.js";
|
|
2
1
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
3
|
-
import { OrgRoles, SpiceDbProjectPermissions, SpiceDbResourceTypes, checkBulkPermissions, commonGetErrorResponses, createApiError
|
|
2
|
+
import { OrgRoles, SpiceDbProjectPermissions, SpiceDbResourceTypes, checkBulkPermissions, commonGetErrorResponses, createApiError } from "@inkeep/agents-core";
|
|
4
3
|
|
|
5
4
|
//#region src/domains/manage/routes/projectPermissions.ts
|
|
6
5
|
const app = new OpenAPIHono();
|
|
@@ -32,8 +31,7 @@ app.openapi(createRoute({
|
|
|
32
31
|
const { projectId } = c.req.valid("param");
|
|
33
32
|
const userId = c.get("userId");
|
|
34
33
|
const tenantRole = c.get("tenantRole");
|
|
35
|
-
|
|
36
|
-
if (env.DISABLE_AUTH || isTestEnvironment) return c.json({ data: {
|
|
34
|
+
if (process.env.ENVIRONMENT === "test") return c.json({ data: {
|
|
37
35
|
canView: true,
|
|
38
36
|
canUse: true,
|
|
39
37
|
canEdit: true
|
|
@@ -43,11 +41,6 @@ app.openapi(createRoute({
|
|
|
43
41
|
canUse: true,
|
|
44
42
|
canEdit: true
|
|
45
43
|
} });
|
|
46
|
-
if (!isAuthzEnabled()) return c.json({ data: {
|
|
47
|
-
canView: true,
|
|
48
|
-
canUse: true,
|
|
49
|
-
canEdit: false
|
|
50
|
-
} });
|
|
51
44
|
if (!userId) throw createApiError({
|
|
52
45
|
code: "unauthorized",
|
|
53
46
|
message: "User not found"
|
|
@@ -4,7 +4,7 @@ import { requireProjectPermission } from "../../../middleware/projectAccess.js";
|
|
|
4
4
|
import { speakeasyOffsetLimitPagination } from "../../../utils/speakeasy.js";
|
|
5
5
|
import { requirePermission } from "../../../middleware/requirePermission.js";
|
|
6
6
|
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
|
|
7
|
-
import { ErrorResponseSchema, PaginationQueryParamsSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, ProjectListResponse, ProjectResponse, TenantIdParamsSchema, TenantParamsSchema, cascadeDeleteByProject, commonGetErrorResponses, createApiError, createProject, createProjectMetadataAndBranch, deleteProject, deleteProjectWithBranch, doltCheckout, getProject, getProjectMainBranchName,
|
|
7
|
+
import { ErrorResponseSchema, PaginationQueryParamsSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, ProjectListResponse, ProjectResponse, TenantIdParamsSchema, TenantParamsSchema, cascadeDeleteByProject, commonGetErrorResponses, createApiError, createProject, createProjectMetadataAndBranch, deleteProject, deleteProjectWithBranch, doltCheckout, getProject, getProjectMainBranchName, listAccessibleProjectIds, listProjectsWithMetadataPaginated, removeProjectFromSpiceDb, syncProjectToSpiceDb, updateProject } from "@inkeep/agents-core";
|
|
8
8
|
|
|
9
9
|
//#region src/domains/manage/routes/projects.ts
|
|
10
10
|
const app = new OpenAPIHono();
|
|
@@ -45,7 +45,7 @@ app.openapi(createRoute({
|
|
|
45
45
|
const page = Number(c.req.query("page")) || 1;
|
|
46
46
|
const limit = Math.min(Number(c.req.query("limit")) || 10, 100);
|
|
47
47
|
let accessibleIds;
|
|
48
|
-
if (
|
|
48
|
+
if (userId) {
|
|
49
49
|
const result$1 = await listAccessibleProjectIds({
|
|
50
50
|
userId,
|
|
51
51
|
orgRole: tenantRole
|
|
@@ -148,20 +148,18 @@ app.openapi(createRoute({
|
|
|
148
148
|
tenantId,
|
|
149
149
|
...body
|
|
150
150
|
});
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
if (!userId) throw createApiError({
|
|
152
|
+
code: "unauthorized",
|
|
153
|
+
message: "User not found"
|
|
154
|
+
});
|
|
155
|
+
try {
|
|
156
|
+
await syncProjectToSpiceDb({
|
|
157
|
+
tenantId,
|
|
158
|
+
projectId: body.id,
|
|
159
|
+
creatorUserId: userId
|
|
155
160
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
tenantId,
|
|
159
|
-
projectId: body.id,
|
|
160
|
-
creatorUserId: userId
|
|
161
|
-
});
|
|
162
|
-
} catch (syncError) {
|
|
163
|
-
console.warn("Failed to sync project to SpiceDB:", syncError);
|
|
164
|
-
}
|
|
161
|
+
} catch (syncError) {
|
|
162
|
+
console.warn("Failed to sync project to SpiceDB:", syncError);
|
|
165
163
|
}
|
|
166
164
|
return c.json({ data: {
|
|
167
165
|
...projectConfig,
|
|
@@ -255,7 +253,7 @@ app.openapi(createRoute({
|
|
|
255
253
|
code: "not_found",
|
|
256
254
|
message: "Project not found"
|
|
257
255
|
});
|
|
258
|
-
|
|
256
|
+
try {
|
|
259
257
|
await removeProjectFromSpiceDb({
|
|
260
258
|
tenantId,
|
|
261
259
|
projectId: id
|
|
@@ -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/signoz.d.ts
|
|
6
6
|
declare const app: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types5.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { app as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getLogger as getLogger$1 } from "../../../logger.js";
|
|
2
2
|
import { env } from "../../../env.js";
|
|
3
3
|
import { enforceSecurityFilters } from "../../../utils/signozHelpers.js";
|
|
4
|
-
import { Hono } from "hono";
|
|
5
4
|
import { createApiError, projectExists } from "@inkeep/agents-core";
|
|
5
|
+
import { Hono } from "hono";
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
|
|
8
8
|
//#region src/domains/manage/routes/signoz.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
2
|
-
import { ProjectRoles, commonGetErrorResponses,
|
|
2
|
+
import { ProjectRoles, commonGetErrorResponses, listUserProjectMembershipsInSpiceDb } from "@inkeep/agents-core";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/userProjectMemberships.ts
|
|
5
5
|
const app = new OpenAPIHono();
|
|
@@ -32,7 +32,6 @@ app.openapi(createRoute({
|
|
|
32
32
|
}
|
|
33
33
|
}), async (c) => {
|
|
34
34
|
const { tenantId, userId } = c.req.valid("param");
|
|
35
|
-
if (!isAuthzEnabled()) return c.json({ data: [] });
|
|
36
35
|
const memberships = await listUserProjectMembershipsInSpiceDb({
|
|
37
36
|
tenantId,
|
|
38
37
|
userId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types14 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_types14.BlankEnv, hono_types14.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -364,7 +364,19 @@ async function dispatchExecution(params) {
|
|
|
364
364
|
*/
|
|
365
365
|
async function executeAgentAsync(params) {
|
|
366
366
|
const { tenantId, projectId, agentId, triggerId, invocationId, conversationId, userMessage, messageParts, resolvedRef } = params;
|
|
367
|
-
const
|
|
367
|
+
const project = await withRef(manageDbPool_default, resolvedRef, async (db) => {
|
|
368
|
+
return await getFullProjectWithRelationIds(db)({ scopes: {
|
|
369
|
+
tenantId,
|
|
370
|
+
projectId
|
|
371
|
+
} });
|
|
372
|
+
});
|
|
373
|
+
if (!project) throw new Error(`Project ${projectId} not found`);
|
|
374
|
+
const agent = project.agents?.[agentId];
|
|
375
|
+
if (!agent) throw new Error(`Agent ${agentId} not found in project`);
|
|
376
|
+
const defaultSubAgentId = agent.defaultSubAgentId;
|
|
377
|
+
if (!defaultSubAgentId) throw new Error(`Agent ${agentId} has no default sub-agent configured`);
|
|
378
|
+
const agentName = agent.name || agentId;
|
|
379
|
+
const baggage = propagation.createBaggage().setEntry("conversation.id", { value: conversationId }).setEntry("tenant.id", { value: tenantId }).setEntry("project.id", { value: projectId }).setEntry("agent.id", { value: agentId }).setEntry("agent.name", { value: agentName });
|
|
368
380
|
const ctxWithBaggage = propagation.setBaggage(context.active(), baggage);
|
|
369
381
|
return tracer.startActiveSpan("trigger.execute_async", {
|
|
370
382
|
root: true,
|
|
@@ -372,6 +384,7 @@ async function executeAgentAsync(params) {
|
|
|
372
384
|
"tenant.id": tenantId,
|
|
373
385
|
"project.id": projectId,
|
|
374
386
|
"agent.id": agentId,
|
|
387
|
+
"agent.name": agentName,
|
|
375
388
|
"trigger.id": triggerId,
|
|
376
389
|
"trigger.invocation.id": invocationId,
|
|
377
390
|
"conversation.id": conversationId,
|
|
@@ -382,6 +395,7 @@ async function executeAgentAsync(params) {
|
|
|
382
395
|
"tenant.id": tenantId,
|
|
383
396
|
"project.id": projectId,
|
|
384
397
|
"agent.id": agentId,
|
|
398
|
+
"agent.name": agentName,
|
|
385
399
|
"trigger.id": triggerId,
|
|
386
400
|
"trigger.invocation.id": invocationId,
|
|
387
401
|
"conversation.id": conversationId,
|
|
@@ -400,18 +414,6 @@ async function executeAgentAsync(params) {
|
|
|
400
414
|
conversationId
|
|
401
415
|
}, "Starting async trigger execution");
|
|
402
416
|
try {
|
|
403
|
-
const project = await withRef(manageDbPool_default, resolvedRef, async (db) => {
|
|
404
|
-
return await getFullProjectWithRelationIds(db)({ scopes: {
|
|
405
|
-
tenantId,
|
|
406
|
-
projectId
|
|
407
|
-
} });
|
|
408
|
-
});
|
|
409
|
-
if (!project) throw new Error(`Project ${projectId} not found`);
|
|
410
|
-
const agent = project.agents?.[agentId];
|
|
411
|
-
if (!agent) throw new Error(`Agent ${agentId} not found in project`);
|
|
412
|
-
const defaultSubAgentId = agent.defaultSubAgentId;
|
|
413
|
-
if (!defaultSubAgentId) throw new Error(`Agent ${agentId} has no default sub-agent configured`);
|
|
414
|
-
span.setAttribute("agent.name", agent.name || agentId);
|
|
415
417
|
await createOrGetConversation(runDbClient_default)({
|
|
416
418
|
id: conversationId,
|
|
417
419
|
tenantId,
|
|
@@ -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 };
|
package/dist/env.d.ts
CHANGED
|
@@ -37,7 +37,6 @@ declare const envSchema: z.ZodObject<{
|
|
|
37
37
|
NANGO_SECRET_KEY: z.ZodOptional<z.ZodString>;
|
|
38
38
|
OTEL_BSP_SCHEDULE_DELAY: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
39
39
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
40
|
-
DISABLE_AUTH: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<boolean, string>>;
|
|
41
40
|
TENANT_ID: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
42
41
|
SIGNOZ_URL: z.ZodOptional<z.ZodString>;
|
|
43
42
|
SIGNOZ_API_KEY: z.ZodOptional<z.ZodString>;
|
|
@@ -60,7 +59,6 @@ declare const env: {
|
|
|
60
59
|
NANGO_SERVER_URL: string;
|
|
61
60
|
OTEL_BSP_SCHEDULE_DELAY: number;
|
|
62
61
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: number;
|
|
63
|
-
DISABLE_AUTH: boolean;
|
|
64
62
|
TENANT_ID: string;
|
|
65
63
|
ANTHROPIC_API_KEY: string;
|
|
66
64
|
INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
|
package/dist/env.js
CHANGED
|
@@ -39,7 +39,6 @@ const envSchema = z.object({
|
|
|
39
39
|
NANGO_SECRET_KEY: z.string().optional(),
|
|
40
40
|
OTEL_BSP_SCHEDULE_DELAY: z.coerce.number().optional().default(500),
|
|
41
41
|
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: z.coerce.number().optional().default(64),
|
|
42
|
-
DISABLE_AUTH: z.string().optional().default("false").transform((val) => val === "true"),
|
|
43
42
|
TENANT_ID: z.string().optional().default("default"),
|
|
44
43
|
SIGNOZ_URL: z.string().optional(),
|
|
45
44
|
SIGNOZ_API_KEY: z.string().optional(),
|