@inkeep/agents-manage-api 0.24.2 → 0.26.0
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 +332 -135
- package/dist/index.js +333 -136
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -12,6 +12,7 @@ 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');
|
|
15
16
|
|
|
16
17
|
var __defProp = Object.defineProperty;
|
|
17
18
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -71,10 +72,10 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
|
|
|
71
72
|
await next();
|
|
72
73
|
return;
|
|
73
74
|
});
|
|
74
|
-
function setupOpenAPIRoutes(
|
|
75
|
-
|
|
75
|
+
function setupOpenAPIRoutes(app24) {
|
|
76
|
+
app24.get("/openapi.json", (c) => {
|
|
76
77
|
try {
|
|
77
|
-
const document =
|
|
78
|
+
const document = app24.getOpenAPIDocument({
|
|
78
79
|
openapi: "3.0.0",
|
|
79
80
|
info: {
|
|
80
81
|
title: "Inkeep Agents Manage API",
|
|
@@ -95,7 +96,7 @@ function setupOpenAPIRoutes(app23) {
|
|
|
95
96
|
return c.json({ error: "Failed to generate OpenAPI document", details: errorDetails }, 500);
|
|
96
97
|
}
|
|
97
98
|
});
|
|
98
|
-
|
|
99
|
+
app24.get(
|
|
99
100
|
"/docs",
|
|
100
101
|
swaggerUi.swaggerUI({
|
|
101
102
|
url: "/openapi.json",
|
|
@@ -577,6 +578,7 @@ app2.openapi(
|
|
|
577
578
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
578
579
|
const agentData = c.req.valid("json");
|
|
579
580
|
try {
|
|
581
|
+
logger2.info({}, "test agent data");
|
|
580
582
|
const validatedAgentData = agentsCore.AgentWithinContextOfProjectSchema.parse(agentData);
|
|
581
583
|
if (agentId !== validatedAgentData.id) {
|
|
582
584
|
throw agentsCore.createApiError({
|
|
@@ -1553,7 +1555,7 @@ app7.openapi(
|
|
|
1553
1555
|
}),
|
|
1554
1556
|
async (c) => {
|
|
1555
1557
|
const { tenantId, projectId, id } = c.req.valid("param");
|
|
1556
|
-
const credential = await agentsCore.
|
|
1558
|
+
const credential = await agentsCore.getCredentialReferenceWithResources(dbClient_default)({
|
|
1557
1559
|
scopes: { tenantId, projectId },
|
|
1558
1560
|
id
|
|
1559
1561
|
});
|
|
@@ -1956,7 +1958,7 @@ app9.openapi(
|
|
|
1956
1958
|
operationId: "list-external-agents",
|
|
1957
1959
|
tags: ["External Agents"],
|
|
1958
1960
|
request: {
|
|
1959
|
-
params: agentsCore.
|
|
1961
|
+
params: agentsCore.TenantProjectParamsSchema,
|
|
1960
1962
|
query: agentsCore.PaginationQueryParamsSchema
|
|
1961
1963
|
},
|
|
1962
1964
|
responses: {
|
|
@@ -1972,10 +1974,10 @@ app9.openapi(
|
|
|
1972
1974
|
}
|
|
1973
1975
|
}),
|
|
1974
1976
|
async (c) => {
|
|
1975
|
-
const { tenantId, projectId
|
|
1977
|
+
const { tenantId, projectId } = c.req.valid("param");
|
|
1976
1978
|
const { page, limit } = c.req.valid("query");
|
|
1977
1979
|
const result = await agentsCore.listExternalAgentsPaginated(dbClient_default)({
|
|
1978
|
-
scopes: { tenantId, projectId
|
|
1980
|
+
scopes: { tenantId, projectId },
|
|
1979
1981
|
pagination: { page, limit }
|
|
1980
1982
|
});
|
|
1981
1983
|
const dataWithType = {
|
|
@@ -1996,7 +1998,7 @@ app9.openapi(
|
|
|
1996
1998
|
operationId: "get-external-agent-by-id",
|
|
1997
1999
|
tags: ["External Agents"],
|
|
1998
2000
|
request: {
|
|
1999
|
-
params: agentsCore.
|
|
2001
|
+
params: agentsCore.TenantProjectIdParamsSchema
|
|
2000
2002
|
},
|
|
2001
2003
|
responses: {
|
|
2002
2004
|
200: {
|
|
@@ -2011,10 +2013,10 @@ app9.openapi(
|
|
|
2011
2013
|
}
|
|
2012
2014
|
}),
|
|
2013
2015
|
async (c) => {
|
|
2014
|
-
const { tenantId, projectId,
|
|
2016
|
+
const { tenantId, projectId, id } = c.req.valid("param");
|
|
2015
2017
|
const externalAgent = await agentsCore.getExternalAgent(dbClient_default)({
|
|
2016
|
-
scopes: { tenantId, projectId
|
|
2017
|
-
|
|
2018
|
+
scopes: { tenantId, projectId },
|
|
2019
|
+
externalAgentId: id
|
|
2018
2020
|
});
|
|
2019
2021
|
if (!externalAgent) {
|
|
2020
2022
|
throw agentsCore.createApiError({
|
|
@@ -2037,7 +2039,7 @@ app9.openapi(
|
|
|
2037
2039
|
operationId: "create-external-agent",
|
|
2038
2040
|
tags: ["External Agents"],
|
|
2039
2041
|
request: {
|
|
2040
|
-
params: agentsCore.
|
|
2042
|
+
params: agentsCore.TenantProjectParamsSchema,
|
|
2041
2043
|
body: {
|
|
2042
2044
|
content: {
|
|
2043
2045
|
"application/json": {
|
|
@@ -2059,18 +2061,16 @@ app9.openapi(
|
|
|
2059
2061
|
}
|
|
2060
2062
|
}),
|
|
2061
2063
|
async (c) => {
|
|
2062
|
-
const { tenantId, projectId
|
|
2064
|
+
const { tenantId, projectId } = c.req.valid("param");
|
|
2063
2065
|
const body = c.req.valid("json");
|
|
2064
2066
|
const externalAgentData = {
|
|
2065
2067
|
tenantId,
|
|
2066
2068
|
projectId,
|
|
2067
|
-
agentId,
|
|
2068
2069
|
id: body.id ? String(body.id) : agentsCore.generateId(),
|
|
2069
2070
|
name: body.name,
|
|
2070
2071
|
description: body.description,
|
|
2071
2072
|
baseUrl: body.baseUrl,
|
|
2072
|
-
credentialReferenceId: body.credentialReferenceId || void 0
|
|
2073
|
-
headers: body.headers || void 0
|
|
2073
|
+
credentialReferenceId: body.credentialReferenceId || void 0
|
|
2074
2074
|
};
|
|
2075
2075
|
const externalAgent = await agentsCore.createExternalAgent(dbClient_default)(externalAgentData);
|
|
2076
2076
|
const agentWithType = {
|
|
@@ -2088,7 +2088,7 @@ app9.openapi(
|
|
|
2088
2088
|
operationId: "update-external-agent",
|
|
2089
2089
|
tags: ["External Agents"],
|
|
2090
2090
|
request: {
|
|
2091
|
-
params: agentsCore.
|
|
2091
|
+
params: agentsCore.TenantProjectIdParamsSchema,
|
|
2092
2092
|
body: {
|
|
2093
2093
|
content: {
|
|
2094
2094
|
"application/json": {
|
|
@@ -2110,11 +2110,11 @@ app9.openapi(
|
|
|
2110
2110
|
}
|
|
2111
2111
|
}),
|
|
2112
2112
|
async (c) => {
|
|
2113
|
-
const { tenantId, projectId,
|
|
2113
|
+
const { tenantId, projectId, id } = c.req.valid("param");
|
|
2114
2114
|
const body = c.req.valid("json");
|
|
2115
2115
|
const updatedExternalAgent = await agentsCore.updateExternalAgent(dbClient_default)({
|
|
2116
|
-
scopes: { tenantId, projectId
|
|
2117
|
-
|
|
2116
|
+
scopes: { tenantId, projectId },
|
|
2117
|
+
externalAgentId: id,
|
|
2118
2118
|
data: body
|
|
2119
2119
|
});
|
|
2120
2120
|
if (!updatedExternalAgent) {
|
|
@@ -2138,7 +2138,7 @@ app9.openapi(
|
|
|
2138
2138
|
operationId: "delete-external-agent",
|
|
2139
2139
|
tags: ["External Agents"],
|
|
2140
2140
|
request: {
|
|
2141
|
-
params: agentsCore.
|
|
2141
|
+
params: agentsCore.TenantProjectIdParamsSchema
|
|
2142
2142
|
},
|
|
2143
2143
|
responses: {
|
|
2144
2144
|
204: {
|
|
@@ -2155,10 +2155,10 @@ app9.openapi(
|
|
|
2155
2155
|
}
|
|
2156
2156
|
}),
|
|
2157
2157
|
async (c) => {
|
|
2158
|
-
const { tenantId, projectId,
|
|
2158
|
+
const { tenantId, projectId, id } = c.req.valid("param");
|
|
2159
2159
|
const deleted = await agentsCore.deleteExternalAgent(dbClient_default)({
|
|
2160
|
-
scopes: { tenantId, projectId
|
|
2161
|
-
|
|
2160
|
+
scopes: { tenantId, projectId },
|
|
2161
|
+
externalAgentId: id
|
|
2162
2162
|
});
|
|
2163
2163
|
if (!deleted) {
|
|
2164
2164
|
throw agentsCore.createApiError({
|
|
@@ -3368,6 +3368,228 @@ app14.openapi(
|
|
|
3368
3368
|
var subAgentDataComponents_default = app14;
|
|
3369
3369
|
var app15 = new zodOpenapi.OpenAPIHono();
|
|
3370
3370
|
app15.openapi(
|
|
3371
|
+
zodOpenapi.createRoute({
|
|
3372
|
+
method: "get",
|
|
3373
|
+
path: "/",
|
|
3374
|
+
summary: "List Sub Agent External Agent Relations",
|
|
3375
|
+
operationId: "list-sub-agent-external-agent-relations",
|
|
3376
|
+
tags: ["Sub Agent External Agent Relations"],
|
|
3377
|
+
request: {
|
|
3378
|
+
params: agentsCore.TenantProjectAgentSubAgentParamsSchema,
|
|
3379
|
+
query: agentsCore.PaginationQueryParamsSchema
|
|
3380
|
+
},
|
|
3381
|
+
responses: {
|
|
3382
|
+
200: {
|
|
3383
|
+
description: "List of sub agent external agent relations retrieved successfully",
|
|
3384
|
+
content: {
|
|
3385
|
+
"application/json": {
|
|
3386
|
+
schema: agentsCore.ListResponseSchema(agentsCore.SubAgentExternalAgentRelationApiSelectSchema)
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3390
|
+
...agentsCore.commonGetErrorResponses
|
|
3391
|
+
}
|
|
3392
|
+
}),
|
|
3393
|
+
async (c) => {
|
|
3394
|
+
const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
|
|
3395
|
+
const { page = 1, limit = 10 } = c.req.valid("query");
|
|
3396
|
+
const pageNum = Number(page);
|
|
3397
|
+
const limitNum = Math.min(Number(limit), 100);
|
|
3398
|
+
try {
|
|
3399
|
+
const result = await agentsCore.listSubAgentExternalAgentRelations(dbClient_default)({
|
|
3400
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3401
|
+
pagination: { page: pageNum, limit: limitNum }
|
|
3402
|
+
});
|
|
3403
|
+
return c.json(result);
|
|
3404
|
+
} catch (_error) {
|
|
3405
|
+
throw agentsCore.createApiError({
|
|
3406
|
+
code: "internal_server_error",
|
|
3407
|
+
message: "Failed to retrieve sub agent external agent relations"
|
|
3408
|
+
});
|
|
3409
|
+
}
|
|
3410
|
+
}
|
|
3411
|
+
);
|
|
3412
|
+
app15.openapi(
|
|
3413
|
+
zodOpenapi.createRoute({
|
|
3414
|
+
method: "get",
|
|
3415
|
+
path: "/{id}",
|
|
3416
|
+
summary: "Get Sub Agent External Agent Relation",
|
|
3417
|
+
operationId: "get-sub-agent-external-agent-relation-by-id",
|
|
3418
|
+
tags: ["Sub Agent External Agent Relations"],
|
|
3419
|
+
request: {
|
|
3420
|
+
params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema
|
|
3421
|
+
},
|
|
3422
|
+
responses: {
|
|
3423
|
+
200: {
|
|
3424
|
+
description: "Sub Agent external agent relation found",
|
|
3425
|
+
content: {
|
|
3426
|
+
"application/json": {
|
|
3427
|
+
schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentExternalAgentRelationApiSelectSchema)
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3431
|
+
...agentsCore.commonGetErrorResponses
|
|
3432
|
+
}
|
|
3433
|
+
}),
|
|
3434
|
+
async (c) => {
|
|
3435
|
+
const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
|
|
3436
|
+
const relation = await agentsCore.getSubAgentExternalAgentRelationById(dbClient_default)({
|
|
3437
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3438
|
+
relationId: id
|
|
3439
|
+
});
|
|
3440
|
+
if (!relation) {
|
|
3441
|
+
throw agentsCore.createApiError({
|
|
3442
|
+
code: "not_found",
|
|
3443
|
+
message: "Sub Agent External Agent Relation not found"
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
return c.json({ data: relation });
|
|
3447
|
+
}
|
|
3448
|
+
);
|
|
3449
|
+
app15.openapi(
|
|
3450
|
+
zodOpenapi.createRoute({
|
|
3451
|
+
method: "post",
|
|
3452
|
+
path: "/",
|
|
3453
|
+
summary: "Create Sub Agent External Agent Relation",
|
|
3454
|
+
operationId: "create-sub-agent-external-agent-relation",
|
|
3455
|
+
tags: ["Sub Agent External Agent Relations"],
|
|
3456
|
+
request: {
|
|
3457
|
+
params: agentsCore.TenantProjectAgentSubAgentParamsSchema,
|
|
3458
|
+
body: {
|
|
3459
|
+
content: {
|
|
3460
|
+
"application/json": {
|
|
3461
|
+
schema: agentsCore.SubAgentExternalAgentRelationApiInsertSchema
|
|
3462
|
+
}
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
},
|
|
3466
|
+
responses: {
|
|
3467
|
+
201: {
|
|
3468
|
+
description: "Sub Agent External Agent Relation created successfully",
|
|
3469
|
+
content: {
|
|
3470
|
+
"application/json": {
|
|
3471
|
+
schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentExternalAgentRelationApiSelectSchema)
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
},
|
|
3475
|
+
...agentsCore.commonGetErrorResponses
|
|
3476
|
+
}
|
|
3477
|
+
}),
|
|
3478
|
+
async (c) => {
|
|
3479
|
+
const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
|
|
3480
|
+
const body = await c.req.valid("json");
|
|
3481
|
+
const existingRelations = await agentsCore.listSubAgentExternalAgentRelations(dbClient_default)({
|
|
3482
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3483
|
+
pagination: { page: 1, limit: 1e3 }
|
|
3484
|
+
});
|
|
3485
|
+
const isDuplicate = existingRelations.data.some(
|
|
3486
|
+
(relation2) => relation2.externalAgentId === body.externalAgentId && relation2.subAgentId === subAgentId
|
|
3487
|
+
);
|
|
3488
|
+
if (isDuplicate) {
|
|
3489
|
+
throw agentsCore.createApiError({
|
|
3490
|
+
code: "unprocessable_entity",
|
|
3491
|
+
message: `A relation between this sub-agent and external agent already exists`
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
3494
|
+
const relation = await agentsCore.createSubAgentExternalAgentRelation(dbClient_default)({
|
|
3495
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3496
|
+
relationId: nanoid.nanoid(),
|
|
3497
|
+
data: {
|
|
3498
|
+
externalAgentId: body.externalAgentId,
|
|
3499
|
+
headers: body.headers || null
|
|
3500
|
+
}
|
|
3501
|
+
});
|
|
3502
|
+
return c.json({ data: relation }, 201);
|
|
3503
|
+
}
|
|
3504
|
+
);
|
|
3505
|
+
app15.openapi(
|
|
3506
|
+
zodOpenapi.createRoute({
|
|
3507
|
+
method: "put",
|
|
3508
|
+
path: "/{id}",
|
|
3509
|
+
summary: "Update Sub Agent External Agent Relation",
|
|
3510
|
+
operationId: "update-sub-agent-external-agent-relation",
|
|
3511
|
+
tags: ["Sub Agent External Agent Relations"],
|
|
3512
|
+
request: {
|
|
3513
|
+
params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema,
|
|
3514
|
+
body: {
|
|
3515
|
+
content: {
|
|
3516
|
+
"application/json": {
|
|
3517
|
+
schema: agentsCore.SubAgentExternalAgentRelationApiUpdateSchema
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
},
|
|
3522
|
+
responses: {
|
|
3523
|
+
200: {
|
|
3524
|
+
description: "Sub Agent external agent relation updated successfully",
|
|
3525
|
+
content: {
|
|
3526
|
+
"application/json": {
|
|
3527
|
+
schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentExternalAgentRelationApiSelectSchema)
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
},
|
|
3531
|
+
...agentsCore.commonGetErrorResponses
|
|
3532
|
+
}
|
|
3533
|
+
}),
|
|
3534
|
+
async (c) => {
|
|
3535
|
+
const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
|
|
3536
|
+
const body = await c.req.valid("json");
|
|
3537
|
+
const updatedRelation = await agentsCore.updateSubAgentExternalAgentRelation(dbClient_default)({
|
|
3538
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3539
|
+
relationId: id,
|
|
3540
|
+
data: body
|
|
3541
|
+
});
|
|
3542
|
+
if (!updatedRelation) {
|
|
3543
|
+
throw agentsCore.createApiError({
|
|
3544
|
+
code: "not_found",
|
|
3545
|
+
message: "Sub Agent External Agent Relation not found"
|
|
3546
|
+
});
|
|
3547
|
+
}
|
|
3548
|
+
return c.json({ data: updatedRelation });
|
|
3549
|
+
}
|
|
3550
|
+
);
|
|
3551
|
+
app15.openapi(
|
|
3552
|
+
zodOpenapi.createRoute({
|
|
3553
|
+
method: "delete",
|
|
3554
|
+
path: "/{id}",
|
|
3555
|
+
summary: "Delete Sub Agent External Agent Relation",
|
|
3556
|
+
operationId: "delete-sub-agent-external-agent-relation",
|
|
3557
|
+
tags: ["Sub Agent External Agent Relations"],
|
|
3558
|
+
request: {
|
|
3559
|
+
params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema
|
|
3560
|
+
},
|
|
3561
|
+
responses: {
|
|
3562
|
+
204: {
|
|
3563
|
+
description: "Sub Agent External Agent Relation deleted successfully"
|
|
3564
|
+
},
|
|
3565
|
+
404: {
|
|
3566
|
+
description: "Sub Agent External Agent Relation not found",
|
|
3567
|
+
content: {
|
|
3568
|
+
"application/json": {
|
|
3569
|
+
schema: agentsCore.ErrorResponseSchema
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
}),
|
|
3575
|
+
async (c) => {
|
|
3576
|
+
const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
|
|
3577
|
+
const deleted = await agentsCore.deleteSubAgentExternalAgentRelation(dbClient_default)({
|
|
3578
|
+
scopes: { tenantId, projectId, agentId, subAgentId },
|
|
3579
|
+
relationId: id
|
|
3580
|
+
});
|
|
3581
|
+
if (!deleted) {
|
|
3582
|
+
throw agentsCore.createApiError({
|
|
3583
|
+
code: "not_found",
|
|
3584
|
+
message: "Sub Agent External Agent Relation not found"
|
|
3585
|
+
});
|
|
3586
|
+
}
|
|
3587
|
+
return c.body(null, 204);
|
|
3588
|
+
}
|
|
3589
|
+
);
|
|
3590
|
+
var subAgentExternalAgentRelations_default = app15;
|
|
3591
|
+
var app16 = new zodOpenapi.OpenAPIHono();
|
|
3592
|
+
app16.openapi(
|
|
3371
3593
|
zodOpenapi.createRoute({
|
|
3372
3594
|
method: "get",
|
|
3373
3595
|
path: "/",
|
|
@@ -3392,13 +3614,7 @@ app15.openapi(
|
|
|
3392
3614
|
}),
|
|
3393
3615
|
async (c) => {
|
|
3394
3616
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
3395
|
-
const {
|
|
3396
|
-
page = 1,
|
|
3397
|
-
limit = 10,
|
|
3398
|
-
sourceSubAgentId,
|
|
3399
|
-
targetSubAgentId,
|
|
3400
|
-
externalSubAgentId
|
|
3401
|
-
} = c.req.valid("query");
|
|
3617
|
+
const { page = 1, limit = 10, sourceSubAgentId, targetSubAgentId } = c.req.valid("query");
|
|
3402
3618
|
const pageNum = Number(page);
|
|
3403
3619
|
const limitNum = Math.min(Number(limit), 100);
|
|
3404
3620
|
try {
|
|
@@ -3417,13 +3633,6 @@ app15.openapi(
|
|
|
3417
3633
|
pagination: { page: pageNum, limit: limitNum }
|
|
3418
3634
|
});
|
|
3419
3635
|
result = { ...rawResult, data: rawResult.data };
|
|
3420
|
-
} else if (externalSubAgentId) {
|
|
3421
|
-
const rawResult = await agentsCore.getExternalAgentRelations(dbClient_default)({
|
|
3422
|
-
scopes: { tenantId, projectId, agentId },
|
|
3423
|
-
externalSubAgentId,
|
|
3424
|
-
pagination: { page: pageNum, limit: limitNum }
|
|
3425
|
-
});
|
|
3426
|
-
result = { ...rawResult, data: rawResult.data };
|
|
3427
3636
|
} else {
|
|
3428
3637
|
const rawResult = await agentsCore.listAgentRelations(dbClient_default)({
|
|
3429
3638
|
scopes: { tenantId, projectId, agentId },
|
|
@@ -3440,7 +3649,7 @@ app15.openapi(
|
|
|
3440
3649
|
}
|
|
3441
3650
|
}
|
|
3442
3651
|
);
|
|
3443
|
-
|
|
3652
|
+
app16.openapi(
|
|
3444
3653
|
zodOpenapi.createRoute({
|
|
3445
3654
|
method: "get",
|
|
3446
3655
|
path: "/{id}",
|
|
@@ -3477,7 +3686,7 @@ app15.openapi(
|
|
|
3477
3686
|
return c.json({ data: agentRelation });
|
|
3478
3687
|
}
|
|
3479
3688
|
);
|
|
3480
|
-
|
|
3689
|
+
app16.openapi(
|
|
3481
3690
|
zodOpenapi.createRoute({
|
|
3482
3691
|
method: "post",
|
|
3483
3692
|
path: "/",
|
|
@@ -3509,26 +3718,14 @@ app15.openapi(
|
|
|
3509
3718
|
async (c) => {
|
|
3510
3719
|
const { tenantId, projectId, agentId } = c.req.valid("param");
|
|
3511
3720
|
const body = await c.req.valid("json");
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
const externalAgentExists = await agentsCore.validateExternalAgent(dbClient_default)({
|
|
3515
|
-
scopes: { tenantId, projectId, agentId, subAgentId: body.externalSubAgentId }
|
|
3516
|
-
});
|
|
3517
|
-
if (!externalAgentExists) {
|
|
3518
|
-
throw agentsCore.createApiError({
|
|
3519
|
-
code: "bad_request",
|
|
3520
|
-
message: `External agent with ID ${body.externalSubAgentId} not found`
|
|
3521
|
-
});
|
|
3522
|
-
}
|
|
3523
|
-
}
|
|
3524
|
-
if (!isExternalAgent && body.targetSubAgentId) {
|
|
3525
|
-
const internalAgentExists = await agentsCore.validateInternalSubAgent(dbClient_default)({
|
|
3721
|
+
if (body.targetSubAgentId) {
|
|
3722
|
+
const subAgentExists = await agentsCore.validateSubAgent(dbClient_default)({
|
|
3526
3723
|
scopes: { tenantId, projectId, agentId, subAgentId: body.targetSubAgentId }
|
|
3527
3724
|
});
|
|
3528
|
-
if (!
|
|
3725
|
+
if (!subAgentExists) {
|
|
3529
3726
|
throw agentsCore.createApiError({
|
|
3530
3727
|
code: "bad_request",
|
|
3531
|
-
message: `
|
|
3728
|
+
message: `Sub agent with ID ${body.targetSubAgentId} not found`
|
|
3532
3729
|
});
|
|
3533
3730
|
}
|
|
3534
3731
|
}
|
|
@@ -3540,16 +3737,12 @@ app15.openapi(
|
|
|
3540
3737
|
if (relation.agentId !== agentId || relation.sourceSubAgentId !== body.sourceSubAgentId) {
|
|
3541
3738
|
return false;
|
|
3542
3739
|
}
|
|
3543
|
-
if (isExternalAgent) {
|
|
3544
|
-
return relation.externalSubAgentId === body.externalSubAgentId;
|
|
3545
|
-
}
|
|
3546
3740
|
return relation.targetSubAgentId === body.targetSubAgentId;
|
|
3547
3741
|
});
|
|
3548
3742
|
if (isDuplicate) {
|
|
3549
|
-
const agentType = isExternalAgent ? "external" : "internal";
|
|
3550
3743
|
throw agentsCore.createApiError({
|
|
3551
3744
|
code: "unprocessable_entity",
|
|
3552
|
-
message: `A relation between these agents
|
|
3745
|
+
message: `A relation between these agents in this agent already exists`
|
|
3553
3746
|
});
|
|
3554
3747
|
}
|
|
3555
3748
|
const relationData = {
|
|
@@ -3558,8 +3751,7 @@ app15.openapi(
|
|
|
3558
3751
|
id: agentsCore.generateId(),
|
|
3559
3752
|
projectId,
|
|
3560
3753
|
sourceSubAgentId: body.sourceSubAgentId,
|
|
3561
|
-
targetSubAgentId:
|
|
3562
|
-
externalSubAgentId: isExternalAgent ? body.externalSubAgentId : void 0,
|
|
3754
|
+
targetSubAgentId: body.targetSubAgentId,
|
|
3563
3755
|
relationType: body.relationType
|
|
3564
3756
|
};
|
|
3565
3757
|
const agentRelation = await agentsCore.createSubAgentRelation(dbClient_default)({
|
|
@@ -3568,7 +3760,7 @@ app15.openapi(
|
|
|
3568
3760
|
return c.json({ data: agentRelation }, 201);
|
|
3569
3761
|
}
|
|
3570
3762
|
);
|
|
3571
|
-
|
|
3763
|
+
app16.openapi(
|
|
3572
3764
|
zodOpenapi.createRoute({
|
|
3573
3765
|
method: "put",
|
|
3574
3766
|
path: "/{id}",
|
|
@@ -3614,7 +3806,7 @@ app15.openapi(
|
|
|
3614
3806
|
return c.json({ data: updatedAgentRelation });
|
|
3615
3807
|
}
|
|
3616
3808
|
);
|
|
3617
|
-
|
|
3809
|
+
app16.openapi(
|
|
3618
3810
|
zodOpenapi.createRoute({
|
|
3619
3811
|
method: "delete",
|
|
3620
3812
|
path: "/{id}",
|
|
@@ -3653,9 +3845,9 @@ app15.openapi(
|
|
|
3653
3845
|
return c.body(null, 204);
|
|
3654
3846
|
}
|
|
3655
3847
|
);
|
|
3656
|
-
var subAgentRelations_default =
|
|
3657
|
-
var
|
|
3658
|
-
|
|
3848
|
+
var subAgentRelations_default = app16;
|
|
3849
|
+
var app17 = new zodOpenapi.OpenAPIHono();
|
|
3850
|
+
app17.openapi(
|
|
3659
3851
|
zodOpenapi.createRoute({
|
|
3660
3852
|
method: "get",
|
|
3661
3853
|
path: "/",
|
|
@@ -3696,7 +3888,7 @@ app16.openapi(
|
|
|
3696
3888
|
return c.json(dataWithType);
|
|
3697
3889
|
}
|
|
3698
3890
|
);
|
|
3699
|
-
|
|
3891
|
+
app17.openapi(
|
|
3700
3892
|
zodOpenapi.createRoute({
|
|
3701
3893
|
method: "get",
|
|
3702
3894
|
path: "/{id}",
|
|
@@ -3737,7 +3929,7 @@ app16.openapi(
|
|
|
3737
3929
|
return c.json({ data: subAgentWithType });
|
|
3738
3930
|
}
|
|
3739
3931
|
);
|
|
3740
|
-
|
|
3932
|
+
app17.openapi(
|
|
3741
3933
|
zodOpenapi.createRoute({
|
|
3742
3934
|
method: "post",
|
|
3743
3935
|
path: "/",
|
|
@@ -3784,7 +3976,7 @@ app16.openapi(
|
|
|
3784
3976
|
return c.json({ data: subAgentWithType }, 201);
|
|
3785
3977
|
}
|
|
3786
3978
|
);
|
|
3787
|
-
|
|
3979
|
+
app17.openapi(
|
|
3788
3980
|
zodOpenapi.createRoute({
|
|
3789
3981
|
method: "put",
|
|
3790
3982
|
path: "/{id}",
|
|
@@ -3834,7 +4026,7 @@ app16.openapi(
|
|
|
3834
4026
|
return c.json({ data: subAgentWithType });
|
|
3835
4027
|
}
|
|
3836
4028
|
);
|
|
3837
|
-
|
|
4029
|
+
app17.openapi(
|
|
3838
4030
|
zodOpenapi.createRoute({
|
|
3839
4031
|
method: "delete",
|
|
3840
4032
|
path: "/{id}",
|
|
@@ -3873,9 +4065,9 @@ app16.openapi(
|
|
|
3873
4065
|
return c.body(null, 204);
|
|
3874
4066
|
}
|
|
3875
4067
|
);
|
|
3876
|
-
var subAgents_default =
|
|
3877
|
-
var
|
|
3878
|
-
|
|
4068
|
+
var subAgents_default = app17;
|
|
4069
|
+
var app18 = new zodOpenapi.OpenAPIHono();
|
|
4070
|
+
app18.openapi(
|
|
3879
4071
|
zodOpenapi.createRoute({
|
|
3880
4072
|
method: "get",
|
|
3881
4073
|
path: "/",
|
|
@@ -3937,7 +4129,7 @@ app17.openapi(
|
|
|
3937
4129
|
return c.json(result);
|
|
3938
4130
|
}
|
|
3939
4131
|
);
|
|
3940
|
-
|
|
4132
|
+
app18.openapi(
|
|
3941
4133
|
zodOpenapi.createRoute({
|
|
3942
4134
|
method: "get",
|
|
3943
4135
|
path: "/{id}",
|
|
@@ -3974,7 +4166,7 @@ app17.openapi(
|
|
|
3974
4166
|
return c.json({ data: agentToolRelation });
|
|
3975
4167
|
}
|
|
3976
4168
|
);
|
|
3977
|
-
|
|
4169
|
+
app18.openapi(
|
|
3978
4170
|
zodOpenapi.createRoute({
|
|
3979
4171
|
method: "get",
|
|
3980
4172
|
path: "/tool/{toolId}/sub-agents",
|
|
@@ -4010,7 +4202,7 @@ app17.openapi(
|
|
|
4010
4202
|
return c.json(dbResult);
|
|
4011
4203
|
}
|
|
4012
4204
|
);
|
|
4013
|
-
|
|
4205
|
+
app18.openapi(
|
|
4014
4206
|
zodOpenapi.createRoute({
|
|
4015
4207
|
method: "post",
|
|
4016
4208
|
path: "/",
|
|
@@ -4073,7 +4265,7 @@ app17.openapi(
|
|
|
4073
4265
|
}
|
|
4074
4266
|
}
|
|
4075
4267
|
);
|
|
4076
|
-
|
|
4268
|
+
app18.openapi(
|
|
4077
4269
|
zodOpenapi.createRoute({
|
|
4078
4270
|
method: "put",
|
|
4079
4271
|
path: "/{id}",
|
|
@@ -4126,7 +4318,7 @@ app17.openapi(
|
|
|
4126
4318
|
return c.json({ data: updatedAgentToolRelation });
|
|
4127
4319
|
}
|
|
4128
4320
|
);
|
|
4129
|
-
|
|
4321
|
+
app18.openapi(
|
|
4130
4322
|
zodOpenapi.createRoute({
|
|
4131
4323
|
method: "delete",
|
|
4132
4324
|
path: "/{id}",
|
|
@@ -4165,10 +4357,10 @@ app17.openapi(
|
|
|
4165
4357
|
return c.body(null, 204);
|
|
4166
4358
|
}
|
|
4167
4359
|
);
|
|
4168
|
-
var subAgentToolRelations_default =
|
|
4360
|
+
var subAgentToolRelations_default = app18;
|
|
4169
4361
|
var logger5 = agentsCore.getLogger("tools");
|
|
4170
|
-
var
|
|
4171
|
-
|
|
4362
|
+
var app19 = new zodOpenapi.OpenAPIHono();
|
|
4363
|
+
app19.openapi(
|
|
4172
4364
|
zodOpenapi.createRoute({
|
|
4173
4365
|
method: "get",
|
|
4174
4366
|
path: "/",
|
|
@@ -4228,7 +4420,7 @@ app18.openapi(
|
|
|
4228
4420
|
return c.json(result);
|
|
4229
4421
|
}
|
|
4230
4422
|
);
|
|
4231
|
-
|
|
4423
|
+
app19.openapi(
|
|
4232
4424
|
zodOpenapi.createRoute({
|
|
4233
4425
|
method: "get",
|
|
4234
4426
|
path: "/{id}",
|
|
@@ -4265,7 +4457,7 @@ app18.openapi(
|
|
|
4265
4457
|
});
|
|
4266
4458
|
}
|
|
4267
4459
|
);
|
|
4268
|
-
|
|
4460
|
+
app19.openapi(
|
|
4269
4461
|
zodOpenapi.createRoute({
|
|
4270
4462
|
method: "post",
|
|
4271
4463
|
path: "/",
|
|
@@ -4318,7 +4510,7 @@ app18.openapi(
|
|
|
4318
4510
|
);
|
|
4319
4511
|
}
|
|
4320
4512
|
);
|
|
4321
|
-
|
|
4513
|
+
app19.openapi(
|
|
4322
4514
|
zodOpenapi.createRoute({
|
|
4323
4515
|
method: "put",
|
|
4324
4516
|
path: "/{id}",
|
|
@@ -4379,7 +4571,7 @@ app18.openapi(
|
|
|
4379
4571
|
});
|
|
4380
4572
|
}
|
|
4381
4573
|
);
|
|
4382
|
-
|
|
4574
|
+
app19.openapi(
|
|
4383
4575
|
zodOpenapi.createRoute({
|
|
4384
4576
|
method: "delete",
|
|
4385
4577
|
path: "/{id}",
|
|
@@ -4415,38 +4607,42 @@ app18.openapi(
|
|
|
4415
4607
|
return c.body(null, 204);
|
|
4416
4608
|
}
|
|
4417
4609
|
);
|
|
4418
|
-
var tools_default =
|
|
4610
|
+
var tools_default = app19;
|
|
4419
4611
|
|
|
4420
4612
|
// src/routes/index.ts
|
|
4421
|
-
var
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4613
|
+
var app20 = new zodOpenapi.OpenAPIHono();
|
|
4614
|
+
app20.route("/projects", projects_default);
|
|
4615
|
+
app20.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
|
|
4616
|
+
app20.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
|
|
4617
|
+
app20.route(
|
|
4618
|
+
"/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/external-agent-relations",
|
|
4619
|
+
subAgentExternalAgentRelations_default
|
|
4620
|
+
);
|
|
4621
|
+
app20.route("/projects/:projectId/agents", agent_default);
|
|
4622
|
+
app20.route(
|
|
4427
4623
|
"/projects/:projectId/agents/:agentId/sub-agent-tool-relations",
|
|
4428
4624
|
subAgentToolRelations_default
|
|
4429
4625
|
);
|
|
4430
|
-
|
|
4626
|
+
app20.route(
|
|
4431
4627
|
"/projects/:projectId/agents/:agentId/sub-agent-artifact-components",
|
|
4432
4628
|
subAgentArtifactComponents_default
|
|
4433
4629
|
);
|
|
4434
|
-
|
|
4630
|
+
app20.route(
|
|
4435
4631
|
"/projects/:projectId/agents/:agentId/sub-agent-data-components",
|
|
4436
4632
|
subAgentDataComponents_default
|
|
4437
4633
|
);
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
var routes_default =
|
|
4634
|
+
app20.route("/projects/:projectId/artifact-components", artifactComponents_default);
|
|
4635
|
+
app20.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
|
|
4636
|
+
app20.route("/projects/:projectId/credentials", credentials_default);
|
|
4637
|
+
app20.route("/projects/:projectId/credential-stores", credentialStores_default);
|
|
4638
|
+
app20.route("/projects/:projectId/data-components", dataComponents_default);
|
|
4639
|
+
app20.route("/projects/:projectId/external-agents", externalAgents_default);
|
|
4640
|
+
app20.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
|
|
4641
|
+
app20.route("/projects/:projectId/functions", functions_default);
|
|
4642
|
+
app20.route("/projects/:projectId/tools", tools_default);
|
|
4643
|
+
app20.route("/projects/:projectId/api-keys", apiKeys_default);
|
|
4644
|
+
app20.route("/projects/:projectId/agent", agentFull_default);
|
|
4645
|
+
var routes_default = app20;
|
|
4450
4646
|
var logger6 = agentsCore.getLogger("oauth-service");
|
|
4451
4647
|
var pkceStore = /* @__PURE__ */ new Map();
|
|
4452
4648
|
function storePKCEVerifier(state, codeVerifier, toolId, tenantId, projectId, clientInformation, metadata, resourceUrl) {
|
|
@@ -4561,7 +4757,7 @@ var oauthService = new OAuthService();
|
|
|
4561
4757
|
// src/routes/oauth.ts
|
|
4562
4758
|
async function findOrCreateCredential(tenantId, projectId, credentialData) {
|
|
4563
4759
|
try {
|
|
4564
|
-
const existingCredential = await agentsCore.
|
|
4760
|
+
const existingCredential = await agentsCore.getCredentialReferenceWithResources(dbClient_default)({
|
|
4565
4761
|
scopes: { tenantId, projectId },
|
|
4566
4762
|
id: credentialData.id
|
|
4567
4763
|
});
|
|
@@ -4584,7 +4780,7 @@ async function findOrCreateCredential(tenantId, projectId, credentialData) {
|
|
|
4584
4780
|
throw new Error(`Failed to save credential '${credentialData.id}' to database`);
|
|
4585
4781
|
}
|
|
4586
4782
|
}
|
|
4587
|
-
var
|
|
4783
|
+
var app21 = new zodOpenapi.OpenAPIHono();
|
|
4588
4784
|
var logger7 = agentsCore.getLogger("oauth-callback");
|
|
4589
4785
|
function getBaseUrlFromRequest(c) {
|
|
4590
4786
|
const url = new URL(c.req.url);
|
|
@@ -4671,7 +4867,7 @@ var OAuthCallbackQuerySchema = zodOpenapi.z.object({
|
|
|
4671
4867
|
error: zodOpenapi.z.string().optional(),
|
|
4672
4868
|
error_description: zodOpenapi.z.string().optional()
|
|
4673
4869
|
});
|
|
4674
|
-
|
|
4870
|
+
app21.openapi(
|
|
4675
4871
|
zodOpenapi.createRoute({
|
|
4676
4872
|
method: "get",
|
|
4677
4873
|
path: "/login",
|
|
@@ -4736,7 +4932,7 @@ app20.openapi(
|
|
|
4736
4932
|
}
|
|
4737
4933
|
}
|
|
4738
4934
|
);
|
|
4739
|
-
|
|
4935
|
+
app21.openapi(
|
|
4740
4936
|
zodOpenapi.createRoute({
|
|
4741
4937
|
method: "get",
|
|
4742
4938
|
path: "/callback",
|
|
@@ -4878,9 +5074,9 @@ app20.openapi(
|
|
|
4878
5074
|
}
|
|
4879
5075
|
}
|
|
4880
5076
|
);
|
|
4881
|
-
var oauth_default =
|
|
5077
|
+
var oauth_default = app21;
|
|
4882
5078
|
var logger8 = agentsCore.getLogger("projectFull");
|
|
4883
|
-
var
|
|
5079
|
+
var app22 = new zodOpenapi.OpenAPIHono();
|
|
4884
5080
|
var ProjectIdParamsSchema = zod.z.object({
|
|
4885
5081
|
tenantId: zod.z.string().openapi({
|
|
4886
5082
|
description: "Tenant identifier",
|
|
@@ -4897,7 +5093,7 @@ var TenantParamsSchema2 = zod.z.object({
|
|
|
4897
5093
|
example: "tenant_123"
|
|
4898
5094
|
})
|
|
4899
5095
|
}).openapi("TenantParams");
|
|
4900
|
-
|
|
5096
|
+
app22.openapi(
|
|
4901
5097
|
zodOpenapi.createRoute({
|
|
4902
5098
|
method: "post",
|
|
4903
5099
|
path: "/project-full",
|
|
@@ -4939,6 +5135,7 @@ app21.openapi(
|
|
|
4939
5135
|
const { tenantId } = c.req.valid("param");
|
|
4940
5136
|
const projectData = c.req.valid("json");
|
|
4941
5137
|
const validatedProjectData = agentsCore.FullProjectDefinitionSchema.parse(projectData);
|
|
5138
|
+
console.log("validatedProjectData", validatedProjectData);
|
|
4942
5139
|
try {
|
|
4943
5140
|
const createdProject = await agentsCore.createFullProjectServerSide(dbClient_default, logger8)(
|
|
4944
5141
|
{ tenantId, projectId: validatedProjectData.id },
|
|
@@ -4956,7 +5153,7 @@ app21.openapi(
|
|
|
4956
5153
|
}
|
|
4957
5154
|
}
|
|
4958
5155
|
);
|
|
4959
|
-
|
|
5156
|
+
app22.openapi(
|
|
4960
5157
|
zodOpenapi.createRoute({
|
|
4961
5158
|
method: "get",
|
|
4962
5159
|
path: "/project-full/{projectId}",
|
|
@@ -5009,7 +5206,7 @@ app21.openapi(
|
|
|
5009
5206
|
}
|
|
5010
5207
|
}
|
|
5011
5208
|
);
|
|
5012
|
-
|
|
5209
|
+
app22.openapi(
|
|
5013
5210
|
zodOpenapi.createRoute({
|
|
5014
5211
|
method: "put",
|
|
5015
5212
|
path: "/project-full/{projectId}",
|
|
@@ -5093,7 +5290,7 @@ app21.openapi(
|
|
|
5093
5290
|
}
|
|
5094
5291
|
}
|
|
5095
5292
|
);
|
|
5096
|
-
|
|
5293
|
+
app22.openapi(
|
|
5097
5294
|
zodOpenapi.createRoute({
|
|
5098
5295
|
method: "delete",
|
|
5099
5296
|
path: "/project-full/{projectId}",
|
|
@@ -5141,20 +5338,20 @@ app21.openapi(
|
|
|
5141
5338
|
}
|
|
5142
5339
|
}
|
|
5143
5340
|
);
|
|
5144
|
-
var projectFull_default =
|
|
5341
|
+
var projectFull_default = app22;
|
|
5145
5342
|
|
|
5146
5343
|
// src/app.ts
|
|
5147
5344
|
var logger9 = agentsCore.getLogger("agents-manage-api");
|
|
5148
5345
|
logger9.info({ logger: logger9.getTransports() }, "Logger initialized");
|
|
5149
5346
|
function createManagementHono(serverConfig, credentialStores) {
|
|
5150
|
-
const
|
|
5151
|
-
|
|
5152
|
-
|
|
5347
|
+
const app24 = new zodOpenapi.OpenAPIHono();
|
|
5348
|
+
app24.use("*", requestId.requestId());
|
|
5349
|
+
app24.use("*", async (c, next) => {
|
|
5153
5350
|
c.set("serverConfig", serverConfig);
|
|
5154
5351
|
c.set("credentialStores", credentialStores);
|
|
5155
5352
|
return next();
|
|
5156
5353
|
});
|
|
5157
|
-
|
|
5354
|
+
app24.use(
|
|
5158
5355
|
honoPino.pinoLogger({
|
|
5159
5356
|
pino: agentsCore.getLogger("agents-manage-api").getPinoInstance(),
|
|
5160
5357
|
http: {
|
|
@@ -5167,7 +5364,7 @@ function createManagementHono(serverConfig, credentialStores) {
|
|
|
5167
5364
|
}
|
|
5168
5365
|
})
|
|
5169
5366
|
);
|
|
5170
|
-
|
|
5367
|
+
app24.onError(async (err, c) => {
|
|
5171
5368
|
const isExpectedError = err instanceof httpException.HTTPException;
|
|
5172
5369
|
const status = isExpectedError ? err.status : 500;
|
|
5173
5370
|
const requestId2 = c.get("requestId") || "unknown";
|
|
@@ -5242,7 +5439,7 @@ function createManagementHono(serverConfig, credentialStores) {
|
|
|
5242
5439
|
...instance && { instance }
|
|
5243
5440
|
});
|
|
5244
5441
|
});
|
|
5245
|
-
|
|
5442
|
+
app24.use(
|
|
5246
5443
|
"*",
|
|
5247
5444
|
cors.cors({
|
|
5248
5445
|
origin: (origin) => {
|
|
@@ -5256,7 +5453,7 @@ function createManagementHono(serverConfig, credentialStores) {
|
|
|
5256
5453
|
credentials: true
|
|
5257
5454
|
})
|
|
5258
5455
|
);
|
|
5259
|
-
|
|
5456
|
+
app24.openapi(
|
|
5260
5457
|
zodOpenapi.createRoute({
|
|
5261
5458
|
method: "get",
|
|
5262
5459
|
path: "/health",
|
|
@@ -5273,13 +5470,13 @@ function createManagementHono(serverConfig, credentialStores) {
|
|
|
5273
5470
|
return c.body(null, 204);
|
|
5274
5471
|
}
|
|
5275
5472
|
);
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
setupOpenAPIRoutes(
|
|
5473
|
+
app24.use("/tenants/*", apiKeyAuth());
|
|
5474
|
+
app24.route("/tenants/:tenantId", routes_default);
|
|
5475
|
+
app24.route("/tenants/:tenantId", projectFull_default);
|
|
5476
|
+
app24.route("/oauth", oauth_default);
|
|
5477
|
+
setupOpenAPIRoutes(app24);
|
|
5281
5478
|
const baseApp = new hono.Hono();
|
|
5282
|
-
baseApp.route("/",
|
|
5479
|
+
baseApp.route("/", app24);
|
|
5283
5480
|
return baseApp;
|
|
5284
5481
|
}
|
|
5285
5482
|
|
|
@@ -5295,8 +5492,8 @@ var defaultConfig = {
|
|
|
5295
5492
|
};
|
|
5296
5493
|
var defaultStores = agentsCore.createDefaultCredentialStores();
|
|
5297
5494
|
var defaultRegistry = new agentsCore.CredentialStoreRegistry(defaultStores);
|
|
5298
|
-
var
|
|
5299
|
-
var index_default =
|
|
5495
|
+
var app23 = createManagementHono(defaultConfig, defaultRegistry);
|
|
5496
|
+
var index_default = app23;
|
|
5300
5497
|
function createManagementApp(config) {
|
|
5301
5498
|
const serverConfig = config?.serverConfig ?? defaultConfig;
|
|
5302
5499
|
const stores = config?.credentialStores ?? defaultStores;
|