@inkeep/agents-manage-api 0.39.5 → 0.41.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/create-app.d.ts +21 -0
- package/dist/create-app.js +144 -0
- package/dist/data/agentFull.d.ts +15 -0
- package/dist/data/agentFull.js +84 -0
- package/dist/data/conversations.d.ts +77 -0
- package/dist/data/conversations.js +152 -0
- package/dist/data/db/dbClient.d.ts +6 -0
- package/dist/data/db/dbClient.js +17 -0
- package/dist/env.d.ts +61 -0
- package/dist/env.js +55 -0
- package/dist/factory.d.ts +17 -2
- package/dist/factory.js +35 -2
- package/dist/index.d.ts +163 -57
- package/dist/index.js +8 -5
- package/dist/initialization.d.ts +6 -0
- package/dist/initialization.js +79 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +3 -0
- package/dist/middleware/auth.d.ts +24 -0
- package/dist/middleware/auth.js +64 -0
- package/dist/middleware/error-handler.d.ts +12 -0
- package/dist/middleware/error-handler.js +88 -0
- package/dist/middleware/require-permission.d.ts +19 -0
- package/dist/middleware/require-permission.js +80 -0
- package/dist/middleware/session-auth.d.ts +6 -0
- package/dist/middleware/session-auth.js +26 -0
- package/dist/middleware/tenant-access.d.ts +12 -0
- package/dist/middleware/tenant-access.js +54 -0
- package/dist/openapi.d.ts +7 -0
- package/dist/openapi.js +157 -0
- package/dist/routes/agent.d.ts +9 -0
- package/dist/routes/agent.js +244 -0
- package/dist/routes/agentFull.d.ts +9 -0
- package/dist/routes/agentFull.js +188 -0
- package/dist/routes/agentToolRelations.d.ts +9 -0
- package/dist/routes/agentToolRelations.js +284 -0
- package/dist/routes/apiKeys.d.ts +9 -0
- package/dist/routes/apiKeys.js +217 -0
- package/dist/routes/artifactComponents.d.ts +9 -0
- package/dist/routes/artifactComponents.js +206 -0
- package/dist/routes/cliAuth.d.ts +9 -0
- package/dist/routes/cliAuth.js +60 -0
- package/dist/routes/contextConfigs.d.ts +9 -0
- package/dist/routes/contextConfigs.js +175 -0
- package/dist/routes/conversations.d.ts +7 -0
- package/dist/routes/conversations.js +59 -0
- package/dist/routes/credentialStores.d.ts +9 -0
- package/dist/routes/credentialStores.js +81 -0
- package/dist/routes/credentials.d.ts +9 -0
- package/dist/routes/credentials.js +204 -0
- package/dist/routes/dataComponents.d.ts +9 -0
- package/dist/routes/dataComponents.js +188 -0
- package/dist/routes/externalAgents.d.ts +9 -0
- package/dist/routes/externalAgents.js +195 -0
- package/dist/routes/functionTools.d.ts +9 -0
- package/dist/routes/functionTools.js +252 -0
- package/dist/routes/functions.d.ts +9 -0
- package/dist/routes/functions.js +281 -0
- package/dist/routes/index.d.ts +7 -0
- package/dist/routes/index.js +54 -0
- package/dist/routes/invitations.d.ts +9 -0
- package/dist/routes/invitations.js +41 -0
- package/dist/routes/mcp.d.ts +7 -0
- package/dist/routes/mcp.js +45 -0
- package/dist/routes/mcpCatalog.d.ts +13 -0
- package/dist/routes/mcpCatalog.js +454 -0
- package/dist/routes/oauth.d.ts +10 -0
- package/dist/routes/oauth.js +314 -0
- package/dist/routes/playgroundToken.d.ts +9 -0
- package/dist/routes/playgroundToken.js +108 -0
- package/dist/routes/projectFull.d.ts +9 -0
- package/dist/routes/projectFull.js +193 -0
- package/dist/routes/projects.d.ts +9 -0
- package/dist/routes/projects.js +188 -0
- package/dist/routes/shared.d.ts +93 -0
- package/dist/routes/shared.js +44 -0
- package/dist/routes/signoz.d.ts +10 -0
- package/dist/routes/signoz.js +155 -0
- package/dist/routes/subAgentArtifactComponents.d.ts +9 -0
- package/dist/routes/subAgentArtifactComponents.js +198 -0
- package/dist/routes/subAgentDataComponents.d.ts +9 -0
- package/dist/routes/subAgentDataComponents.js +197 -0
- package/dist/routes/subAgentExternalAgentRelations.d.ts +9 -0
- package/dist/routes/subAgentExternalAgentRelations.js +213 -0
- package/dist/routes/subAgentRelations.d.ts +9 -0
- package/dist/routes/subAgentRelations.js +259 -0
- package/dist/routes/subAgentTeamAgentRelations.d.ts +9 -0
- package/dist/routes/subAgentTeamAgentRelations.js +213 -0
- package/dist/routes/subAgentToolRelations.d.ts +9 -0
- package/dist/routes/subAgentToolRelations.js +284 -0
- package/dist/routes/subAgents.d.ts +9 -0
- package/dist/routes/subAgents.js +210 -0
- package/dist/routes/thirdPartyMCPServers.d.ts +14 -0
- package/dist/routes/thirdPartyMCPServers.js +72 -0
- package/dist/routes/tools.d.ts +9 -0
- package/dist/routes/tools.js +256 -0
- package/dist/routes/userOrganizations.d.ts +9 -0
- package/dist/routes/userOrganizations.js +58 -0
- package/dist/sso-helpers.d.ts +20 -0
- package/dist/sso-helpers.js +51 -0
- package/dist/types/app.d.ts +47 -0
- package/dist/types/app.js +1 -0
- package/dist/utils/cors.d.ts +33 -0
- package/dist/utils/cors.js +98 -0
- package/dist/utils/oauth-service.d.ts +71 -0
- package/dist/utils/oauth-service.js +106 -0
- package/dist/utils/signoz-helpers.d.ts +9 -0
- package/dist/utils/signoz-helpers.js +33 -0
- package/dist/utils/temp-api-keys.d.ts +17 -0
- package/dist/utils/temp-api-keys.js +26 -0
- package/package.json +6 -13
- package/dist/chunk-VBDAOXYI.js +0 -832
- package/dist/chunk-VBDAOXYI.js.map +0 -1
- package/dist/factory2.d.ts +0 -41
- package/dist/factory2.d.ts.map +0 -1
- package/dist/factory2.js +0 -37085
- package/dist/factory2.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nodefs.js +0 -27
- package/dist/nodefs.js.map +0 -1
- package/dist/opfs-ahp.js +0 -368
- package/dist/opfs-ahp.js.map +0 -1
package/dist/factory.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { env } from "./env.js";
|
|
2
|
+
import dbClient_default from "./data/db/dbClient.js";
|
|
3
|
+
import { createManagementHono } from "./create-app.js";
|
|
4
|
+
import { initializeDefaultUser } from "./initialization.js";
|
|
5
|
+
import { createAuth0Provider, createOIDCProvider } from "./sso-helpers.js";
|
|
6
|
+
import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
|
|
7
|
+
import { createAuth } from "@inkeep/agents-core/auth";
|
|
3
8
|
|
|
9
|
+
//#region src/factory.ts
|
|
10
|
+
const defaultConfig = {
|
|
11
|
+
port: 3002,
|
|
12
|
+
serverOptions: {
|
|
13
|
+
requestTimeout: 6e4,
|
|
14
|
+
keepAliveTimeout: 6e4,
|
|
15
|
+
keepAlive: true
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
function createManagementAuth(userAuthConfig) {
|
|
19
|
+
if (env.DISABLE_AUTH) return null;
|
|
20
|
+
return createAuth({
|
|
21
|
+
baseURL: env.INKEEP_AGENTS_MANAGE_API_URL || "http://localhost:3002",
|
|
22
|
+
secret: env.BETTER_AUTH_SECRET || "development-secret-change-in-production",
|
|
23
|
+
dbClient: dbClient_default,
|
|
24
|
+
...userAuthConfig?.ssoProviders && { ssoProviders: userAuthConfig.ssoProviders },
|
|
25
|
+
...userAuthConfig?.socialProviders && { socialProviders: userAuthConfig.socialProviders }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function createManagementApp(config) {
|
|
29
|
+
const serverConfig = config?.serverConfig ?? defaultConfig;
|
|
30
|
+
const registry = new CredentialStoreRegistry(config?.credentialStores ?? createDefaultCredentialStores());
|
|
31
|
+
const auth$1 = createManagementAuth(config?.auth);
|
|
32
|
+
if (!config?.skipInitialization && env.ENVIRONMENT !== "test") initializeDefaultUser(auth$1);
|
|
33
|
+
return createManagementHono(serverConfig, registry, auth$1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
4
37
|
export { createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, initializeDefaultUser };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createManagementHono } from "./create-app.js";
|
|
2
|
+
import { initializeDefaultUser } from "./initialization.js";
|
|
3
|
+
import { createAuth0Provider, createOIDCProvider } from "./sso-helpers.js";
|
|
4
|
+
import { SSOProviderConfig, UserAuthConfig, createManagementApp } from "./factory.js";
|
|
2
5
|
import { Hono } from "hono";
|
|
3
6
|
import * as better_auth0 from "better-auth";
|
|
4
|
-
import * as
|
|
7
|
+
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
5
8
|
import * as zod0 from "zod";
|
|
6
9
|
import * as _better_auth_sso0 from "@better-auth/sso";
|
|
7
|
-
import * as better_auth_plugins0 from "better-auth/plugins";
|
|
8
10
|
|
|
9
11
|
//#region src/index.d.ts
|
|
10
12
|
declare const auth: better_auth0.Auth<{
|
|
@@ -19,7 +21,51 @@ declare const auth: better_auth0.Auth<{
|
|
|
19
21
|
autoSignIn: true;
|
|
20
22
|
};
|
|
21
23
|
socialProviders: {
|
|
22
|
-
google:
|
|
24
|
+
google: {
|
|
25
|
+
redirectURI?: string | undefined;
|
|
26
|
+
clientId: string;
|
|
27
|
+
accessType?: ("offline" | "online") | undefined;
|
|
28
|
+
display?: ("page" | "popup" | "touch" | "wap") | undefined;
|
|
29
|
+
hd?: string | undefined;
|
|
30
|
+
clientSecret?: string | undefined;
|
|
31
|
+
scope?: string[] | undefined;
|
|
32
|
+
disableDefaultScope?: boolean | undefined;
|
|
33
|
+
clientKey?: string | undefined;
|
|
34
|
+
disableIdTokenSignIn?: boolean | undefined;
|
|
35
|
+
verifyIdToken?: ((token: string, nonce?: string) => Promise<boolean>) | undefined;
|
|
36
|
+
getUserInfo?: ((token: better_auth0.OAuth2Tokens) => Promise<{
|
|
37
|
+
user: {
|
|
38
|
+
id: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
email?: string | null;
|
|
41
|
+
image?: string;
|
|
42
|
+
emailVerified: boolean;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
};
|
|
45
|
+
data: any;
|
|
46
|
+
} | null>) | undefined;
|
|
47
|
+
refreshAccessToken?: ((refreshToken: string) => Promise<better_auth0.OAuth2Tokens>) | undefined;
|
|
48
|
+
mapProfileToUser?: ((profile: better_auth0.GoogleProfile) => {
|
|
49
|
+
id?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
email?: string | null;
|
|
52
|
+
image?: string;
|
|
53
|
+
emailVerified?: boolean;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
} | Promise<{
|
|
56
|
+
id?: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
email?: string | null;
|
|
59
|
+
image?: string;
|
|
60
|
+
emailVerified?: boolean;
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}>) | undefined;
|
|
63
|
+
disableImplicitSignUp?: boolean | undefined;
|
|
64
|
+
disableSignUp?: boolean | undefined;
|
|
65
|
+
prompt?: ("select_account" | "consent" | "login" | "none" | "select_account consent") | undefined;
|
|
66
|
+
responseMode?: ("query" | "form_post") | undefined;
|
|
67
|
+
overrideUserInfoOnSignIn?: boolean | undefined;
|
|
68
|
+
};
|
|
23
69
|
} | undefined;
|
|
24
70
|
session: {
|
|
25
71
|
expiresIn: number;
|
|
@@ -57,6 +103,9 @@ declare const auth: better_auth0.Auth<{
|
|
|
57
103
|
generateId?: better_auth0.GenerateIdFn | false | "serial" | "uuid";
|
|
58
104
|
} | undefined;
|
|
59
105
|
trustedProxyHeaders?: boolean | undefined;
|
|
106
|
+
backgroundTasks?: {
|
|
107
|
+
handler: (promise: Promise<void>) => void;
|
|
108
|
+
};
|
|
60
109
|
};
|
|
61
110
|
trustedOrigins: string[];
|
|
62
111
|
plugins: [{
|
|
@@ -75,6 +124,7 @@ declare const auth: better_auth0.Auth<{
|
|
|
75
124
|
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
76
125
|
}[];
|
|
77
126
|
};
|
|
127
|
+
options: better_auth_plugins0.BearerOptions | undefined;
|
|
78
128
|
}, {
|
|
79
129
|
id: "sso";
|
|
80
130
|
endpoints: {
|
|
@@ -99,8 +149,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
99
149
|
};
|
|
100
150
|
};
|
|
101
151
|
};
|
|
102
|
-
} & {
|
|
103
|
-
use: any[];
|
|
104
152
|
}, Response>>;
|
|
105
153
|
registerSSOProvider: better_auth0.StrictEndpoint<"/sso/register", {
|
|
106
154
|
method: "POST";
|
|
@@ -120,6 +168,7 @@ declare const auth: better_auth0.Auth<{
|
|
|
120
168
|
}>>;
|
|
121
169
|
jwksEndpoint: zod0.ZodOptional<zod0.ZodString>;
|
|
122
170
|
discoveryEndpoint: zod0.ZodOptional<zod0.ZodString>;
|
|
171
|
+
skipDiscovery: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
123
172
|
scopes: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString>>;
|
|
124
173
|
pkce: zod0.ZodOptional<zod0.ZodDefault<zod0.ZodBoolean>>;
|
|
125
174
|
mapping: zod0.ZodOptional<zod0.ZodObject<{
|
|
@@ -364,9 +413,11 @@ declare const auth: better_auth0.Auth<{
|
|
|
364
413
|
};
|
|
365
414
|
};
|
|
366
415
|
};
|
|
367
|
-
} & {
|
|
368
|
-
use: any[];
|
|
369
416
|
}, {
|
|
417
|
+
redirectURI: string;
|
|
418
|
+
oidcConfig: _better_auth_sso0.OIDCConfig | null;
|
|
419
|
+
samlConfig: _better_auth_sso0.SAMLConfig | null;
|
|
420
|
+
} & Omit<{
|
|
370
421
|
issuer: string;
|
|
371
422
|
oidcConfig?: _better_auth_sso0.OIDCConfig | undefined;
|
|
372
423
|
samlConfig?: _better_auth_sso0.SAMLConfig | undefined;
|
|
@@ -374,7 +425,7 @@ declare const auth: better_auth0.Auth<{
|
|
|
374
425
|
providerId: string;
|
|
375
426
|
organizationId?: string | undefined;
|
|
376
427
|
domain: string;
|
|
377
|
-
}
|
|
428
|
+
}, "oidcConfig" | "samlConfig">>;
|
|
378
429
|
signInSSO: ReturnType<(options?: _better_auth_sso0.SSOOptions) => better_auth0.StrictEndpoint<"/sign-in/sso", {
|
|
379
430
|
method: "POST";
|
|
380
431
|
body: zod0.ZodObject<{
|
|
@@ -389,8 +440,8 @@ declare const auth: better_auth0.Auth<{
|
|
|
389
440
|
loginHint: zod0.ZodOptional<zod0.ZodString>;
|
|
390
441
|
requestSignUp: zod0.ZodOptional<zod0.ZodBoolean>;
|
|
391
442
|
providerType: zod0.ZodOptional<zod0.ZodEnum<{
|
|
392
|
-
oidc: "oidc";
|
|
393
443
|
saml: "saml";
|
|
444
|
+
oidc: "oidc";
|
|
394
445
|
}>>;
|
|
395
446
|
}, better_auth0.$strip>;
|
|
396
447
|
metadata: {
|
|
@@ -465,8 +516,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
465
516
|
};
|
|
466
517
|
};
|
|
467
518
|
};
|
|
468
|
-
} & {
|
|
469
|
-
use: any[];
|
|
470
519
|
}, {
|
|
471
520
|
url: string;
|
|
472
521
|
redirect: boolean;
|
|
@@ -481,7 +530,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
481
530
|
}, better_auth0.$strip>;
|
|
482
531
|
allowedMediaTypes: string[];
|
|
483
532
|
metadata: {
|
|
484
|
-
isAction: false;
|
|
485
533
|
openapi: {
|
|
486
534
|
operationId: string;
|
|
487
535
|
summary: string;
|
|
@@ -492,9 +540,8 @@ declare const auth: better_auth0.Auth<{
|
|
|
492
540
|
};
|
|
493
541
|
};
|
|
494
542
|
};
|
|
543
|
+
scope: "server";
|
|
495
544
|
};
|
|
496
|
-
} & {
|
|
497
|
-
use: any[];
|
|
498
545
|
}, never>>;
|
|
499
546
|
callbackSSOSAML: ReturnType<(options?: _better_auth_sso0.SSOOptions) => better_auth0.StrictEndpoint<"/sso/saml2/callback/:providerId", {
|
|
500
547
|
method: "POST";
|
|
@@ -503,7 +550,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
503
550
|
RelayState: zod0.ZodOptional<zod0.ZodString>;
|
|
504
551
|
}, better_auth0.$strip>;
|
|
505
552
|
metadata: {
|
|
506
|
-
isAction: false;
|
|
507
553
|
allowedMediaTypes: string[];
|
|
508
554
|
openapi: {
|
|
509
555
|
operationId: string;
|
|
@@ -521,9 +567,8 @@ declare const auth: better_auth0.Auth<{
|
|
|
521
567
|
};
|
|
522
568
|
};
|
|
523
569
|
};
|
|
570
|
+
scope: "server";
|
|
524
571
|
};
|
|
525
|
-
} & {
|
|
526
|
-
use: any[];
|
|
527
572
|
}, never>>;
|
|
528
573
|
acsEndpoint: ReturnType<(options?: _better_auth_sso0.SSOOptions) => better_auth0.StrictEndpoint<"/sso/saml2/sp/acs/:providerId", {
|
|
529
574
|
method: "POST";
|
|
@@ -535,7 +580,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
535
580
|
RelayState: zod0.ZodOptional<zod0.ZodString>;
|
|
536
581
|
}, better_auth0.$strip>;
|
|
537
582
|
metadata: {
|
|
538
|
-
isAction: false;
|
|
539
583
|
allowedMediaTypes: string[];
|
|
540
584
|
openapi: {
|
|
541
585
|
operationId: string;
|
|
@@ -547,9 +591,8 @@ declare const auth: better_auth0.Auth<{
|
|
|
547
591
|
};
|
|
548
592
|
};
|
|
549
593
|
};
|
|
594
|
+
scope: "server";
|
|
550
595
|
};
|
|
551
|
-
} & {
|
|
552
|
-
use: any[];
|
|
553
596
|
}, never>>;
|
|
554
597
|
} & {
|
|
555
598
|
requestDomainVerification: ReturnType<(options: _better_auth_sso0.SSOOptions) => better_auth0.StrictEndpoint<"/sso/request-domain-verification", {
|
|
@@ -597,8 +640,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
597
640
|
};
|
|
598
641
|
};
|
|
599
642
|
}>)[];
|
|
600
|
-
} & {
|
|
601
|
-
use: any[];
|
|
602
643
|
}, {
|
|
603
644
|
domainVerificationToken: string;
|
|
604
645
|
}>>;
|
|
@@ -650,8 +691,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
650
691
|
};
|
|
651
692
|
};
|
|
652
693
|
}>)[];
|
|
653
|
-
} & {
|
|
654
|
-
use: any[];
|
|
655
694
|
}, void>>;
|
|
656
695
|
};
|
|
657
696
|
schema: any;
|
|
@@ -660,6 +699,57 @@ declare const auth: better_auth0.Auth<{
|
|
|
660
699
|
enabled: true;
|
|
661
700
|
};
|
|
662
701
|
};
|
|
702
|
+
}, {
|
|
703
|
+
id: "oauth-proxy";
|
|
704
|
+
options: NoInfer<{
|
|
705
|
+
productionURL: string;
|
|
706
|
+
}>;
|
|
707
|
+
endpoints: {
|
|
708
|
+
oAuthProxy: better_auth0.StrictEndpoint<"/oauth-proxy-callback", {
|
|
709
|
+
method: "GET";
|
|
710
|
+
operationId: string;
|
|
711
|
+
query: zod0.ZodObject<{
|
|
712
|
+
callbackURL: zod0.ZodString;
|
|
713
|
+
cookies: zod0.ZodString;
|
|
714
|
+
}, better_auth0.$strip>;
|
|
715
|
+
use: ((inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>)[];
|
|
716
|
+
metadata: {
|
|
717
|
+
openapi: {
|
|
718
|
+
operationId: string;
|
|
719
|
+
description: string;
|
|
720
|
+
parameters: {
|
|
721
|
+
in: "query";
|
|
722
|
+
name: string;
|
|
723
|
+
required: true;
|
|
724
|
+
description: string;
|
|
725
|
+
}[];
|
|
726
|
+
responses: {
|
|
727
|
+
302: {
|
|
728
|
+
description: string;
|
|
729
|
+
headers: {
|
|
730
|
+
Location: {
|
|
731
|
+
description: string;
|
|
732
|
+
schema: {
|
|
733
|
+
type: string;
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
}, never>;
|
|
742
|
+
};
|
|
743
|
+
hooks: {
|
|
744
|
+
before: {
|
|
745
|
+
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
746
|
+
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
747
|
+
}[];
|
|
748
|
+
after: {
|
|
749
|
+
matcher(context: better_auth0.HookEndpointContext): boolean;
|
|
750
|
+
handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
|
|
751
|
+
}[];
|
|
752
|
+
};
|
|
663
753
|
}, {
|
|
664
754
|
id: "organization";
|
|
665
755
|
endpoints: better_auth_plugins0.OrganizationEndpoints<{
|
|
@@ -667,25 +757,25 @@ declare const auth: better_auth0.Auth<{
|
|
|
667
757
|
ac: better_auth_plugins0.AccessControl;
|
|
668
758
|
roles: {
|
|
669
759
|
member: {
|
|
670
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
671
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
760
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
761
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
672
762
|
connector: "OR" | "AND";
|
|
673
763
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
674
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
764
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
675
765
|
};
|
|
676
766
|
admin: {
|
|
677
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
678
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
767
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
768
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
679
769
|
connector: "OR" | "AND";
|
|
680
770
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
681
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
771
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
682
772
|
};
|
|
683
773
|
owner: {
|
|
684
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
685
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
774
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
775
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
686
776
|
connector: "OR" | "AND";
|
|
687
777
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
688
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
778
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
689
779
|
};
|
|
690
780
|
};
|
|
691
781
|
membershipLimit: number;
|
|
@@ -941,30 +1031,30 @@ declare const auth: better_auth0.Auth<{
|
|
|
941
1031
|
readonly ROLE_NAME_IS_ALREADY_TAKEN: "That role name is already taken";
|
|
942
1032
|
readonly CANNOT_DELETE_A_PRE_DEFINED_ROLE: "Cannot delete a pre-defined role";
|
|
943
1033
|
};
|
|
944
|
-
options: {
|
|
1034
|
+
options: NoInfer<{
|
|
945
1035
|
allowUserToCreateOrganization: true;
|
|
946
1036
|
ac: better_auth_plugins0.AccessControl;
|
|
947
1037
|
roles: {
|
|
948
1038
|
member: {
|
|
949
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
950
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1039
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1040
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
951
1041
|
connector: "OR" | "AND";
|
|
952
1042
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
953
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1043
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
954
1044
|
};
|
|
955
1045
|
admin: {
|
|
956
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
957
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1046
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1047
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
958
1048
|
connector: "OR" | "AND";
|
|
959
1049
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
960
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1050
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
961
1051
|
};
|
|
962
1052
|
owner: {
|
|
963
|
-
authorize<K_1 extends "function" | "organization" | "
|
|
964
|
-
actions: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1053
|
+
authorize<K_1 extends "function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1054
|
+
actions: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>[key];
|
|
965
1055
|
connector: "OR" | "AND";
|
|
966
1056
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
967
|
-
statements: better_auth_plugins0.Subset<"function" | "organization" | "
|
|
1057
|
+
statements: better_auth_plugins0.Subset<"function" | "organization" | "member" | "invitation" | "ac" | "project" | "agent" | "sub_agent" | "tool" | "api_key" | "credential" | "data_component" | "artifact_component" | "external_agent" | "context_config" | "team", better_auth_plugins0.Statements>;
|
|
968
1058
|
};
|
|
969
1059
|
};
|
|
970
1060
|
membershipLimit: number;
|
|
@@ -980,7 +1070,7 @@ declare const auth: better_auth0.Auth<{
|
|
|
980
1070
|
user: better_auth0.User;
|
|
981
1071
|
};
|
|
982
1072
|
}): Promise<void>;
|
|
983
|
-
}
|
|
1073
|
+
}>;
|
|
984
1074
|
}, {
|
|
985
1075
|
id: "device-authorization";
|
|
986
1076
|
schema: {
|
|
@@ -1103,8 +1193,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
1103
1193
|
};
|
|
1104
1194
|
};
|
|
1105
1195
|
};
|
|
1106
|
-
} & {
|
|
1107
|
-
use: any[];
|
|
1108
1196
|
}, {
|
|
1109
1197
|
device_code: string;
|
|
1110
1198
|
user_code: string;
|
|
@@ -1175,8 +1263,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
1175
1263
|
};
|
|
1176
1264
|
};
|
|
1177
1265
|
};
|
|
1178
|
-
} & {
|
|
1179
|
-
use: any[];
|
|
1180
1266
|
}, {
|
|
1181
1267
|
access_token: string;
|
|
1182
1268
|
token_type: string;
|
|
@@ -1222,8 +1308,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
1222
1308
|
};
|
|
1223
1309
|
};
|
|
1224
1310
|
};
|
|
1225
|
-
} & {
|
|
1226
|
-
use: any[];
|
|
1227
1311
|
}, {
|
|
1228
1312
|
user_code: string;
|
|
1229
1313
|
status: string;
|
|
@@ -1264,8 +1348,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
1264
1348
|
};
|
|
1265
1349
|
};
|
|
1266
1350
|
};
|
|
1267
|
-
} & {
|
|
1268
|
-
use: any[];
|
|
1269
1351
|
}, {
|
|
1270
1352
|
success: boolean;
|
|
1271
1353
|
}>;
|
|
@@ -1303,8 +1385,6 @@ declare const auth: better_auth0.Auth<{
|
|
|
1303
1385
|
};
|
|
1304
1386
|
};
|
|
1305
1387
|
};
|
|
1306
|
-
} & {
|
|
1307
|
-
use: any[];
|
|
1308
1388
|
}, {
|
|
1309
1389
|
success: boolean;
|
|
1310
1390
|
}>;
|
|
@@ -1323,9 +1403,35 @@ declare const auth: better_auth0.Auth<{
|
|
|
1323
1403
|
readonly INVALID_DEVICE_CODE_STATUS: "Invalid device code status";
|
|
1324
1404
|
readonly AUTHENTICATION_REQUIRED: "Authentication required";
|
|
1325
1405
|
};
|
|
1406
|
+
options: Partial<{
|
|
1407
|
+
expiresIn: better_auth_plugins0.TimeString;
|
|
1408
|
+
interval: better_auth_plugins0.TimeString;
|
|
1409
|
+
deviceCodeLength: number;
|
|
1410
|
+
userCodeLength: number;
|
|
1411
|
+
schema: {
|
|
1412
|
+
deviceCode?: {
|
|
1413
|
+
modelName?: string | undefined;
|
|
1414
|
+
fields?: {
|
|
1415
|
+
deviceCode?: string | undefined;
|
|
1416
|
+
userCode?: string | undefined;
|
|
1417
|
+
userId?: string | undefined;
|
|
1418
|
+
expiresAt?: string | undefined;
|
|
1419
|
+
status?: string | undefined;
|
|
1420
|
+
lastPolledAt?: string | undefined;
|
|
1421
|
+
pollingInterval?: string | undefined;
|
|
1422
|
+
clientId?: string | undefined;
|
|
1423
|
+
scope?: string | undefined;
|
|
1424
|
+
} | undefined;
|
|
1425
|
+
} | undefined;
|
|
1426
|
+
};
|
|
1427
|
+
generateDeviceCode?: (() => string | Promise<string>) | undefined;
|
|
1428
|
+
generateUserCode?: (() => string | Promise<string>) | undefined;
|
|
1429
|
+
validateClient?: ((clientId: string) => boolean | Promise<boolean>) | undefined;
|
|
1430
|
+
onDeviceAuthRequest?: ((clientId: string, scope: string | undefined) => void | Promise<void>) | undefined;
|
|
1431
|
+
verificationUri?: string | undefined;
|
|
1432
|
+
}>;
|
|
1326
1433
|
}];
|
|
1327
1434
|
}> | null;
|
|
1328
1435
|
declare const app: Hono;
|
|
1329
1436
|
//#endregion
|
|
1330
|
-
export { Hono, type SSOProviderConfig, type UserAuthConfig, auth, createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, app as default, initializeDefaultUser };
|
|
1331
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1437
|
+
export { Hono, type SSOProviderConfig, type UserAuthConfig, auth, createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, app as default, initializeDefaultUser };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { env } from "./env.js";
|
|
2
|
+
import dbClient_default from "./data/db/dbClient.js";
|
|
3
|
+
import { createManagementHono } from "./create-app.js";
|
|
4
|
+
import { initializeDefaultUser } from "./initialization.js";
|
|
5
|
+
import { createAuth0Provider, createOIDCProvider } from "./sso-helpers.js";
|
|
6
|
+
import { createManagementApp } from "./factory.js";
|
|
7
|
+
import { Hono } from "hono";
|
|
3
8
|
import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
|
|
4
9
|
import { createAuth } from "@inkeep/agents-core/auth";
|
|
5
|
-
import { Hono } from "hono";
|
|
6
10
|
|
|
7
11
|
//#region src/index.ts
|
|
8
12
|
const defaultConfig = {
|
|
@@ -44,5 +48,4 @@ if (env.ENVIRONMENT === "development") initializeDefaultUser(auth);
|
|
|
44
48
|
var src_default = app;
|
|
45
49
|
|
|
46
50
|
//#endregion
|
|
47
|
-
export { Hono, auth, createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, src_default as default, initializeDefaultUser };
|
|
48
|
-
//# sourceMappingURL=index.js.map
|
|
51
|
+
export { Hono, auth, createAuth0Provider, createManagementApp, createManagementHono, createOIDCProvider, src_default as default, initializeDefaultUser };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { env } from "./env.js";
|
|
2
|
+
import { getLogger as getLogger$1 } from "./logger.js";
|
|
3
|
+
import dbClient_default from "./data/db/dbClient.js";
|
|
4
|
+
import { generateId, getUserByEmail, member, organization } from "@inkeep/agents-core";
|
|
5
|
+
import { and, eq } from "drizzle-orm";
|
|
6
|
+
|
|
7
|
+
//#region src/initialization.ts
|
|
8
|
+
const logger = getLogger$1("initialization");
|
|
9
|
+
async function initializeDefaultUser(authInstance) {
|
|
10
|
+
const { INKEEP_AGENTS_MANAGE_UI_USERNAME, INKEEP_AGENTS_MANAGE_UI_PASSWORD, DISABLE_AUTH } = env;
|
|
11
|
+
const hasCredentials = INKEEP_AGENTS_MANAGE_UI_USERNAME && INKEEP_AGENTS_MANAGE_UI_PASSWORD;
|
|
12
|
+
const orgId = env.TENANT_ID;
|
|
13
|
+
if ((await dbClient_default.select().from(organization).where(eq(organization.id, orgId)).limit(1)).length === 0) {
|
|
14
|
+
await dbClient_default.insert(organization).values({
|
|
15
|
+
id: orgId,
|
|
16
|
+
name: env.TENANT_ID,
|
|
17
|
+
slug: env.TENANT_ID,
|
|
18
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
19
|
+
logo: null,
|
|
20
|
+
metadata: null
|
|
21
|
+
});
|
|
22
|
+
logger.info({ organizationId: orgId }, "Created default organization");
|
|
23
|
+
} else logger.info({ organizationId: orgId }, "Organization already exists");
|
|
24
|
+
if (!hasCredentials || DISABLE_AUTH || !authInstance) {
|
|
25
|
+
logger.info({ hasCredentials: false }, "Skipping default user creation");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
let user = await getUserByEmail(dbClient_default)(INKEEP_AGENTS_MANAGE_UI_USERNAME);
|
|
30
|
+
if (user) logger.info({
|
|
31
|
+
email: INKEEP_AGENTS_MANAGE_UI_USERNAME,
|
|
32
|
+
userId: user.id
|
|
33
|
+
}, "Default user already exists");
|
|
34
|
+
else {
|
|
35
|
+
logger.info({ email: INKEEP_AGENTS_MANAGE_UI_USERNAME }, "Creating default user with Better Auth...");
|
|
36
|
+
if (!(await authInstance.api.signUpEmail({ body: {
|
|
37
|
+
email: INKEEP_AGENTS_MANAGE_UI_USERNAME,
|
|
38
|
+
password: INKEEP_AGENTS_MANAGE_UI_PASSWORD,
|
|
39
|
+
name: INKEEP_AGENTS_MANAGE_UI_USERNAME.split("@")[0]
|
|
40
|
+
} })).user) throw new Error("signUpEmail returned no user");
|
|
41
|
+
user = await getUserByEmail(dbClient_default)(INKEEP_AGENTS_MANAGE_UI_USERNAME);
|
|
42
|
+
if (!user) throw new Error("User was created but could not be retrieved from database");
|
|
43
|
+
logger.info({
|
|
44
|
+
email: user.email,
|
|
45
|
+
id: user.id
|
|
46
|
+
}, "Default user created from INKEEP_AGENTS_MANAGE_UI_USERNAME/INKEEP_AGENTS_MANAGE_UI_PASSWORD");
|
|
47
|
+
}
|
|
48
|
+
if ((await dbClient_default.select().from(member).where(and(eq(member.userId, user.id), eq(member.organizationId, orgId))).limit(1)).length === 0) {
|
|
49
|
+
await dbClient_default.insert(member).values({
|
|
50
|
+
id: generateId(),
|
|
51
|
+
userId: user.id,
|
|
52
|
+
organizationId: orgId,
|
|
53
|
+
role: "owner",
|
|
54
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
55
|
+
});
|
|
56
|
+
logger.info({
|
|
57
|
+
userId: user.id,
|
|
58
|
+
organizationId: orgId
|
|
59
|
+
}, "Added user as organization owner");
|
|
60
|
+
} else logger.info({
|
|
61
|
+
userId: user.id,
|
|
62
|
+
organizationId: orgId
|
|
63
|
+
}, "User already a member of organization");
|
|
64
|
+
logger.info({
|
|
65
|
+
organizationId: orgId,
|
|
66
|
+
organizationSlug: env.TENANT_ID,
|
|
67
|
+
userId: user.id,
|
|
68
|
+
email: INKEEP_AGENTS_MANAGE_UI_USERNAME
|
|
69
|
+
}, "✅ Initialization complete - login with these credentials");
|
|
70
|
+
} catch (error) {
|
|
71
|
+
logger.error({
|
|
72
|
+
error,
|
|
73
|
+
email: INKEEP_AGENTS_MANAGE_UI_USERNAME
|
|
74
|
+
}, "❌ Failed to create default user");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { initializeDefaultUser };
|
package/dist/logger.d.ts
ADDED
package/dist/logger.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as hono0 from "hono";
|
|
2
|
+
import { ExecutionContext } from "@inkeep/agents-core";
|
|
3
|
+
import { createAuth } from "@inkeep/agents-core/auth";
|
|
4
|
+
|
|
5
|
+
//#region src/middleware/auth.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Middleware to authenticate API requests using Bearer token authentication
|
|
9
|
+
* Authentication priority:
|
|
10
|
+
* 1. Bypass secret (INKEEP_AGENTS_MANAGE_API_BYPASS_SECRET)
|
|
11
|
+
* 2. Better-auth session token (from device authorization flow)
|
|
12
|
+
* 3. Database API key
|
|
13
|
+
*/
|
|
14
|
+
declare const apiKeyAuth: () => hono0.MiddlewareHandler<{
|
|
15
|
+
Variables: {
|
|
16
|
+
executionContext: ExecutionContext;
|
|
17
|
+
userId?: string;
|
|
18
|
+
userEmail?: string;
|
|
19
|
+
tenantId?: string;
|
|
20
|
+
auth: ReturnType<typeof createAuth> | null;
|
|
21
|
+
};
|
|
22
|
+
}, string, {}, Response>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { apiKeyAuth };
|