@inkeep/agents-manage-api 0.0.0-dev-20251124223719 → 0.0.0-dev-20251124234228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { F, u, R, x, T, h, U, L, or, C, Vr, ce, ur, P } from './chunk-SBJLXGYG.js';
2
- import { loadEnvironmentFiles, getLogger, createDatabaseClient, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, RelatedAgentInfoListResponse, TenantProjectAgentSubAgentParamsSchema, getAgentSubAgentInfos, AgentWithinContextOfProjectResponse, TenantProjectAgentParamsSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, generateId, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, AgentWithinContextOfProjectSchema, createFullAgentServerSide, getFullAgent, updateFullAgentServerSide, deleteFullAgent, ApiKeyListResponse, listApiKeysPaginated, ApiKeyResponse, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, ArtifactComponentListResponse, listArtifactComponentsPaginated, ArtifactComponentResponse, getArtifactComponentById, ArtifactComponentApiInsertSchema, validatePropsAsJsonSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigListResponse, listContextConfigsPaginated, ContextConfigResponse, TenantProjectAgentIdParamsSchema, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, CredentialStoreListResponseSchema, CreateCredentialInStoreResponseSchema, CreateCredentialInStoreRequestSchema, CredentialReferenceListResponse, listCredentialReferencesPaginated, ListResponseSchema, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithResources, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialReferenceById, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, DataComponentListResponse, listDataComponentsPaginated, DataComponentResponse, getDataComponent, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentListResponse, listExternalAgentsPaginated, ExternalAgentResponse, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, FunctionListResponse, listFunctions, FunctionResponse, getFunction, FunctionApiInsertSchema, upsertFunction, FunctionApiUpdateSchema, deleteFunction, FunctionToolListResponse, listFunctionTools, FunctionToolResponse, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, MCPCatalogListResponse, fetchComposioServers, MCPTransportType, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentArrayResponse, getArtifactComponentsForAgent, ComponentAssociationListResponse, getAgentsUsingArtifactComponent, SubAgentArtifactComponentResponse, SubAgentArtifactComponentApiInsertSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentArrayResponse, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentResponse, SubAgentDataComponentApiInsertSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentExternalAgentRelationListResponse, listSubAgentExternalAgentRelations, SubAgentExternalAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationListResponse, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, SubAgentRelationResponse, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentTeamAgentRelationListResponse, listSubAgentTeamAgentRelations, SubAgentTeamAgentRelationResponse, getSubAgentTeamAgentRelationById, SubAgentTeamAgentRelationApiInsertSchema, createSubAgentTeamAgentRelation, SubAgentTeamAgentRelationApiUpdateSchema, updateSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, SubAgentToolRelationListResponse, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, SubAgentToolRelationResponse, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ThirdPartyMCPServerResponse, fetchSingleComposioServer, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, handleApiError, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry } from '@inkeep/agents-core';
2
+ import { loadEnvironmentFiles, getLogger, createDatabaseClient, commonGetErrorResponses, AgentListResponse, PaginationQueryParamsSchema, TenantProjectParamsSchema, listAgents, AgentResponse, TenantProjectIdParamsSchema, getAgentById, createApiError, RelatedAgentInfoListResponse, TenantProjectAgentSubAgentParamsSchema, getAgentSubAgentInfos, AgentWithinContextOfProjectResponse, TenantProjectAgentParamsSchema, getFullAgentDefinition, AgentApiInsertSchema, createAgent, generateId, AgentApiUpdateSchema, updateAgent, ErrorResponseSchema, deleteAgent, AgentWithinContextOfProjectSchema, createFullAgentServerSide, getFullAgent, updateFullAgentServerSide, deleteFullAgent, ApiKeyListResponse, listApiKeysPaginated, ApiKeyResponse, getApiKeyById, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, generateApiKey, createApiKey, ApiKeyApiUpdateSchema, updateApiKey, deleteApiKey, ArtifactComponentListResponse, listArtifactComponentsPaginated, ArtifactComponentResponse, getArtifactComponentById, ArtifactComponentApiInsertSchema, validatePropsAsJsonSchema, createArtifactComponent, ArtifactComponentApiUpdateSchema, updateArtifactComponent, deleteArtifactComponent, ContextConfigListResponse, listContextConfigsPaginated, ContextConfigResponse, TenantProjectAgentIdParamsSchema, getContextConfigById, ContextConfigApiInsertSchema, createContextConfig, commonUpdateErrorResponses, ContextConfigApiUpdateSchema, updateContextConfig, commonDeleteErrorResponses, deleteContextConfig, getConversationHistory, formatMessagesForLLMContext, CredentialStoreListResponseSchema, CreateCredentialInStoreResponseSchema, CreateCredentialInStoreRequestSchema, CredentialReferenceListResponse, listCredentialReferencesPaginated, ListResponseSchema, CredentialReferenceApiSelectSchema, CredentialReferenceResponse, getCredentialReferenceWithResources, CredentialReferenceApiInsertSchema, createCredentialReference, CredentialReferenceApiUpdateSchema, updateCredentialReference, getCredentialReferenceById, getCredentialStoreLookupKeyFromRetrievalParams, deleteCredentialReference, DataComponentListResponse, listDataComponentsPaginated, DataComponentResponse, getDataComponent, DataComponentApiInsertSchema, createDataComponent, DataComponentApiUpdateSchema, updateDataComponent, deleteDataComponent, ExternalAgentListResponse, listExternalAgentsPaginated, ExternalAgentResponse, getExternalAgent, ExternalAgentApiInsertSchema, createExternalAgent, ExternalAgentApiUpdateSchema, updateExternalAgent, deleteExternalAgent, FunctionListResponse, listFunctions, FunctionResponse, getFunction, FunctionApiInsertSchema, upsertFunction, FunctionApiUpdateSchema, deleteFunction, FunctionToolListResponse, listFunctionTools, FunctionToolResponse, getFunctionToolById, FunctionToolApiInsertSchema, createFunctionTool, FunctionToolApiUpdateSchema, updateFunctionTool, deleteFunctionTool, MCPCatalogListResponse, fetchComposioServers, MCPTransportType, ProjectListResponse, TenantParamsSchema, listProjectsPaginated, ProjectResponse, TenantIdParamsSchema, getProject, ProjectApiInsertSchema, createProject, ProjectApiUpdateSchema, updateProject, deleteProject, ArtifactComponentArrayResponse, getArtifactComponentsForAgent, ComponentAssociationListResponse, getAgentsUsingArtifactComponent, SubAgentArtifactComponentResponse, SubAgentArtifactComponentApiInsertSchema, getSubAgentById, isArtifactComponentAssociatedWithAgent, associateArtifactComponentWithAgent, RemovedResponseSchema, removeArtifactComponentFromAgent, ExistsResponseSchema, DataComponentArrayResponse, getDataComponentsForAgent, getAgentsUsingDataComponent, SubAgentDataComponentResponse, SubAgentDataComponentApiInsertSchema, isDataComponentAssociatedWithAgent, associateDataComponentWithAgent, removeDataComponentFromAgent, SubAgentExternalAgentRelationListResponse, listSubAgentExternalAgentRelations, SubAgentExternalAgentRelationResponse, TenantProjectAgentSubAgentIdParamsSchema, getSubAgentExternalAgentRelationById, SubAgentExternalAgentRelationApiInsertSchema, createSubAgentExternalAgentRelation, SubAgentExternalAgentRelationApiUpdateSchema, updateSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, SubAgentRelationListResponse, SubAgentRelationQuerySchema, getAgentRelationsBySource, getSubAgentRelationsByTarget, listAgentRelations, SubAgentRelationResponse, getAgentRelationById, SubAgentRelationApiInsertSchema, validateSubAgent, createSubAgentRelation, SubAgentRelationApiUpdateSchema, updateAgentRelation, deleteSubAgentRelation, SubAgentListResponse, listSubAgentsPaginated, SubAgentResponse, SubAgentApiInsertSchema, createSubAgent, SubAgentApiUpdateSchema, updateSubAgent, deleteSubAgent, SubAgentIsDefaultError, SubAgentTeamAgentRelationListResponse, listSubAgentTeamAgentRelations, SubAgentTeamAgentRelationResponse, getSubAgentTeamAgentRelationById, SubAgentTeamAgentRelationApiInsertSchema, createSubAgentTeamAgentRelation, SubAgentTeamAgentRelationApiUpdateSchema, updateSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, SubAgentToolRelationListResponse, getAgentToolRelationByAgent, getAgentToolRelationByTool, listAgentToolRelations, SubAgentToolRelationResponse, getAgentToolRelationById, getAgentsForTool, SubAgentToolRelationApiInsertSchema, createAgentToolRelation, SubAgentToolRelationApiUpdateSchema, updateAgentToolRelation, deleteAgentToolRelation, ThirdPartyMCPServerResponse, fetchSingleComposioServer, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, handleApiError, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry } from '@inkeep/agents-core';
3
3
  import { createAuth } from '@inkeep/agents-core/auth';
4
4
  import { OpenAPIHono, createRoute, z as z$1 } from '@hono/zod-openapi';
5
5
  import { Hono } from 'hono';
@@ -13,6 +13,8 @@ import * as schema from '@inkeep/agents-core/db/schema';
13
13
  import { drizzle } from 'drizzle-orm/pglite';
14
14
  import { swaggerUI } from '@hono/swagger-ui';
15
15
  import { nanoid } from 'nanoid';
16
+ import { StreamableHTTPTransport } from '@hono/mcp';
17
+ import { createConsoleLogger, createMCPServer } from '@inkeep/agents-manage-mcp';
16
18
  import { UserOrganizationsResponseSchema, AddUserToOrganizationResponseSchema, AddUserToOrganizationRequestSchema } from '@inkeep/agents-core/auth/validation';
17
19
  import { eq, and } from 'drizzle-orm';
18
20
  import * as client from 'openid-client';
@@ -5201,11 +5203,11 @@ var requireTenantAccess = () => createMiddleware(async (c, next) => {
5201
5203
  });
5202
5204
  }
5203
5205
  });
5204
- function setupOpenAPIRoutes(app27) {
5205
- app27.get("/openapi.json", (c) => {
5206
+ function setupOpenAPIRoutes(app29) {
5207
+ app29.get("/openapi.json", (c) => {
5206
5208
  try {
5207
5209
  const serverUrl = process.env.VERCEL_ENV === "production" && process.env.VERCEL_PROJECT_PRODUCTION_URL ? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}` : process.env.VERCEL_ENV === "preview" && process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : env.INKEEP_AGENTS_MANAGE_API_URL;
5208
- const document2 = app27.getOpenAPIDocument({
5210
+ const document2 = app29.getOpenAPIDocument({
5209
5211
  openapi: "3.0.0",
5210
5212
  info: {
5211
5213
  title: "Inkeep Agents Manage API",
@@ -5344,7 +5346,7 @@ function setupOpenAPIRoutes(app27) {
5344
5346
  return c.json({ error: "Failed to generate OpenAPI document", details: errorDetails }, 500);
5345
5347
  }
5346
5348
  });
5347
- app27.get(
5349
+ app29.get(
5348
5350
  "/docs",
5349
5351
  swaggerUI({
5350
5352
  url: "/openapi.json",
@@ -5593,15 +5595,26 @@ app.openapi(
5593
5595
  async (c) => {
5594
5596
  const { tenantId, projectId } = c.req.valid("param");
5595
5597
  const validatedBody = c.req.valid("json");
5596
- const agent = await createAgent(dbClient_default)({
5597
- tenantId,
5598
- projectId,
5599
- id: validatedBody.id || generateId(),
5600
- name: validatedBody.name,
5601
- defaultSubAgentId: validatedBody.defaultSubAgentId,
5602
- contextConfigId: validatedBody.contextConfigId ?? void 0
5603
- });
5604
- return c.json({ data: agent }, 201);
5598
+ try {
5599
+ const agent = await createAgent(dbClient_default)({
5600
+ tenantId,
5601
+ projectId,
5602
+ id: validatedBody.id || generateId(),
5603
+ name: validatedBody.name,
5604
+ defaultSubAgentId: validatedBody.defaultSubAgentId,
5605
+ contextConfigId: validatedBody.contextConfigId ?? void 0
5606
+ });
5607
+ return c.json({ data: agent }, 201);
5608
+ } catch (error) {
5609
+ if (error?.cause?.code === "23505") {
5610
+ const agentId = validatedBody.id || "unknown";
5611
+ throw createApiError({
5612
+ code: "conflict",
5613
+ message: `An agent with ID '${agentId}' already exists`
5614
+ });
5615
+ }
5616
+ throw error;
5617
+ }
5605
5618
  }
5606
5619
  );
5607
5620
  app.openapi(
@@ -6685,7 +6698,72 @@ app5.openapi(
6685
6698
  );
6686
6699
  var contextConfigs_default = app5;
6687
6700
  var app6 = new OpenAPIHono();
6701
+ var ConversationQueryParamsSchema = z.object({
6702
+ limit: z.coerce.number().min(1).max(200).default(20).optional(),
6703
+ includeInternal: z.coerce.boolean().default(false).optional()
6704
+ });
6705
+ var ConversationWithFormattedMessagesResponse = z.object({
6706
+ data: z.object({
6707
+ messages: z.array(z.any()),
6708
+ formatted: z.object({
6709
+ llmContext: z.string()
6710
+ })
6711
+ })
6712
+ }).openapi("ConversationWithFormattedMessagesResponse");
6688
6713
  app6.openapi(
6714
+ createRoute({
6715
+ method: "get",
6716
+ path: "/{id}",
6717
+ summary: "Get Conversation",
6718
+ operationId: "get-conversation",
6719
+ tags: ["Conversations"],
6720
+ request: {
6721
+ params: TenantProjectIdParamsSchema,
6722
+ query: ConversationQueryParamsSchema
6723
+ },
6724
+ responses: {
6725
+ 200: {
6726
+ description: "Conversation found with formatted messages for LLM use",
6727
+ content: {
6728
+ "application/json": {
6729
+ schema: ConversationWithFormattedMessagesResponse
6730
+ }
6731
+ }
6732
+ },
6733
+ ...commonGetErrorResponses
6734
+ }
6735
+ }),
6736
+ async (c) => {
6737
+ const { tenantId, projectId, id } = c.req.valid("param");
6738
+ const { limit = 20, includeInternal = true } = c.req.valid("query");
6739
+ const messages = await getConversationHistory(dbClient_default)({
6740
+ scopes: { tenantId, projectId },
6741
+ conversationId: id,
6742
+ options: {
6743
+ limit,
6744
+ includeInternal
6745
+ }
6746
+ });
6747
+ if (!messages || messages.length === 0) {
6748
+ throw createApiError({
6749
+ code: "not_found",
6750
+ message: "Conversation not found"
6751
+ });
6752
+ }
6753
+ const llmContext = formatMessagesForLLMContext(messages);
6754
+ return c.json({
6755
+ data: {
6756
+ messages,
6757
+ formatted: {
6758
+ llmContext
6759
+ }
6760
+ }
6761
+ });
6762
+ }
6763
+ );
6764
+ var conversations_default = app6;
6765
+ var app7 = new OpenAPIHono();
6766
+ app7.openapi(
6689
6767
  createRoute({
6690
6768
  method: "get",
6691
6769
  path: "/",
@@ -6726,7 +6804,7 @@ app6.openapi(
6726
6804
  });
6727
6805
  }
6728
6806
  );
6729
- app6.openapi(
6807
+ app7.openapi(
6730
6808
  createRoute({
6731
6809
  method: "post",
6732
6810
  path: "/{id}/credentials",
@@ -6794,9 +6872,9 @@ app6.openapi(
6794
6872
  }
6795
6873
  }
6796
6874
  );
6797
- var credentialStores_default = app6;
6798
- var app7 = new OpenAPIHono();
6799
- app7.use("/", async (c, next) => {
6875
+ var credentialStores_default = app7;
6876
+ var app8 = new OpenAPIHono();
6877
+ app8.use("/", async (c, next) => {
6800
6878
  if (c.req.method === "POST") {
6801
6879
  return requirePermission({ credential: ["create"] })(
6802
6880
  c,
@@ -6805,7 +6883,7 @@ app7.use("/", async (c, next) => {
6805
6883
  }
6806
6884
  return next();
6807
6885
  });
6808
- app7.use("/:id", async (c, next) => {
6886
+ app8.use("/:id", async (c, next) => {
6809
6887
  if (c.req.method === "PATCH") {
6810
6888
  return requirePermission({ credential: ["update"] })(
6811
6889
  c,
@@ -6820,7 +6898,7 @@ app7.use("/:id", async (c, next) => {
6820
6898
  }
6821
6899
  return next();
6822
6900
  });
6823
- app7.openapi(
6901
+ app8.openapi(
6824
6902
  createRoute({
6825
6903
  method: "get",
6826
6904
  path: "/",
@@ -6855,7 +6933,7 @@ app7.openapi(
6855
6933
  return c.json(validatedResult);
6856
6934
  }
6857
6935
  );
6858
- app7.openapi(
6936
+ app8.openapi(
6859
6937
  createRoute({
6860
6938
  method: "get",
6861
6939
  path: "/{id}",
@@ -6893,7 +6971,7 @@ app7.openapi(
6893
6971
  return c.json({ data: validatedCredential });
6894
6972
  }
6895
6973
  );
6896
- app7.openapi(
6974
+ app8.openapi(
6897
6975
  createRoute({
6898
6976
  method: "post",
6899
6977
  path: "/",
@@ -6935,7 +7013,7 @@ app7.openapi(
6935
7013
  return c.json({ data: validatedCredential }, 201);
6936
7014
  }
6937
7015
  );
6938
- app7.openapi(
7016
+ app8.openapi(
6939
7017
  createRoute({
6940
7018
  method: "put",
6941
7019
  path: "/{id}",
@@ -6982,7 +7060,7 @@ app7.openapi(
6982
7060
  return c.json({ data: validatedCredential });
6983
7061
  }
6984
7062
  );
6985
- app7.openapi(
7063
+ app8.openapi(
6986
7064
  createRoute({
6987
7065
  method: "delete",
6988
7066
  path: "/{id}",
@@ -7053,15 +7131,15 @@ app7.openapi(
7053
7131
  return c.body(null, 204);
7054
7132
  }
7055
7133
  );
7056
- var credentials_default = app7;
7057
- var app8 = new OpenAPIHono();
7058
- app8.use("/", async (c, next) => {
7134
+ var credentials_default = app8;
7135
+ var app9 = new OpenAPIHono();
7136
+ app9.use("/", async (c, next) => {
7059
7137
  if (c.req.method === "POST") {
7060
7138
  return requirePermission({ data_component: ["create"] })(c, next);
7061
7139
  }
7062
7140
  return next();
7063
7141
  });
7064
- app8.use("/:id", async (c, next) => {
7142
+ app9.use("/:id", async (c, next) => {
7065
7143
  if (c.req.method === "PATCH") {
7066
7144
  return requirePermission({ data_component: ["update"] })(c, next);
7067
7145
  }
@@ -7070,7 +7148,7 @@ app8.use("/:id", async (c, next) => {
7070
7148
  }
7071
7149
  return next();
7072
7150
  });
7073
- app8.openapi(
7151
+ app9.openapi(
7074
7152
  createRoute({
7075
7153
  method: "get",
7076
7154
  path: "/",
@@ -7104,7 +7182,7 @@ app8.openapi(
7104
7182
  return c.json(result);
7105
7183
  }
7106
7184
  );
7107
- app8.openapi(
7185
+ app9.openapi(
7108
7186
  createRoute({
7109
7187
  method: "get",
7110
7188
  path: "/{id}",
@@ -7141,7 +7219,7 @@ app8.openapi(
7141
7219
  return c.json({ data: dataComponent });
7142
7220
  }
7143
7221
  );
7144
- app8.openapi(
7222
+ app9.openapi(
7145
7223
  createRoute({
7146
7224
  method: "post",
7147
7225
  path: "/",
@@ -7192,7 +7270,7 @@ app8.openapi(
7192
7270
  return c.json({ data: dataComponent }, 201);
7193
7271
  }
7194
7272
  );
7195
- app8.openapi(
7273
+ app9.openapi(
7196
7274
  createRoute({
7197
7275
  method: "put",
7198
7276
  path: "/{id}",
@@ -7248,7 +7326,7 @@ app8.openapi(
7248
7326
  return c.json({ data: updatedDataComponent });
7249
7327
  }
7250
7328
  );
7251
- app8.openapi(
7329
+ app9.openapi(
7252
7330
  createRoute({
7253
7331
  method: "delete",
7254
7332
  path: "/{id}",
@@ -7287,15 +7365,15 @@ app8.openapi(
7287
7365
  return c.body(null, 204);
7288
7366
  }
7289
7367
  );
7290
- var dataComponents_default = app8;
7291
- var app9 = new OpenAPIHono();
7292
- app9.use("/", async (c, next) => {
7368
+ var dataComponents_default = app9;
7369
+ var app10 = new OpenAPIHono();
7370
+ app10.use("/", async (c, next) => {
7293
7371
  if (c.req.method === "POST") {
7294
7372
  return requirePermission({ external_agent: ["create"] })(c, next);
7295
7373
  }
7296
7374
  return next();
7297
7375
  });
7298
- app9.use("/:id", async (c, next) => {
7376
+ app10.use("/:id", async (c, next) => {
7299
7377
  if (c.req.method === "PATCH") {
7300
7378
  return requirePermission({ external_agent: ["update"] })(c, next);
7301
7379
  }
@@ -7304,7 +7382,7 @@ app9.use("/:id", async (c, next) => {
7304
7382
  }
7305
7383
  return next();
7306
7384
  });
7307
- app9.openapi(
7385
+ app10.openapi(
7308
7386
  createRoute({
7309
7387
  method: "get",
7310
7388
  path: "/",
@@ -7344,7 +7422,7 @@ app9.openapi(
7344
7422
  return c.json(dataWithType);
7345
7423
  }
7346
7424
  );
7347
- app9.openapi(
7425
+ app10.openapi(
7348
7426
  createRoute({
7349
7427
  method: "get",
7350
7428
  path: "/{id}",
@@ -7385,7 +7463,7 @@ app9.openapi(
7385
7463
  return c.json({ data: agentWithType });
7386
7464
  }
7387
7465
  );
7388
- app9.openapi(
7466
+ app10.openapi(
7389
7467
  createRoute({
7390
7468
  method: "post",
7391
7469
  path: "/",
@@ -7434,7 +7512,7 @@ app9.openapi(
7434
7512
  return c.json({ data: agentWithType }, 201);
7435
7513
  }
7436
7514
  );
7437
- app9.openapi(
7515
+ app10.openapi(
7438
7516
  createRoute({
7439
7517
  method: "put",
7440
7518
  path: "/{id}",
@@ -7484,7 +7562,7 @@ app9.openapi(
7484
7562
  return c.json({ data: agentWithType });
7485
7563
  }
7486
7564
  );
7487
- app9.openapi(
7565
+ app10.openapi(
7488
7566
  createRoute({
7489
7567
  method: "delete",
7490
7568
  path: "/{id}",
@@ -7523,16 +7601,16 @@ app9.openapi(
7523
7601
  return c.body(null, 204);
7524
7602
  }
7525
7603
  );
7526
- var externalAgents_default = app9;
7604
+ var externalAgents_default = app10;
7527
7605
  var logger3 = getLogger("functions");
7528
- var app10 = new OpenAPIHono();
7529
- app10.use("/", async (c, next) => {
7606
+ var app11 = new OpenAPIHono();
7607
+ app11.use("/", async (c, next) => {
7530
7608
  if (c.req.method === "POST") {
7531
7609
  return requirePermission({ function: ["create"] })(c, next);
7532
7610
  }
7533
7611
  return next();
7534
7612
  });
7535
- app10.use("/:id", async (c, next) => {
7613
+ app11.use("/:id", async (c, next) => {
7536
7614
  if (c.req.method === "PUT") {
7537
7615
  return requirePermission({ function: ["update"] })(c, next);
7538
7616
  }
@@ -7541,7 +7619,7 @@ app10.use("/:id", async (c, next) => {
7541
7619
  }
7542
7620
  return next();
7543
7621
  });
7544
- app10.openapi(
7622
+ app11.openapi(
7545
7623
  createRoute({
7546
7624
  method: "get",
7547
7625
  path: "/",
@@ -7586,7 +7664,7 @@ app10.openapi(
7586
7664
  }
7587
7665
  }
7588
7666
  );
7589
- app10.openapi(
7667
+ app11.openapi(
7590
7668
  createRoute({
7591
7669
  method: "get",
7592
7670
  path: "/{id}",
@@ -7631,7 +7709,7 @@ app10.openapi(
7631
7709
  }
7632
7710
  }
7633
7711
  );
7634
- app10.openapi(
7712
+ app11.openapi(
7635
7713
  createRoute({
7636
7714
  method: "post",
7637
7715
  path: "/",
@@ -7687,7 +7765,7 @@ app10.openapi(
7687
7765
  }
7688
7766
  }
7689
7767
  );
7690
- app10.openapi(
7768
+ app11.openapi(
7691
7769
  createRoute({
7692
7770
  method: "put",
7693
7771
  path: "/{id}",
@@ -7753,7 +7831,7 @@ app10.openapi(
7753
7831
  }
7754
7832
  }
7755
7833
  );
7756
- app10.openapi(
7834
+ app11.openapi(
7757
7835
  createRoute({
7758
7836
  method: "delete",
7759
7837
  path: "/{id}",
@@ -7798,16 +7876,16 @@ app10.openapi(
7798
7876
  }
7799
7877
  }
7800
7878
  );
7801
- var functions_default = app10;
7879
+ var functions_default = app11;
7802
7880
  var logger4 = getLogger("functionTools");
7803
- var app11 = new OpenAPIHono();
7804
- app11.use("/", async (c, next) => {
7881
+ var app12 = new OpenAPIHono();
7882
+ app12.use("/", async (c, next) => {
7805
7883
  if (c.req.method === "POST") {
7806
7884
  return requirePermission({ function: ["create"] })(c, next);
7807
7885
  }
7808
7886
  return next();
7809
7887
  });
7810
- app11.use("/:id", async (c, next) => {
7888
+ app12.use("/:id", async (c, next) => {
7811
7889
  if (c.req.method === "PUT") {
7812
7890
  return requirePermission({ function: ["update"] })(c, next);
7813
7891
  }
@@ -7816,7 +7894,7 @@ app11.use("/:id", async (c, next) => {
7816
7894
  }
7817
7895
  return next();
7818
7896
  });
7819
- app11.openapi(
7897
+ app12.openapi(
7820
7898
  createRoute({
7821
7899
  method: "get",
7822
7900
  path: "/",
@@ -7857,7 +7935,7 @@ app11.openapi(
7857
7935
  }
7858
7936
  }
7859
7937
  );
7860
- app11.openapi(
7938
+ app12.openapi(
7861
7939
  createRoute({
7862
7940
  method: "get",
7863
7941
  path: "/{id}",
@@ -7902,7 +7980,7 @@ app11.openapi(
7902
7980
  }
7903
7981
  }
7904
7982
  );
7905
- app11.openapi(
7983
+ app12.openapi(
7906
7984
  createRoute({
7907
7985
  method: "post",
7908
7986
  path: "/",
@@ -7956,7 +8034,7 @@ app11.openapi(
7956
8034
  }
7957
8035
  }
7958
8036
  );
7959
- app11.openapi(
8037
+ app12.openapi(
7960
8038
  createRoute({
7961
8039
  method: "put",
7962
8040
  path: "/{id}",
@@ -8016,7 +8094,7 @@ app11.openapi(
8016
8094
  }
8017
8095
  }
8018
8096
  );
8019
- app11.openapi(
8097
+ app12.openapi(
8020
8098
  createRoute({
8021
8099
  method: "delete",
8022
8100
  path: "/{id}",
@@ -8059,8 +8137,8 @@ app11.openapi(
8059
8137
  }
8060
8138
  }
8061
8139
  );
8062
- var functionTools_default = app11;
8063
- var app12 = new OpenAPIHono();
8140
+ var functionTools_default = app12;
8141
+ var app13 = new OpenAPIHono();
8064
8142
  var PREBUILT_MCP_SERVERS = [
8065
8143
  {
8066
8144
  id: "apify",
@@ -8482,7 +8560,7 @@ var PREBUILT_MCP_SERVERS = [
8482
8560
  description: "AI-powered content creation"
8483
8561
  }
8484
8562
  ];
8485
- app12.openapi(
8563
+ app13.openapi(
8486
8564
  createRoute({
8487
8565
  method: "get",
8488
8566
  path: "/",
@@ -8517,15 +8595,15 @@ app12.openapi(
8517
8595
  });
8518
8596
  }
8519
8597
  );
8520
- var mcpCatalog_default = app12;
8521
- var app13 = new OpenAPIHono();
8522
- app13.use("/", async (c, next) => {
8598
+ var mcpCatalog_default = app13;
8599
+ var app14 = new OpenAPIHono();
8600
+ app14.use("/", async (c, next) => {
8523
8601
  if (c.req.method === "POST") {
8524
8602
  return requirePermission({ project: ["create"] })(c, next);
8525
8603
  }
8526
8604
  return next();
8527
8605
  });
8528
- app13.use("/:id", async (c, next) => {
8606
+ app14.use("/:id", async (c, next) => {
8529
8607
  if (c.req.method === "PATCH") {
8530
8608
  return requirePermission({ project: ["update"] })(c, next);
8531
8609
  }
@@ -8534,7 +8612,7 @@ app13.use("/:id", async (c, next) => {
8534
8612
  }
8535
8613
  return next();
8536
8614
  });
8537
- app13.openapi(
8615
+ app14.openapi(
8538
8616
  createRoute({
8539
8617
  method: "get",
8540
8618
  path: "/",
@@ -8569,7 +8647,7 @@ app13.openapi(
8569
8647
  return c.json(result);
8570
8648
  }
8571
8649
  );
8572
- app13.openapi(
8650
+ app14.openapi(
8573
8651
  createRoute({
8574
8652
  method: "get",
8575
8653
  path: "/{id}",
@@ -8604,7 +8682,7 @@ app13.openapi(
8604
8682
  return c.json({ data: project });
8605
8683
  }
8606
8684
  );
8607
- app13.openapi(
8685
+ app14.openapi(
8608
8686
  createRoute({
8609
8687
  method: "post",
8610
8688
  path: "/",
@@ -8662,7 +8740,7 @@ app13.openapi(
8662
8740
  }
8663
8741
  }
8664
8742
  );
8665
- app13.openapi(
8743
+ app14.openapi(
8666
8744
  createRoute({
8667
8745
  method: "patch",
8668
8746
  path: "/{id}",
@@ -8708,7 +8786,7 @@ app13.openapi(
8708
8786
  return c.json({ data: project });
8709
8787
  }
8710
8788
  );
8711
- app13.openapi(
8789
+ app14.openapi(
8712
8790
  createRoute({
8713
8791
  method: "delete",
8714
8792
  path: "/{id}",
@@ -8758,21 +8836,21 @@ app13.openapi(
8758
8836
  }
8759
8837
  }
8760
8838
  );
8761
- var projects_default = app13;
8762
- var app14 = new OpenAPIHono();
8763
- app14.use("/", async (c, next) => {
8839
+ var projects_default = app14;
8840
+ var app15 = new OpenAPIHono();
8841
+ app15.use("/", async (c, next) => {
8764
8842
  if (c.req.method === "POST") {
8765
8843
  return requirePermission({ sub_agent: ["create"] })(c, next);
8766
8844
  }
8767
8845
  return next();
8768
8846
  });
8769
- app14.use("/agent/:subAgentId/component/:artifactComponentId", async (c, next) => {
8847
+ app15.use("/agent/:subAgentId/component/:artifactComponentId", async (c, next) => {
8770
8848
  if (c.req.method === "DELETE") {
8771
8849
  return requirePermission({ sub_agent: ["delete"] })(c, next);
8772
8850
  }
8773
8851
  return next();
8774
8852
  });
8775
- app14.openapi(
8853
+ app15.openapi(
8776
8854
  createRoute({
8777
8855
  method: "get",
8778
8856
  path: "/agent/{subAgentId}",
@@ -8804,7 +8882,7 @@ app14.openapi(
8804
8882
  });
8805
8883
  }
8806
8884
  );
8807
- app14.openapi(
8885
+ app15.openapi(
8808
8886
  createRoute({
8809
8887
  method: "get",
8810
8888
  path: "/component/{artifactComponentId}/agents",
@@ -8837,7 +8915,7 @@ app14.openapi(
8837
8915
  return c.json({ data: agents });
8838
8916
  }
8839
8917
  );
8840
- app14.openapi(
8918
+ app15.openapi(
8841
8919
  createRoute({
8842
8920
  method: "post",
8843
8921
  path: "/",
@@ -8914,7 +8992,7 @@ app14.openapi(
8914
8992
  return c.json({ data: association }, 201);
8915
8993
  }
8916
8994
  );
8917
- app14.openapi(
8995
+ app15.openapi(
8918
8996
  createRoute({
8919
8997
  method: "delete",
8920
8998
  path: "/agent/{subAgentId}/component/{artifactComponentId}",
@@ -8956,7 +9034,7 @@ app14.openapi(
8956
9034
  });
8957
9035
  }
8958
9036
  );
8959
- app14.openapi(
9037
+ app15.openapi(
8960
9038
  createRoute({
8961
9039
  method: "get",
8962
9040
  path: "/agent/{subAgentId}/component/{artifactComponentId}/exists",
@@ -8989,21 +9067,21 @@ app14.openapi(
8989
9067
  return c.json({ exists });
8990
9068
  }
8991
9069
  );
8992
- var subAgentArtifactComponents_default = app14;
8993
- var app15 = new OpenAPIHono();
8994
- app15.use("/", async (c, next) => {
9070
+ var subAgentArtifactComponents_default = app15;
9071
+ var app16 = new OpenAPIHono();
9072
+ app16.use("/", async (c, next) => {
8995
9073
  if (c.req.method === "POST") {
8996
9074
  return requirePermission({ sub_agent: ["create"] })(c, next);
8997
9075
  }
8998
9076
  return next();
8999
9077
  });
9000
- app15.use("/agent/:subAgentId/component/:dataComponentId", async (c, next) => {
9078
+ app16.use("/agent/:subAgentId/component/:dataComponentId", async (c, next) => {
9001
9079
  if (c.req.method === "DELETE") {
9002
9080
  return requirePermission({ sub_agent: ["delete"] })(c, next);
9003
9081
  }
9004
9082
  return next();
9005
9083
  });
9006
- app15.openapi(
9084
+ app16.openapi(
9007
9085
  createRoute({
9008
9086
  method: "get",
9009
9087
  path: "/agent/{subAgentId}",
@@ -9033,7 +9111,7 @@ app15.openapi(
9033
9111
  return c.json({ data: dataComponents });
9034
9112
  }
9035
9113
  );
9036
- app15.openapi(
9114
+ app16.openapi(
9037
9115
  createRoute({
9038
9116
  method: "get",
9039
9117
  path: "/component/{dataComponentId}/agents",
@@ -9066,7 +9144,7 @@ app15.openapi(
9066
9144
  return c.json({ data: agents });
9067
9145
  }
9068
9146
  );
9069
- app15.openapi(
9147
+ app16.openapi(
9070
9148
  createRoute({
9071
9149
  method: "post",
9072
9150
  path: "/",
@@ -9139,7 +9217,7 @@ app15.openapi(
9139
9217
  return c.json({ data: association }, 201);
9140
9218
  }
9141
9219
  );
9142
- app15.openapi(
9220
+ app16.openapi(
9143
9221
  createRoute({
9144
9222
  method: "delete",
9145
9223
  path: "/agent/{subAgentId}/component/{dataComponentId}",
@@ -9181,7 +9259,7 @@ app15.openapi(
9181
9259
  });
9182
9260
  }
9183
9261
  );
9184
- app15.openapi(
9262
+ app16.openapi(
9185
9263
  createRoute({
9186
9264
  method: "get",
9187
9265
  path: "/agent/{subAgentId}/component/{dataComponentId}/exists",
@@ -9214,15 +9292,15 @@ app15.openapi(
9214
9292
  return c.json({ exists });
9215
9293
  }
9216
9294
  );
9217
- var subAgentDataComponents_default = app15;
9218
- var app16 = new OpenAPIHono();
9219
- app16.use("/", async (c, next) => {
9295
+ var subAgentDataComponents_default = app16;
9296
+ var app17 = new OpenAPIHono();
9297
+ app17.use("/", async (c, next) => {
9220
9298
  if (c.req.method === "POST") {
9221
9299
  return requirePermission({ sub_agent: ["create"] })(c, next);
9222
9300
  }
9223
9301
  return next();
9224
9302
  });
9225
- app16.use("/:id", async (c, next) => {
9303
+ app17.use("/:id", async (c, next) => {
9226
9304
  if (c.req.method === "PUT") {
9227
9305
  return requirePermission({ sub_agent: ["update"] })(c, next);
9228
9306
  }
@@ -9231,7 +9309,7 @@ app16.use("/:id", async (c, next) => {
9231
9309
  }
9232
9310
  return next();
9233
9311
  });
9234
- app16.openapi(
9312
+ app17.openapi(
9235
9313
  createRoute({
9236
9314
  method: "get",
9237
9315
  path: "/",
@@ -9273,7 +9351,7 @@ app16.openapi(
9273
9351
  }
9274
9352
  }
9275
9353
  );
9276
- app16.openapi(
9354
+ app17.openapi(
9277
9355
  createRoute({
9278
9356
  method: "get",
9279
9357
  path: "/{id}",
@@ -9310,7 +9388,7 @@ app16.openapi(
9310
9388
  return c.json({ data: relation });
9311
9389
  }
9312
9390
  );
9313
- app16.openapi(
9391
+ app17.openapi(
9314
9392
  createRoute({
9315
9393
  method: "post",
9316
9394
  path: "/",
@@ -9366,7 +9444,7 @@ app16.openapi(
9366
9444
  return c.json({ data: relation }, 201);
9367
9445
  }
9368
9446
  );
9369
- app16.openapi(
9447
+ app17.openapi(
9370
9448
  createRoute({
9371
9449
  method: "put",
9372
9450
  path: "/{id}",
@@ -9412,7 +9490,7 @@ app16.openapi(
9412
9490
  return c.json({ data: updatedRelation });
9413
9491
  }
9414
9492
  );
9415
- app16.openapi(
9493
+ app17.openapi(
9416
9494
  createRoute({
9417
9495
  method: "delete",
9418
9496
  path: "/{id}",
@@ -9451,15 +9529,15 @@ app16.openapi(
9451
9529
  return c.body(null, 204);
9452
9530
  }
9453
9531
  );
9454
- var subAgentExternalAgentRelations_default = app16;
9455
- var app17 = new OpenAPIHono();
9456
- app17.use("/", async (c, next) => {
9532
+ var subAgentExternalAgentRelations_default = app17;
9533
+ var app18 = new OpenAPIHono();
9534
+ app18.use("/", async (c, next) => {
9457
9535
  if (c.req.method === "POST") {
9458
9536
  return requirePermission({ sub_agent: ["create"] })(c, next);
9459
9537
  }
9460
9538
  return next();
9461
9539
  });
9462
- app17.use("/:id", async (c, next) => {
9540
+ app18.use("/:id", async (c, next) => {
9463
9541
  if (c.req.method === "PUT") {
9464
9542
  return requirePermission({ sub_agent: ["update"] })(c, next);
9465
9543
  }
@@ -9468,7 +9546,7 @@ app17.use("/:id", async (c, next) => {
9468
9546
  }
9469
9547
  return next();
9470
9548
  });
9471
- app17.openapi(
9549
+ app18.openapi(
9472
9550
  createRoute({
9473
9551
  method: "get",
9474
9552
  path: "/",
@@ -9528,7 +9606,7 @@ app17.openapi(
9528
9606
  }
9529
9607
  }
9530
9608
  );
9531
- app17.openapi(
9609
+ app18.openapi(
9532
9610
  createRoute({
9533
9611
  method: "get",
9534
9612
  path: "/{id}",
@@ -9565,7 +9643,7 @@ app17.openapi(
9565
9643
  return c.json({ data: agentRelation });
9566
9644
  }
9567
9645
  );
9568
- app17.openapi(
9646
+ app18.openapi(
9569
9647
  createRoute({
9570
9648
  method: "post",
9571
9649
  path: "/",
@@ -9639,7 +9717,7 @@ app17.openapi(
9639
9717
  return c.json({ data: agentRelation }, 201);
9640
9718
  }
9641
9719
  );
9642
- app17.openapi(
9720
+ app18.openapi(
9643
9721
  createRoute({
9644
9722
  method: "put",
9645
9723
  path: "/{id}",
@@ -9685,7 +9763,7 @@ app17.openapi(
9685
9763
  return c.json({ data: updatedAgentRelation });
9686
9764
  }
9687
9765
  );
9688
- app17.openapi(
9766
+ app18.openapi(
9689
9767
  createRoute({
9690
9768
  method: "delete",
9691
9769
  path: "/{id}",
@@ -9724,15 +9802,15 @@ app17.openapi(
9724
9802
  return c.body(null, 204);
9725
9803
  }
9726
9804
  );
9727
- var subAgentRelations_default = app17;
9728
- var app18 = new OpenAPIHono();
9729
- app18.use("/", async (c, next) => {
9805
+ var subAgentRelations_default = app18;
9806
+ var app19 = new OpenAPIHono();
9807
+ app19.use("/", async (c, next) => {
9730
9808
  if (c.req.method === "POST") {
9731
9809
  return requirePermission({ sub_agent: ["create"] })(c, next);
9732
9810
  }
9733
9811
  return next();
9734
9812
  });
9735
- app18.use("/:id", async (c, next) => {
9813
+ app19.use("/:id", async (c, next) => {
9736
9814
  if (c.req.method === "PUT") {
9737
9815
  return requirePermission({ sub_agent: ["update"] })(c, next);
9738
9816
  }
@@ -9741,7 +9819,7 @@ app18.use("/:id", async (c, next) => {
9741
9819
  }
9742
9820
  return next();
9743
9821
  });
9744
- app18.openapi(
9822
+ app19.openapi(
9745
9823
  createRoute({
9746
9824
  method: "get",
9747
9825
  path: "/",
@@ -9782,7 +9860,7 @@ app18.openapi(
9782
9860
  return c.json(dataWithType);
9783
9861
  }
9784
9862
  );
9785
- app18.openapi(
9863
+ app19.openapi(
9786
9864
  createRoute({
9787
9865
  method: "get",
9788
9866
  path: "/{id}",
@@ -9823,7 +9901,7 @@ app18.openapi(
9823
9901
  return c.json({ data: subAgentWithType });
9824
9902
  }
9825
9903
  );
9826
- app18.openapi(
9904
+ app19.openapi(
9827
9905
  createRoute({
9828
9906
  method: "post",
9829
9907
  path: "/",
@@ -9870,7 +9948,7 @@ app18.openapi(
9870
9948
  return c.json({ data: subAgentWithType }, 201);
9871
9949
  }
9872
9950
  );
9873
- app18.openapi(
9951
+ app19.openapi(
9874
9952
  createRoute({
9875
9953
  method: "put",
9876
9954
  path: "/{id}",
@@ -9920,7 +9998,7 @@ app18.openapi(
9920
9998
  return c.json({ data: subAgentWithType });
9921
9999
  }
9922
10000
  );
9923
- app18.openapi(
10001
+ app19.openapi(
9924
10002
  createRoute({
9925
10003
  method: "delete",
9926
10004
  path: "/{id}",
@@ -9941,33 +10019,51 @@ app18.openapi(
9941
10019
  schema: ErrorResponseSchema
9942
10020
  }
9943
10021
  }
10022
+ },
10023
+ 409: {
10024
+ description: "SubAgent is set as default and cannot be deleted",
10025
+ content: {
10026
+ "application/json": {
10027
+ schema: ErrorResponseSchema
10028
+ }
10029
+ }
9944
10030
  }
9945
10031
  }
9946
10032
  }),
9947
10033
  async (c) => {
9948
10034
  const { tenantId, projectId, agentId, id } = c.req.valid("param");
9949
- const deleted = await deleteSubAgent(dbClient_default)({
9950
- scopes: { tenantId, projectId, agentId },
9951
- subAgentId: id
9952
- });
9953
- if (!deleted) {
9954
- throw createApiError({
9955
- code: "not_found",
9956
- message: "SubAgent not found"
10035
+ try {
10036
+ const deleted = await deleteSubAgent(dbClient_default)({
10037
+ scopes: { tenantId, projectId, agentId },
10038
+ subAgentId: id
9957
10039
  });
10040
+ if (!deleted) {
10041
+ throw createApiError({
10042
+ code: "not_found",
10043
+ message: "SubAgent not found"
10044
+ });
10045
+ }
10046
+ return c.body(null, 204);
10047
+ } catch (error) {
10048
+ if (error instanceof SubAgentIsDefaultError) {
10049
+ throw createApiError({
10050
+ code: "conflict",
10051
+ message: error.message
10052
+ });
10053
+ }
10054
+ throw error;
9958
10055
  }
9959
- return c.body(null, 204);
9960
10056
  }
9961
10057
  );
9962
- var subAgents_default = app18;
9963
- var app19 = new OpenAPIHono();
9964
- app19.use("/", async (c, next) => {
10058
+ var subAgents_default = app19;
10059
+ var app20 = new OpenAPIHono();
10060
+ app20.use("/", async (c, next) => {
9965
10061
  if (c.req.method === "POST") {
9966
10062
  return requirePermission({ sub_agent: ["create"] })(c, next);
9967
10063
  }
9968
10064
  return next();
9969
10065
  });
9970
- app19.use("/:id", async (c, next) => {
10066
+ app20.use("/:id", async (c, next) => {
9971
10067
  if (c.req.method === "PUT") {
9972
10068
  return requirePermission({ sub_agent: ["update"] })(c, next);
9973
10069
  }
@@ -9976,7 +10072,7 @@ app19.use("/:id", async (c, next) => {
9976
10072
  }
9977
10073
  return next();
9978
10074
  });
9979
- app19.openapi(
10075
+ app20.openapi(
9980
10076
  createRoute({
9981
10077
  method: "get",
9982
10078
  path: "/",
@@ -10018,7 +10114,7 @@ app19.openapi(
10018
10114
  }
10019
10115
  }
10020
10116
  );
10021
- app19.openapi(
10117
+ app20.openapi(
10022
10118
  createRoute({
10023
10119
  method: "get",
10024
10120
  path: "/{id}",
@@ -10055,7 +10151,7 @@ app19.openapi(
10055
10151
  return c.json({ data: relation });
10056
10152
  }
10057
10153
  );
10058
- app19.openapi(
10154
+ app20.openapi(
10059
10155
  createRoute({
10060
10156
  method: "post",
10061
10157
  path: "/",
@@ -10111,7 +10207,7 @@ app19.openapi(
10111
10207
  return c.json({ data: relation }, 201);
10112
10208
  }
10113
10209
  );
10114
- app19.openapi(
10210
+ app20.openapi(
10115
10211
  createRoute({
10116
10212
  method: "put",
10117
10213
  path: "/{id}",
@@ -10157,7 +10253,7 @@ app19.openapi(
10157
10253
  return c.json({ data: updatedRelation });
10158
10254
  }
10159
10255
  );
10160
- app19.openapi(
10256
+ app20.openapi(
10161
10257
  createRoute({
10162
10258
  method: "delete",
10163
10259
  path: "/{id}",
@@ -10196,15 +10292,15 @@ app19.openapi(
10196
10292
  return c.body(null, 204);
10197
10293
  }
10198
10294
  );
10199
- var subAgentTeamAgentRelations_default = app19;
10200
- var app20 = new OpenAPIHono();
10201
- app20.use("/", async (c, next) => {
10295
+ var subAgentTeamAgentRelations_default = app20;
10296
+ var app21 = new OpenAPIHono();
10297
+ app21.use("/", async (c, next) => {
10202
10298
  if (c.req.method === "POST") {
10203
10299
  return requirePermission({ sub_agent: ["create"] })(c, next);
10204
10300
  }
10205
10301
  return next();
10206
10302
  });
10207
- app20.use("/:id", async (c, next) => {
10303
+ app21.use("/:id", async (c, next) => {
10208
10304
  if (c.req.method === "PUT") {
10209
10305
  return requirePermission({ sub_agent: ["update"] })(c, next);
10210
10306
  }
@@ -10213,7 +10309,7 @@ app20.use("/:id", async (c, next) => {
10213
10309
  }
10214
10310
  return next();
10215
10311
  });
10216
- app20.openapi(
10312
+ app21.openapi(
10217
10313
  createRoute({
10218
10314
  method: "get",
10219
10315
  path: "/",
@@ -10275,7 +10371,7 @@ app20.openapi(
10275
10371
  return c.json(result);
10276
10372
  }
10277
10373
  );
10278
- app20.openapi(
10374
+ app21.openapi(
10279
10375
  createRoute({
10280
10376
  method: "get",
10281
10377
  path: "/{id}",
@@ -10312,7 +10408,7 @@ app20.openapi(
10312
10408
  return c.json({ data: agentToolRelation });
10313
10409
  }
10314
10410
  );
10315
- app20.openapi(
10411
+ app21.openapi(
10316
10412
  createRoute({
10317
10413
  method: "get",
10318
10414
  path: "/tool/{toolId}/sub-agents",
@@ -10348,7 +10444,7 @@ app20.openapi(
10348
10444
  return c.json(dbResult);
10349
10445
  }
10350
10446
  );
10351
- app20.openapi(
10447
+ app21.openapi(
10352
10448
  createRoute({
10353
10449
  method: "post",
10354
10450
  path: "/",
@@ -10411,7 +10507,7 @@ app20.openapi(
10411
10507
  }
10412
10508
  }
10413
10509
  );
10414
- app20.openapi(
10510
+ app21.openapi(
10415
10511
  createRoute({
10416
10512
  method: "put",
10417
10513
  path: "/{id}",
@@ -10463,7 +10559,7 @@ app20.openapi(
10463
10559
  return c.json({ data: updatedAgentToolRelation });
10464
10560
  }
10465
10561
  );
10466
- app20.openapi(
10562
+ app21.openapi(
10467
10563
  createRoute({
10468
10564
  method: "delete",
10469
10565
  path: "/{id}",
@@ -10502,12 +10598,12 @@ app20.openapi(
10502
10598
  return c.body(null, 204);
10503
10599
  }
10504
10600
  );
10505
- var subAgentToolRelations_default = app20;
10506
- var app21 = new OpenAPIHono();
10601
+ var subAgentToolRelations_default = app21;
10602
+ var app22 = new OpenAPIHono();
10507
10603
  var ThirdPartyMCPServerBodySchema = z.object({
10508
10604
  url: z.url().describe("The MCP server URL to fetch details for")
10509
10605
  });
10510
- app21.openapi(
10606
+ app22.openapi(
10511
10607
  createRoute({
10512
10608
  method: "post",
10513
10609
  path: "/",
@@ -10546,10 +10642,10 @@ app21.openapi(
10546
10642
  });
10547
10643
  }
10548
10644
  );
10549
- var thirdPartyMCPServers_default = app21;
10645
+ var thirdPartyMCPServers_default = app22;
10550
10646
  var logger5 = getLogger("tools");
10551
- var app22 = new OpenAPIHono();
10552
- app22.use("/", async (c, next) => {
10647
+ var app23 = new OpenAPIHono();
10648
+ app23.use("/", async (c, next) => {
10553
10649
  if (c.req.method === "POST") {
10554
10650
  return requirePermission({ tool: ["create"] })(
10555
10651
  c,
@@ -10558,7 +10654,7 @@ app22.use("/", async (c, next) => {
10558
10654
  }
10559
10655
  return next();
10560
10656
  });
10561
- app22.use("/:id", async (c, next) => {
10657
+ app23.use("/:id", async (c, next) => {
10562
10658
  if (c.req.method === "PUT") {
10563
10659
  return requirePermission({ tool: ["update"] })(
10564
10660
  c,
@@ -10573,7 +10669,7 @@ app22.use("/:id", async (c, next) => {
10573
10669
  }
10574
10670
  return next();
10575
10671
  });
10576
- app22.openapi(
10672
+ app23.openapi(
10577
10673
  createRoute({
10578
10674
  method: "get",
10579
10675
  path: "/",
@@ -10633,7 +10729,7 @@ app22.openapi(
10633
10729
  return c.json(result);
10634
10730
  }
10635
10731
  );
10636
- app22.openapi(
10732
+ app23.openapi(
10637
10733
  createRoute({
10638
10734
  method: "get",
10639
10735
  path: "/{id}",
@@ -10670,7 +10766,7 @@ app22.openapi(
10670
10766
  });
10671
10767
  }
10672
10768
  );
10673
- app22.openapi(
10769
+ app23.openapi(
10674
10770
  createRoute({
10675
10771
  method: "post",
10676
10772
  path: "/",
@@ -10723,7 +10819,7 @@ app22.openapi(
10723
10819
  );
10724
10820
  }
10725
10821
  );
10726
- app22.openapi(
10822
+ app23.openapi(
10727
10823
  createRoute({
10728
10824
  method: "put",
10729
10825
  path: "/{id}",
@@ -10784,7 +10880,7 @@ app22.openapi(
10784
10880
  });
10785
10881
  }
10786
10882
  );
10787
- app22.openapi(
10883
+ app23.openapi(
10788
10884
  createRoute({
10789
10885
  method: "delete",
10790
10886
  path: "/{id}",
@@ -10813,48 +10909,49 @@ app22.openapi(
10813
10909
  return c.body(null, 204);
10814
10910
  }
10815
10911
  );
10816
- var tools_default = app22;
10912
+ var tools_default = app23;
10817
10913
 
10818
10914
  // src/routes/index.ts
10819
- var app23 = new OpenAPIHono();
10820
- app23.route("/projects", projects_default);
10821
- app23.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
10822
- app23.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
10823
- app23.route(
10915
+ var app24 = new OpenAPIHono();
10916
+ app24.route("/projects", projects_default);
10917
+ app24.route("/projects/:projectId/agents/:agentId/sub-agents", subAgents_default);
10918
+ app24.route("/projects/:projectId/agents/:agentId/sub-agent-relations", subAgentRelations_default);
10919
+ app24.route(
10824
10920
  "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/external-agent-relations",
10825
10921
  subAgentExternalAgentRelations_default
10826
10922
  );
10827
- app23.route(
10923
+ app24.route(
10828
10924
  "/projects/:projectId/agents/:agentId/sub-agents/:subAgentId/team-agent-relations",
10829
10925
  subAgentTeamAgentRelations_default
10830
10926
  );
10831
- app23.route("/projects/:projectId/agents", agent_default);
10832
- app23.route(
10927
+ app24.route("/projects/:projectId/agents", agent_default);
10928
+ app24.route(
10833
10929
  "/projects/:projectId/agents/:agentId/sub-agent-tool-relations",
10834
10930
  subAgentToolRelations_default
10835
10931
  );
10836
- app23.route(
10932
+ app24.route(
10837
10933
  "/projects/:projectId/agents/:agentId/sub-agent-artifact-components",
10838
10934
  subAgentArtifactComponents_default
10839
10935
  );
10840
- app23.route(
10936
+ app24.route(
10841
10937
  "/projects/:projectId/agents/:agentId/sub-agent-data-components",
10842
10938
  subAgentDataComponents_default
10843
10939
  );
10844
- app23.route("/projects/:projectId/artifact-components", artifactComponents_default);
10845
- app23.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
10846
- app23.route("/projects/:projectId/credentials", credentials_default);
10847
- app23.route("/projects/:projectId/credential-stores", credentialStores_default);
10848
- app23.route("/projects/:projectId/data-components", dataComponents_default);
10849
- app23.route("/projects/:projectId/external-agents", externalAgents_default);
10850
- app23.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
10851
- app23.route("/projects/:projectId/functions", functions_default);
10852
- app23.route("/projects/:projectId/tools", tools_default);
10853
- app23.route("/projects/:projectId/api-keys", apiKeys_default);
10854
- app23.route("/projects/:projectId/agent", agentFull_default);
10855
- app23.route("/projects/:projectId/mcp-catalog", mcpCatalog_default);
10856
- app23.route("/projects/:projectId/third-party-mcp-servers", thirdPartyMCPServers_default);
10857
- var routes_default = app23;
10940
+ app24.route("/projects/:projectId/artifact-components", artifactComponents_default);
10941
+ app24.route("/projects/:projectId/agents/:agentId/context-configs", contextConfigs_default);
10942
+ app24.route("/projects/:projectId/conversations", conversations_default);
10943
+ app24.route("/projects/:projectId/credentials", credentials_default);
10944
+ app24.route("/projects/:projectId/credential-stores", credentialStores_default);
10945
+ app24.route("/projects/:projectId/data-components", dataComponents_default);
10946
+ app24.route("/projects/:projectId/external-agents", externalAgents_default);
10947
+ app24.route("/projects/:projectId/agents/:agentId/function-tools", functionTools_default);
10948
+ app24.route("/projects/:projectId/functions", functions_default);
10949
+ app24.route("/projects/:projectId/tools", tools_default);
10950
+ app24.route("/projects/:projectId/api-keys", apiKeys_default);
10951
+ app24.route("/projects/:projectId/agent", agentFull_default);
10952
+ app24.route("/projects/:projectId/mcp-catalog", mcpCatalog_default);
10953
+ app24.route("/projects/:projectId/third-party-mcp-servers", thirdPartyMCPServers_default);
10954
+ var routes_default = app24;
10858
10955
  var invitationsRoutes = new OpenAPIHono();
10859
10956
  var PendingInvitationSchema = z$1.object({
10860
10957
  id: z$1.string(),
@@ -10902,6 +10999,17 @@ invitationsRoutes.openapi(
10902
10999
  }
10903
11000
  );
10904
11001
  var invitations_default = invitationsRoutes;
11002
+ var app25 = new Hono();
11003
+ app25.all("/", async (c) => {
11004
+ const transport = new StreamableHTTPTransport();
11005
+ const noOpLogger = createConsoleLogger("error");
11006
+ const mcpServer = createMCPServer({
11007
+ logger: noOpLogger
11008
+ });
11009
+ await mcpServer.connect(transport);
11010
+ return transport.handleRequest(c);
11011
+ });
11012
+ var mcp_default = app25;
10905
11013
  var logger6 = getLogger("oauth-service");
10906
11014
  var pkceStore = /* @__PURE__ */ new Map();
10907
11015
  function storePKCEVerifier(state, codeVerifier, toolId, tenantId, projectId, clientInformation, metadata2, resourceUrl) {
@@ -11039,7 +11147,7 @@ async function findOrCreateCredential(tenantId, projectId, credentialData) {
11039
11147
  throw new Error(`Failed to save credential '${credentialData.id}' to database`);
11040
11148
  }
11041
11149
  }
11042
- var app24 = new OpenAPIHono();
11150
+ var app26 = new OpenAPIHono();
11043
11151
  var logger7 = getLogger("oauth-callback");
11044
11152
  function getBaseUrlFromRequest(c) {
11045
11153
  const url = new URL(c.req.url);
@@ -11115,7 +11223,7 @@ function generateOAuthCallbackPage(params) {
11115
11223
  </html>
11116
11224
  `;
11117
11225
  }
11118
- app24.openapi(
11226
+ app26.openapi(
11119
11227
  createRoute({
11120
11228
  method: "get",
11121
11229
  path: "/login",
@@ -11180,7 +11288,7 @@ app24.openapi(
11180
11288
  }
11181
11289
  }
11182
11290
  );
11183
- app24.openapi(
11291
+ app26.openapi(
11184
11292
  createRoute({
11185
11293
  method: "get",
11186
11294
  path: "/callback",
@@ -11323,10 +11431,10 @@ app24.openapi(
11323
11431
  }
11324
11432
  }
11325
11433
  );
11326
- var oauth_default = app24;
11434
+ var oauth_default = app26;
11327
11435
  var logger8 = getLogger("playgroundToken");
11328
- var app25 = new OpenAPIHono();
11329
- app25.use("/", requirePermission({ agent: ["create"] }));
11436
+ var app27 = new OpenAPIHono();
11437
+ app27.use("/", requirePermission({ agent: ["create"] }));
11330
11438
  var PlaygroundTokenRequestSchema = z$1.object({
11331
11439
  projectId: z$1.string(),
11332
11440
  agentId: z$1.string()
@@ -11335,7 +11443,7 @@ var PlaygroundTokenResponseSchema = z$1.object({
11335
11443
  apiKey: z$1.string().describe("Temporary API key for playground use"),
11336
11444
  expiresAt: z$1.string().describe("ISO 8601 timestamp when the key expires")
11337
11445
  });
11338
- app25.openapi(
11446
+ app27.openapi(
11339
11447
  createRoute({
11340
11448
  method: "post",
11341
11449
  path: "/",
@@ -11426,16 +11534,16 @@ app25.openapi(
11426
11534
  );
11427
11535
  }
11428
11536
  );
11429
- var playgroundToken_default = app25;
11537
+ var playgroundToken_default = app27;
11430
11538
  var logger9 = getLogger("projectFull");
11431
- var app26 = new OpenAPIHono();
11432
- app26.use("/project-full", async (c, next) => {
11539
+ var app28 = new OpenAPIHono();
11540
+ app28.use("/project-full", async (c, next) => {
11433
11541
  if (c.req.method === "POST") {
11434
11542
  return requirePermission({ project: ["create"] })(c, next);
11435
11543
  }
11436
11544
  return next();
11437
11545
  });
11438
- app26.use("/project-full/:projectId", async (c, next) => {
11546
+ app28.use("/project-full/:projectId", async (c, next) => {
11439
11547
  if (c.req.method === "PUT") {
11440
11548
  return requirePermission({ project: ["update"] })(c, next);
11441
11549
  }
@@ -11444,7 +11552,7 @@ app26.use("/project-full/:projectId", async (c, next) => {
11444
11552
  }
11445
11553
  return next();
11446
11554
  });
11447
- app26.openapi(
11555
+ app28.openapi(
11448
11556
  createRoute({
11449
11557
  method: "post",
11450
11558
  path: "/project-full",
@@ -11504,7 +11612,7 @@ app26.openapi(
11504
11612
  }
11505
11613
  }
11506
11614
  );
11507
- app26.openapi(
11615
+ app28.openapi(
11508
11616
  createRoute({
11509
11617
  method: "get",
11510
11618
  path: "/project-full/{projectId}",
@@ -11557,7 +11665,7 @@ app26.openapi(
11557
11665
  }
11558
11666
  }
11559
11667
  );
11560
- app26.openapi(
11668
+ app28.openapi(
11561
11669
  createRoute({
11562
11670
  method: "put",
11563
11671
  path: "/project-full/{projectId}",
@@ -11641,7 +11749,7 @@ app26.openapi(
11641
11749
  }
11642
11750
  }
11643
11751
  );
11644
- app26.openapi(
11752
+ app28.openapi(
11645
11753
  createRoute({
11646
11754
  method: "delete",
11647
11755
  path: "/project-full/{projectId}",
@@ -11689,7 +11797,7 @@ app26.openapi(
11689
11797
  }
11690
11798
  }
11691
11799
  );
11692
- var projectFull_default = app26;
11800
+ var projectFull_default = app28;
11693
11801
  var userOrganizationsRoutes = new OpenAPIHono();
11694
11802
  userOrganizationsRoutes.openapi(
11695
11803
  createRoute({
@@ -11784,15 +11892,15 @@ function isOriginAllowed(origin) {
11784
11892
  }
11785
11893
  }
11786
11894
  function createManagementHono(serverConfig, credentialStores, auth) {
11787
- const app27 = new OpenAPIHono();
11788
- app27.use("*", requestId());
11789
- app27.use("*", async (c, next) => {
11895
+ const app29 = new OpenAPIHono();
11896
+ app29.use("*", requestId());
11897
+ app29.use("*", async (c, next) => {
11790
11898
  c.set("serverConfig", serverConfig);
11791
11899
  c.set("credentialStores", credentialStores);
11792
11900
  c.set("auth", auth);
11793
11901
  return next();
11794
11902
  });
11795
- app27.use(
11903
+ app29.use(
11796
11904
  pinoLogger({
11797
11905
  pino: getLogger("agents-manage-api").getPinoInstance(),
11798
11906
  http: {
@@ -11805,7 +11913,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11805
11913
  }
11806
11914
  })
11807
11915
  );
11808
- app27.onError(async (err2, c) => {
11916
+ app29.onError(async (err2, c) => {
11809
11917
  const isExpectedError = err2 instanceof HTTPException;
11810
11918
  const status = isExpectedError ? err2.status : 500;
11811
11919
  const requestId2 = c.get("requestId") || "unknown";
@@ -11875,7 +11983,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11875
11983
  return c.body(JSON.stringify(responseBody));
11876
11984
  });
11877
11985
  if (auth) {
11878
- app27.use(
11986
+ app29.use(
11879
11987
  "/api/auth/*",
11880
11988
  cors({
11881
11989
  origin: (origin) => {
@@ -11888,11 +11996,11 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11888
11996
  credentials: true
11889
11997
  })
11890
11998
  );
11891
- app27.on(["POST", "GET"], "/api/auth/*", (c) => {
11999
+ app29.on(["POST", "GET", "OPTIONS"], "/api/auth/*", (c) => {
11892
12000
  return auth.handler(c.req.raw);
11893
12001
  });
11894
12002
  }
11895
- app27.use(
12003
+ app29.use(
11896
12004
  "/tenants/*/playground/token",
11897
12005
  cors({
11898
12006
  origin: (origin) => {
@@ -11905,7 +12013,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11905
12013
  credentials: true
11906
12014
  })
11907
12015
  );
11908
- app27.use("*", async (c, next) => {
12016
+ app29.use("*", async (c, next) => {
11909
12017
  if (auth && c.req.path.startsWith("/api/auth/")) {
11910
12018
  return next();
11911
12019
  }
@@ -11923,7 +12031,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11923
12031
  credentials: true
11924
12032
  })(c, next);
11925
12033
  });
11926
- app27.use("*", async (c, next) => {
12034
+ app29.use("*", async (c, next) => {
11927
12035
  if (env.DISABLE_AUTH || !auth) {
11928
12036
  c.set("user", null);
11929
12037
  c.set("session", null);
@@ -11941,7 +12049,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11941
12049
  c.set("session", session.session);
11942
12050
  await next();
11943
12051
  });
11944
- app27.openapi(
12052
+ app29.openapi(
11945
12053
  createRoute({
11946
12054
  method: "get",
11947
12055
  path: "/health",
@@ -11958,7 +12066,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11958
12066
  return c.body(null, 204);
11959
12067
  }
11960
12068
  );
11961
- app27.use("/tenants/*", async (c, next) => {
12069
+ app29.use("/tenants/*", async (c, next) => {
11962
12070
  const isTestEnvironment = process.env.ENVIRONMENT === "test";
11963
12071
  if (env.DISABLE_AUTH || isTestEnvironment) {
11964
12072
  await next();
@@ -11972,17 +12080,18 @@ function createManagementHono(serverConfig, credentialStores, auth) {
11972
12080
  });
11973
12081
  const isTestEnv = process.env.ENVIRONMENT === "test";
11974
12082
  if (!env.DISABLE_AUTH && !isTestEnv) {
11975
- app27.use("/tenants/:tenantId/*", requireTenantAccess());
11976
- }
11977
- app27.route("/api/users/:userId/organizations", userOrganizations_default);
11978
- app27.route("/api/invitations", invitations_default);
11979
- app27.route("/tenants/:tenantId", routes_default);
11980
- app27.route("/tenants/:tenantId/playground/token", playgroundToken_default);
11981
- app27.route("/tenants/:tenantId", projectFull_default);
11982
- app27.route("/oauth", oauth_default);
11983
- setupOpenAPIRoutes(app27);
12083
+ app29.use("/tenants/:tenantId/*", requireTenantAccess());
12084
+ }
12085
+ app29.route("/api/users/:userId/organizations", userOrganizations_default);
12086
+ app29.route("/api/invitations", invitations_default);
12087
+ app29.route("/tenants/:tenantId", routes_default);
12088
+ app29.route("/tenants/:tenantId/playground/token", playgroundToken_default);
12089
+ app29.route("/tenants/:tenantId", projectFull_default);
12090
+ app29.route("/oauth", oauth_default);
12091
+ app29.route("/mcp", mcp_default);
12092
+ setupOpenAPIRoutes(app29);
11984
12093
  const baseApp = new Hono();
11985
- baseApp.route("/", app27);
12094
+ baseApp.route("/", app29);
11986
12095
  return baseApp;
11987
12096
  }
11988
12097
  var logger11 = getLogger("initialization");