@inkeep/agents-core 0.0.0-dev-20260302234522 → 0.0.0-dev-20260303013812

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 (32) hide show
  1. package/dist/auth/auth-schema.d.ts +107 -107
  2. package/dist/auth/auth-validation-schemas.d.ts +152 -152
  3. package/dist/auth/auth.d.ts +54 -29
  4. package/dist/auth/auth.js +45 -3
  5. package/dist/auth/email-send-status-store.d.ts +10 -0
  6. package/dist/auth/email-send-status-store.js +20 -0
  7. package/dist/auth/permissions.d.ts +13 -13
  8. package/dist/client-exports.d.ts +4 -4
  9. package/dist/data-access/manage/agents.d.ts +20 -20
  10. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  11. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  12. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  13. package/dist/data-access/manage/functionTools.d.ts +14 -14
  14. package/dist/data-access/manage/skills.d.ts +12 -12
  15. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  16. package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
  17. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  18. package/dist/data-access/manage/subAgents.d.ts +12 -12
  19. package/dist/data-access/manage/tools.d.ts +18 -18
  20. package/dist/data-access/manage/triggers.d.ts +1 -1
  21. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  22. package/dist/data-access/runtime/conversations.d.ts +16 -16
  23. package/dist/data-access/runtime/messages.d.ts +6 -6
  24. package/dist/data-access/runtime/tasks.d.ts +4 -4
  25. package/dist/db/manage/manage-schema.d.ts +449 -449
  26. package/dist/db/runtime/runtime-schema.d.ts +294 -294
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.js +2 -1
  29. package/dist/middleware/no-auth.d.ts +2 -2
  30. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  31. package/dist/validation/schemas.d.ts +446 -446
  32. package/package.json +1 -1
@@ -4,7 +4,7 @@ import * as zod0 from "zod";
4
4
  import * as better_auth0 from "better-auth";
5
5
  import { BetterAuthAdvancedOptions } from "better-auth";
6
6
  import * as _better_auth_sso0 from "@better-auth/sso";
7
- import * as better_auth_plugins0 from "better-auth/plugins";
7
+ import * as better_auth_plugins20 from "better-auth/plugins";
8
8
  import { GoogleOptions } from "better-auth/social-providers";
9
9
 
10
10
  //#region src/auth/auth.d.ts
@@ -54,6 +54,29 @@ interface SSOProviderConfig {
54
54
  oidcConfig?: OIDCProviderConfig;
55
55
  samlConfig?: SAMLProviderConfig;
56
56
  }
57
+ interface EmailServiceConfig {
58
+ sendInvitationEmail(data: {
59
+ to: string;
60
+ inviterName: string;
61
+ organizationName: string;
62
+ role: string;
63
+ invitationUrl: string;
64
+ authMethod?: string;
65
+ expiresInDays?: number;
66
+ }): Promise<{
67
+ emailSent: boolean;
68
+ error?: string;
69
+ }>;
70
+ sendPasswordResetEmail(data: {
71
+ to: string;
72
+ resetUrl: string;
73
+ expiresInMinutes?: number;
74
+ }): Promise<{
75
+ emailSent: boolean;
76
+ error?: string;
77
+ }>;
78
+ isConfigured: boolean;
79
+ }
57
80
  interface BetterAuthConfig {
58
81
  baseURL: string;
59
82
  secret: string;
@@ -65,6 +88,7 @@ interface BetterAuthConfig {
65
88
  google?: GoogleOptions;
66
89
  };
67
90
  advanced?: BetterAuthAdvancedOptions;
91
+ emailService?: EmailServiceConfig;
68
92
  }
69
93
  interface UserAuthConfig {
70
94
  ssoProviders?: SSOProviderConfig[];
@@ -90,6 +114,7 @@ interface UserAuthConfig {
90
114
  * - Any *.inkeep.com URL -> .inkeep.com
91
115
  */
92
116
  declare function extractCookieDomain(baseURL: string, explicitDomain?: string): string | undefined;
117
+ declare function hasCredentialAccount(dbClient: AgentsRunDatabaseClient, userId: string): Promise<boolean>;
93
118
  declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
94
119
  baseURL: string;
95
120
  secret: string;
@@ -252,7 +277,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
252
277
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
253
278
  }[];
254
279
  };
255
- options: better_auth_plugins0.BearerOptions | undefined;
280
+ options: better_auth_plugins20.BearerOptions | undefined;
256
281
  }, {
257
282
  id: "sso";
258
283
  endpoints: {
@@ -1243,30 +1268,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1243
1268
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
1244
1269
  }[];
1245
1270
  };
1246
- }, better_auth_plugins0.DefaultOrganizationPlugin<{
1271
+ }, better_auth_plugins20.DefaultOrganizationPlugin<{
1247
1272
  allowUserToCreateOrganization: true;
1248
- ac: better_auth_plugins0.AccessControl;
1273
+ ac: better_auth_plugins20.AccessControl;
1249
1274
  roles: {
1250
1275
  member: {
1251
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key] | {
1252
- actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key];
1276
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1277
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
1253
1278
  connector: "OR" | "AND";
1254
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1255
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>;
1279
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1280
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
1256
1281
  };
1257
1282
  admin: {
1258
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key] | {
1259
- actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key];
1283
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1284
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
1260
1285
  connector: "OR" | "AND";
1261
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1262
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>;
1286
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1287
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
1263
1288
  };
1264
1289
  owner: {
1265
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key] | {
1266
- actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>[key];
1290
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key] | {
1291
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>[key];
1267
1292
  connector: "OR" | "AND";
1268
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1269
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins0.Statements>;
1293
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1294
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins20.Statements>;
1270
1295
  };
1271
1296
  };
1272
1297
  creatorRole: "admin";
@@ -1277,9 +1302,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1277
1302
  id: string;
1278
1303
  role: string;
1279
1304
  email: string;
1280
- organization: better_auth_plugins0.Organization;
1281
- invitation: better_auth_plugins0.Invitation;
1282
- inviter: better_auth_plugins0.Member & {
1305
+ organization: better_auth_plugins20.Organization;
1306
+ invitation: better_auth_plugins20.Invitation;
1307
+ inviter: better_auth_plugins20.Member & {
1283
1308
  user: better_auth0.User;
1284
1309
  };
1285
1310
  }): Promise<void>;
@@ -1314,28 +1339,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1314
1339
  user,
1315
1340
  organization: org
1316
1341
  }: {
1317
- invitation: better_auth_plugins0.Invitation & Record<string, any>;
1318
- member: better_auth_plugins0.Member & Record<string, any>;
1342
+ invitation: better_auth_plugins20.Invitation & Record<string, any>;
1343
+ member: better_auth_plugins20.Member & Record<string, any>;
1319
1344
  user: better_auth0.User & Record<string, any>;
1320
- organization: better_auth_plugins0.Organization & Record<string, any>;
1345
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1321
1346
  }) => Promise<void>;
1322
1347
  beforeUpdateMemberRole: ({
1323
1348
  member,
1324
1349
  organization: org,
1325
1350
  newRole
1326
1351
  }: {
1327
- member: better_auth_plugins0.Member & Record<string, any>;
1352
+ member: better_auth_plugins20.Member & Record<string, any>;
1328
1353
  newRole: string;
1329
1354
  user: better_auth0.User & Record<string, any>;
1330
- organization: better_auth_plugins0.Organization & Record<string, any>;
1355
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1331
1356
  }) => Promise<void>;
1332
1357
  beforeRemoveMember: ({
1333
1358
  member,
1334
1359
  organization: org
1335
1360
  }: {
1336
- member: better_auth_plugins0.Member & Record<string, any>;
1361
+ member: better_auth_plugins20.Member & Record<string, any>;
1337
1362
  user: better_auth0.User & Record<string, any>;
1338
- organization: better_auth_plugins0.Organization & Record<string, any>;
1363
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1339
1364
  }) => Promise<void>;
1340
1365
  };
1341
1366
  }>, {
@@ -1676,8 +1701,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1676
1701
  readonly AUTHENTICATION_REQUIRED: "Authentication required";
1677
1702
  };
1678
1703
  options: Partial<{
1679
- expiresIn: better_auth_plugins0.TimeString;
1680
- interval: better_auth_plugins0.TimeString;
1704
+ expiresIn: better_auth_plugins20.TimeString;
1705
+ interval: better_auth_plugins20.TimeString;
1681
1706
  deviceCodeLength: number;
1682
1707
  userCodeLength: number;
1683
1708
  schema: {
@@ -1706,4 +1731,4 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1706
1731
  }>;
1707
1732
  declare const auth: ReturnType<typeof createAuth>;
1708
1733
  //#endregion
1709
- export { BetterAuthConfig, OIDCProviderConfig, SAMLProviderConfig, SSOProviderConfig, UserAuthConfig, auth, createAuth, extractCookieDomain };
1734
+ export { BetterAuthConfig, EmailServiceConfig, OIDCProviderConfig, SAMLProviderConfig, SSOProviderConfig, UserAuthConfig, auth, createAuth, extractCookieDomain, hasCredentialAccount };
package/dist/auth/auth.js CHANGED
@@ -1,11 +1,12 @@
1
- import { member, ssoProvider } from "./auth-schema.js";
1
+ import { account, member, ssoProvider } from "./auth-schema.js";
2
2
  import { OrgRoles } from "./authz/types.js";
3
3
  import { env } from "../env.js";
4
+ import { setEmailSendStatus } from "./email-send-status-store.js";
4
5
  import { setPasswordResetLink } from "./password-reset-link-store.js";
5
6
  import { generateId as generateId$1 } from "../utils/conversations.js";
6
7
  import "../utils/index.js";
7
8
  import { ac, adminRole, memberRole, ownerRole } from "./permissions.js";
8
- import { eq } from "drizzle-orm";
9
+ import { and, eq } from "drizzle-orm";
9
10
  import { betterAuth } from "better-auth";
10
11
  import { sso } from "@better-auth/sso";
11
12
  import { drizzleAdapter } from "better-auth/adapters/drizzle";
@@ -71,6 +72,10 @@ async function registerSSOProvider(dbClient, provider) {
71
72
  console.error(`❌ Failed to register SSO provider '${provider.providerId}':`, error);
72
73
  }
73
74
  }
75
+ async function hasCredentialAccount(dbClient, userId) {
76
+ const [row] = await dbClient.select({ id: account.id }).from(account).where(and(eq(account.userId, userId), eq(account.providerId, "credential"))).limit(1);
77
+ return !!row;
78
+ }
74
79
  function createAuth(config) {
75
80
  const cookieDomain = extractCookieDomain(config.baseURL, config.cookieDomain);
76
81
  const isSecure = config.baseURL.startsWith("https://");
@@ -86,11 +91,20 @@ function createAuth(config) {
86
91
  autoSignIn: true,
87
92
  resetPasswordTokenExpiresIn: 1800,
88
93
  sendResetPassword: async ({ user, url, token }) => {
94
+ if (!await hasCredentialAccount(config.dbClient, user.id)) return;
89
95
  setPasswordResetLink({
90
96
  email: user.email,
91
97
  url,
92
98
  token
93
99
  });
100
+ if (config.emailService?.isConfigured) try {
101
+ await config.emailService.sendPasswordResetEmail({
102
+ to: user.email,
103
+ resetUrl: url
104
+ });
105
+ } catch (err) {
106
+ console.error("[email] Failed to send password reset email:", err);
107
+ }
94
108
  }
95
109
  },
96
110
  account: { accountLinking: {
@@ -169,6 +183,34 @@ function createAuth(config) {
169
183
  organization: data.organization.name,
170
184
  invitationId: data.id
171
185
  });
186
+ if (config.emailService?.isConfigured) try {
187
+ const invitationUrl = `${env.INKEEP_AGENTS_MANAGE_UI_URL || "http://localhost:3000"}/accept-invitation/${data.id}?email=${encodeURIComponent(data.email)}`;
188
+ const result = await config.emailService.sendInvitationEmail({
189
+ to: data.email,
190
+ inviterName: data.inviter.user.name || data.inviter.user.email,
191
+ organizationName: data.organization.name,
192
+ role: data.role,
193
+ invitationUrl,
194
+ authMethod: data.invitation?.authMethod
195
+ });
196
+ setEmailSendStatus(data.id, {
197
+ emailSent: result.emailSent,
198
+ error: result.error,
199
+ organizationId: data.organization.id
200
+ });
201
+ } catch (err) {
202
+ const message = err instanceof Error ? err.message : String(err);
203
+ console.error(`[email] Failed to send invitation email to ${data.email}:`, message);
204
+ setEmailSendStatus(data.id, {
205
+ emailSent: false,
206
+ error: message,
207
+ organizationId: data.organization.id
208
+ });
209
+ }
210
+ else setEmailSendStatus(data.id, {
211
+ emailSent: false,
212
+ organizationId: data.organization.id
213
+ });
172
214
  },
173
215
  schema: {
174
216
  invitation: { additionalFields: { authMethod: {
@@ -266,4 +308,4 @@ function createAuth(config) {
266
308
  const auth = null;
267
309
 
268
310
  //#endregion
269
- export { auth, createAuth, extractCookieDomain };
311
+ export { auth, createAuth, extractCookieDomain, hasCredentialAccount };
@@ -0,0 +1,10 @@
1
+ //#region src/auth/email-send-status-store.d.ts
2
+ type EmailSendStatus = {
3
+ emailSent: boolean;
4
+ error?: string;
5
+ organizationId?: string;
6
+ };
7
+ declare function setEmailSendStatus(id: string, status: EmailSendStatus, ttlMs?: number): void;
8
+ declare function getEmailSendStatus(id: string): EmailSendStatus | null;
9
+ //#endregion
10
+ export { getEmailSendStatus, setEmailSendStatus };
@@ -0,0 +1,20 @@
1
+ //#region src/auth/email-send-status-store.ts
2
+ const DEFAULT_TTL_MS = 300 * 1e3;
3
+ const store = /* @__PURE__ */ new Map();
4
+ const timers = /* @__PURE__ */ new Map();
5
+ function setEmailSendStatus(id, status, ttlMs = DEFAULT_TTL_MS) {
6
+ const existingTimer = timers.get(id);
7
+ if (existingTimer) clearTimeout(existingTimer);
8
+ store.set(id, status);
9
+ const timer = setTimeout(() => {
10
+ store.delete(id);
11
+ timers.delete(id);
12
+ }, ttlMs);
13
+ timers.set(id, timer);
14
+ }
15
+ function getEmailSendStatus(id) {
16
+ return store.get(id) ?? null;
17
+ }
18
+
19
+ //#endregion
20
+ export { getEmailSendStatus, setEmailSendStatus };
@@ -1,29 +1,29 @@
1
- import * as better_auth_plugins35 from "better-auth/plugins";
1
+ import * as better_auth_plugins0 from "better-auth/plugins";
2
2
  import { AccessControl } from "better-auth/plugins/access";
3
3
  import { organizationClient } from "better-auth/client/plugins";
4
4
 
5
5
  //#region src/auth/permissions.d.ts
6
6
  declare const ac: AccessControl;
7
7
  declare const memberRole: {
8
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key] | {
9
- actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key];
8
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
9
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
10
10
  connector: "OR" | "AND";
11
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
12
- statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>;
11
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
12
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
13
13
  };
14
14
  declare const adminRole: {
15
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key] | {
16
- actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key];
15
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
16
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
17
17
  connector: "OR" | "AND";
18
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
19
- statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>;
18
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
19
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
20
20
  };
21
21
  declare const ownerRole: {
22
- authorize<K_1 extends "project" | "organization" | "member" | "ac" | "team" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key] | {
23
- actions: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>[key];
22
+ authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key] | {
23
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>[key];
24
24
  connector: "OR" | "AND";
25
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
26
- statements: better_auth_plugins35.Subset<"project" | "organization" | "member" | "ac" | "team" | "invitation", better_auth_plugins35.Statements>;
25
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
26
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins0.Statements>;
27
27
  };
28
28
  //#endregion
29
29
  export { ac, adminRole, memberRole, organizationClient, ownerRole };
@@ -17,11 +17,10 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
17
17
  description: z.ZodOptional<z.ZodString>;
18
18
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
19
19
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
20
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
20
  id: z.ZodString;
22
21
  name: z.ZodString;
23
- createdAt: z.ZodOptional<z.ZodString>;
24
- updatedAt: z.ZodOptional<z.ZodString>;
22
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
25
24
  models: z.ZodOptional<z.ZodObject<{
26
25
  base: z.ZodOptional<z.ZodObject<{
27
26
  model: z.ZodOptional<z.ZodString>;
@@ -36,7 +35,8 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
36
35
  providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
37
36
  }, z.core.$strip>>;
38
37
  }, z.core.$strip>>;
39
- conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
38
+ createdAt: z.ZodOptional<z.ZodString>;
39
+ updatedAt: z.ZodOptional<z.ZodString>;
40
40
  type: z.ZodLiteral<"internal">;
41
41
  canUse: z.ZodArray<z.ZodObject<{
42
42
  agentToolRelationId: z.ZodOptional<z.ZodString>;
@@ -9,13 +9,13 @@ import { PgTable } from "drizzle-orm/pg-core";
9
9
  declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  scopes: AgentScopeConfig;
11
11
  }) => Promise<{
12
+ name: string;
12
13
  description: string | null;
13
- tenantId: string;
14
- projectId: string;
15
14
  id: string;
16
- name: string;
17
15
  createdAt: string;
18
16
  updatedAt: string;
17
+ projectId: string;
18
+ tenantId: string;
19
19
  models: {
20
20
  base?: {
21
21
  model?: string | undefined;
@@ -33,9 +33,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
33
33
  stopWhen: {
34
34
  transferCountIs?: number | undefined;
35
35
  } | null;
36
- prompt: string | null;
37
36
  defaultSubAgentId: string | null;
38
37
  contextConfigId: string | null;
38
+ prompt: string | null;
39
39
  statusUpdates: {
40
40
  enabled?: boolean | undefined;
41
41
  numEvents?: number | undefined;
@@ -55,13 +55,13 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
55
55
  declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
56
56
  scopes: AgentScopeConfig;
57
57
  }) => Promise<{
58
+ name: string;
58
59
  description: string | null;
59
- tenantId: string;
60
- projectId: string;
61
60
  id: string;
62
- name: string;
63
61
  createdAt: string;
64
62
  updatedAt: string;
63
+ projectId: string;
64
+ tenantId: string;
65
65
  models: {
66
66
  base?: {
67
67
  model?: string | undefined;
@@ -79,9 +79,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
79
79
  stopWhen: {
80
80
  transferCountIs?: number | undefined;
81
81
  } | null;
82
- prompt: string | null;
83
82
  defaultSubAgentId: string | null;
84
83
  contextConfigId: string | null;
84
+ prompt: string | null;
85
85
  statusUpdates: {
86
86
  enabled?: boolean | undefined;
87
87
  numEvents?: number | undefined;
@@ -98,14 +98,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
98
98
  }[] | undefined;
99
99
  } | null;
100
100
  defaultSubAgent: {
101
+ name: string;
101
102
  description: string | null;
102
- tenantId: string;
103
- agentId: string;
104
- projectId: string;
105
103
  id: string;
106
- name: string;
107
104
  createdAt: string;
108
105
  updatedAt: string;
106
+ projectId: string;
107
+ tenantId: string;
109
108
  models: {
110
109
  base?: {
111
110
  model?: string | undefined;
@@ -123,6 +122,7 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
123
122
  stopWhen: {
124
123
  stepCountIs?: number | undefined;
125
124
  } | null;
125
+ agentId: string;
126
126
  prompt: string | null;
127
127
  conversationHistoryConfig: ConversationHistoryConfig | null;
128
128
  } | null;
@@ -130,13 +130,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
130
130
  declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
131
131
  scopes: ProjectScopeConfig;
132
132
  }) => Promise<{
133
+ name: string;
133
134
  description: string | null;
134
- tenantId: string;
135
- projectId: string;
136
135
  id: string;
137
- name: string;
138
136
  createdAt: string;
139
137
  updatedAt: string;
138
+ projectId: string;
139
+ tenantId: string;
140
140
  models: {
141
141
  base?: {
142
142
  model?: string | undefined;
@@ -154,9 +154,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
154
154
  stopWhen: {
155
155
  transferCountIs?: number | undefined;
156
156
  } | null;
157
- prompt: string | null;
158
157
  defaultSubAgentId: string | null;
159
158
  contextConfigId: string | null;
159
+ prompt: string | null;
160
160
  statusUpdates: {
161
161
  enabled?: boolean | undefined;
162
162
  numEvents?: number | undefined;
@@ -246,13 +246,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
246
246
  projectIds: string[];
247
247
  }): Promise<AvailableAgentInfo[]>;
248
248
  declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
249
+ name: string;
249
250
  description: string | null;
250
- tenantId: string;
251
- projectId: string;
252
251
  id: string;
253
- name: string;
254
252
  createdAt: string;
255
253
  updatedAt: string;
254
+ projectId: string;
255
+ tenantId: string;
256
256
  models: {
257
257
  base?: {
258
258
  model?: string | undefined;
@@ -270,9 +270,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
270
270
  stopWhen: {
271
271
  transferCountIs?: number | undefined;
272
272
  } | null;
273
- prompt: string | null;
274
273
  defaultSubAgentId: string | null;
275
274
  contextConfigId: string | null;
275
+ prompt: string | null;
276
276
  statusUpdates: {
277
277
  enabled?: boolean | undefined;
278
278
  numEvents?: number | undefined;
@@ -9,11 +9,9 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
9
9
  scopes: ProjectScopeConfig;
10
10
  id: string;
11
11
  }) => Promise<{
12
+ name: string;
12
13
  description: string | null;
13
- tenantId: string;
14
- projectId: string;
15
14
  id: string;
16
- name: string;
17
15
  props: {
18
16
  [x: string]: unknown;
19
17
  type: "object";
@@ -28,6 +26,8 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
28
26
  } | null;
29
27
  createdAt: string;
30
28
  updatedAt: string;
29
+ projectId: string;
30
+ tenantId: string;
31
31
  } | undefined>;
32
32
  declare const listArtifactComponents: (db: AgentsManageDatabaseClient) => (params: {
33
33
  scopes: ProjectScopeConfig;
@@ -65,11 +65,9 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
65
65
  };
66
66
  }>;
67
67
  declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
68
+ name: string;
68
69
  description: string | null;
69
- tenantId: string;
70
- projectId: string;
71
70
  id: string;
72
- name: string;
73
71
  props: {
74
72
  [x: string]: unknown;
75
73
  type: "object";
@@ -84,6 +82,8 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
84
82
  } | null;
85
83
  createdAt: string;
86
84
  updatedAt: string;
85
+ projectId: string;
86
+ tenantId: string;
87
87
  }>;
88
88
  declare const updateArtifactComponent: (db: AgentsManageDatabaseClient) => (params: {
89
89
  scopes: ProjectScopeConfig;
@@ -141,12 +141,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
141
141
  scopes: SubAgentScopeConfig;
142
142
  artifactComponentId: string;
143
143
  }) => Promise<{
144
- tenantId: string;
145
- agentId: string;
146
- projectId: string;
147
144
  subAgentId: string;
148
145
  id: string;
149
146
  createdAt: string;
147
+ projectId: string;
148
+ tenantId: string;
149
+ agentId: string;
150
150
  artifactComponentId: string;
151
151
  }>;
152
152
  declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -184,12 +184,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
184
184
  scopes: SubAgentScopeConfig;
185
185
  artifactComponentId: string;
186
186
  }) => Promise<{
187
- tenantId: string;
188
- agentId: string;
189
- projectId: string;
190
187
  subAgentId: string;
191
188
  id: string;
192
189
  createdAt: string;
190
+ projectId: string;
191
+ tenantId: string;
192
+ agentId: string;
193
193
  artifactComponentId: string;
194
194
  } | null>;
195
195
  /**
@@ -9,26 +9,26 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
9
9
  scopes: AgentScopeConfig;
10
10
  id: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- agentId: string;
14
- projectId: string;
15
12
  id: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
18
17
  headersSchema: unknown;
19
18
  contextVariables: Record<string, ContextFetchDefinition> | null;
19
+ agentId: string;
20
20
  } | undefined>;
21
21
  declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
22
22
  scopes: AgentScopeConfig;
23
23
  }) => Promise<{
24
- tenantId: string;
25
- agentId: string;
26
- projectId: string;
27
24
  id: string;
28
25
  createdAt: string;
29
26
  updatedAt: string;
27
+ projectId: string;
28
+ tenantId: string;
30
29
  headersSchema: unknown;
31
30
  contextVariables: Record<string, ContextFetchDefinition> | null;
31
+ agentId: string;
32
32
  }[]>;
33
33
  declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
34
34
  scopes: AgentScopeConfig;
@@ -43,14 +43,14 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
43
43
  };
44
44
  }>;
45
45
  declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
46
- tenantId: string;
47
- agentId: string;
48
- projectId: string;
49
46
  id: string;
50
47
  createdAt: string;
51
48
  updatedAt: string;
49
+ projectId: string;
50
+ tenantId: string;
52
51
  headersSchema: unknown;
53
52
  contextVariables: Record<string, ContextFetchDefinition> | null;
53
+ agentId: string;
54
54
  }>;
55
55
  declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
56
56
  scopes: AgentScopeConfig;
@@ -83,14 +83,14 @@ declare const countContextConfigs: (db: AgentsManageDatabaseClient) => (params:
83
83
  declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params: {
84
84
  data: ContextConfigInsert;
85
85
  }) => Promise<{
86
- tenantId: string;
87
- agentId: string;
88
- projectId: string;
89
86
  id: string;
90
87
  createdAt: string;
91
88
  updatedAt: string;
89
+ projectId: string;
90
+ tenantId: string;
92
91
  headersSchema: unknown;
93
92
  contextVariables: Record<string, ContextFetchDefinition> | null;
93
+ agentId: string;
94
94
  }>;
95
95
  //#endregion
96
96
  export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };