@inkeep/agents-manage-api 0.24.1 → 0.24.2
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 +8 -9
- package/dist/index.js +9 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,6 @@ var honoPino = require('hono-pino');
|
|
|
12
12
|
var factory = require('hono/factory');
|
|
13
13
|
var zod = require('zod');
|
|
14
14
|
var swaggerUi = require('@hono/swagger-ui');
|
|
15
|
-
var nanoid = require('nanoid');
|
|
16
15
|
|
|
17
16
|
var __defProp = Object.defineProperty;
|
|
18
17
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -323,7 +322,7 @@ app.openapi(
|
|
|
323
322
|
const agent = await agentsCore.createAgent(dbClient_default)({
|
|
324
323
|
tenantId,
|
|
325
324
|
projectId,
|
|
326
|
-
id: validatedBody.id ||
|
|
325
|
+
id: validatedBody.id || agentsCore.generateId(),
|
|
327
326
|
name: validatedBody.name,
|
|
328
327
|
defaultSubAgentId: validatedBody.defaultSubAgentId,
|
|
329
328
|
contextConfigId: validatedBody.contextConfigId ?? void 0
|
|
@@ -1040,7 +1039,7 @@ app4.openapi(
|
|
|
1040
1039
|
});
|
|
1041
1040
|
}
|
|
1042
1041
|
}
|
|
1043
|
-
const finalId = body.id ? String(body.id) :
|
|
1042
|
+
const finalId = body.id ? String(body.id) : agentsCore.generateId();
|
|
1044
1043
|
const componentData = {
|
|
1045
1044
|
tenantId,
|
|
1046
1045
|
projectId,
|
|
@@ -2066,7 +2065,7 @@ app9.openapi(
|
|
|
2066
2065
|
tenantId,
|
|
2067
2066
|
projectId,
|
|
2068
2067
|
agentId,
|
|
2069
|
-
id: body.id ? String(body.id) :
|
|
2068
|
+
id: body.id ? String(body.id) : agentsCore.generateId(),
|
|
2070
2069
|
name: body.name,
|
|
2071
2070
|
description: body.description,
|
|
2072
2071
|
baseUrl: body.baseUrl,
|
|
@@ -2296,7 +2295,7 @@ app10.openapi(
|
|
|
2296
2295
|
const { tenantId, projectId } = c.req.valid("param");
|
|
2297
2296
|
const functionData = c.req.valid("json");
|
|
2298
2297
|
try {
|
|
2299
|
-
const id = functionData.id ||
|
|
2298
|
+
const id = functionData.id || agentsCore.generateId();
|
|
2300
2299
|
await agentsCore.upsertFunction(dbClient_default)({
|
|
2301
2300
|
data: {
|
|
2302
2301
|
...functionData,
|
|
@@ -2554,7 +2553,7 @@ app11.openapi(
|
|
|
2554
2553
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
2555
2554
|
const body = c.req.valid("json");
|
|
2556
2555
|
try {
|
|
2557
|
-
const id = body.id ||
|
|
2556
|
+
const id = body.id || agentsCore.generateId();
|
|
2558
2557
|
const functionTool = await agentsCore.createFunctionTool(dbClient_default)({
|
|
2559
2558
|
scopes: { tenantId, projectId, agentId },
|
|
2560
2559
|
data: {
|
|
@@ -3556,7 +3555,7 @@ app15.openapi(
|
|
|
3556
3555
|
const relationData = {
|
|
3557
3556
|
agentId,
|
|
3558
3557
|
tenantId,
|
|
3559
|
-
id:
|
|
3558
|
+
id: agentsCore.generateId(),
|
|
3560
3559
|
projectId,
|
|
3561
3560
|
sourceSubAgentId: body.sourceSubAgentId,
|
|
3562
3561
|
targetSubAgentId: isExternalAgent ? void 0 : body.targetSubAgentId,
|
|
@@ -3770,7 +3769,7 @@ app16.openapi(
|
|
|
3770
3769
|
async (c) => {
|
|
3771
3770
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
3772
3771
|
const body = c.req.valid("json");
|
|
3773
|
-
const subAgentId = body.id ? String(body.id) :
|
|
3772
|
+
const subAgentId = body.id ? String(body.id) : agentsCore.generateId();
|
|
3774
3773
|
const subAgent = await agentsCore.createSubAgent(dbClient_default)({
|
|
3775
3774
|
...body,
|
|
3776
3775
|
id: subAgentId,
|
|
@@ -4300,7 +4299,7 @@ app18.openapi(
|
|
|
4300
4299
|
const body = c.req.valid("json");
|
|
4301
4300
|
const credentialStores = c.get("credentialStores");
|
|
4302
4301
|
logger5.info({ body }, "body");
|
|
4303
|
-
const id = body.id ||
|
|
4302
|
+
const id = body.id || agentsCore.generateId();
|
|
4304
4303
|
const tool = await agentsCore.createTool(dbClient_default)({
|
|
4305
4304
|
tenantId,
|
|
4306
4305
|
projectId,
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadEnvironmentFiles, getLogger, createDatabaseClient, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, ListResponseSchema, getAgentSubAgentInfos, SingleResponseSchema, TenantProjectAgentParamsSchema, AgentWithinContextOfProjectSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, 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, CredentialStoreType, CredentialReferenceListResponse, listCredentialReferencesPaginated, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithTools, 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, FunctionToolApiSelectSchema, listFunctionTools, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentApiSelectSchema, getArtifactComponentsForAgent, getAgentsUsingArtifactComponent, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentApiSelectSchema, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentRelationApiSelectSchema, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, getExternalAgentRelations, listAgentRelations, getAgentRelationById, SubAgentRelationApiInsertSchema, validateExternalAgent, validateInternalSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentToolRelationApiSelectSchema, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, McpToolSchema, ToolStatusSchema, listTools, dbResultToMcpTool, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, generateIdFromName, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, createDefaultCredentialStores, CredentialStoreRegistry, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, handleApiError } from '@inkeep/agents-core';
|
|
1
|
+
import { loadEnvironmentFiles, getLogger, createDatabaseClient, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, ListResponseSchema, getAgentSubAgentInfos, SingleResponseSchema, TenantProjectAgentParamsSchema, AgentWithinContextOfProjectSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, generateId, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, 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, CredentialStoreType, CredentialReferenceListResponse, listCredentialReferencesPaginated, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithTools, 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, FunctionToolApiSelectSchema, listFunctionTools, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentApiSelectSchema, getArtifactComponentsForAgent, getAgentsUsingArtifactComponent, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentApiSelectSchema, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentRelationApiSelectSchema, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, getExternalAgentRelations, listAgentRelations, getAgentRelationById, SubAgentRelationApiInsertSchema, validateExternalAgent, validateInternalSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentToolRelationApiSelectSchema, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, McpToolSchema, ToolStatusSchema, listTools, dbResultToMcpTool, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, generateIdFromName, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, createDefaultCredentialStores, CredentialStoreRegistry, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, handleApiError } 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';
|
|
@@ -8,7 +8,6 @@ import { pinoLogger } from 'hono-pino';
|
|
|
8
8
|
import { createMiddleware } from 'hono/factory';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { swaggerUI } from '@hono/swagger-ui';
|
|
11
|
-
import { nanoid } from 'nanoid';
|
|
12
11
|
|
|
13
12
|
var __defProp = Object.defineProperty;
|
|
14
13
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -319,7 +318,7 @@ app.openapi(
|
|
|
319
318
|
const agent = await createAgent(dbClient_default)({
|
|
320
319
|
tenantId,
|
|
321
320
|
projectId,
|
|
322
|
-
id: validatedBody.id ||
|
|
321
|
+
id: validatedBody.id || generateId(),
|
|
323
322
|
name: validatedBody.name,
|
|
324
323
|
defaultSubAgentId: validatedBody.defaultSubAgentId,
|
|
325
324
|
contextConfigId: validatedBody.contextConfigId ?? void 0
|
|
@@ -1036,7 +1035,7 @@ app4.openapi(
|
|
|
1036
1035
|
});
|
|
1037
1036
|
}
|
|
1038
1037
|
}
|
|
1039
|
-
const finalId = body.id ? String(body.id) :
|
|
1038
|
+
const finalId = body.id ? String(body.id) : generateId();
|
|
1040
1039
|
const componentData = {
|
|
1041
1040
|
tenantId,
|
|
1042
1041
|
projectId,
|
|
@@ -2062,7 +2061,7 @@ app9.openapi(
|
|
|
2062
2061
|
tenantId,
|
|
2063
2062
|
projectId,
|
|
2064
2063
|
agentId,
|
|
2065
|
-
id: body.id ? String(body.id) :
|
|
2064
|
+
id: body.id ? String(body.id) : generateId(),
|
|
2066
2065
|
name: body.name,
|
|
2067
2066
|
description: body.description,
|
|
2068
2067
|
baseUrl: body.baseUrl,
|
|
@@ -2292,7 +2291,7 @@ app10.openapi(
|
|
|
2292
2291
|
const { tenantId, projectId } = c.req.valid("param");
|
|
2293
2292
|
const functionData = c.req.valid("json");
|
|
2294
2293
|
try {
|
|
2295
|
-
const id = functionData.id ||
|
|
2294
|
+
const id = functionData.id || generateId();
|
|
2296
2295
|
await upsertFunction(dbClient_default)({
|
|
2297
2296
|
data: {
|
|
2298
2297
|
...functionData,
|
|
@@ -2550,7 +2549,7 @@ app11.openapi(
|
|
|
2550
2549
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
2551
2550
|
const body = c.req.valid("json");
|
|
2552
2551
|
try {
|
|
2553
|
-
const id = body.id ||
|
|
2552
|
+
const id = body.id || generateId();
|
|
2554
2553
|
const functionTool = await createFunctionTool(dbClient_default)({
|
|
2555
2554
|
scopes: { tenantId, projectId, agentId },
|
|
2556
2555
|
data: {
|
|
@@ -3552,7 +3551,7 @@ app15.openapi(
|
|
|
3552
3551
|
const relationData = {
|
|
3553
3552
|
agentId,
|
|
3554
3553
|
tenantId,
|
|
3555
|
-
id:
|
|
3554
|
+
id: generateId(),
|
|
3556
3555
|
projectId,
|
|
3557
3556
|
sourceSubAgentId: body.sourceSubAgentId,
|
|
3558
3557
|
targetSubAgentId: isExternalAgent ? void 0 : body.targetSubAgentId,
|
|
@@ -3766,7 +3765,7 @@ app16.openapi(
|
|
|
3766
3765
|
async (c) => {
|
|
3767
3766
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
3768
3767
|
const body = c.req.valid("json");
|
|
3769
|
-
const subAgentId = body.id ? String(body.id) :
|
|
3768
|
+
const subAgentId = body.id ? String(body.id) : generateId();
|
|
3770
3769
|
const subAgent = await createSubAgent(dbClient_default)({
|
|
3771
3770
|
...body,
|
|
3772
3771
|
id: subAgentId,
|
|
@@ -4296,7 +4295,7 @@ app18.openapi(
|
|
|
4296
4295
|
const body = c.req.valid("json");
|
|
4297
4296
|
const credentialStores = c.get("credentialStores");
|
|
4298
4297
|
logger5.info({ body }, "body");
|
|
4299
|
-
const id = body.id ||
|
|
4298
|
+
const id = body.id || generateId();
|
|
4300
4299
|
const tool = await createTool(dbClient_default)({
|
|
4301
4300
|
tenantId,
|
|
4302
4301
|
projectId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-manage-api",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"openid-client": "^6.6.4",
|
|
24
24
|
"pino": "^9.7.0",
|
|
25
25
|
"zod": "^4.1.11",
|
|
26
|
-
"@inkeep/agents-core": "^0.24.
|
|
26
|
+
"@inkeep/agents-core": "^0.24.2"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
29
|
"keytar": "^7.9.0"
|