@inkeep/agents-manage-api 0.0.0-dev-20251212042017 → 0.0.0-dev-20251212052636

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.
@@ -1,5 +1,5 @@
1
1
  import { F, u, R, x, T, h, U, L, or, C, Vr, ce, ur, P } from './chunk-JCVMVG3J.js';
2
- import { loadEnvironmentFiles, createDatabaseClient, getLogger, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, RelatedAgentInfoListResponse, TenantProjectAgentSubAgentParamsSchema, getAgentSubAgentInfos, AgentWithinContextOfProjectResponse, TenantProjectAgentParamsSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, generateId, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, AgentWithinContextOfProjectSchema, createFullAgentServerSide, getFullAgent, updateFullAgentServerSide, deleteFullAgent, ApiKeyListResponse, listApiKeysPaginated, ApiKeyResponse, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, ArtifactComponentListResponse, listArtifactComponentsPaginated, ArtifactComponentResponse, getArtifactComponentById, ArtifactComponentApiInsertSchema, validatePropsAsJsonSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigListResponse, listContextConfigsPaginated, ContextConfigResponse, TenantProjectAgentIdParamsSchema, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, getConversationHistory, formatMessagesForLLMContext, CredentialStoreListResponseSchema, CreateCredentialInStoreResponseSchema, CreateCredentialInStoreRequestSchema, CredentialReferenceListResponse, listCredentialReferencesPaginated, ListResponseSchema, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithResources, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialReferenceById, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, DataComponentListResponse, listDataComponentsPaginated, DataComponentResponse, getDataComponent, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentListResponse, listExternalAgentsPaginated, ExternalAgentResponse, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, FunctionListResponse, listFunctions, FunctionResponse, getFunction, FunctionApiInsertSchema, upsertFunction, FunctionApiUpdateSchema, deleteFunction, FunctionToolListResponse, listFunctionTools, FunctionToolResponse, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, MCPCatalogListResponse, fetchComposioServers, MCPTransportType, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentArrayResponse, getArtifactComponentsForAgent, ComponentAssociationListResponse, getAgentsUsingArtifactComponent, SubAgentArtifactComponentResponse, SubAgentArtifactComponentApiInsertSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentArrayResponse, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentResponse, SubAgentDataComponentApiInsertSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentExternalAgentRelationListResponse, listSubAgentExternalAgentRelations, SubAgentExternalAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationListResponse, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, SubAgentRelationResponse, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentIsDefaultError, SubAgentTeamAgentRelationListResponse, listSubAgentTeamAgentRelations, SubAgentTeamAgentRelationResponse, getSubAgentTeamAgentRelationById, SubAgentTeamAgentRelationApiInsertSchema, createSubAgentTeamAgentRelation, SubAgentTeamAgentRelationApiUpdateSchema, updateSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, SubAgentToolRelationListResponse, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, SubAgentToolRelationResponse, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ThirdPartyMCPServerResponse, fetchSingleComposioServer, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, getUserScopedCredentialReference, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, handleApiError, validateAndGetApiKey } from '@inkeep/agents-core';
2
+ import { loadEnvironmentFiles, createDatabaseClient, getLogger, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, RelatedAgentInfoListResponse, TenantProjectAgentSubAgentParamsSchema, getAgentSubAgentInfos, AgentWithinContextOfProjectResponse, TenantProjectAgentParamsSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, generateId, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, AgentWithinContextOfProjectSchema, createFullAgentServerSide, getFullAgent, updateFullAgentServerSide, deleteFullAgent, ApiKeyListResponse, listApiKeysPaginated, ApiKeyResponse, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, ArtifactComponentListResponse, listArtifactComponentsPaginated, ArtifactComponentResponse, getArtifactComponentById, ArtifactComponentApiInsertSchema, validatePropsAsJsonSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigListResponse, listContextConfigsPaginated, ContextConfigResponse, TenantProjectAgentIdParamsSchema, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, getConversationHistory, formatMessagesForLLMContext, CredentialStoreListResponseSchema, CreateCredentialInStoreResponseSchema, CreateCredentialInStoreRequestSchema, CredentialReferenceListResponse, listCredentialReferencesPaginated, ListResponseSchema, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithResources, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialReferenceById, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, DataComponentListResponse, listDataComponentsPaginated, DataComponentResponse, getDataComponent, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentListResponse, listExternalAgentsPaginated, ExternalAgentResponse, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, FunctionListResponse, listFunctions, FunctionResponse, getFunction, FunctionApiInsertSchema, upsertFunction, FunctionApiUpdateSchema, deleteFunction, FunctionToolListResponse, listFunctionTools, FunctionToolResponse, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, MCPCatalogListResponse, fetchComposioServers, MCPTransportType, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentArrayResponse, getArtifactComponentsForAgent, ComponentAssociationListResponse, getAgentsUsingArtifactComponent, SubAgentArtifactComponentResponse, SubAgentArtifactComponentApiInsertSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentArrayResponse, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentResponse, SubAgentDataComponentApiInsertSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentExternalAgentRelationListResponse, listSubAgentExternalAgentRelations, SubAgentExternalAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationListResponse, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, SubAgentRelationResponse, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentIsDefaultError, SubAgentTeamAgentRelationListResponse, listSubAgentTeamAgentRelations, SubAgentTeamAgentRelationResponse, getSubAgentTeamAgentRelationById, SubAgentTeamAgentRelationApiInsertSchema, createSubAgentTeamAgentRelation, SubAgentTeamAgentRelationApiUpdateSchema, updateSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, SubAgentToolRelationListResponse, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, SubAgentToolRelationResponse, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ThirdPartyMCPServerResponse, fetchSingleComposioServer, getComposioOAuthRedirectUrl, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, getUserScopedCredentialReference, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, handleApiError, validateAndGetApiKey } from '@inkeep/agents-core';
3
3
  import { createAuth } from '@inkeep/agents-core/auth';
4
4
  import { z, OpenAPIHono, createRoute } from '@hono/zod-openapi';
5
5
  import { Hono } from 'hono';
@@ -8727,8 +8727,8 @@ app13.openapi(
8727
8727
  }
8728
8728
  }),
8729
8729
  async (c) => {
8730
- const { tenantId, projectId } = c.req.valid("param");
8731
- const composioServers = await fetchComposioServers(tenantId, projectId);
8730
+ c.req.valid("param");
8731
+ const composioServers = await fetchComposioServers();
8732
8732
  const allServers = [...PREBUILT_MCP_SERVERS, ...composioServers].sort(
8733
8733
  (a, b2) => a.name.localeCompare(b2.name)
8734
8734
  );
@@ -10744,7 +10744,17 @@ app21.openapi(
10744
10744
  var subAgentToolRelations_default = app21;
10745
10745
  var app22 = new OpenAPIHono();
10746
10746
  var ThirdPartyMCPServerBodySchema = z.object({
10747
- url: z.url().describe("The MCP server URL to fetch details for")
10747
+ url: z.url().describe("The MCP server URL to fetch details for"),
10748
+ credentialScope: z.enum(["project", "user"]).default("project").optional()
10749
+ });
10750
+ var GetOAuthRedirectBodySchema = z.object({
10751
+ url: z.url().describe("The MCP server URL"),
10752
+ credentialScope: z.enum(["project", "user"]).describe("The credential scope")
10753
+ });
10754
+ var OAuthRedirectResponse = z.object({
10755
+ data: z.object({
10756
+ redirectUrl: z.string().nullable()
10757
+ })
10748
10758
  });
10749
10759
  app22.openapi(
10750
10760
  createRoute({
@@ -10778,13 +10788,72 @@ app22.openapi(
10778
10788
  }),
10779
10789
  async (c) => {
10780
10790
  const { tenantId, projectId } = c.req.valid("param");
10781
- const { url } = c.req.valid("json");
10782
- const server = await fetchSingleComposioServer(tenantId, projectId, url);
10791
+ const { url, credentialScope } = c.req.valid("json");
10792
+ const userId = c.get("userId");
10793
+ const server = await fetchSingleComposioServer(
10794
+ tenantId,
10795
+ projectId,
10796
+ url,
10797
+ credentialScope ?? "project",
10798
+ userId
10799
+ );
10783
10800
  return c.json({
10784
10801
  data: server
10785
10802
  });
10786
10803
  }
10787
10804
  );
10805
+ app22.openapi(
10806
+ createRoute({
10807
+ method: "post",
10808
+ path: "/oauth-redirect",
10809
+ summary: "Get OAuth Redirect URL",
10810
+ operationId: "get-oauth-redirect-url",
10811
+ tags: ["Third-Party MCP Servers"],
10812
+ description: "Get the OAuth redirect URL for a third-party MCP server. Call this after scope selection to get the correct URL for the selected scope.",
10813
+ request: {
10814
+ params: TenantProjectParamsSchema,
10815
+ body: {
10816
+ content: {
10817
+ "application/json": {
10818
+ schema: GetOAuthRedirectBodySchema
10819
+ }
10820
+ }
10821
+ }
10822
+ },
10823
+ responses: {
10824
+ 200: {
10825
+ description: "OAuth redirect URL",
10826
+ content: {
10827
+ "application/json": {
10828
+ schema: OAuthRedirectResponse
10829
+ }
10830
+ }
10831
+ },
10832
+ ...commonGetErrorResponses
10833
+ }
10834
+ }),
10835
+ async (c) => {
10836
+ const { tenantId, projectId } = c.req.valid("param");
10837
+ const { url, credentialScope } = c.req.valid("json");
10838
+ const userId = c.get("userId");
10839
+ if (credentialScope === "user" && !userId) {
10840
+ throw createApiError({
10841
+ code: "bad_request",
10842
+ message: "User ID required for user-scoped credentials"
10843
+ });
10844
+ }
10845
+ const redirectUrl = await getComposioOAuthRedirectUrl(
10846
+ tenantId,
10847
+ projectId,
10848
+ url,
10849
+ credentialScope,
10850
+ userId
10851
+ );
10852
+ return c.json({
10853
+ data: { redirectUrl }
10854
+ });
10855
+ }
10856
+ );
10788
10857
  var thirdPartyMCPServers_default = app22;
10789
10858
  var logger6 = getLogger("tools");
10790
10859
  var app23 = new OpenAPIHono();
@@ -33710,7 +33779,8 @@ app25.all("/", async (c) => {
33710
33779
  const transport = new StreamableHTTPTransport();
33711
33780
  const noOpLogger = createConsoleLogger("error");
33712
33781
  const mcpServer = createMCPServer({
33713
- logger: noOpLogger
33782
+ logger: noOpLogger,
33783
+ serverURL: env.INKEEP_AGENTS_MANAGE_API_URL
33714
33784
  });
33715
33785
  await mcpServer.connect(transport);
33716
33786
  return transport.handleRequest(c);
package/dist/factory.js CHANGED
@@ -1 +1 @@
1
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-JF2QPWG5.js';
1
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-OR52SACL.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-JF2QPWG5.js';
2
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-JF2QPWG5.js';
1
+ import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-OR52SACL.js';
2
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-OR52SACL.js';
3
3
  import { createDefaultCredentialStores, CredentialStoreRegistry } from '@inkeep/agents-core';
4
4
  import { createAuth } from '@inkeep/agents-core/auth';
5
5
  export { Hono } from 'hono';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.0.0-dev-20251212042017",
3
+ "version": "0.0.0-dev-20251212052636",
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",
@@ -32,8 +32,8 @@
32
32
  "nanoid": "^5.1.5",
33
33
  "openid-client": "^6.6.4",
34
34
  "pino": "^9.7.0",
35
- "@inkeep/agents-core": "^0.0.0-dev-20251212042017",
36
- "@inkeep/agents-manage-mcp": "^0.0.0-dev-20251212042017"
35
+ "@inkeep/agents-core": "^0.0.0-dev-20251212052636",
36
+ "@inkeep/agents-manage-mcp": "^0.0.0-dev-20251212052636"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",