@inkeep/agents-manage-api 0.0.0-dev-20260118170655 → 0.0.0-dev-20260119163620

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/data/db/dbClient.d.ts +2 -2
  2. package/dist/data/db/runDbClient.d.ts +2 -2
  3. package/dist/factory.d.ts +2 -2
  4. package/dist/index.d.ts +82 -22
  5. package/dist/middleware/auth.d.ts +2 -2
  6. package/dist/middleware/project-access.d.ts +31 -0
  7. package/dist/middleware/project-access.js +118 -0
  8. package/dist/middleware/require-permission.d.ts +2 -2
  9. package/dist/middleware/session-auth.d.ts +2 -2
  10. package/dist/middleware/tenant-access.d.ts +2 -2
  11. package/dist/routes/agent.js +4 -4
  12. package/dist/routes/agentFull.js +4 -4
  13. package/dist/routes/agentToolRelations.js +4 -4
  14. package/dist/routes/apiKeys.js +4 -4
  15. package/dist/routes/artifactComponents.js +4 -4
  16. package/dist/routes/contextConfigs.js +4 -4
  17. package/dist/routes/conversations.d.ts +2 -2
  18. package/dist/routes/credentialStores.d.ts +2 -2
  19. package/dist/routes/credentialStores.js +5 -0
  20. package/dist/routes/credentials.js +4 -4
  21. package/dist/routes/dataComponents.js +4 -4
  22. package/dist/routes/evals/evaluationResults.d.ts +2 -2
  23. package/dist/routes/externalAgents.js +4 -4
  24. package/dist/routes/functionTools.js +4 -4
  25. package/dist/routes/functions.js +4 -4
  26. package/dist/routes/index.d.ts +2 -2
  27. package/dist/routes/index.js +6 -0
  28. package/dist/routes/playgroundToken.js +18 -3
  29. package/dist/routes/projectFull.js +3 -2
  30. package/dist/routes/projectMembers.d.ts +9 -0
  31. package/dist/routes/projectMembers.js +201 -0
  32. package/dist/routes/projectPermissions.d.ts +9 -0
  33. package/dist/routes/projectPermissions.js +64 -0
  34. package/dist/routes/projects.js +38 -7
  35. package/dist/routes/subAgentArtifactComponents.js +3 -3
  36. package/dist/routes/subAgentDataComponents.js +3 -3
  37. package/dist/routes/subAgentExternalAgentRelations.js +4 -4
  38. package/dist/routes/subAgentFunctionTools.js +3 -3
  39. package/dist/routes/subAgentRelations.js +4 -4
  40. package/dist/routes/subAgentTeamAgentRelations.js +4 -4
  41. package/dist/routes/subAgentToolRelations.js +4 -4
  42. package/dist/routes/subAgents.js +4 -4
  43. package/dist/routes/tools.js +4 -4
  44. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { requirePermission } from "../middleware/require-permission.js";
1
+ import { requireProjectPermission } from "../middleware/project-access.js";
2
2
  import { speakeasyOffsetLimitPagination } from "./shared.js";
3
3
  import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
4
4
  import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, commonGetErrorResponses, createApiError, createSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, getSubAgentExternalAgentRelationById, listSubAgentExternalAgentRelations, updateSubAgentExternalAgentRelation } from "@inkeep/agents-core";
@@ -7,12 +7,12 @@ import { nanoid } from "nanoid";
7
7
  //#region src/routes/subAgentExternalAgentRelations.ts
8
8
  const app = new OpenAPIHono();
9
9
  app.use("/", async (c, next) => {
10
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
10
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
11
11
  return next();
12
12
  });
13
13
  app.use("/:id", async (c, next) => {
14
- if (c.req.method === "PUT") return requirePermission({ sub_agent: ["update"] })(c, next);
15
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
14
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
15
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
16
16
  return next();
17
17
  });
18
18
  app.openapi(createRoute({
@@ -1,15 +1,15 @@
1
- import { requirePermission } from "../middleware/require-permission.js";
1
+ import { requireProjectPermission } from "../middleware/project-access.js";
2
2
  import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
3
3
  import { ComponentAssociationListResponse, ErrorResponseSchema, ExistsResponseSchema, FunctionToolListResponse, RemovedResponseSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationResponse, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentParamsSchema, addFunctionToolToSubAgent, commonGetErrorResponses, createApiError, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentById, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, removeFunctionToolFromSubAgent } from "@inkeep/agents-core";
4
4
 
5
5
  //#region src/routes/subAgentFunctionTools.ts
6
6
  const app = new OpenAPIHono();
7
7
  app.use("/", async (c, next) => {
8
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
8
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
9
9
  return next();
10
10
  });
11
11
  app.use("/sub-agent/:subAgentId/function-tool/:functionToolId", async (c, next) => {
12
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
12
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
13
13
  return next();
14
14
  });
15
15
  app.openapi(createRoute({
@@ -1,4 +1,4 @@
1
- import { requirePermission } from "../middleware/require-permission.js";
1
+ import { requireProjectPermission } from "../middleware/project-access.js";
2
2
  import { speakeasyOffsetLimitPagination } from "./shared.js";
3
3
  import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
4
4
  import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, commonGetErrorResponses, createApiError, createSubAgentRelation, deleteSubAgentRelation, generateId, getAgentRelationById, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, updateAgentRelation, validateSubAgent } from "@inkeep/agents-core";
@@ -6,12 +6,12 @@ import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentRelationApiIn
6
6
  //#region src/routes/subAgentRelations.ts
7
7
  const app = new OpenAPIHono();
8
8
  app.use("/", async (c, next) => {
9
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
9
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
10
10
  return next();
11
11
  });
12
12
  app.use("/:id", async (c, next) => {
13
- if (c.req.method === "PUT") return requirePermission({ sub_agent: ["update"] })(c, next);
14
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
13
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
14
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
15
15
  return next();
16
16
  });
17
17
  app.openapi(createRoute({
@@ -1,4 +1,4 @@
1
- import { requirePermission } from "../middleware/require-permission.js";
1
+ import { requireProjectPermission } from "../middleware/project-access.js";
2
2
  import { speakeasyOffsetLimitPagination } from "./shared.js";
3
3
  import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
4
4
  import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, commonGetErrorResponses, createApiError, createSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, getSubAgentTeamAgentRelationById, listSubAgentTeamAgentRelations, updateSubAgentTeamAgentRelation } from "@inkeep/agents-core";
@@ -7,12 +7,12 @@ import { nanoid } from "nanoid";
7
7
  //#region src/routes/subAgentTeamAgentRelations.ts
8
8
  const app = new OpenAPIHono();
9
9
  app.use("/", async (c, next) => {
10
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
10
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
11
11
  return next();
12
12
  });
13
13
  app.use("/:id", async (c, next) => {
14
- if (c.req.method === "PUT") return requirePermission({ sub_agent: ["update"] })(c, next);
15
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
14
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
15
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
16
16
  return next();
17
17
  });
18
18
  app.openapi(createRoute({
@@ -1,4 +1,4 @@
1
- import { requirePermission } from "../middleware/require-permission.js";
1
+ import { requireProjectPermission } from "../middleware/project-access.js";
2
2
  import { speakeasyOffsetLimitPagination } from "./shared.js";
3
3
  import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
4
4
  import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, commonGetErrorResponses, createAgentToolRelation, createApiError, deleteAgentToolRelation, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsForTool, listAgentToolRelations, updateAgentToolRelation } from "@inkeep/agents-core";
@@ -6,12 +6,12 @@ import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentToolRelationA
6
6
  //#region src/routes/subAgentToolRelations.ts
7
7
  const app = new OpenAPIHono();
8
8
  app.use("/", async (c, next) => {
9
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
9
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
10
10
  return next();
11
11
  });
12
12
  app.use("/:id", async (c, next) => {
13
- if (c.req.method === "PUT") return requirePermission({ sub_agent: ["update"] })(c, next);
14
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
13
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
14
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
15
15
  return next();
16
16
  });
17
17
  app.openapi(createRoute({
@@ -1,5 +1,5 @@
1
1
  import runDbClient_default from "../data/db/runDbClient.js";
2
- import { requirePermission } from "../middleware/require-permission.js";
2
+ import { requireProjectPermission } from "../middleware/project-access.js";
3
3
  import { speakeasyOffsetLimitPagination } from "./shared.js";
4
4
  import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
5
5
  import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentIsDefaultError, SubAgentListResponse, SubAgentResponse, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, cascadeDeleteBySubAgent, commonGetErrorResponses, createApiError, createSubAgent, deleteSubAgent, generateId, getSubAgentById, listSubAgentsPaginated, updateSubAgent } from "@inkeep/agents-core";
@@ -7,12 +7,12 @@ import { ErrorResponseSchema, PaginationQueryParamsSchema, SubAgentApiInsertSche
7
7
  //#region src/routes/subAgents.ts
8
8
  const app = new OpenAPIHono();
9
9
  app.use("/", async (c, next) => {
10
- if (c.req.method === "POST") return requirePermission({ sub_agent: ["create"] })(c, next);
10
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
11
11
  return next();
12
12
  });
13
13
  app.use("/:id", async (c, next) => {
14
- if (c.req.method === "PUT") return requirePermission({ sub_agent: ["update"] })(c, next);
15
- if (c.req.method === "DELETE") return requirePermission({ sub_agent: ["delete"] })(c, next);
14
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
15
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
16
16
  return next();
17
17
  });
18
18
  app.openapi(createRoute({
@@ -1,5 +1,5 @@
1
1
  import { getLogger as getLogger$1 } from "../logger.js";
2
- import { requirePermission } from "../middleware/require-permission.js";
2
+ import { requireProjectPermission } from "../middleware/project-access.js";
3
3
  import { speakeasyOffsetLimitPagination } from "./shared.js";
4
4
  import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
5
5
  import { CredentialReferenceApiSelectSchema, CredentialReferenceResponse, McpToolListResponse, McpToolResponse, PaginationQueryParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiUpdateSchema, ToolStatusSchema, commonGetErrorResponses, createApiError, createTool, dbResultToMcpTool, deleteTool, generateId, getToolById, getUserScopedCredentialReference, listTools, updateTool } from "@inkeep/agents-core";
@@ -8,12 +8,12 @@ import { CredentialReferenceApiSelectSchema, CredentialReferenceResponse, McpToo
8
8
  const logger = getLogger$1("tools");
9
9
  const app = new OpenAPIHono();
10
10
  app.use("/", async (c, next) => {
11
- if (c.req.method === "POST") return requirePermission({ tool: ["create"] })(c, next);
11
+ if (c.req.method === "POST") return requireProjectPermission("edit")(c, next);
12
12
  return next();
13
13
  });
14
14
  app.use("/:id", async (c, next) => {
15
- if (c.req.method === "PUT") return requirePermission({ tool: ["update"] })(c, next);
16
- if (c.req.method === "DELETE") return requirePermission({ tool: ["delete"] })(c, next);
15
+ if (c.req.method === "PUT") return requireProjectPermission("edit")(c, next);
16
+ if (c.req.method === "DELETE") return requireProjectPermission("edit")(c, next);
17
17
  return next();
18
18
  });
19
19
  app.openapi(createRoute({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.0.0-dev-20260118170655",
3
+ "version": "0.0.0-dev-20260119163620",
4
4
  "description": "Agents Manage API for Inkeep Agent Framework - handles CRUD operations and OAuth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "openid-client": "^6.6.4",
30
30
  "pg": "^8.16.3",
31
31
  "pino": "^9.7.0",
32
- "@inkeep/agents-core": "^0.0.0-dev-20260118170655",
33
- "@inkeep/agents-manage-mcp": "^0.0.0-dev-20260118170655"
32
+ "@inkeep/agents-core": "^0.0.0-dev-20260119163620",
33
+ "@inkeep/agents-manage-mcp": "^0.0.0-dev-20260119163620"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@hono/zod-openapi": "^1.1.5",