@inkeep/agents-manage-api 0.26.2 → 0.28.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.
Files changed (3) hide show
  1. package/dist/index.cjs +289 -63
  2. package/dist/index.js +290 -64
  3. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -72,10 +72,10 @@ var apiKeyAuth = () => factory.createMiddleware(async (c, next) => {
72
72
  await next();
73
73
  return;
74
74
  });
75
- function setupOpenAPIRoutes(app24) {
76
- app24.get("/openapi.json", (c) => {
75
+ function setupOpenAPIRoutes(app25) {
76
+ app25.get("/openapi.json", (c) => {
77
77
  try {
78
- const document = app24.getOpenAPIDocument({
78
+ const document = app25.getOpenAPIDocument({
79
79
  openapi: "3.0.0",
80
80
  info: {
81
81
  title: "Inkeep Agents Manage API",
@@ -96,7 +96,7 @@ function setupOpenAPIRoutes(app24) {
96
96
  return c.json({ error: "Failed to generate OpenAPI document", details: errorDetails }, 500);
97
97
  }
98
98
  });
99
- app24.get(
99
+ app25.get(
100
100
  "/docs",
101
101
  swaggerUi.swaggerUI({
102
102
  url: "/openapi.json",
@@ -4068,6 +4068,228 @@ app17.openapi(
4068
4068
  var subAgents_default = app17;
4069
4069
  var app18 = new zodOpenapi.OpenAPIHono();
4070
4070
  app18.openapi(
4071
+ zodOpenapi.createRoute({
4072
+ method: "get",
4073
+ path: "/",
4074
+ summary: "List Sub Agent Team Agent Relations",
4075
+ operationId: "list-sub-agent-team-agent-relations",
4076
+ tags: ["Sub Agent Team Agent Relations"],
4077
+ request: {
4078
+ params: agentsCore.TenantProjectAgentSubAgentParamsSchema,
4079
+ query: agentsCore.PaginationQueryParamsSchema
4080
+ },
4081
+ responses: {
4082
+ 200: {
4083
+ description: "List of sub agent team agent relations retrieved successfully",
4084
+ content: {
4085
+ "application/json": {
4086
+ schema: agentsCore.ListResponseSchema(agentsCore.SubAgentTeamAgentRelationApiSelectSchema)
4087
+ }
4088
+ }
4089
+ },
4090
+ ...agentsCore.commonGetErrorResponses
4091
+ }
4092
+ }),
4093
+ async (c) => {
4094
+ const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
4095
+ const { page = 1, limit = 10 } = c.req.valid("query");
4096
+ const pageNum = Number(page);
4097
+ const limitNum = Math.min(Number(limit), 100);
4098
+ try {
4099
+ const result = await agentsCore.listSubAgentTeamAgentRelations(dbClient_default)({
4100
+ scopes: { tenantId, projectId, agentId, subAgentId },
4101
+ pagination: { page: pageNum, limit: limitNum }
4102
+ });
4103
+ return c.json(result);
4104
+ } catch (_error) {
4105
+ throw agentsCore.createApiError({
4106
+ code: "internal_server_error",
4107
+ message: "Failed to retrieve sub agent team agent relations"
4108
+ });
4109
+ }
4110
+ }
4111
+ );
4112
+ app18.openapi(
4113
+ zodOpenapi.createRoute({
4114
+ method: "get",
4115
+ path: "/{id}",
4116
+ summary: "Get Sub Agent Team Agent Relation",
4117
+ operationId: "get-sub-agent-team-agent-relation-by-id",
4118
+ tags: ["Sub Agent Team Agent Relations"],
4119
+ request: {
4120
+ params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema
4121
+ },
4122
+ responses: {
4123
+ 200: {
4124
+ description: "Sub Agent team agent relation found",
4125
+ content: {
4126
+ "application/json": {
4127
+ schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentTeamAgentRelationApiSelectSchema)
4128
+ }
4129
+ }
4130
+ },
4131
+ ...agentsCore.commonGetErrorResponses
4132
+ }
4133
+ }),
4134
+ async (c) => {
4135
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4136
+ const relation = await agentsCore.getSubAgentTeamAgentRelationById(dbClient_default)({
4137
+ scopes: { tenantId, projectId, agentId, subAgentId },
4138
+ relationId: id
4139
+ });
4140
+ if (!relation) {
4141
+ throw agentsCore.createApiError({
4142
+ code: "not_found",
4143
+ message: "Sub Agent Team Agent Relation not found"
4144
+ });
4145
+ }
4146
+ return c.json({ data: relation });
4147
+ }
4148
+ );
4149
+ app18.openapi(
4150
+ zodOpenapi.createRoute({
4151
+ method: "post",
4152
+ path: "/",
4153
+ summary: "Create Sub Agent Team Agent Relation",
4154
+ operationId: "create-sub-agent-team-agent-relation",
4155
+ tags: ["Sub Agent Team Agent Relations"],
4156
+ request: {
4157
+ params: agentsCore.TenantProjectAgentSubAgentParamsSchema,
4158
+ body: {
4159
+ content: {
4160
+ "application/json": {
4161
+ schema: agentsCore.SubAgentTeamAgentRelationApiInsertSchema
4162
+ }
4163
+ }
4164
+ }
4165
+ },
4166
+ responses: {
4167
+ 201: {
4168
+ description: "Sub Agent Team Agent Relation created successfully",
4169
+ content: {
4170
+ "application/json": {
4171
+ schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentTeamAgentRelationApiSelectSchema)
4172
+ }
4173
+ }
4174
+ },
4175
+ ...agentsCore.commonGetErrorResponses
4176
+ }
4177
+ }),
4178
+ async (c) => {
4179
+ const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
4180
+ const body = await c.req.valid("json");
4181
+ const existingRelations = await agentsCore.listSubAgentTeamAgentRelations(dbClient_default)({
4182
+ scopes: { tenantId, projectId, agentId, subAgentId },
4183
+ pagination: { page: 1, limit: 1e3 }
4184
+ });
4185
+ const isDuplicate = existingRelations.data.some(
4186
+ (relation2) => relation2.targetAgentId === body.targetAgentId && relation2.subAgentId === subAgentId
4187
+ );
4188
+ if (isDuplicate) {
4189
+ throw agentsCore.createApiError({
4190
+ code: "unprocessable_entity",
4191
+ message: `A relation between this sub-agent and team agent already exists`
4192
+ });
4193
+ }
4194
+ const relation = await agentsCore.createSubAgentTeamAgentRelation(dbClient_default)({
4195
+ scopes: { tenantId, projectId, agentId, subAgentId },
4196
+ relationId: nanoid.nanoid(),
4197
+ data: {
4198
+ targetAgentId: body.targetAgentId,
4199
+ headers: body.headers || null
4200
+ }
4201
+ });
4202
+ return c.json({ data: relation }, 201);
4203
+ }
4204
+ );
4205
+ app18.openapi(
4206
+ zodOpenapi.createRoute({
4207
+ method: "put",
4208
+ path: "/{id}",
4209
+ summary: "Update Sub Agent Team Agent Relation",
4210
+ operationId: "update-sub-agent-team-agent-relation",
4211
+ tags: ["Sub Agent Team Agent Relations"],
4212
+ request: {
4213
+ params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema,
4214
+ body: {
4215
+ content: {
4216
+ "application/json": {
4217
+ schema: agentsCore.SubAgentTeamAgentRelationApiUpdateSchema
4218
+ }
4219
+ }
4220
+ }
4221
+ },
4222
+ responses: {
4223
+ 200: {
4224
+ description: "Sub Agent team agent relation updated successfully",
4225
+ content: {
4226
+ "application/json": {
4227
+ schema: agentsCore.SingleResponseSchema(agentsCore.SubAgentTeamAgentRelationApiSelectSchema)
4228
+ }
4229
+ }
4230
+ },
4231
+ ...agentsCore.commonGetErrorResponses
4232
+ }
4233
+ }),
4234
+ async (c) => {
4235
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4236
+ const body = await c.req.valid("json");
4237
+ const updatedRelation = await agentsCore.updateSubAgentTeamAgentRelation(dbClient_default)({
4238
+ scopes: { tenantId, projectId, agentId, subAgentId },
4239
+ relationId: id,
4240
+ data: body
4241
+ });
4242
+ if (!updatedRelation) {
4243
+ throw agentsCore.createApiError({
4244
+ code: "not_found",
4245
+ message: "Sub Agent Team Agent Relation not found"
4246
+ });
4247
+ }
4248
+ return c.json({ data: updatedRelation });
4249
+ }
4250
+ );
4251
+ app18.openapi(
4252
+ zodOpenapi.createRoute({
4253
+ method: "delete",
4254
+ path: "/{id}",
4255
+ summary: "Delete Sub Agent Team Agent Relation",
4256
+ operationId: "delete-sub-agent-team-agent-relation",
4257
+ tags: ["Sub Agent Team Agent Relations"],
4258
+ request: {
4259
+ params: agentsCore.TenantProjectAgentSubAgentIdParamsSchema
4260
+ },
4261
+ responses: {
4262
+ 204: {
4263
+ description: "Sub Agent Team Agent Relation deleted successfully"
4264
+ },
4265
+ 404: {
4266
+ description: "Sub Agent Team Agent Relation not found",
4267
+ content: {
4268
+ "application/json": {
4269
+ schema: agentsCore.ErrorResponseSchema
4270
+ }
4271
+ }
4272
+ }
4273
+ }
4274
+ }),
4275
+ async (c) => {
4276
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4277
+ const deleted = await agentsCore.deleteSubAgentTeamAgentRelation(dbClient_default)({
4278
+ scopes: { tenantId, projectId, agentId, subAgentId },
4279
+ relationId: id
4280
+ });
4281
+ if (!deleted) {
4282
+ throw agentsCore.createApiError({
4283
+ code: "not_found",
4284
+ message: "Sub Agent Team Agent Relation not found"
4285
+ });
4286
+ }
4287
+ return c.body(null, 204);
4288
+ }
4289
+ );
4290
+ var subAgentTeamAgentRelations_default = app18;
4291
+ var app19 = new zodOpenapi.OpenAPIHono();
4292
+ app19.openapi(
4071
4293
  zodOpenapi.createRoute({
4072
4294
  method: "get",
4073
4295
  path: "/",
@@ -4129,7 +4351,7 @@ app18.openapi(
4129
4351
  return c.json(result);
4130
4352
  }
4131
4353
  );
4132
- app18.openapi(
4354
+ app19.openapi(
4133
4355
  zodOpenapi.createRoute({
4134
4356
  method: "get",
4135
4357
  path: "/{id}",
@@ -4166,7 +4388,7 @@ app18.openapi(
4166
4388
  return c.json({ data: agentToolRelation });
4167
4389
  }
4168
4390
  );
4169
- app18.openapi(
4391
+ app19.openapi(
4170
4392
  zodOpenapi.createRoute({
4171
4393
  method: "get",
4172
4394
  path: "/tool/{toolId}/sub-agents",
@@ -4202,7 +4424,7 @@ app18.openapi(
4202
4424
  return c.json(dbResult);
4203
4425
  }
4204
4426
  );
4205
- app18.openapi(
4427
+ app19.openapi(
4206
4428
  zodOpenapi.createRoute({
4207
4429
  method: "post",
4208
4430
  path: "/",
@@ -4265,7 +4487,7 @@ app18.openapi(
4265
4487
  }
4266
4488
  }
4267
4489
  );
4268
- app18.openapi(
4490
+ app19.openapi(
4269
4491
  zodOpenapi.createRoute({
4270
4492
  method: "put",
4271
4493
  path: "/{id}",
@@ -4318,7 +4540,7 @@ app18.openapi(
4318
4540
  return c.json({ data: updatedAgentToolRelation });
4319
4541
  }
4320
4542
  );
4321
- app18.openapi(
4543
+ app19.openapi(
4322
4544
  zodOpenapi.createRoute({
4323
4545
  method: "delete",
4324
4546
  path: "/{id}",
@@ -4357,10 +4579,10 @@ app18.openapi(
4357
4579
  return c.body(null, 204);
4358
4580
  }
4359
4581
  );
4360
- var subAgentToolRelations_default = app18;
4582
+ var subAgentToolRelations_default = app19;
4361
4583
  var logger5 = agentsCore.getLogger("tools");
4362
- var app19 = new zodOpenapi.OpenAPIHono();
4363
- app19.openapi(
4584
+ var app20 = new zodOpenapi.OpenAPIHono();
4585
+ app20.openapi(
4364
4586
  zodOpenapi.createRoute({
4365
4587
  method: "get",
4366
4588
  path: "/",
@@ -4420,7 +4642,7 @@ app19.openapi(
4420
4642
  return c.json(result);
4421
4643
  }
4422
4644
  );
4423
- app19.openapi(
4645
+ app20.openapi(
4424
4646
  zodOpenapi.createRoute({
4425
4647
  method: "get",
4426
4648
  path: "/{id}",
@@ -4457,7 +4679,7 @@ app19.openapi(
4457
4679
  });
4458
4680
  }
4459
4681
  );
4460
- app19.openapi(
4682
+ app20.openapi(
4461
4683
  zodOpenapi.createRoute({
4462
4684
  method: "post",
4463
4685
  path: "/",
@@ -4510,7 +4732,7 @@ app19.openapi(
4510
4732
  );
4511
4733
  }
4512
4734
  );
4513
- app19.openapi(
4735
+ app20.openapi(
4514
4736
  zodOpenapi.createRoute({
4515
4737
  method: "put",
4516
4738
  path: "/{id}",
@@ -4571,7 +4793,7 @@ app19.openapi(
4571
4793
  });
4572
4794
  }
4573
4795
  );
4574
- app19.openapi(
4796
+ app20.openapi(
4575
4797
  zodOpenapi.createRoute({
4576
4798
  method: "delete",
4577
4799
  path: "/{id}",
@@ -4607,42 +4829,46 @@ app19.openapi(
4607
4829
  return c.body(null, 204);
4608
4830
  }
4609
4831
  );
4610
- var tools_default = app19;
4832
+ var tools_default = app20;
4611
4833
 
4612
4834
  // src/routes/index.ts
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(
4835
+ var app21 = new zodOpenapi.OpenAPIHono();
4836
+ app21.route("/projects", projects_default);
4837
+ app21.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
4838
+ app21.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
4839
+ app21.route(
4618
4840
  "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/external-agent-relations",
4619
4841
  subAgentExternalAgentRelations_default
4620
4842
  );
4621
- app20.route("/projects/:projectId/agents", agent_default);
4622
- app20.route(
4843
+ app21.route(
4844
+ "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/team-agent-relations",
4845
+ subAgentTeamAgentRelations_default
4846
+ );
4847
+ app21.route("/projects/:projectId/agents", agent_default);
4848
+ app21.route(
4623
4849
  "/projects/:projectId/agents/:agentId/sub-agent-tool-relations",
4624
4850
  subAgentToolRelations_default
4625
4851
  );
4626
- app20.route(
4852
+ app21.route(
4627
4853
  "/projects/:projectId/agents/:agentId/sub-agent-artifact-components",
4628
4854
  subAgentArtifactComponents_default
4629
4855
  );
4630
- app20.route(
4856
+ app21.route(
4631
4857
  "/projects/:projectId/agents/:agentId/sub-agent-data-components",
4632
4858
  subAgentDataComponents_default
4633
4859
  );
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;
4860
+ app21.route("/projects/:projectId/artifact-components", artifactComponents_default);
4861
+ app21.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
4862
+ app21.route("/projects/:projectId/credentials", credentials_default);
4863
+ app21.route("/projects/:projectId/credential-stores", credentialStores_default);
4864
+ app21.route("/projects/:projectId/data-components", dataComponents_default);
4865
+ app21.route("/projects/:projectId/external-agents", externalAgents_default);
4866
+ app21.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
4867
+ app21.route("/projects/:projectId/functions", functions_default);
4868
+ app21.route("/projects/:projectId/tools", tools_default);
4869
+ app21.route("/projects/:projectId/api-keys", apiKeys_default);
4870
+ app21.route("/projects/:projectId/agent", agentFull_default);
4871
+ var routes_default = app21;
4646
4872
  var logger6 = agentsCore.getLogger("oauth-service");
4647
4873
  var pkceStore = /* @__PURE__ */ new Map();
4648
4874
  function storePKCEVerifier(state, codeVerifier, toolId, tenantId, projectId, clientInformation, metadata, resourceUrl) {
@@ -4780,7 +5006,7 @@ async function findOrCreateCredential(tenantId, projectId, credentialData) {
4780
5006
  throw new Error(`Failed to save credential '${credentialData.id}' to database`);
4781
5007
  }
4782
5008
  }
4783
- var app21 = new zodOpenapi.OpenAPIHono();
5009
+ var app22 = new zodOpenapi.OpenAPIHono();
4784
5010
  var logger7 = agentsCore.getLogger("oauth-callback");
4785
5011
  function getBaseUrlFromRequest(c) {
4786
5012
  const url = new URL(c.req.url);
@@ -4867,7 +5093,7 @@ var OAuthCallbackQuerySchema = zodOpenapi.z.object({
4867
5093
  error: zodOpenapi.z.string().optional(),
4868
5094
  error_description: zodOpenapi.z.string().optional()
4869
5095
  });
4870
- app21.openapi(
5096
+ app22.openapi(
4871
5097
  zodOpenapi.createRoute({
4872
5098
  method: "get",
4873
5099
  path: "/login",
@@ -4932,7 +5158,7 @@ app21.openapi(
4932
5158
  }
4933
5159
  }
4934
5160
  );
4935
- app21.openapi(
5161
+ app22.openapi(
4936
5162
  zodOpenapi.createRoute({
4937
5163
  method: "get",
4938
5164
  path: "/callback",
@@ -5074,9 +5300,9 @@ app21.openapi(
5074
5300
  }
5075
5301
  }
5076
5302
  );
5077
- var oauth_default = app21;
5303
+ var oauth_default = app22;
5078
5304
  var logger8 = agentsCore.getLogger("projectFull");
5079
- var app22 = new zodOpenapi.OpenAPIHono();
5305
+ var app23 = new zodOpenapi.OpenAPIHono();
5080
5306
  var ProjectIdParamsSchema = zod.z.object({
5081
5307
  tenantId: zod.z.string().openapi({
5082
5308
  description: "Tenant identifier",
@@ -5093,7 +5319,7 @@ var TenantParamsSchema2 = zod.z.object({
5093
5319
  example: "tenant_123"
5094
5320
  })
5095
5321
  }).openapi("TenantParams");
5096
- app22.openapi(
5322
+ app23.openapi(
5097
5323
  zodOpenapi.createRoute({
5098
5324
  method: "post",
5099
5325
  path: "/project-full",
@@ -5153,7 +5379,7 @@ app22.openapi(
5153
5379
  }
5154
5380
  }
5155
5381
  );
5156
- app22.openapi(
5382
+ app23.openapi(
5157
5383
  zodOpenapi.createRoute({
5158
5384
  method: "get",
5159
5385
  path: "/project-full/{projectId}",
@@ -5206,7 +5432,7 @@ app22.openapi(
5206
5432
  }
5207
5433
  }
5208
5434
  );
5209
- app22.openapi(
5435
+ app23.openapi(
5210
5436
  zodOpenapi.createRoute({
5211
5437
  method: "put",
5212
5438
  path: "/project-full/{projectId}",
@@ -5290,7 +5516,7 @@ app22.openapi(
5290
5516
  }
5291
5517
  }
5292
5518
  );
5293
- app22.openapi(
5519
+ app23.openapi(
5294
5520
  zodOpenapi.createRoute({
5295
5521
  method: "delete",
5296
5522
  path: "/project-full/{projectId}",
@@ -5338,20 +5564,20 @@ app22.openapi(
5338
5564
  }
5339
5565
  }
5340
5566
  );
5341
- var projectFull_default = app22;
5567
+ var projectFull_default = app23;
5342
5568
 
5343
5569
  // src/app.ts
5344
5570
  var logger9 = agentsCore.getLogger("agents-manage-api");
5345
5571
  logger9.info({ logger: logger9.getTransports() }, "Logger initialized");
5346
5572
  function createManagementHono(serverConfig, credentialStores) {
5347
- const app24 = new zodOpenapi.OpenAPIHono();
5348
- app24.use("*", requestId.requestId());
5349
- app24.use("*", async (c, next) => {
5573
+ const app25 = new zodOpenapi.OpenAPIHono();
5574
+ app25.use("*", requestId.requestId());
5575
+ app25.use("*", async (c, next) => {
5350
5576
  c.set("serverConfig", serverConfig);
5351
5577
  c.set("credentialStores", credentialStores);
5352
5578
  return next();
5353
5579
  });
5354
- app24.use(
5580
+ app25.use(
5355
5581
  honoPino.pinoLogger({
5356
5582
  pino: agentsCore.getLogger("agents-manage-api").getPinoInstance(),
5357
5583
  http: {
@@ -5364,7 +5590,7 @@ function createManagementHono(serverConfig, credentialStores) {
5364
5590
  }
5365
5591
  })
5366
5592
  );
5367
- app24.onError(async (err, c) => {
5593
+ app25.onError(async (err, c) => {
5368
5594
  const isExpectedError = err instanceof httpException.HTTPException;
5369
5595
  const status = isExpectedError ? err.status : 500;
5370
5596
  const requestId2 = c.get("requestId") || "unknown";
@@ -5439,7 +5665,7 @@ function createManagementHono(serverConfig, credentialStores) {
5439
5665
  ...instance && { instance }
5440
5666
  });
5441
5667
  });
5442
- app24.use(
5668
+ app25.use(
5443
5669
  "*",
5444
5670
  cors.cors({
5445
5671
  origin: (origin) => {
@@ -5453,7 +5679,7 @@ function createManagementHono(serverConfig, credentialStores) {
5453
5679
  credentials: true
5454
5680
  })
5455
5681
  );
5456
- app24.openapi(
5682
+ app25.openapi(
5457
5683
  zodOpenapi.createRoute({
5458
5684
  method: "get",
5459
5685
  path: "/health",
@@ -5470,13 +5696,13 @@ function createManagementHono(serverConfig, credentialStores) {
5470
5696
  return c.body(null, 204);
5471
5697
  }
5472
5698
  );
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);
5699
+ app25.use("/tenants/*", apiKeyAuth());
5700
+ app25.route("/tenants/:tenantId", routes_default);
5701
+ app25.route("/tenants/:tenantId", projectFull_default);
5702
+ app25.route("/oauth", oauth_default);
5703
+ setupOpenAPIRoutes(app25);
5478
5704
  const baseApp = new hono.Hono();
5479
- baseApp.route("/", app24);
5705
+ baseApp.route("/", app25);
5480
5706
  return baseApp;
5481
5707
  }
5482
5708
 
@@ -5492,8 +5718,8 @@ var defaultConfig = {
5492
5718
  };
5493
5719
  var defaultStores = agentsCore.createDefaultCredentialStores();
5494
5720
  var defaultRegistry = new agentsCore.CredentialStoreRegistry(defaultStores);
5495
- var app23 = createManagementHono(defaultConfig, defaultRegistry);
5496
- var index_default = app23;
5721
+ var app24 = createManagementHono(defaultConfig, defaultRegistry);
5722
+ var index_default = app24;
5497
5723
  function createManagementApp(config) {
5498
5724
  const serverConfig = config?.serverConfig ?? defaultConfig;
5499
5725
  const stores = config?.credentialStores ?? defaultStores;
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, 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, 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, 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, TenantProjectAgentSubAgentParamsSchema, SubAgentExternalAgentRelationApiSelectSchema, listSubAgentExternalAgentRelations, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationApiSelectSchema, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, 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, 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, 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, TenantProjectAgentSubAgentParamsSchema, SubAgentExternalAgentRelationApiSelectSchema, listSubAgentExternalAgentRelations, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationApiSelectSchema, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentTeamAgentRelationApiSelectSchema, listSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationById, SubAgentTeamAgentRelationApiInsertSchema, createSubAgentTeamAgentRelation, SubAgentTeamAgentRelationApiUpdateSchema, updateSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, 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';
@@ -68,10 +68,10 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
68
68
  await next();
69
69
  return;
70
70
  });
71
- function setupOpenAPIRoutes(app24) {
72
- app24.get("/openapi.json", (c) => {
71
+ function setupOpenAPIRoutes(app25) {
72
+ app25.get("/openapi.json", (c) => {
73
73
  try {
74
- const document = app24.getOpenAPIDocument({
74
+ const document = app25.getOpenAPIDocument({
75
75
  openapi: "3.0.0",
76
76
  info: {
77
77
  title: "Inkeep Agents Manage API",
@@ -92,7 +92,7 @@ function setupOpenAPIRoutes(app24) {
92
92
  return c.json({ error: "Failed to generate OpenAPI document", details: errorDetails }, 500);
93
93
  }
94
94
  });
95
- app24.get(
95
+ app25.get(
96
96
  "/docs",
97
97
  swaggerUI({
98
98
  url: "/openapi.json",
@@ -4064,6 +4064,228 @@ app17.openapi(
4064
4064
  var subAgents_default = app17;
4065
4065
  var app18 = new OpenAPIHono();
4066
4066
  app18.openapi(
4067
+ createRoute({
4068
+ method: "get",
4069
+ path: "/",
4070
+ summary: "List Sub Agent Team Agent Relations",
4071
+ operationId: "list-sub-agent-team-agent-relations",
4072
+ tags: ["Sub Agent Team Agent Relations"],
4073
+ request: {
4074
+ params: TenantProjectAgentSubAgentParamsSchema,
4075
+ query: PaginationQueryParamsSchema
4076
+ },
4077
+ responses: {
4078
+ 200: {
4079
+ description: "List of sub agent team agent relations retrieved successfully",
4080
+ content: {
4081
+ "application/json": {
4082
+ schema: ListResponseSchema(SubAgentTeamAgentRelationApiSelectSchema)
4083
+ }
4084
+ }
4085
+ },
4086
+ ...commonGetErrorResponses
4087
+ }
4088
+ }),
4089
+ async (c) => {
4090
+ const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
4091
+ const { page = 1, limit = 10 } = c.req.valid("query");
4092
+ const pageNum = Number(page);
4093
+ const limitNum = Math.min(Number(limit), 100);
4094
+ try {
4095
+ const result = await listSubAgentTeamAgentRelations(dbClient_default)({
4096
+ scopes: { tenantId, projectId, agentId, subAgentId },
4097
+ pagination: { page: pageNum, limit: limitNum }
4098
+ });
4099
+ return c.json(result);
4100
+ } catch (_error) {
4101
+ throw createApiError({
4102
+ code: "internal_server_error",
4103
+ message: "Failed to retrieve sub agent team agent relations"
4104
+ });
4105
+ }
4106
+ }
4107
+ );
4108
+ app18.openapi(
4109
+ createRoute({
4110
+ method: "get",
4111
+ path: "/{id}",
4112
+ summary: "Get Sub Agent Team Agent Relation",
4113
+ operationId: "get-sub-agent-team-agent-relation-by-id",
4114
+ tags: ["Sub Agent Team Agent Relations"],
4115
+ request: {
4116
+ params: TenantProjectAgentSubAgentIdParamsSchema
4117
+ },
4118
+ responses: {
4119
+ 200: {
4120
+ description: "Sub Agent team agent relation found",
4121
+ content: {
4122
+ "application/json": {
4123
+ schema: SingleResponseSchema(SubAgentTeamAgentRelationApiSelectSchema)
4124
+ }
4125
+ }
4126
+ },
4127
+ ...commonGetErrorResponses
4128
+ }
4129
+ }),
4130
+ async (c) => {
4131
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4132
+ const relation = await getSubAgentTeamAgentRelationById(dbClient_default)({
4133
+ scopes: { tenantId, projectId, agentId, subAgentId },
4134
+ relationId: id
4135
+ });
4136
+ if (!relation) {
4137
+ throw createApiError({
4138
+ code: "not_found",
4139
+ message: "Sub Agent Team Agent Relation not found"
4140
+ });
4141
+ }
4142
+ return c.json({ data: relation });
4143
+ }
4144
+ );
4145
+ app18.openapi(
4146
+ createRoute({
4147
+ method: "post",
4148
+ path: "/",
4149
+ summary: "Create Sub Agent Team Agent Relation",
4150
+ operationId: "create-sub-agent-team-agent-relation",
4151
+ tags: ["Sub Agent Team Agent Relations"],
4152
+ request: {
4153
+ params: TenantProjectAgentSubAgentParamsSchema,
4154
+ body: {
4155
+ content: {
4156
+ "application/json": {
4157
+ schema: SubAgentTeamAgentRelationApiInsertSchema
4158
+ }
4159
+ }
4160
+ }
4161
+ },
4162
+ responses: {
4163
+ 201: {
4164
+ description: "Sub Agent Team Agent Relation created successfully",
4165
+ content: {
4166
+ "application/json": {
4167
+ schema: SingleResponseSchema(SubAgentTeamAgentRelationApiSelectSchema)
4168
+ }
4169
+ }
4170
+ },
4171
+ ...commonGetErrorResponses
4172
+ }
4173
+ }),
4174
+ async (c) => {
4175
+ const { tenantId, projectId, agentId, subAgentId } = c.req.valid("param");
4176
+ const body = await c.req.valid("json");
4177
+ const existingRelations = await listSubAgentTeamAgentRelations(dbClient_default)({
4178
+ scopes: { tenantId, projectId, agentId, subAgentId },
4179
+ pagination: { page: 1, limit: 1e3 }
4180
+ });
4181
+ const isDuplicate = existingRelations.data.some(
4182
+ (relation2) => relation2.targetAgentId === body.targetAgentId && relation2.subAgentId === subAgentId
4183
+ );
4184
+ if (isDuplicate) {
4185
+ throw createApiError({
4186
+ code: "unprocessable_entity",
4187
+ message: `A relation between this sub-agent and team agent already exists`
4188
+ });
4189
+ }
4190
+ const relation = await createSubAgentTeamAgentRelation(dbClient_default)({
4191
+ scopes: { tenantId, projectId, agentId, subAgentId },
4192
+ relationId: nanoid(),
4193
+ data: {
4194
+ targetAgentId: body.targetAgentId,
4195
+ headers: body.headers || null
4196
+ }
4197
+ });
4198
+ return c.json({ data: relation }, 201);
4199
+ }
4200
+ );
4201
+ app18.openapi(
4202
+ createRoute({
4203
+ method: "put",
4204
+ path: "/{id}",
4205
+ summary: "Update Sub Agent Team Agent Relation",
4206
+ operationId: "update-sub-agent-team-agent-relation",
4207
+ tags: ["Sub Agent Team Agent Relations"],
4208
+ request: {
4209
+ params: TenantProjectAgentSubAgentIdParamsSchema,
4210
+ body: {
4211
+ content: {
4212
+ "application/json": {
4213
+ schema: SubAgentTeamAgentRelationApiUpdateSchema
4214
+ }
4215
+ }
4216
+ }
4217
+ },
4218
+ responses: {
4219
+ 200: {
4220
+ description: "Sub Agent team agent relation updated successfully",
4221
+ content: {
4222
+ "application/json": {
4223
+ schema: SingleResponseSchema(SubAgentTeamAgentRelationApiSelectSchema)
4224
+ }
4225
+ }
4226
+ },
4227
+ ...commonGetErrorResponses
4228
+ }
4229
+ }),
4230
+ async (c) => {
4231
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4232
+ const body = await c.req.valid("json");
4233
+ const updatedRelation = await updateSubAgentTeamAgentRelation(dbClient_default)({
4234
+ scopes: { tenantId, projectId, agentId, subAgentId },
4235
+ relationId: id,
4236
+ data: body
4237
+ });
4238
+ if (!updatedRelation) {
4239
+ throw createApiError({
4240
+ code: "not_found",
4241
+ message: "Sub Agent Team Agent Relation not found"
4242
+ });
4243
+ }
4244
+ return c.json({ data: updatedRelation });
4245
+ }
4246
+ );
4247
+ app18.openapi(
4248
+ createRoute({
4249
+ method: "delete",
4250
+ path: "/{id}",
4251
+ summary: "Delete Sub Agent Team Agent Relation",
4252
+ operationId: "delete-sub-agent-team-agent-relation",
4253
+ tags: ["Sub Agent Team Agent Relations"],
4254
+ request: {
4255
+ params: TenantProjectAgentSubAgentIdParamsSchema
4256
+ },
4257
+ responses: {
4258
+ 204: {
4259
+ description: "Sub Agent Team Agent Relation deleted successfully"
4260
+ },
4261
+ 404: {
4262
+ description: "Sub Agent Team Agent Relation not found",
4263
+ content: {
4264
+ "application/json": {
4265
+ schema: ErrorResponseSchema
4266
+ }
4267
+ }
4268
+ }
4269
+ }
4270
+ }),
4271
+ async (c) => {
4272
+ const { tenantId, projectId, agentId, subAgentId, id } = c.req.valid("param");
4273
+ const deleted = await deleteSubAgentTeamAgentRelation(dbClient_default)({
4274
+ scopes: { tenantId, projectId, agentId, subAgentId },
4275
+ relationId: id
4276
+ });
4277
+ if (!deleted) {
4278
+ throw createApiError({
4279
+ code: "not_found",
4280
+ message: "Sub Agent Team Agent Relation not found"
4281
+ });
4282
+ }
4283
+ return c.body(null, 204);
4284
+ }
4285
+ );
4286
+ var subAgentTeamAgentRelations_default = app18;
4287
+ var app19 = new OpenAPIHono();
4288
+ app19.openapi(
4067
4289
  createRoute({
4068
4290
  method: "get",
4069
4291
  path: "/",
@@ -4125,7 +4347,7 @@ app18.openapi(
4125
4347
  return c.json(result);
4126
4348
  }
4127
4349
  );
4128
- app18.openapi(
4350
+ app19.openapi(
4129
4351
  createRoute({
4130
4352
  method: "get",
4131
4353
  path: "/{id}",
@@ -4162,7 +4384,7 @@ app18.openapi(
4162
4384
  return c.json({ data: agentToolRelation });
4163
4385
  }
4164
4386
  );
4165
- app18.openapi(
4387
+ app19.openapi(
4166
4388
  createRoute({
4167
4389
  method: "get",
4168
4390
  path: "/tool/{toolId}/sub-agents",
@@ -4198,7 +4420,7 @@ app18.openapi(
4198
4420
  return c.json(dbResult);
4199
4421
  }
4200
4422
  );
4201
- app18.openapi(
4423
+ app19.openapi(
4202
4424
  createRoute({
4203
4425
  method: "post",
4204
4426
  path: "/",
@@ -4261,7 +4483,7 @@ app18.openapi(
4261
4483
  }
4262
4484
  }
4263
4485
  );
4264
- app18.openapi(
4486
+ app19.openapi(
4265
4487
  createRoute({
4266
4488
  method: "put",
4267
4489
  path: "/{id}",
@@ -4314,7 +4536,7 @@ app18.openapi(
4314
4536
  return c.json({ data: updatedAgentToolRelation });
4315
4537
  }
4316
4538
  );
4317
- app18.openapi(
4539
+ app19.openapi(
4318
4540
  createRoute({
4319
4541
  method: "delete",
4320
4542
  path: "/{id}",
@@ -4353,10 +4575,10 @@ app18.openapi(
4353
4575
  return c.body(null, 204);
4354
4576
  }
4355
4577
  );
4356
- var subAgentToolRelations_default = app18;
4578
+ var subAgentToolRelations_default = app19;
4357
4579
  var logger5 = getLogger("tools");
4358
- var app19 = new OpenAPIHono();
4359
- app19.openapi(
4580
+ var app20 = new OpenAPIHono();
4581
+ app20.openapi(
4360
4582
  createRoute({
4361
4583
  method: "get",
4362
4584
  path: "/",
@@ -4416,7 +4638,7 @@ app19.openapi(
4416
4638
  return c.json(result);
4417
4639
  }
4418
4640
  );
4419
- app19.openapi(
4641
+ app20.openapi(
4420
4642
  createRoute({
4421
4643
  method: "get",
4422
4644
  path: "/{id}",
@@ -4453,7 +4675,7 @@ app19.openapi(
4453
4675
  });
4454
4676
  }
4455
4677
  );
4456
- app19.openapi(
4678
+ app20.openapi(
4457
4679
  createRoute({
4458
4680
  method: "post",
4459
4681
  path: "/",
@@ -4506,7 +4728,7 @@ app19.openapi(
4506
4728
  );
4507
4729
  }
4508
4730
  );
4509
- app19.openapi(
4731
+ app20.openapi(
4510
4732
  createRoute({
4511
4733
  method: "put",
4512
4734
  path: "/{id}",
@@ -4567,7 +4789,7 @@ app19.openapi(
4567
4789
  });
4568
4790
  }
4569
4791
  );
4570
- app19.openapi(
4792
+ app20.openapi(
4571
4793
  createRoute({
4572
4794
  method: "delete",
4573
4795
  path: "/{id}",
@@ -4603,42 +4825,46 @@ app19.openapi(
4603
4825
  return c.body(null, 204);
4604
4826
  }
4605
4827
  );
4606
- var tools_default = app19;
4828
+ var tools_default = app20;
4607
4829
 
4608
4830
  // src/routes/index.ts
4609
- var app20 = new OpenAPIHono();
4610
- app20.route("/projects", projects_default);
4611
- app20.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
4612
- app20.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
4613
- app20.route(
4831
+ var app21 = new OpenAPIHono();
4832
+ app21.route("/projects", projects_default);
4833
+ app21.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
4834
+ app21.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
4835
+ app21.route(
4614
4836
  "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/external-agent-relations",
4615
4837
  subAgentExternalAgentRelations_default
4616
4838
  );
4617
- app20.route("/projects/:projectId/agents", agent_default);
4618
- app20.route(
4839
+ app21.route(
4840
+ "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/team-agent-relations",
4841
+ subAgentTeamAgentRelations_default
4842
+ );
4843
+ app21.route("/projects/:projectId/agents", agent_default);
4844
+ app21.route(
4619
4845
  "/projects/:projectId/agents/:agentId/sub-agent-tool-relations",
4620
4846
  subAgentToolRelations_default
4621
4847
  );
4622
- app20.route(
4848
+ app21.route(
4623
4849
  "/projects/:projectId/agents/:agentId/sub-agent-artifact-components",
4624
4850
  subAgentArtifactComponents_default
4625
4851
  );
4626
- app20.route(
4852
+ app21.route(
4627
4853
  "/projects/:projectId/agents/:agentId/sub-agent-data-components",
4628
4854
  subAgentDataComponents_default
4629
4855
  );
4630
- app20.route("/projects/:projectId/artifact-components", artifactComponents_default);
4631
- app20.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
4632
- app20.route("/projects/:projectId/credentials", credentials_default);
4633
- app20.route("/projects/:projectId/credential-stores", credentialStores_default);
4634
- app20.route("/projects/:projectId/data-components", dataComponents_default);
4635
- app20.route("/projects/:projectId/external-agents", externalAgents_default);
4636
- app20.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
4637
- app20.route("/projects/:projectId/functions", functions_default);
4638
- app20.route("/projects/:projectId/tools", tools_default);
4639
- app20.route("/projects/:projectId/api-keys", apiKeys_default);
4640
- app20.route("/projects/:projectId/agent", agentFull_default);
4641
- var routes_default = app20;
4856
+ app21.route("/projects/:projectId/artifact-components", artifactComponents_default);
4857
+ app21.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
4858
+ app21.route("/projects/:projectId/credentials", credentials_default);
4859
+ app21.route("/projects/:projectId/credential-stores", credentialStores_default);
4860
+ app21.route("/projects/:projectId/data-components", dataComponents_default);
4861
+ app21.route("/projects/:projectId/external-agents", externalAgents_default);
4862
+ app21.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
4863
+ app21.route("/projects/:projectId/functions", functions_default);
4864
+ app21.route("/projects/:projectId/tools", tools_default);
4865
+ app21.route("/projects/:projectId/api-keys", apiKeys_default);
4866
+ app21.route("/projects/:projectId/agent", agentFull_default);
4867
+ var routes_default = app21;
4642
4868
  var logger6 = getLogger("oauth-service");
4643
4869
  var pkceStore = /* @__PURE__ */ new Map();
4644
4870
  function storePKCEVerifier(state, codeVerifier, toolId, tenantId, projectId, clientInformation, metadata, resourceUrl) {
@@ -4776,7 +5002,7 @@ async function findOrCreateCredential(tenantId, projectId, credentialData) {
4776
5002
  throw new Error(`Failed to save credential '${credentialData.id}' to database`);
4777
5003
  }
4778
5004
  }
4779
- var app21 = new OpenAPIHono();
5005
+ var app22 = new OpenAPIHono();
4780
5006
  var logger7 = getLogger("oauth-callback");
4781
5007
  function getBaseUrlFromRequest(c) {
4782
5008
  const url = new URL(c.req.url);
@@ -4863,7 +5089,7 @@ var OAuthCallbackQuerySchema = z$1.object({
4863
5089
  error: z$1.string().optional(),
4864
5090
  error_description: z$1.string().optional()
4865
5091
  });
4866
- app21.openapi(
5092
+ app22.openapi(
4867
5093
  createRoute({
4868
5094
  method: "get",
4869
5095
  path: "/login",
@@ -4928,7 +5154,7 @@ app21.openapi(
4928
5154
  }
4929
5155
  }
4930
5156
  );
4931
- app21.openapi(
5157
+ app22.openapi(
4932
5158
  createRoute({
4933
5159
  method: "get",
4934
5160
  path: "/callback",
@@ -5070,9 +5296,9 @@ app21.openapi(
5070
5296
  }
5071
5297
  }
5072
5298
  );
5073
- var oauth_default = app21;
5299
+ var oauth_default = app22;
5074
5300
  var logger8 = getLogger("projectFull");
5075
- var app22 = new OpenAPIHono();
5301
+ var app23 = new OpenAPIHono();
5076
5302
  var ProjectIdParamsSchema = z.object({
5077
5303
  tenantId: z.string().openapi({
5078
5304
  description: "Tenant identifier",
@@ -5089,7 +5315,7 @@ var TenantParamsSchema2 = z.object({
5089
5315
  example: "tenant_123"
5090
5316
  })
5091
5317
  }).openapi("TenantParams");
5092
- app22.openapi(
5318
+ app23.openapi(
5093
5319
  createRoute({
5094
5320
  method: "post",
5095
5321
  path: "/project-full",
@@ -5149,7 +5375,7 @@ app22.openapi(
5149
5375
  }
5150
5376
  }
5151
5377
  );
5152
- app22.openapi(
5378
+ app23.openapi(
5153
5379
  createRoute({
5154
5380
  method: "get",
5155
5381
  path: "/project-full/{projectId}",
@@ -5202,7 +5428,7 @@ app22.openapi(
5202
5428
  }
5203
5429
  }
5204
5430
  );
5205
- app22.openapi(
5431
+ app23.openapi(
5206
5432
  createRoute({
5207
5433
  method: "put",
5208
5434
  path: "/project-full/{projectId}",
@@ -5286,7 +5512,7 @@ app22.openapi(
5286
5512
  }
5287
5513
  }
5288
5514
  );
5289
- app22.openapi(
5515
+ app23.openapi(
5290
5516
  createRoute({
5291
5517
  method: "delete",
5292
5518
  path: "/project-full/{projectId}",
@@ -5334,20 +5560,20 @@ app22.openapi(
5334
5560
  }
5335
5561
  }
5336
5562
  );
5337
- var projectFull_default = app22;
5563
+ var projectFull_default = app23;
5338
5564
 
5339
5565
  // src/app.ts
5340
5566
  var logger9 = getLogger("agents-manage-api");
5341
5567
  logger9.info({ logger: logger9.getTransports() }, "Logger initialized");
5342
5568
  function createManagementHono(serverConfig, credentialStores) {
5343
- const app24 = new OpenAPIHono();
5344
- app24.use("*", requestId());
5345
- app24.use("*", async (c, next) => {
5569
+ const app25 = new OpenAPIHono();
5570
+ app25.use("*", requestId());
5571
+ app25.use("*", async (c, next) => {
5346
5572
  c.set("serverConfig", serverConfig);
5347
5573
  c.set("credentialStores", credentialStores);
5348
5574
  return next();
5349
5575
  });
5350
- app24.use(
5576
+ app25.use(
5351
5577
  pinoLogger({
5352
5578
  pino: getLogger("agents-manage-api").getPinoInstance(),
5353
5579
  http: {
@@ -5360,7 +5586,7 @@ function createManagementHono(serverConfig, credentialStores) {
5360
5586
  }
5361
5587
  })
5362
5588
  );
5363
- app24.onError(async (err, c) => {
5589
+ app25.onError(async (err, c) => {
5364
5590
  const isExpectedError = err instanceof HTTPException;
5365
5591
  const status = isExpectedError ? err.status : 500;
5366
5592
  const requestId2 = c.get("requestId") || "unknown";
@@ -5435,7 +5661,7 @@ function createManagementHono(serverConfig, credentialStores) {
5435
5661
  ...instance && { instance }
5436
5662
  });
5437
5663
  });
5438
- app24.use(
5664
+ app25.use(
5439
5665
  "*",
5440
5666
  cors({
5441
5667
  origin: (origin) => {
@@ -5449,7 +5675,7 @@ function createManagementHono(serverConfig, credentialStores) {
5449
5675
  credentials: true
5450
5676
  })
5451
5677
  );
5452
- app24.openapi(
5678
+ app25.openapi(
5453
5679
  createRoute({
5454
5680
  method: "get",
5455
5681
  path: "/health",
@@ -5466,13 +5692,13 @@ function createManagementHono(serverConfig, credentialStores) {
5466
5692
  return c.body(null, 204);
5467
5693
  }
5468
5694
  );
5469
- app24.use("/tenants/*", apiKeyAuth());
5470
- app24.route("/tenants/:tenantId", routes_default);
5471
- app24.route("/tenants/:tenantId", projectFull_default);
5472
- app24.route("/oauth", oauth_default);
5473
- setupOpenAPIRoutes(app24);
5695
+ app25.use("/tenants/*", apiKeyAuth());
5696
+ app25.route("/tenants/:tenantId", routes_default);
5697
+ app25.route("/tenants/:tenantId", projectFull_default);
5698
+ app25.route("/oauth", oauth_default);
5699
+ setupOpenAPIRoutes(app25);
5474
5700
  const baseApp = new Hono();
5475
- baseApp.route("/", app24);
5701
+ baseApp.route("/", app25);
5476
5702
  return baseApp;
5477
5703
  }
5478
5704
 
@@ -5488,8 +5714,8 @@ var defaultConfig = {
5488
5714
  };
5489
5715
  var defaultStores = createDefaultCredentialStores();
5490
5716
  var defaultRegistry = new CredentialStoreRegistry(defaultStores);
5491
- var app23 = createManagementHono(defaultConfig, defaultRegistry);
5492
- var index_default = app23;
5717
+ var app24 = createManagementHono(defaultConfig, defaultRegistry);
5718
+ var index_default = app24;
5493
5719
  function createManagementApp(config) {
5494
5720
  const serverConfig = config?.serverConfig ?? defaultConfig;
5495
5721
  const stores = config?.credentialStores ?? defaultStores;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.26.2",
3
+ "version": "0.28.0",
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.26.2"
26
+ "@inkeep/agents-core": "^0.28.0"
27
27
  },
28
28
  "optionalDependencies": {
29
29
  "keytar": "^7.9.0"