@inkeep/agents-core 0.0.0-dev-20260219212612 → 0.0.0-dev-20260219220341

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 (34) hide show
  1. package/dist/auth/auth-schema.d.ts +105 -105
  2. package/dist/auth/auth-validation-schemas.d.ts +148 -148
  3. package/dist/auth/auth.d.ts +24 -24
  4. package/dist/auth/auth.js +8 -9
  5. package/dist/auth/authz/sync.d.ts +22 -1
  6. package/dist/auth/authz/sync.js +59 -4
  7. package/dist/auth/permissions.d.ts +9 -9
  8. package/dist/client-exports.d.ts +2 -2
  9. package/dist/constants/models.d.ts +1 -0
  10. package/dist/constants/models.js +1 -0
  11. package/dist/data-access/manage/agents.d.ts +42 -42
  12. package/dist/data-access/manage/artifactComponents.d.ts +16 -16
  13. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  14. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  15. package/dist/data-access/manage/functionTools.d.ts +16 -16
  16. package/dist/data-access/manage/scope-helpers.d.ts +5 -5
  17. package/dist/data-access/manage/skills.d.ts +18 -18
  18. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  19. package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
  20. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
  21. package/dist/data-access/manage/subAgents.d.ts +18 -18
  22. package/dist/data-access/manage/tools.d.ts +24 -24
  23. package/dist/data-access/manage/triggers.d.ts +2 -2
  24. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  25. package/dist/data-access/runtime/conversations.d.ts +31 -31
  26. package/dist/data-access/runtime/messages.d.ts +27 -27
  27. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  28. package/dist/data-access/runtime/tasks.d.ts +9 -9
  29. package/dist/db/manage/manage-schema.d.ts +449 -449
  30. package/dist/db/runtime/runtime-schema.d.ts +298 -298
  31. package/dist/validation/dolt-schemas.d.ts +1 -1
  32. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  33. package/dist/validation/schemas.d.ts +1934 -1934
  34. package/package.json +1 -1
@@ -880,25 +880,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
880
880
  ac: better_auth_plugins0.AccessControl;
881
881
  roles: {
882
882
  member: {
883
- 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] | {
884
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
883
+ 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] | {
884
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
885
885
  connector: "OR" | "AND";
886
886
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
887
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
887
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
888
888
  };
889
889
  admin: {
890
- 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] | {
891
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
890
+ 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] | {
891
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
892
892
  connector: "OR" | "AND";
893
893
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
894
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
894
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
895
895
  };
896
896
  owner: {
897
- 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] | {
898
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
897
+ 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] | {
898
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
899
899
  connector: "OR" | "AND";
900
900
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
901
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
901
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
902
902
  };
903
903
  };
904
904
  creatorRole: "admin";
@@ -947,7 +947,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
947
947
  user: better_auth0.User & Record<string, any>;
948
948
  organization: better_auth_plugins0.Organization & Record<string, any>;
949
949
  }) => Promise<void>;
950
- afterRemoveMember: ({
950
+ beforeRemoveMember: ({
951
951
  member,
952
952
  organization: org
953
953
  }: {
@@ -1084,7 +1084,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1084
1084
  id: string;
1085
1085
  organizationId: string;
1086
1086
  email: string;
1087
- role: "member" | "admin" | "owner";
1087
+ role: "member" | "owner" | "admin";
1088
1088
  status: better_auth_plugins0.InvitationStatus;
1089
1089
  inviterId: string;
1090
1090
  expiresAt: Date;
@@ -1094,7 +1094,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1094
1094
  Member: {
1095
1095
  id: string;
1096
1096
  organizationId: string;
1097
- role: "member" | "admin" | "owner";
1097
+ role: "member" | "owner" | "admin";
1098
1098
  createdAt: Date;
1099
1099
  userId: string;
1100
1100
  user: {
@@ -1110,7 +1110,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1110
1110
  members: {
1111
1111
  id: string;
1112
1112
  organizationId: string;
1113
- role: "member" | "admin" | "owner";
1113
+ role: "member" | "owner" | "admin";
1114
1114
  createdAt: Date;
1115
1115
  userId: string;
1116
1116
  user: {
@@ -1124,7 +1124,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1124
1124
  id: string;
1125
1125
  organizationId: string;
1126
1126
  email: string;
1127
- role: "member" | "admin" | "owner";
1127
+ role: "member" | "owner" | "admin";
1128
1128
  status: better_auth_plugins0.InvitationStatus;
1129
1129
  inviterId: string;
1130
1130
  expiresAt: Date;
@@ -1203,25 +1203,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1203
1203
  ac: better_auth_plugins0.AccessControl;
1204
1204
  roles: {
1205
1205
  member: {
1206
- 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] | {
1207
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1206
+ 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] | {
1207
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1208
1208
  connector: "OR" | "AND";
1209
1209
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1210
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1210
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1211
1211
  };
1212
1212
  admin: {
1213
- 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] | {
1214
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1213
+ 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] | {
1214
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1215
1215
  connector: "OR" | "AND";
1216
1216
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1217
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1217
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1218
1218
  };
1219
1219
  owner: {
1220
- 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] | {
1221
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>[key];
1220
+ 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] | {
1221
+ actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
1222
1222
  connector: "OR" | "AND";
1223
1223
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1224
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1224
+ statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1225
1225
  };
1226
1226
  };
1227
1227
  creatorRole: "admin";
@@ -1270,7 +1270,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1270
1270
  user: better_auth0.User & Record<string, any>;
1271
1271
  organization: better_auth_plugins0.Organization & Record<string, any>;
1272
1272
  }) => Promise<void>;
1273
- afterRemoveMember: ({
1273
+ beforeRemoveMember: ({
1274
1274
  member,
1275
1275
  organization: org
1276
1276
  }: {
package/dist/auth/auth.js CHANGED
@@ -117,7 +117,7 @@ function createAuth(config) {
117
117
  updateAge: 3600 * 24,
118
118
  cookieCache: {
119
119
  enabled: true,
120
- maxAge: 300,
120
+ maxAge: 30,
121
121
  strategy: "compact"
122
122
  }
123
123
  },
@@ -209,18 +209,17 @@ function createAuth(config) {
209
209
  console.log(`🔐 SpiceDB: Revoked all project memberships for ${member$1.userId} (promoted to ${targetRole})`);
210
210
  }
211
211
  },
212
- afterRemoveMember: async ({ member: member$1, organization: org }) => {
212
+ beforeRemoveMember: async ({ member: member$1, organization: org }) => {
213
213
  try {
214
- const { syncOrgMemberToSpiceDb } = await import("./authz/sync.js");
215
- await syncOrgMemberToSpiceDb({
214
+ const { revokeAllUserRelationships } = await import("./authz/sync.js");
215
+ await revokeAllUserRelationships({
216
216
  tenantId: org.id,
217
- userId: member$1.userId,
218
- role: member$1.role,
219
- action: "remove"
217
+ userId: member$1.userId
220
218
  });
221
- console.log(`🔐 SpiceDB: Removed member ${member$1.userId} from org ${org.name}`);
219
+ console.log(`🔐 SpiceDB: Preparing to remove member ${member$1.userId} - revoked all relationships in org ${org.name}`);
222
220
  } catch (error) {
223
- console.error("❌ SpiceDB sync failed for member removal:", error);
221
+ console.error("❌ SpiceDB cleanup failed before member removal:", error);
222
+ throw new Error(`Failed to clean up user permissions: ${error instanceof Error ? error.message : "Unknown error"}`);
224
223
  }
225
224
  }
226
225
  }
@@ -73,6 +73,9 @@ declare function removeProjectFromSpiceDb(params: {
73
73
  /**
74
74
  * List all explicit project members from SpiceDB.
75
75
  * Returns users with project_admin, project_member, or project_viewer roles.
76
+ *
77
+ * NOTE: This is an appropriate use of readRelationships for data introspection,
78
+ * not permission logic (per SpiceDB best practices).
76
79
  */
77
80
  declare function listProjectMembers(params: {
78
81
  tenantId: string;
@@ -84,6 +87,9 @@ declare function listProjectMembers(params: {
84
87
  /**
85
88
  * List all project memberships for a specific user.
86
89
  * Returns projects where the user has explicit project_admin, project_member, or project_viewer roles.
90
+ *
91
+ * NOTE: This is an appropriate use of readRelationships for data introspection,
92
+ * not permission logic (per SpiceDB best practices).
87
93
  */
88
94
  declare function listUserProjectMembershipsInSpiceDb(params: {
89
95
  tenantId: string;
@@ -102,5 +108,20 @@ declare function revokeAllProjectMemberships(params: {
102
108
  tenantId: string;
103
109
  userId: string;
104
110
  }): Promise<void>;
111
+ /**
112
+ * Revoke ALL user relationships within an organization.
113
+ * Call when: user is being removed from an organization.
114
+ *
115
+ * This removes:
116
+ * 1. Organization-level relationships (owner, admin, member)
117
+ * 2. All project-level relationships within the organization
118
+ *
119
+ * Uses the most efficient approach: filters by subject without specifying relation.
120
+ * This is much more efficient than individual relation-specific deletions.
121
+ */
122
+ declare function revokeAllUserRelationships(params: {
123
+ tenantId: string;
124
+ userId: string;
125
+ }): Promise<void>;
105
126
  //#endregion
106
- export { changeOrgRole, changeProjectRole, grantProjectAccess, listProjectMembers, listUserProjectMembershipsInSpiceDb, removeProjectFromSpiceDb, revokeAllProjectMemberships, revokeProjectAccess, syncOrgMemberToSpiceDb, syncProjectToSpiceDb };
127
+ export { changeOrgRole, changeProjectRole, grantProjectAccess, listProjectMembers, listUserProjectMembershipsInSpiceDb, removeProjectFromSpiceDb, revokeAllProjectMemberships, revokeAllUserRelationships, revokeProjectAccess, syncOrgMemberToSpiceDb, syncProjectToSpiceDb };
@@ -1,6 +1,6 @@
1
1
  import { SpiceDbRelations, SpiceDbResourceTypes } from "./types.js";
2
2
  import { fromSpiceDbProjectId, toSpiceDbProjectId } from "./config.js";
3
- import { RelationshipOperation, deleteRelationship, getSpiceClient, readRelationships, writeRelationship } from "./client.js";
3
+ import { RelationshipOperation, checkBulkPermissions, deleteRelationship, getSpiceClient, readRelationships, writeRelationship } from "./client.js";
4
4
 
5
5
  //#region src/auth/authz/sync.ts
6
6
  /**
@@ -82,12 +82,13 @@ async function changeOrgRole(params) {
82
82
  */
83
83
  async function syncProjectToSpiceDb(params) {
84
84
  const spice = getSpiceClient();
85
- const isOrgAdminOrOwner = (await readRelationships({
85
+ const isOrgAdminOrOwner = (await checkBulkPermissions({
86
86
  resourceType: SpiceDbResourceTypes.ORGANIZATION,
87
87
  resourceId: params.tenantId,
88
+ permissions: ["manage"],
88
89
  subjectType: SpiceDbResourceTypes.USER,
89
90
  subjectId: params.creatorUserId
90
- })).some((r) => r.relation === SpiceDbRelations.ADMIN || r.relation === SpiceDbRelations.OWNER);
91
+ })).manage;
91
92
  const spiceProjectId = toSpiceDbProjectId(params.tenantId, params.projectId);
92
93
  const updates = [{
93
94
  operation: RelationshipOperation.TOUCH,
@@ -224,6 +225,9 @@ async function removeProjectFromSpiceDb(params) {
224
225
  /**
225
226
  * List all explicit project members from SpiceDB.
226
227
  * Returns users with project_admin, project_member, or project_viewer roles.
228
+ *
229
+ * NOTE: This is an appropriate use of readRelationships for data introspection,
230
+ * not permission logic (per SpiceDB best practices).
227
231
  */
228
232
  async function listProjectMembers(params) {
229
233
  return (await readRelationships({
@@ -237,6 +241,9 @@ async function listProjectMembers(params) {
237
241
  /**
238
242
  * List all project memberships for a specific user.
239
243
  * Returns projects where the user has explicit project_admin, project_member, or project_viewer roles.
244
+ *
245
+ * NOTE: This is an appropriate use of readRelationships for data introspection,
246
+ * not permission logic (per SpiceDB best practices).
240
247
  */
241
248
  async function listUserProjectMembershipsInSpiceDb(params) {
242
249
  return (await readRelationships({
@@ -319,6 +326,54 @@ async function revokeAllProjectMemberships(params) {
319
326
  })
320
327
  ]);
321
328
  }
329
+ /**
330
+ * Revoke ALL user relationships within an organization.
331
+ * Call when: user is being removed from an organization.
332
+ *
333
+ * This removes:
334
+ * 1. Organization-level relationships (owner, admin, member)
335
+ * 2. All project-level relationships within the organization
336
+ *
337
+ * Uses the most efficient approach: filters by subject without specifying relation.
338
+ * This is much more efficient than individual relation-specific deletions.
339
+ */
340
+ async function revokeAllUserRelationships(params) {
341
+ const spice = getSpiceClient();
342
+ const tenantPrefix = `${params.tenantId}/`;
343
+ await Promise.all([spice.promises.deleteRelationships({
344
+ relationshipFilter: {
345
+ resourceType: SpiceDbResourceTypes.ORGANIZATION,
346
+ optionalResourceId: params.tenantId,
347
+ optionalResourceIdPrefix: "",
348
+ optionalRelation: "",
349
+ optionalSubjectFilter: {
350
+ subjectType: SpiceDbResourceTypes.USER,
351
+ optionalSubjectId: params.userId,
352
+ optionalRelation: void 0
353
+ }
354
+ },
355
+ optionalPreconditions: [],
356
+ optionalLimit: 0,
357
+ optionalAllowPartialDeletions: false,
358
+ optionalTransactionMetadata: void 0
359
+ }), spice.promises.deleteRelationships({
360
+ relationshipFilter: {
361
+ resourceType: SpiceDbResourceTypes.PROJECT,
362
+ optionalResourceId: "",
363
+ optionalResourceIdPrefix: tenantPrefix,
364
+ optionalRelation: "",
365
+ optionalSubjectFilter: {
366
+ subjectType: SpiceDbResourceTypes.USER,
367
+ optionalSubjectId: params.userId,
368
+ optionalRelation: void 0
369
+ }
370
+ },
371
+ optionalPreconditions: [],
372
+ optionalLimit: 0,
373
+ optionalAllowPartialDeletions: false,
374
+ optionalTransactionMetadata: void 0
375
+ })]);
376
+ }
322
377
 
323
378
  //#endregion
324
- export { changeOrgRole, changeProjectRole, grantProjectAccess, listProjectMembers, listUserProjectMembershipsInSpiceDb, removeProjectFromSpiceDb, revokeAllProjectMemberships, revokeProjectAccess, syncOrgMemberToSpiceDb, syncProjectToSpiceDb };
379
+ export { changeOrgRole, changeProjectRole, grantProjectAccess, listProjectMembers, listUserProjectMembershipsInSpiceDb, removeProjectFromSpiceDb, revokeAllProjectMemberships, revokeAllUserRelationships, revokeProjectAccess, syncOrgMemberToSpiceDb, syncProjectToSpiceDb };
@@ -5,25 +5,25 @@ import { organizationClient } from "better-auth/client/plugins";
5
5
  //#region src/auth/permissions.d.ts
6
6
  declare const ac: AccessControl;
7
7
  declare const memberRole: {
8
- 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] | {
9
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
8
+ 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] | {
9
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
10
10
  connector: "OR" | "AND";
11
11
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
12
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
12
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
13
13
  };
14
14
  declare const adminRole: {
15
- 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] | {
16
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
15
+ 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] | {
16
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
17
17
  connector: "OR" | "AND";
18
18
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
19
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
19
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
20
20
  };
21
21
  declare const ownerRole: {
22
- 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] | {
23
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>[key];
22
+ 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] | {
23
+ actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
24
24
  connector: "OR" | "AND";
25
25
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
26
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
26
+ statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
27
27
  };
28
28
  //#endregion
29
29
  export { ac, adminRole, memberRole, organizationClient, ownerRole };
@@ -17,11 +17,11 @@ 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
- id: z.ZodString;
20
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
21
  name: z.ZodString;
22
+ id: z.ZodString;
22
23
  createdAt: z.ZodOptional<z.ZodString>;
23
24
  updatedAt: z.ZodOptional<z.ZodString>;
24
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
25
  models: z.ZodOptional<z.ZodObject<{
26
26
  base: z.ZodOptional<z.ZodObject<{
27
27
  model: z.ZodOptional<z.ZodString>;
@@ -38,6 +38,7 @@ declare const OPENAI_MODELS: {
38
38
  readonly GPT_4_1_NANO_20250414: "openai/gpt-4.1-nano-2025-04-14";
39
39
  };
40
40
  declare const GOOGLE_MODELS: {
41
+ readonly GEMINI_3_1_PRO_PREVIEW: "google/gemini-3.1-pro-preview";
41
42
  readonly GEMINI_3_PRO_PREVIEW: "google/gemini-3-pro-preview";
42
43
  readonly GEMINI_3_FLASH_PREVIEW: "google/gemini-3-flash-preview";
43
44
  readonly GEMINI_2_5_PRO: "google/gemini-2.5-pro";
@@ -38,6 +38,7 @@ const OPENAI_MODELS = {
38
38
  GPT_4_1_NANO_20250414: "openai/gpt-4.1-nano-2025-04-14"
39
39
  };
40
40
  const GOOGLE_MODELS = {
41
+ GEMINI_3_1_PRO_PREVIEW: "google/gemini-3.1-pro-preview",
41
42
  GEMINI_3_PRO_PREVIEW: "google/gemini-3-pro-preview",
42
43
  GEMINI_3_FLASH_PREVIEW: "google/gemini-3-flash-preview",
43
44
  GEMINI_2_5_PRO: "google/gemini-2.5-pro",
@@ -8,15 +8,13 @@ import { PgTable } from "drizzle-orm/pg-core";
8
8
  declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
9
9
  scopes: AgentScopeConfig;
10
10
  }) => Promise<{
11
- id: string;
11
+ description: string | null;
12
+ tenantId: string;
12
13
  name: string;
14
+ projectId: string;
15
+ id: string;
13
16
  createdAt: string;
14
17
  updatedAt: string;
15
- description: string | null;
16
- projectId: string;
17
- tenantId: string;
18
- defaultSubAgentId: string | null;
19
- contextConfigId: string | null;
20
18
  models: {
21
19
  base?: {
22
20
  model?: string | undefined;
@@ -31,7 +29,12 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
31
29
  providerOptions?: Record<string, any> | undefined;
32
30
  } | undefined;
33
31
  } | null;
32
+ stopWhen: {
33
+ transferCountIs?: number | undefined;
34
+ } | null;
34
35
  prompt: string | null;
36
+ defaultSubAgentId: string | null;
37
+ contextConfigId: string | null;
35
38
  statusUpdates: {
36
39
  enabled?: boolean | undefined;
37
40
  numEvents?: number | undefined;
@@ -47,22 +50,17 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
47
50
  } | undefined;
48
51
  }[] | undefined;
49
52
  } | null;
50
- stopWhen: {
51
- transferCountIs?: number | undefined;
52
- } | null;
53
53
  } | null>;
54
54
  declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
55
55
  scopes: AgentScopeConfig;
56
56
  }) => Promise<{
57
- id: string;
57
+ description: string | null;
58
+ tenantId: string;
58
59
  name: string;
60
+ projectId: string;
61
+ id: string;
59
62
  createdAt: string;
60
63
  updatedAt: string;
61
- description: string | null;
62
- projectId: string;
63
- tenantId: string;
64
- defaultSubAgentId: string | null;
65
- contextConfigId: string | null;
66
64
  models: {
67
65
  base?: {
68
66
  model?: string | undefined;
@@ -77,7 +75,12 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
77
75
  providerOptions?: Record<string, any> | undefined;
78
76
  } | undefined;
79
77
  } | null;
78
+ stopWhen: {
79
+ transferCountIs?: number | undefined;
80
+ } | null;
80
81
  prompt: string | null;
82
+ defaultSubAgentId: string | null;
83
+ contextConfigId: string | null;
81
84
  statusUpdates: {
82
85
  enabled?: boolean | undefined;
83
86
  numEvents?: number | undefined;
@@ -93,18 +96,14 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
93
96
  } | undefined;
94
97
  }[] | undefined;
95
98
  } | null;
96
- stopWhen: {
97
- transferCountIs?: number | undefined;
98
- } | null;
99
99
  defaultSubAgent: {
100
- id: string;
100
+ description: string | null;
101
+ tenantId: string;
101
102
  name: string;
103
+ projectId: string;
104
+ id: string;
102
105
  createdAt: string;
103
106
  updatedAt: string;
104
- description: string | null;
105
- agentId: string;
106
- projectId: string;
107
- tenantId: string;
108
107
  models: {
109
108
  base?: {
110
109
  model?: string | undefined;
@@ -119,25 +118,24 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
119
118
  providerOptions?: Record<string, any> | undefined;
120
119
  } | undefined;
121
120
  } | null;
122
- prompt: string | null;
123
121
  stopWhen: {
124
122
  stepCountIs?: number | undefined;
125
123
  } | null;
124
+ prompt: string | null;
126
125
  conversationHistoryConfig: ConversationHistoryConfig | null;
126
+ agentId: string;
127
127
  } | null;
128
128
  } | null>;
129
129
  declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
130
130
  scopes: ProjectScopeConfig;
131
131
  }) => Promise<{
132
- id: string;
132
+ description: string | null;
133
+ tenantId: string;
133
134
  name: string;
135
+ projectId: string;
136
+ id: string;
134
137
  createdAt: string;
135
138
  updatedAt: string;
136
- description: string | null;
137
- projectId: string;
138
- tenantId: string;
139
- defaultSubAgentId: string | null;
140
- contextConfigId: string | null;
141
139
  models: {
142
140
  base?: {
143
141
  model?: string | undefined;
@@ -152,7 +150,12 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
152
150
  providerOptions?: Record<string, any> | undefined;
153
151
  } | undefined;
154
152
  } | null;
153
+ stopWhen: {
154
+ transferCountIs?: number | undefined;
155
+ } | null;
155
156
  prompt: string | null;
157
+ defaultSubAgentId: string | null;
158
+ contextConfigId: string | null;
156
159
  statusUpdates: {
157
160
  enabled?: boolean | undefined;
158
161
  numEvents?: number | undefined;
@@ -168,9 +171,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
168
171
  } | undefined;
169
172
  }[] | undefined;
170
173
  } | null;
171
- stopWhen: {
172
- transferCountIs?: number | undefined;
173
- } | null;
174
174
  }[]>;
175
175
  declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
176
176
  scopes: ProjectScopeConfig;
@@ -245,15 +245,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
245
245
  projectIds: string[];
246
246
  }): Promise<AvailableAgentInfo[]>;
247
247
  declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
248
- id: string;
248
+ description: string | null;
249
+ tenantId: string;
249
250
  name: string;
251
+ projectId: string;
252
+ id: string;
250
253
  createdAt: string;
251
254
  updatedAt: string;
252
- description: string | null;
253
- projectId: string;
254
- tenantId: string;
255
- defaultSubAgentId: string | null;
256
- contextConfigId: string | null;
257
255
  models: {
258
256
  base?: {
259
257
  model?: string | undefined;
@@ -268,7 +266,12 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
268
266
  providerOptions?: Record<string, any> | undefined;
269
267
  } | undefined;
270
268
  } | null;
269
+ stopWhen: {
270
+ transferCountIs?: number | undefined;
271
+ } | null;
271
272
  prompt: string | null;
273
+ defaultSubAgentId: string | null;
274
+ contextConfigId: string | null;
272
275
  statusUpdates: {
273
276
  enabled?: boolean | undefined;
274
277
  numEvents?: number | undefined;
@@ -284,9 +287,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
284
287
  } | undefined;
285
288
  }[] | undefined;
286
289
  } | null;
287
- stopWhen: {
288
- transferCountIs?: number | undefined;
289
- } | null;
290
290
  }>;
291
291
  declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
292
292
  scopes: AgentScopeConfig;
@@ -8,13 +8,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- id: string;
12
- name: string;
13
- createdAt: string;
14
- updatedAt: string;
15
11
  description: string | null;
16
- projectId: string;
17
12
  tenantId: string;
13
+ name: string;
14
+ projectId: string;
15
+ id: string;
18
16
  props: {
19
17
  [x: string]: unknown;
20
18
  type: "object";
@@ -27,6 +25,8 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
27
25
  component: string;
28
26
  mockData: Record<string, unknown>;
29
27
  } | null;
28
+ createdAt: string;
29
+ updatedAt: string;
30
30
  } | undefined>;
31
31
  declare const listArtifactComponents: (db: AgentsManageDatabaseClient) => (params: {
32
32
  scopes: ProjectScopeConfig;
@@ -64,13 +64,11 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
64
64
  };
65
65
  }>;
66
66
  declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
67
- id: string;
68
- name: string;
69
- createdAt: string;
70
- updatedAt: string;
71
67
  description: string | null;
72
- projectId: string;
73
68
  tenantId: string;
69
+ name: string;
70
+ projectId: string;
71
+ id: string;
74
72
  props: {
75
73
  [x: string]: unknown;
76
74
  type: "object";
@@ -83,6 +81,8 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
83
81
  component: string;
84
82
  mockData: Record<string, unknown>;
85
83
  } | null;
84
+ createdAt: string;
85
+ updatedAt: string;
86
86
  }>;
87
87
  declare const updateArtifactComponent: (db: AgentsManageDatabaseClient) => (params: {
88
88
  scopes: ProjectScopeConfig;
@@ -140,12 +140,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
140
140
  scopes: SubAgentScopeConfig;
141
141
  artifactComponentId: string;
142
142
  }) => Promise<{
143
+ tenantId: string;
144
+ projectId: string;
145
+ subAgentId: string;
143
146
  id: string;
144
147
  createdAt: string;
145
148
  agentId: string;
146
- projectId: string;
147
- tenantId: string;
148
- subAgentId: string;
149
149
  artifactComponentId: string;
150
150
  }>;
151
151
  declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -183,12 +183,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
183
183
  scopes: SubAgentScopeConfig;
184
184
  artifactComponentId: string;
185
185
  }) => Promise<{
186
+ tenantId: string;
187
+ projectId: string;
188
+ subAgentId: string;
186
189
  id: string;
187
190
  createdAt: string;
188
191
  agentId: string;
189
- projectId: string;
190
- tenantId: string;
191
- subAgentId: string;
192
192
  artifactComponentId: string;
193
193
  } | null>;
194
194
  /**