@inkeep/agents-manage-api 0.38.3 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BAMAX6LI.js → chunk-VM5BBJTO.js} +91 -4
- package/dist/factory.js +1 -1
- package/dist/index.d.ts +358 -0
- package/dist/index.js +2 -2
- package/package.json +3 -3
|
@@ -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,
|
|
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
|
|
5136
|
-
if (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
|
|
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-
|
|
1
|
+
export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-VM5BBJTO.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,22 @@ declare const auth: better_auth.Auth<{
|
|
|
59
59
|
};
|
|
60
60
|
trustedOrigins: string[];
|
|
61
61
|
plugins: [{
|
|
62
|
+
id: "bearer";
|
|
63
|
+
hooks: {
|
|
64
|
+
before: {
|
|
65
|
+
matcher(context: better_auth.HookEndpointContext): boolean;
|
|
66
|
+
handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
67
|
+
context: {
|
|
68
|
+
headers: Headers;
|
|
69
|
+
};
|
|
70
|
+
} | undefined>;
|
|
71
|
+
}[];
|
|
72
|
+
after: {
|
|
73
|
+
matcher(context: better_auth.HookEndpointContext): true;
|
|
74
|
+
handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<void>;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
62
78
|
id: "sso";
|
|
63
79
|
endpoints: {
|
|
64
80
|
spMetadata: ReturnType<() => better_auth.StrictEndpoint<"/sso/saml2/sp/metadata", {
|
|
@@ -958,6 +974,348 @@ declare const auth: better_auth.Auth<{
|
|
|
958
974
|
};
|
|
959
975
|
}): Promise<void>;
|
|
960
976
|
};
|
|
977
|
+
}, {
|
|
978
|
+
id: "device-authorization";
|
|
979
|
+
schema: {
|
|
980
|
+
deviceCode: {
|
|
981
|
+
fields: {
|
|
982
|
+
deviceCode: {
|
|
983
|
+
type: "string";
|
|
984
|
+
required: true;
|
|
985
|
+
};
|
|
986
|
+
userCode: {
|
|
987
|
+
type: "string";
|
|
988
|
+
required: true;
|
|
989
|
+
};
|
|
990
|
+
userId: {
|
|
991
|
+
type: "string";
|
|
992
|
+
required: false;
|
|
993
|
+
};
|
|
994
|
+
expiresAt: {
|
|
995
|
+
type: "date";
|
|
996
|
+
required: true;
|
|
997
|
+
};
|
|
998
|
+
status: {
|
|
999
|
+
type: "string";
|
|
1000
|
+
required: true;
|
|
1001
|
+
};
|
|
1002
|
+
lastPolledAt: {
|
|
1003
|
+
type: "date";
|
|
1004
|
+
required: false;
|
|
1005
|
+
};
|
|
1006
|
+
pollingInterval: {
|
|
1007
|
+
type: "number";
|
|
1008
|
+
required: false;
|
|
1009
|
+
};
|
|
1010
|
+
clientId: {
|
|
1011
|
+
type: "string";
|
|
1012
|
+
required: false;
|
|
1013
|
+
};
|
|
1014
|
+
scope: {
|
|
1015
|
+
type: "string";
|
|
1016
|
+
required: false;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
endpoints: {
|
|
1022
|
+
deviceCode: better_auth.StrictEndpoint<"/device/code", {
|
|
1023
|
+
method: "POST";
|
|
1024
|
+
body: zod.ZodObject<{
|
|
1025
|
+
client_id: zod.ZodString;
|
|
1026
|
+
scope: zod.ZodOptional<zod.ZodString>;
|
|
1027
|
+
}, better_auth.$strip>;
|
|
1028
|
+
error: zod.ZodObject<{
|
|
1029
|
+
error: zod.ZodEnum<{
|
|
1030
|
+
invalid_request: "invalid_request";
|
|
1031
|
+
invalid_client: "invalid_client";
|
|
1032
|
+
}>;
|
|
1033
|
+
error_description: zod.ZodString;
|
|
1034
|
+
}, better_auth.$strip>;
|
|
1035
|
+
metadata: {
|
|
1036
|
+
openapi: {
|
|
1037
|
+
description: string;
|
|
1038
|
+
responses: {
|
|
1039
|
+
200: {
|
|
1040
|
+
description: string;
|
|
1041
|
+
content: {
|
|
1042
|
+
"application/json": {
|
|
1043
|
+
schema: {
|
|
1044
|
+
type: "object";
|
|
1045
|
+
properties: {
|
|
1046
|
+
device_code: {
|
|
1047
|
+
type: string;
|
|
1048
|
+
description: string;
|
|
1049
|
+
};
|
|
1050
|
+
user_code: {
|
|
1051
|
+
type: string;
|
|
1052
|
+
description: string;
|
|
1053
|
+
};
|
|
1054
|
+
verification_uri: {
|
|
1055
|
+
type: string;
|
|
1056
|
+
format: string;
|
|
1057
|
+
description: string;
|
|
1058
|
+
};
|
|
1059
|
+
verification_uri_complete: {
|
|
1060
|
+
type: string;
|
|
1061
|
+
format: string;
|
|
1062
|
+
description: string;
|
|
1063
|
+
};
|
|
1064
|
+
expires_in: {
|
|
1065
|
+
type: string;
|
|
1066
|
+
description: string;
|
|
1067
|
+
};
|
|
1068
|
+
interval: {
|
|
1069
|
+
type: string;
|
|
1070
|
+
description: string;
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
400: {
|
|
1078
|
+
description: string;
|
|
1079
|
+
content: {
|
|
1080
|
+
"application/json": {
|
|
1081
|
+
schema: {
|
|
1082
|
+
type: "object";
|
|
1083
|
+
properties: {
|
|
1084
|
+
error: {
|
|
1085
|
+
type: string;
|
|
1086
|
+
enum: string[];
|
|
1087
|
+
};
|
|
1088
|
+
error_description: {
|
|
1089
|
+
type: string;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
};
|
|
1097
|
+
};
|
|
1098
|
+
};
|
|
1099
|
+
} & {
|
|
1100
|
+
use: any[];
|
|
1101
|
+
}, {
|
|
1102
|
+
device_code: string;
|
|
1103
|
+
user_code: string;
|
|
1104
|
+
verification_uri: string;
|
|
1105
|
+
verification_uri_complete: string;
|
|
1106
|
+
expires_in: number;
|
|
1107
|
+
interval: number;
|
|
1108
|
+
}>;
|
|
1109
|
+
deviceToken: better_auth.StrictEndpoint<"/device/token", {
|
|
1110
|
+
method: "POST";
|
|
1111
|
+
body: zod.ZodObject<{
|
|
1112
|
+
grant_type: zod.ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">;
|
|
1113
|
+
device_code: zod.ZodString;
|
|
1114
|
+
client_id: zod.ZodString;
|
|
1115
|
+
}, better_auth.$strip>;
|
|
1116
|
+
error: zod.ZodObject<{
|
|
1117
|
+
error: zod.ZodEnum<{
|
|
1118
|
+
invalid_request: "invalid_request";
|
|
1119
|
+
authorization_pending: "authorization_pending";
|
|
1120
|
+
slow_down: "slow_down";
|
|
1121
|
+
expired_token: "expired_token";
|
|
1122
|
+
access_denied: "access_denied";
|
|
1123
|
+
invalid_grant: "invalid_grant";
|
|
1124
|
+
}>;
|
|
1125
|
+
error_description: zod.ZodString;
|
|
1126
|
+
}, better_auth.$strip>;
|
|
1127
|
+
metadata: {
|
|
1128
|
+
openapi: {
|
|
1129
|
+
description: string;
|
|
1130
|
+
responses: {
|
|
1131
|
+
200: {
|
|
1132
|
+
description: string;
|
|
1133
|
+
content: {
|
|
1134
|
+
"application/json": {
|
|
1135
|
+
schema: {
|
|
1136
|
+
type: "object";
|
|
1137
|
+
properties: {
|
|
1138
|
+
session: {
|
|
1139
|
+
$ref: string;
|
|
1140
|
+
};
|
|
1141
|
+
user: {
|
|
1142
|
+
$ref: string;
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
};
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1149
|
+
400: {
|
|
1150
|
+
description: string;
|
|
1151
|
+
content: {
|
|
1152
|
+
"application/json": {
|
|
1153
|
+
schema: {
|
|
1154
|
+
type: "object";
|
|
1155
|
+
properties: {
|
|
1156
|
+
error: {
|
|
1157
|
+
type: string;
|
|
1158
|
+
enum: string[];
|
|
1159
|
+
};
|
|
1160
|
+
error_description: {
|
|
1161
|
+
type: string;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
};
|
|
1166
|
+
};
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
};
|
|
1171
|
+
} & {
|
|
1172
|
+
use: any[];
|
|
1173
|
+
}, {
|
|
1174
|
+
access_token: string;
|
|
1175
|
+
token_type: string;
|
|
1176
|
+
expires_in: number;
|
|
1177
|
+
scope: string;
|
|
1178
|
+
}>;
|
|
1179
|
+
deviceVerify: better_auth.StrictEndpoint<"/device", {
|
|
1180
|
+
method: "GET";
|
|
1181
|
+
query: zod.ZodObject<{
|
|
1182
|
+
user_code: zod.ZodString;
|
|
1183
|
+
}, better_auth.$strip>;
|
|
1184
|
+
error: zod.ZodObject<{
|
|
1185
|
+
error: zod.ZodEnum<{
|
|
1186
|
+
invalid_request: "invalid_request";
|
|
1187
|
+
}>;
|
|
1188
|
+
error_description: zod.ZodString;
|
|
1189
|
+
}, better_auth.$strip>;
|
|
1190
|
+
metadata: {
|
|
1191
|
+
openapi: {
|
|
1192
|
+
description: string;
|
|
1193
|
+
responses: {
|
|
1194
|
+
200: {
|
|
1195
|
+
description: string;
|
|
1196
|
+
content: {
|
|
1197
|
+
"application/json": {
|
|
1198
|
+
schema: {
|
|
1199
|
+
type: "object";
|
|
1200
|
+
properties: {
|
|
1201
|
+
user_code: {
|
|
1202
|
+
type: string;
|
|
1203
|
+
description: string;
|
|
1204
|
+
};
|
|
1205
|
+
status: {
|
|
1206
|
+
type: string;
|
|
1207
|
+
enum: string[];
|
|
1208
|
+
description: string;
|
|
1209
|
+
};
|
|
1210
|
+
};
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
};
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
};
|
|
1218
|
+
} & {
|
|
1219
|
+
use: any[];
|
|
1220
|
+
}, {
|
|
1221
|
+
user_code: string;
|
|
1222
|
+
status: string;
|
|
1223
|
+
}>;
|
|
1224
|
+
deviceApprove: better_auth.StrictEndpoint<"/device/approve", {
|
|
1225
|
+
method: "POST";
|
|
1226
|
+
body: zod.ZodObject<{
|
|
1227
|
+
userCode: zod.ZodString;
|
|
1228
|
+
}, better_auth.$strip>;
|
|
1229
|
+
error: zod.ZodObject<{
|
|
1230
|
+
error: zod.ZodEnum<{
|
|
1231
|
+
invalid_request: "invalid_request";
|
|
1232
|
+
expired_token: "expired_token";
|
|
1233
|
+
device_code_already_processed: "device_code_already_processed";
|
|
1234
|
+
}>;
|
|
1235
|
+
error_description: zod.ZodString;
|
|
1236
|
+
}, better_auth.$strip>;
|
|
1237
|
+
requireHeaders: true;
|
|
1238
|
+
metadata: {
|
|
1239
|
+
openapi: {
|
|
1240
|
+
description: string;
|
|
1241
|
+
responses: {
|
|
1242
|
+
200: {
|
|
1243
|
+
description: string;
|
|
1244
|
+
content: {
|
|
1245
|
+
"application/json": {
|
|
1246
|
+
schema: {
|
|
1247
|
+
type: "object";
|
|
1248
|
+
properties: {
|
|
1249
|
+
success: {
|
|
1250
|
+
type: string;
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
};
|
|
1254
|
+
};
|
|
1255
|
+
};
|
|
1256
|
+
};
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
} & {
|
|
1261
|
+
use: any[];
|
|
1262
|
+
}, {
|
|
1263
|
+
success: boolean;
|
|
1264
|
+
}>;
|
|
1265
|
+
deviceDeny: better_auth.StrictEndpoint<"/device/deny", {
|
|
1266
|
+
method: "POST";
|
|
1267
|
+
body: zod.ZodObject<{
|
|
1268
|
+
userCode: zod.ZodString;
|
|
1269
|
+
}, better_auth.$strip>;
|
|
1270
|
+
error: zod.ZodObject<{
|
|
1271
|
+
error: zod.ZodEnum<{
|
|
1272
|
+
invalid_request: "invalid_request";
|
|
1273
|
+
expired_token: "expired_token";
|
|
1274
|
+
}>;
|
|
1275
|
+
error_description: zod.ZodString;
|
|
1276
|
+
}, better_auth.$strip>;
|
|
1277
|
+
metadata: {
|
|
1278
|
+
openapi: {
|
|
1279
|
+
description: string;
|
|
1280
|
+
responses: {
|
|
1281
|
+
200: {
|
|
1282
|
+
description: string;
|
|
1283
|
+
content: {
|
|
1284
|
+
"application/json": {
|
|
1285
|
+
schema: {
|
|
1286
|
+
type: "object";
|
|
1287
|
+
properties: {
|
|
1288
|
+
success: {
|
|
1289
|
+
type: string;
|
|
1290
|
+
};
|
|
1291
|
+
};
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
};
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1297
|
+
};
|
|
1298
|
+
};
|
|
1299
|
+
} & {
|
|
1300
|
+
use: any[];
|
|
1301
|
+
}, {
|
|
1302
|
+
success: boolean;
|
|
1303
|
+
}>;
|
|
1304
|
+
};
|
|
1305
|
+
$ERROR_CODES: {
|
|
1306
|
+
readonly INVALID_DEVICE_CODE: "Invalid device code";
|
|
1307
|
+
readonly EXPIRED_DEVICE_CODE: "Device code has expired";
|
|
1308
|
+
readonly EXPIRED_USER_CODE: "User code has expired";
|
|
1309
|
+
readonly AUTHORIZATION_PENDING: "Authorization pending";
|
|
1310
|
+
readonly ACCESS_DENIED: "Access denied";
|
|
1311
|
+
readonly INVALID_USER_CODE: "Invalid user code";
|
|
1312
|
+
readonly DEVICE_CODE_ALREADY_PROCESSED: "Device code already processed";
|
|
1313
|
+
readonly POLLING_TOO_FREQUENTLY: "Polling too frequently";
|
|
1314
|
+
readonly USER_NOT_FOUND: "User not found";
|
|
1315
|
+
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
1316
|
+
readonly INVALID_DEVICE_CODE_STATUS: "Invalid device code status";
|
|
1317
|
+
readonly AUTHENTICATION_REQUIRED: "Authentication required";
|
|
1318
|
+
};
|
|
961
1319
|
}];
|
|
962
1320
|
}> | null;
|
|
963
1321
|
declare const app: Hono;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createAuth0Provider, createManagementHono, env, initializeDefaultUser, dbClient_default } from './chunk-
|
|
2
|
-
export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser } from './chunk-
|
|
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.
|
|
3
|
+
"version": "0.39.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",
|
|
@@ -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.
|
|
37
|
-
"@inkeep/agents-manage-mcp": "^0.
|
|
36
|
+
"@inkeep/agents-core": "^0.39.0",
|
|
37
|
+
"@inkeep/agents-manage-mcp": "^0.39.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@hono/zod-openapi": "^1.1.5",
|