@inkeep/agents-manage-api 0.0.0-dev-20251209035832 → 0.0.0-dev-20251211233416

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, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, handleApiError, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, 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, 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, handleApiError, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, 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';
@@ -10760,6 +10760,7 @@ app23.openapi(
10760
10760
  const { page, limit, status } = c.req.valid("query");
10761
10761
  let result;
10762
10762
  const credentialStores = c.get("credentialStores");
10763
+ const userId = c.get("userId");
10763
10764
  if (status) {
10764
10765
  const dbResult = await listTools(dbClient_default)({
10765
10766
  scopes: { tenantId, projectId },
@@ -10768,7 +10769,7 @@ app23.openapi(
10768
10769
  result = {
10769
10770
  data: (await Promise.all(
10770
10771
  dbResult.data.map(
10771
- async (tool) => await dbResultToMcpTool(tool, dbClient_default, credentialStores)
10772
+ async (tool) => await dbResultToMcpTool(tool, dbClient_default, credentialStores, void 0, userId)
10772
10773
  )
10773
10774
  )).filter((tool) => tool.status === status),
10774
10775
  pagination: dbResult.pagination
@@ -10781,7 +10782,7 @@ app23.openapi(
10781
10782
  result = {
10782
10783
  data: await Promise.all(
10783
10784
  dbResult.data.map(
10784
- async (tool) => await dbResultToMcpTool(tool, dbClient_default, credentialStores)
10785
+ async (tool) => await dbResultToMcpTool(tool, dbClient_default, credentialStores, void 0, userId)
10785
10786
  )
10786
10787
  ),
10787
10788
  pagination: dbResult.pagination
@@ -10822,8 +10823,9 @@ app23.openapi(
10822
10823
  });
10823
10824
  }
10824
10825
  const credentialStores = c.get("credentialStores");
10826
+ const userId = c.get("userId");
10825
10827
  return c.json({
10826
- data: await dbResultToMcpTool(tool, dbClient_default, credentialStores)
10828
+ data: await dbResultToMcpTool(tool, dbClient_default, credentialStores, void 0, userId)
10827
10829
  });
10828
10830
  }
10829
10831
  );
@@ -10860,6 +10862,7 @@ app23.openapi(
10860
10862
  const { tenantId, projectId } = c.req.valid("param");
10861
10863
  const body2 = c.req.valid("json");
10862
10864
  const credentialStores = c.get("credentialStores");
10865
+ const userId = c.get("userId");
10863
10866
  logger5.info({ body: body2 }, "body");
10864
10867
  const id = body2.id || generateId();
10865
10868
  const tool = await createTool(dbClient_default)({
@@ -10869,12 +10872,13 @@ app23.openapi(
10869
10872
  name: body2.name,
10870
10873
  config: body2.config,
10871
10874
  credentialReferenceId: body2.credentialReferenceId,
10875
+ credentialScope: body2.credentialScope,
10872
10876
  imageUrl: body2.imageUrl,
10873
10877
  headers: body2.headers
10874
10878
  });
10875
10879
  return c.json(
10876
10880
  {
10877
- data: await dbResultToMcpTool(tool, dbClient_default, credentialStores)
10881
+ data: await dbResultToMcpTool(tool, dbClient_default, credentialStores, void 0, userId)
10878
10882
  },
10879
10883
  201
10880
10884
  );
@@ -10913,6 +10917,7 @@ app23.openapi(
10913
10917
  const { tenantId, projectId, id } = c.req.valid("param");
10914
10918
  const body2 = c.req.valid("json");
10915
10919
  const credentialStores = c.get("credentialStores");
10920
+ const userId = c.get("userId");
10916
10921
  if (Object.keys(body2).length === 0) {
10917
10922
  throw createApiError({
10918
10923
  code: "bad_request",
@@ -10926,6 +10931,7 @@ app23.openapi(
10926
10931
  name: body2.name,
10927
10932
  config: body2.config,
10928
10933
  credentialReferenceId: body2.credentialReferenceId,
10934
+ credentialScope: body2.credentialScope,
10929
10935
  imageUrl: body2.imageUrl,
10930
10936
  headers: body2.headers
10931
10937
  }
@@ -10937,10 +10943,56 @@ app23.openapi(
10937
10943
  });
10938
10944
  }
10939
10945
  return c.json({
10940
- data: await dbResultToMcpTool(updatedTool, dbClient_default, credentialStores)
10946
+ data: await dbResultToMcpTool(updatedTool, dbClient_default, credentialStores, void 0, userId)
10941
10947
  });
10942
10948
  }
10943
10949
  );
10950
+ app23.openapi(
10951
+ createRoute({
10952
+ method: "get",
10953
+ path: "/{id}/user-credential",
10954
+ summary: "Get User Credential for Tool",
10955
+ operationId: "get-user-credential-for-tool",
10956
+ tags: ["Tools"],
10957
+ request: {
10958
+ params: TenantProjectIdParamsSchema
10959
+ },
10960
+ responses: {
10961
+ 200: {
10962
+ description: "User credential retrieved successfully",
10963
+ content: {
10964
+ "application/json": {
10965
+ schema: CredentialReferenceResponse
10966
+ }
10967
+ }
10968
+ },
10969
+ ...commonGetErrorResponses
10970
+ }
10971
+ }),
10972
+ async (c) => {
10973
+ const { tenantId, projectId, id: toolId } = c.req.valid("param");
10974
+ const userId = c.get("userId");
10975
+ if (!userId) {
10976
+ throw createApiError({
10977
+ code: "unauthorized",
10978
+ message: "User ID required for user-scoped credential lookup"
10979
+ });
10980
+ }
10981
+ const credential = await getUserScopedCredentialReference(dbClient_default)({
10982
+ scopes: { tenantId, projectId },
10983
+ toolId,
10984
+ userId
10985
+ });
10986
+ if (!credential) {
10987
+ throw createApiError({
10988
+ code: "not_found",
10989
+ message: "User credential not found for this tool"
10990
+ });
10991
+ }
10992
+ const validatedCredential = CredentialReferenceApiSelectSchema.parse(credential);
10993
+ return c.json({ data: validatedCredential });
10994
+ }
10995
+ );
10944
10996
  app23.openapi(
10945
10997
  createRoute({
10946
10998
  method: "delete",
package/dist/factory.js CHANGED
@@ -1 +1 @@
1
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-ZGAP4KGO.js';
1
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-3TUIAUTG.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-ZGAP4KGO.js';
2
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-ZGAP4KGO.js';
1
+ import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-3TUIAUTG.js';
2
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-3TUIAUTG.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-20251209035832",
3
+ "version": "0.0.0-dev-20251211233416",
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-20251209035832",
36
- "@inkeep/agents-manage-mcp": "^0.0.0-dev-20251209035832"
35
+ "@inkeep/agents-manage-mcp": "^0.0.0-dev-20251211233416",
36
+ "@inkeep/agents-core": "^0.0.0-dev-20251211233416"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",