@inkeep/agents-api 0.0.0-dev-20260129102848 → 0.0.0-dev-20260129163144

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/.well-known/workflow/v1/manifest.debug.json +5 -5
  2. package/dist/.well-known/workflow/v1/step.cjs +0 -1
  3. package/dist/createApp.d.ts +2 -2
  4. package/dist/createApp.js +8 -6
  5. package/dist/data/db/runDbClient.d.ts +2 -2
  6. package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
  7. package/dist/domains/evals/routes/index.d.ts +2 -2
  8. package/dist/domains/evals/workflow/routes.d.ts +2 -2
  9. package/dist/domains/github/index.d.ts +3 -3
  10. package/dist/domains/github/routes/tokenExchange.d.ts +2 -2
  11. package/dist/domains/manage/routes/conversations.d.ts +2 -2
  12. package/dist/domains/manage/routes/evals/evaluationResults.d.ts +2 -2
  13. package/dist/domains/manage/routes/index.d.ts +2 -2
  14. package/dist/domains/manage/routes/mcp.d.ts +2 -2
  15. package/dist/domains/manage/routes/projectMembers.js +1 -14
  16. package/dist/domains/manage/routes/projectPermissions.js +2 -9
  17. package/dist/domains/manage/routes/projects.js +14 -16
  18. package/dist/domains/manage/routes/signoz.d.ts +2 -2
  19. package/dist/domains/manage/routes/signoz.js +1 -1
  20. package/dist/domains/manage/routes/userProjectMemberships.js +1 -2
  21. package/dist/domains/mcp/routes/mcp.d.ts +2 -2
  22. package/dist/domains/run/context/validation.d.ts +1 -1
  23. package/dist/domains/run/services/TriggerService.d.ts +1 -1
  24. package/dist/domains/run/services/TriggerService.js +15 -13
  25. package/dist/domains/run/utils/token-estimator.d.ts +2 -2
  26. package/dist/env.d.ts +0 -2
  27. package/dist/env.js +0 -1
  28. package/dist/factory.d.ts +29 -29
  29. package/dist/factory.js +4 -10
  30. package/dist/index.d.ts +30 -29
  31. package/dist/index.js +3 -5
  32. package/dist/middleware/branchScopedDb.d.ts +1 -1
  33. package/dist/middleware/evalsAuth.d.ts +2 -2
  34. package/dist/middleware/manageAuth.d.ts +2 -2
  35. package/dist/middleware/projectAccess.d.ts +2 -11
  36. package/dist/middleware/projectAccess.js +7 -33
  37. package/dist/middleware/projectConfig.d.ts +3 -3
  38. package/dist/middleware/ref.d.ts +1 -1
  39. package/dist/middleware/requirePermission.d.ts +2 -2
  40. package/dist/middleware/requirePermission.js +1 -2
  41. package/dist/middleware/runAuth.d.ts +4 -4
  42. package/dist/middleware/sessionAuth.d.ts +3 -3
  43. package/dist/middleware/sessionAuth.js +1 -2
  44. package/dist/middleware/tenantAccess.d.ts +2 -2
  45. package/dist/middleware/tracing.d.ts +3 -3
  46. package/package.json +4 -4
  47. package/dist/initialization.d.ts +0 -6
  48. package/dist/initialization.js +0 -72
package/dist/factory.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { SandboxConfig } from "./types/app.js";
2
2
  import "./types/index.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
- import { initializeDefaultUser } from "./initialization.js";
5
4
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
6
- import * as hono0 from "hono";
7
5
  import { CredentialStore, ServerConfig } from "@inkeep/agents-core";
6
+ import * as hono0 from "hono";
8
7
  import * as zod0 from "zod";
9
8
  import { SSOProviderConfig, UserAuthConfig } from "@inkeep/agents-core/auth";
10
9
  import * as hono_types0 from "hono/types";
@@ -122,11 +121,11 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
122
121
  useSecureCookies?: boolean | undefined;
123
122
  disableCSRFCheck?: boolean | undefined;
124
123
  disableOriginCheck?: boolean | undefined;
125
- crossSubDomainCookies: {
124
+ crossSubDomainCookies?: {
126
125
  enabled: boolean;
127
126
  additionalCookies?: string[];
128
127
  domain?: string;
129
- };
128
+ } | undefined;
130
129
  cookies?: {
131
130
  [key: string]: {
132
131
  name?: string;
@@ -795,27 +794,28 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
795
794
  ac: better_auth_plugins0.AccessControl;
796
795
  roles: {
797
796
  member: {
798
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
799
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
797
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
798
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
800
799
  connector: "OR" | "AND";
801
800
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
802
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
801
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
803
802
  };
804
803
  admin: {
805
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
806
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
804
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
805
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
807
806
  connector: "OR" | "AND";
808
807
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
809
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
808
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
810
809
  };
811
810
  owner: {
812
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
813
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
811
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
812
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
814
813
  connector: "OR" | "AND";
815
814
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
816
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
815
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
817
816
  };
818
817
  };
818
+ creatorRole: "admin";
819
819
  membershipLimit: number;
820
820
  invitationLimit: number;
821
821
  invitationExpiresIn: number;
@@ -987,7 +987,7 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
987
987
  id: string;
988
988
  organizationId: string;
989
989
  email: string;
990
- role: "member" | "admin" | "owner";
990
+ role: "owner" | "admin" | "member";
991
991
  status: better_auth_plugins0.InvitationStatus;
992
992
  inviterId: string;
993
993
  expiresAt: Date;
@@ -996,7 +996,7 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
996
996
  Member: {
997
997
  id: string;
998
998
  organizationId: string;
999
- role: "member" | "admin" | "owner";
999
+ role: "owner" | "admin" | "member";
1000
1000
  createdAt: Date;
1001
1001
  userId: string;
1002
1002
  user: {
@@ -1012,7 +1012,7 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
1012
1012
  members: {
1013
1013
  id: string;
1014
1014
  organizationId: string;
1015
- role: "member" | "admin" | "owner";
1015
+ role: "owner" | "admin" | "member";
1016
1016
  createdAt: Date;
1017
1017
  userId: string;
1018
1018
  user: {
@@ -1026,7 +1026,7 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
1026
1026
  id: string;
1027
1027
  organizationId: string;
1028
1028
  email: string;
1029
- role: "member" | "admin" | "owner";
1029
+ role: "owner" | "admin" | "member";
1030
1030
  status: better_auth_plugins0.InvitationStatus;
1031
1031
  inviterId: string;
1032
1032
  expiresAt: Date;
@@ -1104,27 +1104,28 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
1104
1104
  ac: better_auth_plugins0.AccessControl;
1105
1105
  roles: {
1106
1106
  member: {
1107
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1108
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1107
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1108
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1109
1109
  connector: "OR" | "AND";
1110
1110
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1111
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1111
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1112
1112
  };
1113
1113
  admin: {
1114
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1115
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1114
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1115
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1116
1116
  connector: "OR" | "AND";
1117
1117
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1118
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1118
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1119
1119
  };
1120
1120
  owner: {
1121
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key] | {
1122
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1121
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1122
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1123
1123
  connector: "OR" | "AND";
1124
1124
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1125
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1125
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1126
1126
  };
1127
1127
  };
1128
+ creatorRole: "admin";
1128
1129
  membershipLimit: number;
1129
1130
  invitationLimit: number;
1130
1131
  invitationExpiresIn: number;
@@ -1529,13 +1530,12 @@ declare function createAgentsAuth(userAuthConfig?: UserAuthConfig): better_auth0
1529
1530
  verificationUri?: string | undefined;
1530
1531
  }>;
1531
1532
  }];
1532
- }> | null;
1533
+ }>;
1533
1534
  declare function createAgentsApp(config?: {
1534
1535
  serverConfig?: ServerConfig;
1535
1536
  credentialStores?: CredentialStore[];
1536
1537
  auth?: UserAuthConfig;
1537
1538
  sandboxConfig?: SandboxConfig;
1538
- skipInitialization?: boolean;
1539
1539
  }): hono0.Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
1540
1540
  //#endregion
1541
- export { type SSOProviderConfig, type UserAuthConfig, createAgentsApp, createAgentsAuth, createAgentsHono, createAuth0Provider, createOIDCProvider, initializeDefaultUser };
1541
+ export { type SSOProviderConfig, type UserAuthConfig, createAgentsApp, createAgentsAuth, createAgentsHono, createAuth0Provider, createOIDCProvider };
package/dist/factory.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { env } from "./env.js";
2
2
  import runDbClient_default from "./data/db/runDbClient.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
- import { initializeDefaultUser } from "./initialization.js";
5
4
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
6
5
  import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
7
6
  import { createAuth } from "@inkeep/agents-core/auth";
@@ -16,7 +15,6 @@ const defaultConfig = {
16
15
  }
17
16
  };
18
17
  function createAgentsAuth(userAuthConfig) {
19
- if (env.DISABLE_AUTH) return null;
20
18
  return createAuth({
21
19
  baseURL: env.INKEEP_AGENTS_API_URL || `http://localhost:3002`,
22
20
  secret: env.BETTER_AUTH_SECRET || "development-secret-change-in-production",
@@ -26,17 +24,13 @@ function createAgentsAuth(userAuthConfig) {
26
24
  });
27
25
  }
28
26
  function createAgentsApp(config) {
29
- const serverConfig = config?.serverConfig ?? defaultConfig;
30
- const registry = new CredentialStoreRegistry(config?.credentialStores ?? createDefaultCredentialStores());
31
- const auth$1 = createAgentsAuth(config?.auth);
32
- if (!config?.skipInitialization && env.ENVIRONMENT !== "test") initializeDefaultUser(auth$1);
33
27
  return createAgentsHono({
34
- serverConfig,
35
- credentialStores: registry,
36
- auth: auth$1,
28
+ serverConfig: config?.serverConfig ?? defaultConfig,
29
+ credentialStores: new CredentialStoreRegistry(config?.credentialStores ?? createDefaultCredentialStores()),
30
+ auth: createAgentsAuth(config?.auth),
37
31
  sandboxConfig: config?.sandboxConfig
38
32
  });
39
33
  }
40
34
 
41
35
  //#endregion
42
- export { createAgentsApp, createAgentsAuth, createAgentsHono, createAuth0Provider, createOIDCProvider, initializeDefaultUser };
36
+ export { createAgentsApp, createAgentsAuth, createAgentsHono, createAuth0Provider, createOIDCProvider };
package/dist/index.d.ts CHANGED
@@ -3,12 +3,11 @@ import "./types/index.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
4
  import { NativeSandboxConfig, SandboxConfig, VercelSandboxConfig } from "./domains/run/types/executionContext.js";
5
5
  import "./env.js";
6
- import { initializeDefaultUser } from "./initialization.js";
7
6
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
8
7
  import { SSOProviderConfig, UserAuthConfig, createAgentsApp } from "./factory.js";
9
8
  import { Hono } from "hono";
10
9
  import * as zod205 from "zod";
11
- import * as hono_types10 from "hono/types";
10
+ import * as hono_types16 from "hono/types";
12
11
  import * as better_auth78 from "better-auth";
13
12
  import * as better_auth_plugins69 from "better-auth/plugins";
14
13
  import * as _better_auth_sso10 from "@better-auth/sso";
@@ -123,11 +122,11 @@ declare const auth: better_auth78.Auth<{
123
122
  useSecureCookies?: boolean | undefined;
124
123
  disableCSRFCheck?: boolean | undefined;
125
124
  disableOriginCheck?: boolean | undefined;
126
- crossSubDomainCookies: {
125
+ crossSubDomainCookies?: {
127
126
  enabled: boolean;
128
127
  additionalCookies?: string[];
129
128
  domain?: string;
130
- };
129
+ } | undefined;
131
130
  cookies?: {
132
131
  [key: string]: {
133
132
  name?: string;
@@ -796,27 +795,28 @@ declare const auth: better_auth78.Auth<{
796
795
  ac: better_auth_plugins69.AccessControl;
797
796
  roles: {
798
797
  member: {
799
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
800
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
798
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
799
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
801
800
  connector: "OR" | "AND";
802
801
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
803
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
802
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
804
803
  };
805
804
  admin: {
806
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
807
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
805
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
806
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
808
807
  connector: "OR" | "AND";
809
808
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
810
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
809
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
811
810
  };
812
811
  owner: {
813
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
814
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
812
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
813
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
815
814
  connector: "OR" | "AND";
816
815
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
817
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
816
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
818
817
  };
819
818
  };
819
+ creatorRole: "admin";
820
820
  membershipLimit: number;
821
821
  invitationLimit: number;
822
822
  invitationExpiresIn: number;
@@ -988,7 +988,7 @@ declare const auth: better_auth78.Auth<{
988
988
  id: string;
989
989
  organizationId: string;
990
990
  email: string;
991
- role: "member" | "admin" | "owner";
991
+ role: "owner" | "admin" | "member";
992
992
  status: better_auth_plugins69.InvitationStatus;
993
993
  inviterId: string;
994
994
  expiresAt: Date;
@@ -997,7 +997,7 @@ declare const auth: better_auth78.Auth<{
997
997
  Member: {
998
998
  id: string;
999
999
  organizationId: string;
1000
- role: "member" | "admin" | "owner";
1000
+ role: "owner" | "admin" | "member";
1001
1001
  createdAt: Date;
1002
1002
  userId: string;
1003
1003
  user: {
@@ -1013,7 +1013,7 @@ declare const auth: better_auth78.Auth<{
1013
1013
  members: {
1014
1014
  id: string;
1015
1015
  organizationId: string;
1016
- role: "member" | "admin" | "owner";
1016
+ role: "owner" | "admin" | "member";
1017
1017
  createdAt: Date;
1018
1018
  userId: string;
1019
1019
  user: {
@@ -1027,7 +1027,7 @@ declare const auth: better_auth78.Auth<{
1027
1027
  id: string;
1028
1028
  organizationId: string;
1029
1029
  email: string;
1030
- role: "member" | "admin" | "owner";
1030
+ role: "owner" | "admin" | "member";
1031
1031
  status: better_auth_plugins69.InvitationStatus;
1032
1032
  inviterId: string;
1033
1033
  expiresAt: Date;
@@ -1105,27 +1105,28 @@ declare const auth: better_auth78.Auth<{
1105
1105
  ac: better_auth_plugins69.AccessControl;
1106
1106
  roles: {
1107
1107
  member: {
1108
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1109
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1108
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
1109
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
1110
1110
  connector: "OR" | "AND";
1111
1111
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1112
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1112
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
1113
1113
  };
1114
1114
  admin: {
1115
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1116
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1115
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
1116
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
1117
1117
  connector: "OR" | "AND";
1118
1118
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1119
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1119
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
1120
1120
  };
1121
1121
  owner: {
1122
- authorize<K_1 extends "organization" | "member" | "invitation" | "ac" | "project" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key] | {
1123
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
1122
+ authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
1123
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
1124
1124
  connector: "OR" | "AND";
1125
1125
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
1126
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
1126
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
1127
1127
  };
1128
1128
  };
1129
+ creatorRole: "admin";
1129
1130
  membershipLimit: number;
1130
1131
  invitationLimit: number;
1131
1132
  invitationExpiresIn: number;
@@ -1530,7 +1531,7 @@ declare const auth: better_auth78.Auth<{
1530
1531
  verificationUri?: string | undefined;
1531
1532
  }>;
1532
1533
  }];
1533
- }> | null;
1534
- declare const app: Hono<hono_types10.BlankEnv, hono_types10.BlankSchema, "/">;
1534
+ }>;
1535
+ declare const app: Hono<hono_types16.BlankEnv, hono_types16.BlankSchema, "/">;
1535
1536
  //#endregion
1536
- export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default, initializeDefaultUser };
1537
+ export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default };
package/dist/index.js CHANGED
@@ -1,11 +1,10 @@
1
- import { env } from "./env.js";
1
+ import "./env.js";
2
2
  import { defaultSDK } from "./instrumentation.js";
3
3
  import { createAgentsHono } from "./createApp.js";
4
- import { initializeDefaultUser } from "./initialization.js";
5
4
  import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
6
5
  import { createAgentsApp, createAgentsAuth } from "./factory.js";
7
- import { Hono } from "hono";
8
6
  import { CredentialStoreRegistry, createDefaultCredentialStores } from "@inkeep/agents-core";
7
+ import { Hono } from "hono";
9
8
 
10
9
  //#region src/index.ts
11
10
  defaultSDK.start();
@@ -52,8 +51,7 @@ const app = createAgentsHono({
52
51
  auth,
53
52
  sandboxConfig
54
53
  });
55
- if (env.ENVIRONMENT === "development") initializeDefaultUser(auth);
56
54
  var src_default = app;
57
55
 
58
56
  //#endregion
59
- export { Hono, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, src_default as default, initializeDefaultUser };
57
+ export { Hono, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, src_default as default };
@@ -1,5 +1,5 @@
1
- import { Context, Next } from "hono";
2
1
  import { AgentsManageDatabaseClient } from "@inkeep/agents-core";
2
+ import { Context, Next } from "hono";
3
3
  import { Pool } from "pg";
4
4
 
5
5
  //#region src/middleware/branchScopedDb.d.ts
@@ -1,5 +1,5 @@
1
- import * as hono2 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono18 from "hono";
3
3
 
4
4
  //#region src/middleware/evalsAuth.d.ts
5
5
 
@@ -7,7 +7,7 @@ import { BaseExecutionContext } from "@inkeep/agents-core";
7
7
  * Middleware to authenticate API requests using Bearer token authentication
8
8
  * First checks if token matches INKEEP_AGENTS_EVAL_API_BYPASS_SECRET,
9
9
  */
10
- declare const evalApiKeyAuth: () => hono2.MiddlewareHandler<{
10
+ declare const evalApiKeyAuth: () => hono18.MiddlewareHandler<{
11
11
  Variables: {
12
12
  executionContext: BaseExecutionContext;
13
13
  };
@@ -1,5 +1,5 @@
1
- import * as hono12 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono3 from "hono";
3
3
  import { createAuth } from "@inkeep/agents-core/auth";
4
4
 
5
5
  //#region src/middleware/manageAuth.d.ts
@@ -12,7 +12,7 @@ import { createAuth } from "@inkeep/agents-core/auth";
12
12
  * 3. Database API key
13
13
  * 4. Internal service token
14
14
  */
15
- declare const manageApiKeyAuth: () => hono12.MiddlewareHandler<{
15
+ declare const manageApiKeyAuth: () => hono3.MiddlewareHandler<{
16
16
  Variables: {
17
17
  executionContext: BaseExecutionContext;
18
18
  userId?: string;
@@ -1,24 +1,15 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono14 from "hono";
3
2
  import { ProjectPermissionLevel } from "@inkeep/agents-core";
3
+ import * as hono9 from "hono";
4
4
 
5
5
  //#region src/middleware/projectAccess.d.ts
6
-
7
6
  /**
8
7
  * Middleware to check project-level access.
9
- *
10
- * When ENABLE_AUTHZ is false:
11
- * - 'view' permission: all org members can view
12
- * - 'edit': only org owner/admin
13
- *
14
- * When ENABLE_AUTHZ is true:
15
- * - Uses SpiceDB to check permissions
16
- * - Org owner/admin bypass (handled in canViewProject etc.)
17
8
  */
18
9
  declare const requireProjectPermission: <Env$1 extends {
19
10
  Variables: ManageAppVariables;
20
11
  } = {
21
12
  Variables: ManageAppVariables;
22
- }>(permission?: ProjectPermissionLevel) => hono14.MiddlewareHandler<Env$1, string, {}, Response>;
13
+ }>(permission?: ProjectPermissionLevel) => hono9.MiddlewareHandler<Env$1, string, {}, Response>;
23
14
  //#endregion
24
15
  export { requireProjectPermission };
@@ -1,23 +1,13 @@
1
- import { env } from "../env.js";
2
- import { canEditProject, canUseProject, canViewProject, createApiError, isAuthzEnabled } from "@inkeep/agents-core";
1
+ import { canEditProject, canUseProject, canViewProject, createApiError } from "@inkeep/agents-core";
3
2
  import { createMiddleware } from "hono/factory";
4
3
  import { HTTPException } from "hono/http-exception";
5
4
 
6
5
  //#region src/middleware/projectAccess.ts
7
6
  /**
8
7
  * Middleware to check project-level access.
9
- *
10
- * When ENABLE_AUTHZ is false:
11
- * - 'view' permission: all org members can view
12
- * - 'edit': only org owner/admin
13
- *
14
- * When ENABLE_AUTHZ is true:
15
- * - Uses SpiceDB to check permissions
16
- * - Org owner/admin bypass (handled in canViewProject etc.)
17
8
  */
18
9
  const requireProjectPermission = (permission = "view") => createMiddleware(async (c, next) => {
19
- const isTestEnvironment = process.env.ENVIRONMENT === "test";
20
- if (env.DISABLE_AUTH || isTestEnvironment) {
10
+ if (process.env.ENVIRONMENT === "test") {
21
11
  await next();
22
12
  return;
23
13
  }
@@ -64,27 +54,11 @@ const requireProjectPermission = (permission = "view") => createMiddleware(async
64
54
  });
65
55
  break;
66
56
  }
67
- if (!hasAccess) {
68
- if (isAuthzEnabled()) throw createApiError({
69
- code: "not_found",
70
- message: "Project not found",
71
- instance: c.req.path
72
- });
73
- throw createApiError({
74
- code: "forbidden",
75
- message: `Permission denied. Required: project:${permission}`,
76
- instance: c.req.path,
77
- extensions: {
78
- requiredPermissions: [`project:${permission}`],
79
- context: {
80
- userId,
81
- organizationId: tenantId,
82
- projectId,
83
- currentRole: tenantRole
84
- }
85
- }
86
- });
87
- }
57
+ if (!hasAccess) throw createApiError({
58
+ code: "not_found",
59
+ message: "Project not found",
60
+ instance: c.req.path
61
+ });
88
62
  await next();
89
63
  } catch (error) {
90
64
  if (error instanceof HTTPException) throw error;
@@ -1,11 +1,11 @@
1
- import * as hono10 from "hono";
2
1
  import { BaseExecutionContext, ResolvedRef } from "@inkeep/agents-core";
2
+ import * as hono14 from "hono";
3
3
 
4
4
  //#region src/middleware/projectConfig.d.ts
5
5
  /**
6
6
  * Middleware that fetches the full project definition from the Management API
7
7
  */
8
- declare const projectConfigMiddleware: hono10.MiddlewareHandler<{
8
+ declare const projectConfigMiddleware: hono14.MiddlewareHandler<{
9
9
  Variables: {
10
10
  executionContext: BaseExecutionContext;
11
11
  resolvedRef: ResolvedRef;
@@ -15,7 +15,7 @@ declare const projectConfigMiddleware: hono10.MiddlewareHandler<{
15
15
  * Creates a middleware that applies project config fetching except for specified route patterns
16
16
  * @param skipRouteCheck - Function that returns true if the route should skip the middleware
17
17
  */
18
- declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono10.MiddlewareHandler<{
18
+ declare const projectConfigMiddlewareExcept: (skipRouteCheck: (path: string) => boolean) => hono14.MiddlewareHandler<{
19
19
  Variables: {
20
20
  executionContext: BaseExecutionContext;
21
21
  resolvedRef: ResolvedRef;
@@ -1,5 +1,5 @@
1
- import { Context, Next } from "hono";
2
1
  import { AgentsManageDatabaseClient, ResolvedRef } from "@inkeep/agents-core";
2
+ import { Context, Next } from "hono";
3
3
 
4
4
  //#region src/middleware/ref.d.ts
5
5
  type RefContext = {
@@ -1,5 +1,5 @@
1
1
  import { ManageAppVariables } from "../types/app.js";
2
- import * as hono13 from "hono";
2
+ import * as hono16 from "hono";
3
3
 
4
4
  //#region src/middleware/requirePermission.d.ts
5
5
  type Permission = {
@@ -9,6 +9,6 @@ declare const requirePermission: <Env$1 extends {
9
9
  Variables: ManageAppVariables;
10
10
  } = {
11
11
  Variables: ManageAppVariables;
12
- }>(permissions: Permission) => hono13.MiddlewareHandler<Env$1, string, {}, Response>;
12
+ }>(permissions: Permission) => hono16.MiddlewareHandler<Env$1, string, {}, Response>;
13
13
  //#endregion
14
14
  export { requirePermission };
@@ -1,4 +1,3 @@
1
- import { env } from "../env.js";
2
1
  import { createApiError } from "@inkeep/agents-core";
3
2
  import { createMiddleware } from "hono/factory";
4
3
  import { HTTPException } from "hono/http-exception";
@@ -15,7 +14,7 @@ function formatPermissionsForDisplay(permissions) {
15
14
  const requirePermission = (permissions) => createMiddleware(async (c, next) => {
16
15
  const isTestEnvironment = process.env.ENVIRONMENT === "test";
17
16
  const auth = c.get("auth");
18
- if (env.DISABLE_AUTH || isTestEnvironment || !auth) {
17
+ if (isTestEnvironment || !auth) {
19
18
  await next();
20
19
  return;
21
20
  }
@@ -1,8 +1,8 @@
1
- import * as hono16 from "hono";
2
1
  import { BaseExecutionContext } from "@inkeep/agents-core";
2
+ import * as hono0 from "hono";
3
3
 
4
4
  //#region src/middleware/runAuth.d.ts
5
- declare const runApiKeyAuth: () => hono16.MiddlewareHandler<{
5
+ declare const runApiKeyAuth: () => hono0.MiddlewareHandler<{
6
6
  Variables: {
7
7
  executionContext: BaseExecutionContext;
8
8
  };
@@ -11,7 +11,7 @@ declare const runApiKeyAuth: () => hono16.MiddlewareHandler<{
11
11
  * Creates a middleware that applies API key authentication except for specified route patterns
12
12
  * @param skipRouteCheck - Function that returns true if the route should skip authentication
13
13
  */
14
- declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono16.MiddlewareHandler<{
14
+ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) => hono0.MiddlewareHandler<{
15
15
  Variables: {
16
16
  executionContext: BaseExecutionContext;
17
17
  };
@@ -20,7 +20,7 @@ declare const runApiKeyAuthExcept: (skipRouteCheck: (path: string) => boolean) =
20
20
  * Helper middleware for endpoints that optionally support API key authentication
21
21
  * If no auth header is present, it continues without setting the executionContext
22
22
  */
23
- declare const runOptionalAuth: () => hono16.MiddlewareHandler<{
23
+ declare const runOptionalAuth: () => hono0.MiddlewareHandler<{
24
24
  Variables: {
25
25
  executionContext?: BaseExecutionContext;
26
26
  };
@@ -1,4 +1,4 @@
1
- import * as hono0 from "hono";
1
+ import * as hono4 from "hono";
2
2
 
3
3
  //#region src/middleware/sessionAuth.d.ts
4
4
 
@@ -7,11 +7,11 @@ import * as hono0 from "hono";
7
7
  * Requires that a user has already been authenticated via Better Auth session.
8
8
  * Used primarily for manage routes that require an active user session.
9
9
  */
10
- declare const sessionAuth: () => hono0.MiddlewareHandler<any, string, {}, Response>;
10
+ declare const sessionAuth: () => hono4.MiddlewareHandler<any, string, {}, Response>;
11
11
  /**
12
12
  * Global session middleware - sets user and session in context for all routes
13
13
  * Used for all routes that require an active user session.
14
14
  */
15
- declare const sessionContext: () => hono0.MiddlewareHandler<any, string, {}, Response>;
15
+ declare const sessionContext: () => hono4.MiddlewareHandler<any, string, {}, Response>;
16
16
  //#endregion
17
17
  export { sessionAuth, sessionContext };