@inkeep/agents-manage-api 0.0.0-dev-20250916190005 → 0.0.0-dev-20250917200022

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/index.cjs CHANGED
@@ -11,64 +11,20 @@ var requestId = require('hono/request-id');
11
11
  var honoPino = require('hono-pino');
12
12
  var async_hooks = require('async_hooks');
13
13
  var pino = require('pino');
14
- var fs = require('fs');
15
- var path = require('path');
16
- var dotenv = require('dotenv');
17
14
  var zod = require('zod');
18
15
  var factory = require('hono/factory');
19
16
  var swaggerUi = require('@hono/swagger-ui');
20
17
  var nanoid = require('nanoid');
21
18
 
22
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
23
-
24
- function _interopNamespace(e) {
25
- if (e && e.__esModule) return e;
26
- var n = Object.create(null);
27
- if (e) {
28
- Object.keys(e).forEach(function (k) {
29
- if (k !== 'default') {
30
- var d = Object.getOwnPropertyDescriptor(e, k);
31
- Object.defineProperty(n, k, d.get ? d : {
32
- enumerable: true,
33
- get: function () { return e[k]; }
34
- });
35
- }
36
- });
37
- }
38
- n.default = e;
39
- return Object.freeze(n);
40
- }
41
-
42
- var fs__default = /*#__PURE__*/_interopDefault(fs);
43
- var path__default = /*#__PURE__*/_interopDefault(path);
44
- var dotenv__namespace = /*#__PURE__*/_interopNamespace(dotenv);
45
-
46
19
  var __defProp = Object.defineProperty;
47
20
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
48
21
  var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
49
- dotenv__namespace.config({ quiet: true });
50
- zod.z.enum(["development", "production"]).default("development");
51
- var environmentSchema = zod.z.enum(["development", "pentest", "production", "test"]);
52
- var criticalEnv = zod.z.object({
53
- ENVIRONMENT: environmentSchema
54
- }).parse(process.env);
55
- var loadEnvFile = () => {
56
- const envPath = path__default.default.resolve(process.cwd(), `.env.${criticalEnv.ENVIRONMENT}.nonsecret`);
57
- if (fs__default.default.existsSync(envPath)) {
58
- const envConfig = dotenv__namespace.parse(fs__default.default.readFileSync(envPath));
59
- for (const k in envConfig) {
60
- if (!(k in process.env)) {
61
- process.env[k] = envConfig[k];
62
- }
63
- }
64
- }
65
- };
66
- loadEnvFile();
22
+ agentsCore.loadEnvironmentFiles();
67
23
  var envSchema = zod.z.object({
68
24
  NODE_ENV: zod.z.enum(["development", "production", "test"]).optional(),
69
25
  ENVIRONMENT: zod.z.enum(["development", "production", "pentest", "test"]).optional(),
70
26
  AGENTS_MANAGE_API_URL: zod.z.string().optional().default("http://localhost:3002"),
71
- DB_FILE_NAME: zod.z.string().default("file:../local.db"),
27
+ DB_FILE_NAME: zod.z.string(),
72
28
  LOG_LEVEL: zod.z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
73
29
  NANGO_SECRET_KEY: zod.z.string().optional(),
74
30
  INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET: zod.z.string().optional()
@@ -3950,14 +3906,14 @@ function retrievePKCEVerifier(state) {
3950
3906
  return null;
3951
3907
  }
3952
3908
  var OAuthService = class {
3953
- constructor(config2 = {}) {
3909
+ constructor(config = {}) {
3954
3910
  __publicField(this, "defaultConfig");
3955
3911
  this.defaultConfig = {
3956
- defaultClientId: config2.defaultClientId || process.env.DEFAULT_OAUTH_CLIENT_ID || "mcp-client",
3957
- clientName: config2.clientName || process.env.OAUTH_CLIENT_NAME || "Inkeep Agent Framework",
3958
- clientUri: config2.clientUri || process.env.OAUTH_CLIENT_URI || "https://inkeep.com",
3959
- logoUri: config2.logoUri || process.env.OAUTH_CLIENT_LOGO_URI || "https://inkeep.com/images/logos/inkeep-logo-blue.svg",
3960
- redirectBaseUrl: config2.redirectBaseUrl || process.env.OAUTH_REDIRECT_BASE_URL || "http://localhost:3002"
3912
+ defaultClientId: config.defaultClientId || process.env.DEFAULT_OAUTH_CLIENT_ID || "mcp-client",
3913
+ clientName: config.clientName || process.env.OAUTH_CLIENT_NAME || "Inkeep Agent Framework",
3914
+ clientUri: config.clientUri || process.env.OAUTH_CLIENT_URI || "https://inkeep.com",
3915
+ logoUri: config.logoUri || process.env.OAUTH_CLIENT_LOGO_URI || "https://inkeep.com/images/logos/inkeep-logo-blue.svg",
3916
+ redirectBaseUrl: config.redirectBaseUrl || process.env.OAUTH_REDIRECT_BASE_URL || "http://localhost:3002"
3961
3917
  };
3962
3918
  }
3963
3919
  /**
@@ -4101,7 +4057,7 @@ var OAuthService = class {
4101
4057
  const tokenUrl = new URL(oAuthConfig.tokenUrl);
4102
4058
  const oauthServerUrl = `${tokenUrl.protocol}//${tokenUrl.host}`;
4103
4059
  logger6.info({ oauthServerUrl, clientId }, "Attempting openid-client discovery");
4104
- const config2 = await oauth.discovery(
4060
+ const config = await oauth.discovery(
4105
4061
  new URL(oauthServerUrl),
4106
4062
  clientId,
4107
4063
  void 0
@@ -4110,7 +4066,7 @@ var OAuthService = class {
4110
4066
  const callbackUrl = new URL(
4111
4067
  `${redirectUri}?${new URLSearchParams({ code, state: "unused" }).toString()}`
4112
4068
  );
4113
- return await oauth.authorizationCodeGrant(config2, callbackUrl, {
4069
+ return await oauth.authorizationCodeGrant(config, callbackUrl, {
4114
4070
  pkceCodeVerifier: codeVerifier
4115
4071
  });
4116
4072
  }
@@ -5353,9 +5309,9 @@ var defaultStores = agentsCore.createDefaultCredentialStores();
5353
5309
  var defaultRegistry = new agentsCore.CredentialStoreRegistry(defaultStores);
5354
5310
  var app19 = createManagementHono(defaultConfig, defaultRegistry);
5355
5311
  var index_default = app19;
5356
- function createManagementApp(config2) {
5357
- const serverConfig = config2?.serverConfig ?? defaultConfig;
5358
- const stores = config2?.credentialStores ?? defaultStores;
5312
+ function createManagementApp(config) {
5313
+ const serverConfig = config?.serverConfig ?? defaultConfig;
5314
+ const stores = config?.credentialStores ?? defaultStores;
5359
5315
  const registry = new agentsCore.CredentialStoreRegistry(stores);
5360
5316
  return createManagementHono(serverConfig, registry);
5361
5317
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getLogger as getLogger$1, createDatabaseClient, commonGetErrorResponses, TenantProjectParamsSchema, ArtifactComponentApiSelectSchema, getArtifactComponentsForAgent, getAgentsUsingArtifactComponent, ErrorResponseSchema, SingleResponseSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, getAgentById, getArtifactComponentById, createApiError, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentApiSelectSchema, getDataComponentsForAgent, getAgentsUsingDataComponent, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, getDataComponent, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, ListResponseSchema, PaginationQueryParamsSchema, AgentGraphApiSelectSchema, listAgentGraphs, IdParamsSchema, getAgentGraph, getGraphAgentInfos, FullGraphDefinitionSchema, getFullGraphDefinition, AgentGraphApiInsertSchema, createAgentGraph, AgentGraphApiUpdateSchema, updateAgentGraph, deleteAgentGraph, AgentRelationApiSelectSchema, AgentRelationQuerySchema, getAgentRelationsBySource, getAgentRelationsByTarget, getExternalAgentRelations, listAgentRelations, getAgentRelationById, AgentRelationApiInsertSchema, validateExternalAgent, validateInternalAgent, createAgentRelation, AgentRelationApiUpdateSchema, updateAgentRelation, deleteAgentRelation, AgentApiSelectSchema, listAgentsPaginated, TenantProjectIdParamsSchema, AgentApiInsertSchema, createAgent, AgentApiUpdateSchema, updateAgent, deleteAgent, AgentToolRelationApiSelectSchema, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, getAgentToolRelationById, getToolsForAgent, getAgentsForTool, AgentToolRelationApiInsertSchema, createAgentToolRelation, AgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ApiKeyApiSelectSchema, listApiKeysPaginated, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, listArtifactComponentsPaginated, ArtifactComponentApiInsertSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigApiSelectSchema, listContextConfigsPaginated, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, CredentialReferenceApiSelectSchema, listCredentialReferencesPaginated, getCredentialReferenceById, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, listDataComponentsPaginated, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentApiSelectSchema, listExternalAgentsPaginated, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, createFullGraphServerSide, getFullGraph, updateFullGraphServerSide, deleteFullGraph, TenantParamsSchema, ProjectApiSelectSchema, listProjectsPaginated, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, McpToolSchema, ToolStatusSchema, listToolsByStatus, dbResultToMcpTool, listTools, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, getCredentialReference, CredentialStoreType, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, createDefaultCredentialStores, CredentialStoreRegistry, ContextResolver, CredentialStuffer, McpClient, detectAuthenticationRequired, handleApiError, MCPServerType, MCPTransportType } from '@inkeep/agents-core';
1
+ import { loadEnvironmentFiles, getLogger as getLogger$1, createDatabaseClient, commonGetErrorResponses, TenantProjectParamsSchema, ArtifactComponentApiSelectSchema, getArtifactComponentsForAgent, getAgentsUsingArtifactComponent, ErrorResponseSchema, SingleResponseSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, getAgentById, getArtifactComponentById, createApiError, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentApiSelectSchema, getDataComponentsForAgent, getAgentsUsingDataComponent, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, getDataComponent, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, ListResponseSchema, PaginationQueryParamsSchema, AgentGraphApiSelectSchema, listAgentGraphs, IdParamsSchema, getAgentGraph, getGraphAgentInfos, FullGraphDefinitionSchema, getFullGraphDefinition, AgentGraphApiInsertSchema, createAgentGraph, AgentGraphApiUpdateSchema, updateAgentGraph, deleteAgentGraph, AgentRelationApiSelectSchema, AgentRelationQuerySchema, getAgentRelationsBySource, getAgentRelationsByTarget, getExternalAgentRelations, listAgentRelations, getAgentRelationById, AgentRelationApiInsertSchema, validateExternalAgent, validateInternalAgent, createAgentRelation, AgentRelationApiUpdateSchema, updateAgentRelation, deleteAgentRelation, AgentApiSelectSchema, listAgentsPaginated, TenantProjectIdParamsSchema, AgentApiInsertSchema, createAgent, AgentApiUpdateSchema, updateAgent, deleteAgent, AgentToolRelationApiSelectSchema, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, getAgentToolRelationById, getToolsForAgent, getAgentsForTool, AgentToolRelationApiInsertSchema, createAgentToolRelation, AgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ApiKeyApiSelectSchema, listApiKeysPaginated, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, listArtifactComponentsPaginated, ArtifactComponentApiInsertSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigApiSelectSchema, listContextConfigsPaginated, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, CredentialReferenceApiSelectSchema, listCredentialReferencesPaginated, getCredentialReferenceById, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, listDataComponentsPaginated, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentApiSelectSchema, listExternalAgentsPaginated, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, createFullGraphServerSide, getFullGraph, updateFullGraphServerSide, deleteFullGraph, TenantParamsSchema, ProjectApiSelectSchema, listProjectsPaginated, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, McpToolSchema, ToolStatusSchema, listToolsByStatus, dbResultToMcpTool, listTools, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, getCredentialReference, CredentialStoreType, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, createDefaultCredentialStores, CredentialStoreRegistry, ContextResolver, CredentialStuffer, McpClient, detectAuthenticationRequired, handleApiError, MCPServerType, MCPTransportType } from '@inkeep/agents-core';
2
2
  import { OpenAPIHono, createRoute, z as z$1 } from '@hono/zod-openapi';
3
3
  import { Hono } from 'hono';
4
4
  import { cors } from 'hono/cors';
@@ -7,9 +7,6 @@ import { requestId } from 'hono/request-id';
7
7
  import { pinoLogger } from 'hono-pino';
8
8
  import { AsyncLocalStorage } from 'async_hooks';
9
9
  import { pino } from 'pino';
10
- import fs from 'fs';
11
- import path from 'path';
12
- import * as dotenv from 'dotenv';
13
10
  import { z } from 'zod';
14
11
  import { createMiddleware } from 'hono/factory';
15
12
  import { swaggerUI } from '@hono/swagger-ui';
@@ -18,29 +15,12 @@ import { nanoid } from 'nanoid';
18
15
  var __defProp = Object.defineProperty;
19
16
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
20
17
  var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
21
- dotenv.config({ quiet: true });
22
- z.enum(["development", "production"]).default("development");
23
- var environmentSchema = z.enum(["development", "pentest", "production", "test"]);
24
- var criticalEnv = z.object({
25
- ENVIRONMENT: environmentSchema
26
- }).parse(process.env);
27
- var loadEnvFile = () => {
28
- const envPath = path.resolve(process.cwd(), `.env.${criticalEnv.ENVIRONMENT}.nonsecret`);
29
- if (fs.existsSync(envPath)) {
30
- const envConfig = dotenv.parse(fs.readFileSync(envPath));
31
- for (const k in envConfig) {
32
- if (!(k in process.env)) {
33
- process.env[k] = envConfig[k];
34
- }
35
- }
36
- }
37
- };
38
- loadEnvFile();
18
+ loadEnvironmentFiles();
39
19
  var envSchema = z.object({
40
20
  NODE_ENV: z.enum(["development", "production", "test"]).optional(),
41
21
  ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional(),
42
22
  AGENTS_MANAGE_API_URL: z.string().optional().default("http://localhost:3002"),
43
- DB_FILE_NAME: z.string().default("file:../local.db"),
23
+ DB_FILE_NAME: z.string(),
44
24
  LOG_LEVEL: z.enum(["trace", "debug", "info", "warn", "error"]).optional().default("debug"),
45
25
  NANGO_SECRET_KEY: z.string().optional(),
46
26
  INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET: z.string().optional()
@@ -3922,14 +3902,14 @@ function retrievePKCEVerifier(state) {
3922
3902
  return null;
3923
3903
  }
3924
3904
  var OAuthService = class {
3925
- constructor(config2 = {}) {
3905
+ constructor(config = {}) {
3926
3906
  __publicField(this, "defaultConfig");
3927
3907
  this.defaultConfig = {
3928
- defaultClientId: config2.defaultClientId || process.env.DEFAULT_OAUTH_CLIENT_ID || "mcp-client",
3929
- clientName: config2.clientName || process.env.OAUTH_CLIENT_NAME || "Inkeep Agent Framework",
3930
- clientUri: config2.clientUri || process.env.OAUTH_CLIENT_URI || "https://inkeep.com",
3931
- logoUri: config2.logoUri || process.env.OAUTH_CLIENT_LOGO_URI || "https://inkeep.com/images/logos/inkeep-logo-blue.svg",
3932
- redirectBaseUrl: config2.redirectBaseUrl || process.env.OAUTH_REDIRECT_BASE_URL || "http://localhost:3002"
3908
+ defaultClientId: config.defaultClientId || process.env.DEFAULT_OAUTH_CLIENT_ID || "mcp-client",
3909
+ clientName: config.clientName || process.env.OAUTH_CLIENT_NAME || "Inkeep Agent Framework",
3910
+ clientUri: config.clientUri || process.env.OAUTH_CLIENT_URI || "https://inkeep.com",
3911
+ logoUri: config.logoUri || process.env.OAUTH_CLIENT_LOGO_URI || "https://inkeep.com/images/logos/inkeep-logo-blue.svg",
3912
+ redirectBaseUrl: config.redirectBaseUrl || process.env.OAUTH_REDIRECT_BASE_URL || "http://localhost:3002"
3933
3913
  };
3934
3914
  }
3935
3915
  /**
@@ -4073,7 +4053,7 @@ var OAuthService = class {
4073
4053
  const tokenUrl = new URL(oAuthConfig.tokenUrl);
4074
4054
  const oauthServerUrl = `${tokenUrl.protocol}//${tokenUrl.host}`;
4075
4055
  logger6.info({ oauthServerUrl, clientId }, "Attempting openid-client discovery");
4076
- const config2 = await oauth.discovery(
4056
+ const config = await oauth.discovery(
4077
4057
  new URL(oauthServerUrl),
4078
4058
  clientId,
4079
4059
  void 0
@@ -4082,7 +4062,7 @@ var OAuthService = class {
4082
4062
  const callbackUrl = new URL(
4083
4063
  `${redirectUri}?${new URLSearchParams({ code, state: "unused" }).toString()}`
4084
4064
  );
4085
- return await oauth.authorizationCodeGrant(config2, callbackUrl, {
4065
+ return await oauth.authorizationCodeGrant(config, callbackUrl, {
4086
4066
  pkceCodeVerifier: codeVerifier
4087
4067
  });
4088
4068
  }
@@ -5325,9 +5305,9 @@ var defaultStores = createDefaultCredentialStores();
5325
5305
  var defaultRegistry = new CredentialStoreRegistry(defaultStores);
5326
5306
  var app19 = createManagementHono(defaultConfig, defaultRegistry);
5327
5307
  var index_default = app19;
5328
- function createManagementApp(config2) {
5329
- const serverConfig = config2?.serverConfig ?? defaultConfig;
5330
- const stores = config2?.credentialStores ?? defaultStores;
5308
+ function createManagementApp(config) {
5309
+ const serverConfig = config?.serverConfig ?? defaultConfig;
5310
+ const stores = config?.credentialStores ?? defaultStores;
5331
5311
  const registry = new CredentialStoreRegistry(stores);
5332
5312
  return createManagementHono(serverConfig, registry);
5333
5313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.0.0-dev-20250916190005",
3
+ "version": "0.0.0-dev-20250917200022",
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",
@@ -24,7 +24,7 @@
24
24
  "openid-client": "^6.6.4",
25
25
  "pino": "^9.7.0",
26
26
  "zod": "^4.1.5",
27
- "@inkeep/agents-core": "^0.0.0-dev-20250916190005"
27
+ "@inkeep/agents-core": "^0.0.0-dev-20250917200022"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@hono/vite-dev-server": "^0.20.1",