@inkeep/agents-manage-api 0.38.3 → 0.39.1

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-JCVMVG3J.js';
2
- import { loadEnvironmentFiles, createDatabaseClient, getLogger, 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, getComposioOAuthRedirectUrl, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, getUserScopedCredentialReference, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, getUserOrganizations, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, handleApiError, validateAndGetApiKey } from '@inkeep/agents-core';
2
+ import { loadEnvironmentFiles, createDatabaseClient, getLogger, getUserOrganizations, 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, getComposioOAuthRedirectUrl, McpToolListResponse, ToolStatusSchema, listTools, dbResultToMcpTool, McpToolResponse, getToolById, ToolApiInsertSchema, createTool, ToolApiUpdateSchema, updateTool, getUserScopedCredentialReference, deleteTool, getPendingInvitationsByEmail, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, CredentialStoreType, projectExists, signTempToken, FullProjectDefinitionResponse, FullProjectDefinitionSchema, createFullProjectServerSide, getFullProject, updateFullProjectServerSide, deleteFullProject, addUserToOrganization, initiateMcpOAuthFlow, exchangeMcpAuthorizationCode, organization, getUserByEmail, member, createDefaultCredentialStores, CredentialStoreRegistry, handleApiError, validateAndGetApiKey } from '@inkeep/agents-core';
3
3
  import { createAuth } from '@inkeep/agents-core/auth';
4
4
  import { z, OpenAPIHono, createRoute } from '@hono/zod-openapi';
5
5
  import { Hono } from 'hono';
@@ -5132,15 +5132,35 @@ var apiKeyAuth = () => createMiddleware(async (c, next) => {
5132
5132
  message: "Missing or invalid authorization header. Expected: Bearer <api_key>"
5133
5133
  });
5134
5134
  }
5135
- const apiKey = authHeader.substring(7);
5136
- if (env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET && apiKey === env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET) {
5135
+ const token = authHeader.substring(7);
5136
+ if (env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET && token === env.INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET) {
5137
5137
  logger.info({}, "Bypass secret authenticated successfully");
5138
5138
  c.set("userId", "system");
5139
5139
  c.set("userEmail", "system@internal");
5140
5140
  await next();
5141
5141
  return;
5142
5142
  }
5143
- const validatedKey = await validateAndGetApiKey(apiKey, dbClient_default);
5143
+ const auth = c.get("auth");
5144
+ if (auth) {
5145
+ try {
5146
+ const headers = new Headers();
5147
+ headers.set("Authorization", authHeader);
5148
+ const session = await auth.api.getSession({ headers });
5149
+ if (session?.user) {
5150
+ logger.info(
5151
+ { userId: session.user.id },
5152
+ "Better-auth session authenticated successfully"
5153
+ );
5154
+ c.set("userId", session.user.id);
5155
+ c.set("userEmail", session.user.email);
5156
+ await next();
5157
+ return;
5158
+ }
5159
+ } catch (error) {
5160
+ logger.debug({ error }, "Better-auth session validation failed, trying API key");
5161
+ }
5162
+ }
5163
+ const validatedKey = await validateAndGetApiKey(token, dbClient_default);
5144
5164
  if (validatedKey) {
5145
5165
  logger.info({ keyId: validatedKey.id }, "API key authenticated successfully");
5146
5166
  c.set("userId", `apikey:${validatedKey.id}`);
@@ -5465,6 +5485,72 @@ function setupOpenAPIRoutes(app30) {
5465
5485
  })
5466
5486
  );
5467
5487
  }
5488
+ var cliAuthRoutes = new OpenAPIHono();
5489
+ var CLIMeResponseSchema = z.object({
5490
+ user: z.object({
5491
+ id: z.string(),
5492
+ email: z.string(),
5493
+ name: z.string().nullable()
5494
+ }),
5495
+ organization: z.object({
5496
+ id: z.string(),
5497
+ name: z.string(),
5498
+ slug: z.string(),
5499
+ role: z.string()
5500
+ })
5501
+ });
5502
+ cliAuthRoutes.openapi(
5503
+ createRoute({
5504
+ method: "get",
5505
+ path: "/me",
5506
+ tags: ["cli"],
5507
+ summary: "Get CLI user info",
5508
+ description: "Get the current authenticated user and their organization for CLI usage",
5509
+ middleware: [sessionAuth()],
5510
+ responses: {
5511
+ 200: {
5512
+ description: "User info with organization",
5513
+ content: {
5514
+ "application/json": {
5515
+ schema: CLIMeResponseSchema
5516
+ }
5517
+ }
5518
+ },
5519
+ 401: {
5520
+ description: "Not authenticated"
5521
+ },
5522
+ 404: {
5523
+ description: "User has no organization"
5524
+ }
5525
+ }
5526
+ }),
5527
+ async (c) => {
5528
+ const user = c.get("user");
5529
+ const userId = c.get("userId");
5530
+ if (!user || !userId) {
5531
+ return c.json({ error: "Not authenticated" }, 401);
5532
+ }
5533
+ const organizations = await getUserOrganizations(dbClient_default)(userId);
5534
+ if (organizations.length === 0) {
5535
+ return c.json({ error: "User has no organization" }, 404);
5536
+ }
5537
+ const org = organizations[0];
5538
+ return c.json({
5539
+ user: {
5540
+ id: user.id,
5541
+ email: user.email,
5542
+ name: user.name || null
5543
+ },
5544
+ organization: {
5545
+ id: org.organizationId,
5546
+ name: org.organizationName || "",
5547
+ slug: org.organizationSlug || "",
5548
+ role: org.role
5549
+ }
5550
+ });
5551
+ }
5552
+ );
5553
+ var cliAuth_default = cliAuthRoutes;
5468
5554
  function formatPermissionsForDisplay(permissions) {
5469
5555
  const formatted = [];
5470
5556
  for (const [resource, actions] of Object.entries(permissions)) {
@@ -35080,6 +35166,7 @@ function createManagementHono(serverConfig, credentialStores, auth) {
35080
35166
  app30.use("/tenants/:tenantId/*", requireTenantAccess());
35081
35167
  }
35082
35168
  app30.route("/api/users/:userId/organizations", userOrganizations_default);
35169
+ app30.route("/api/cli", cliAuth_default);
35083
35170
  app30.route("/api/invitations", invitations_default);
35084
35171
  app30.route("/tenants/:tenantId", routes_default);
35085
35172
  app30.route("/tenants/:tenantId/playground/token", playgroundToken_default);
package/dist/factory.js CHANGED
@@ -1 +1 @@
1
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-BAMAX6LI.js';
1
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-VM5BBJTO.js';
package/dist/index.d.ts CHANGED
@@ -28,6 +28,11 @@ declare const auth: better_auth.Auth<{
28
28
  session: {
29
29
  expiresIn: number;
30
30
  updateAge: number;
31
+ cookieCache: {
32
+ enabled: true;
33
+ maxAge: number;
34
+ strategy: "compact";
35
+ };
31
36
  };
32
37
  advanced: {
33
38
  ipAddress?: {
@@ -59,6 +64,22 @@ declare const auth: better_auth.Auth<{
59
64
  };
60
65
  trustedOrigins: string[];
61
66
  plugins: [{
67
+ id: "bearer";
68
+ hooks: {
69
+ before: {
70
+ matcher(context: better_auth.HookEndpointContext): boolean;
71
+ handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
72
+ context: {
73
+ headers: Headers;
74
+ };
75
+ } | undefined>;
76
+ }[];
77
+ after: {
78
+ matcher(context: better_auth.HookEndpointContext): true;
79
+ handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>;
80
+ }[];
81
+ };
82
+ }, {
62
83
  id: "sso";
63
84
  endpoints: {
64
85
  spMetadata: ReturnType<() => better_auth.StrictEndpoint<"/sso/saml2/sp/metadata", {
@@ -958,6 +979,348 @@ declare const auth: better_auth.Auth<{
958
979
  };
959
980
  }): Promise<void>;
960
981
  };
982
+ }, {
983
+ id: "device-authorization";
984
+ schema: {
985
+ deviceCode: {
986
+ fields: {
987
+ deviceCode: {
988
+ type: "string";
989
+ required: true;
990
+ };
991
+ userCode: {
992
+ type: "string";
993
+ required: true;
994
+ };
995
+ userId: {
996
+ type: "string";
997
+ required: false;
998
+ };
999
+ expiresAt: {
1000
+ type: "date";
1001
+ required: true;
1002
+ };
1003
+ status: {
1004
+ type: "string";
1005
+ required: true;
1006
+ };
1007
+ lastPolledAt: {
1008
+ type: "date";
1009
+ required: false;
1010
+ };
1011
+ pollingInterval: {
1012
+ type: "number";
1013
+ required: false;
1014
+ };
1015
+ clientId: {
1016
+ type: "string";
1017
+ required: false;
1018
+ };
1019
+ scope: {
1020
+ type: "string";
1021
+ required: false;
1022
+ };
1023
+ };
1024
+ };
1025
+ };
1026
+ endpoints: {
1027
+ deviceCode: better_auth.StrictEndpoint<"/device/code", {
1028
+ method: "POST";
1029
+ body: zod.ZodObject<{
1030
+ client_id: zod.ZodString;
1031
+ scope: zod.ZodOptional<zod.ZodString>;
1032
+ }, better_auth.$strip>;
1033
+ error: zod.ZodObject<{
1034
+ error: zod.ZodEnum<{
1035
+ invalid_request: "invalid_request";
1036
+ invalid_client: "invalid_client";
1037
+ }>;
1038
+ error_description: zod.ZodString;
1039
+ }, better_auth.$strip>;
1040
+ metadata: {
1041
+ openapi: {
1042
+ description: string;
1043
+ responses: {
1044
+ 200: {
1045
+ description: string;
1046
+ content: {
1047
+ "application/json": {
1048
+ schema: {
1049
+ type: "object";
1050
+ properties: {
1051
+ device_code: {
1052
+ type: string;
1053
+ description: string;
1054
+ };
1055
+ user_code: {
1056
+ type: string;
1057
+ description: string;
1058
+ };
1059
+ verification_uri: {
1060
+ type: string;
1061
+ format: string;
1062
+ description: string;
1063
+ };
1064
+ verification_uri_complete: {
1065
+ type: string;
1066
+ format: string;
1067
+ description: string;
1068
+ };
1069
+ expires_in: {
1070
+ type: string;
1071
+ description: string;
1072
+ };
1073
+ interval: {
1074
+ type: string;
1075
+ description: string;
1076
+ };
1077
+ };
1078
+ };
1079
+ };
1080
+ };
1081
+ };
1082
+ 400: {
1083
+ description: string;
1084
+ content: {
1085
+ "application/json": {
1086
+ schema: {
1087
+ type: "object";
1088
+ properties: {
1089
+ error: {
1090
+ type: string;
1091
+ enum: string[];
1092
+ };
1093
+ error_description: {
1094
+ type: string;
1095
+ };
1096
+ };
1097
+ };
1098
+ };
1099
+ };
1100
+ };
1101
+ };
1102
+ };
1103
+ };
1104
+ } & {
1105
+ use: any[];
1106
+ }, {
1107
+ device_code: string;
1108
+ user_code: string;
1109
+ verification_uri: string;
1110
+ verification_uri_complete: string;
1111
+ expires_in: number;
1112
+ interval: number;
1113
+ }>;
1114
+ deviceToken: better_auth.StrictEndpoint<"/device/token", {
1115
+ method: "POST";
1116
+ body: zod.ZodObject<{
1117
+ grant_type: zod.ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">;
1118
+ device_code: zod.ZodString;
1119
+ client_id: zod.ZodString;
1120
+ }, better_auth.$strip>;
1121
+ error: zod.ZodObject<{
1122
+ error: zod.ZodEnum<{
1123
+ invalid_request: "invalid_request";
1124
+ authorization_pending: "authorization_pending";
1125
+ slow_down: "slow_down";
1126
+ expired_token: "expired_token";
1127
+ access_denied: "access_denied";
1128
+ invalid_grant: "invalid_grant";
1129
+ }>;
1130
+ error_description: zod.ZodString;
1131
+ }, better_auth.$strip>;
1132
+ metadata: {
1133
+ openapi: {
1134
+ description: string;
1135
+ responses: {
1136
+ 200: {
1137
+ description: string;
1138
+ content: {
1139
+ "application/json": {
1140
+ schema: {
1141
+ type: "object";
1142
+ properties: {
1143
+ session: {
1144
+ $ref: string;
1145
+ };
1146
+ user: {
1147
+ $ref: string;
1148
+ };
1149
+ };
1150
+ };
1151
+ };
1152
+ };
1153
+ };
1154
+ 400: {
1155
+ description: string;
1156
+ content: {
1157
+ "application/json": {
1158
+ schema: {
1159
+ type: "object";
1160
+ properties: {
1161
+ error: {
1162
+ type: string;
1163
+ enum: string[];
1164
+ };
1165
+ error_description: {
1166
+ type: string;
1167
+ };
1168
+ };
1169
+ };
1170
+ };
1171
+ };
1172
+ };
1173
+ };
1174
+ };
1175
+ };
1176
+ } & {
1177
+ use: any[];
1178
+ }, {
1179
+ access_token: string;
1180
+ token_type: string;
1181
+ expires_in: number;
1182
+ scope: string;
1183
+ }>;
1184
+ deviceVerify: better_auth.StrictEndpoint<"/device", {
1185
+ method: "GET";
1186
+ query: zod.ZodObject<{
1187
+ user_code: zod.ZodString;
1188
+ }, better_auth.$strip>;
1189
+ error: zod.ZodObject<{
1190
+ error: zod.ZodEnum<{
1191
+ invalid_request: "invalid_request";
1192
+ }>;
1193
+ error_description: zod.ZodString;
1194
+ }, better_auth.$strip>;
1195
+ metadata: {
1196
+ openapi: {
1197
+ description: string;
1198
+ responses: {
1199
+ 200: {
1200
+ description: string;
1201
+ content: {
1202
+ "application/json": {
1203
+ schema: {
1204
+ type: "object";
1205
+ properties: {
1206
+ user_code: {
1207
+ type: string;
1208
+ description: string;
1209
+ };
1210
+ status: {
1211
+ type: string;
1212
+ enum: string[];
1213
+ description: string;
1214
+ };
1215
+ };
1216
+ };
1217
+ };
1218
+ };
1219
+ };
1220
+ };
1221
+ };
1222
+ };
1223
+ } & {
1224
+ use: any[];
1225
+ }, {
1226
+ user_code: string;
1227
+ status: string;
1228
+ }>;
1229
+ deviceApprove: better_auth.StrictEndpoint<"/device/approve", {
1230
+ method: "POST";
1231
+ body: zod.ZodObject<{
1232
+ userCode: zod.ZodString;
1233
+ }, better_auth.$strip>;
1234
+ error: zod.ZodObject<{
1235
+ error: zod.ZodEnum<{
1236
+ invalid_request: "invalid_request";
1237
+ expired_token: "expired_token";
1238
+ device_code_already_processed: "device_code_already_processed";
1239
+ }>;
1240
+ error_description: zod.ZodString;
1241
+ }, better_auth.$strip>;
1242
+ requireHeaders: true;
1243
+ metadata: {
1244
+ openapi: {
1245
+ description: string;
1246
+ responses: {
1247
+ 200: {
1248
+ description: string;
1249
+ content: {
1250
+ "application/json": {
1251
+ schema: {
1252
+ type: "object";
1253
+ properties: {
1254
+ success: {
1255
+ type: string;
1256
+ };
1257
+ };
1258
+ };
1259
+ };
1260
+ };
1261
+ };
1262
+ };
1263
+ };
1264
+ };
1265
+ } & {
1266
+ use: any[];
1267
+ }, {
1268
+ success: boolean;
1269
+ }>;
1270
+ deviceDeny: better_auth.StrictEndpoint<"/device/deny", {
1271
+ method: "POST";
1272
+ body: zod.ZodObject<{
1273
+ userCode: zod.ZodString;
1274
+ }, better_auth.$strip>;
1275
+ error: zod.ZodObject<{
1276
+ error: zod.ZodEnum<{
1277
+ invalid_request: "invalid_request";
1278
+ expired_token: "expired_token";
1279
+ }>;
1280
+ error_description: zod.ZodString;
1281
+ }, better_auth.$strip>;
1282
+ metadata: {
1283
+ openapi: {
1284
+ description: string;
1285
+ responses: {
1286
+ 200: {
1287
+ description: string;
1288
+ content: {
1289
+ "application/json": {
1290
+ schema: {
1291
+ type: "object";
1292
+ properties: {
1293
+ success: {
1294
+ type: string;
1295
+ };
1296
+ };
1297
+ };
1298
+ };
1299
+ };
1300
+ };
1301
+ };
1302
+ };
1303
+ };
1304
+ } & {
1305
+ use: any[];
1306
+ }, {
1307
+ success: boolean;
1308
+ }>;
1309
+ };
1310
+ $ERROR_CODES: {
1311
+ readonly INVALID_DEVICE_CODE: "Invalid device code";
1312
+ readonly EXPIRED_DEVICE_CODE: "Device code has expired";
1313
+ readonly EXPIRED_USER_CODE: "User code has expired";
1314
+ readonly AUTHORIZATION_PENDING: "Authorization pending";
1315
+ readonly ACCESS_DENIED: "Access denied";
1316
+ readonly INVALID_USER_CODE: "Invalid user code";
1317
+ readonly DEVICE_CODE_ALREADY_PROCESSED: "Device code already processed";
1318
+ readonly POLLING_TOO_FREQUENTLY: "Polling too frequently";
1319
+ readonly USER_NOT_FOUND: "User not found";
1320
+ readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
1321
+ readonly INVALID_DEVICE_CODE_STATUS: "Invalid device code status";
1322
+ readonly AUTHENTICATION_REQUIRED: "Authentication required";
1323
+ };
961
1324
  }];
962
1325
  }> | null;
963
1326
  declare const app: Hono;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-BAMAX6LI.js';
2
- export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-BAMAX6LI.js';
1
+ import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-VM5BBJTO.js';
2
+ export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-VM5BBJTO.js';
3
3
  import { createDefaultCredentialStores, CredentialStoreRegistry } from '@inkeep/agents-core';
4
4
  import { createAuth } from '@inkeep/agents-core/auth';
5
5
  export { Hono } from 'hono';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-manage-api",
3
- "version": "0.38.3",
3
+ "version": "0.39.1",
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",
@@ -33,8 +33,8 @@
33
33
  "nanoid": "^5.1.5",
34
34
  "openid-client": "^6.6.4",
35
35
  "pino": "^9.7.0",
36
- "@inkeep/agents-core": "^0.38.3",
37
- "@inkeep/agents-manage-mcp": "^0.38.3"
36
+ "@inkeep/agents-core": "^0.39.1",
37
+ "@inkeep/agents-manage-mcp": "^0.39.1"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@hono/zod-openapi": "^1.1.5",