@inkeep/agents-core 0.50.1 → 0.50.4

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 (60) 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/constants/models.d.ts +1 -0
  9. package/dist/constants/models.js +1 -0
  10. package/dist/constants/otel-attributes.d.ts +4 -0
  11. package/dist/constants/otel-attributes.js +4 -0
  12. package/dist/data-access/manage/agents.d.ts +43 -43
  13. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  14. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  15. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  16. package/dist/data-access/manage/functionTools.d.ts +18 -18
  17. package/dist/data-access/manage/scope-helpers.d.ts +25 -0
  18. package/dist/data-access/manage/scope-helpers.js +18 -0
  19. package/dist/data-access/manage/skills.d.ts +14 -14
  20. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  21. package/dist/data-access/manage/subAgentExternalAgentRelations.js +13 -12
  22. package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
  23. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  24. package/dist/data-access/manage/subAgents.d.ts +21 -21
  25. package/dist/data-access/manage/tools.d.ts +24 -24
  26. package/dist/data-access/manage/triggers.d.ts +2 -2
  27. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  28. package/dist/data-access/runtime/conversations.d.ts +31 -31
  29. package/dist/data-access/runtime/messages.d.ts +18 -18
  30. package/dist/data-access/runtime/tasks.d.ts +9 -9
  31. package/dist/data-access/runtime/workAppSlack.js +1 -0
  32. package/dist/db/manage/manage-schema.d.ts +449 -449
  33. package/dist/db/runtime/runtime-schema.d.ts +313 -296
  34. package/dist/db/runtime/runtime-schema.js +1 -0
  35. package/dist/index.d.ts +2 -1
  36. package/dist/index.js +2 -1
  37. package/dist/middleware/authz-meta.d.ts +15 -0
  38. package/dist/middleware/authz-meta.js +11 -0
  39. package/dist/middleware/create-protected-route.d.ts +30 -0
  40. package/dist/middleware/create-protected-route.js +20 -0
  41. package/dist/middleware/index.d.ts +5 -0
  42. package/dist/middleware/index.js +6 -0
  43. package/dist/middleware/inherited-auth.d.ts +43 -0
  44. package/dist/middleware/inherited-auth.js +50 -0
  45. package/dist/middleware/no-auth.d.ts +6 -0
  46. package/dist/middleware/no-auth.js +11 -0
  47. package/dist/types/utility.d.ts +6 -0
  48. package/dist/utils/in-process-fetch.d.ts +30 -0
  49. package/dist/utils/in-process-fetch.js +51 -0
  50. package/dist/utils/index.d.ts +2 -1
  51. package/dist/utils/index.js +2 -1
  52. package/dist/utils/slack-user-token.d.ts +11 -0
  53. package/dist/utils/slack-user-token.js +11 -3
  54. package/dist/validation/dolt-schemas.d.ts +1 -1
  55. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  56. package/dist/validation/schemas.d.ts +1867 -1867
  57. package/drizzle/runtime/0014_odd_oracle.sql +1 -0
  58. package/drizzle/runtime/meta/0014_snapshot.json +3753 -0
  59. package/drizzle/runtime/meta/_journal.json +7 -0
  60. package/package.json +5 -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 "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];
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];
885
885
  connector: "OR" | "AND";
886
886
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
887
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
887
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
888
888
  };
889
889
  admin: {
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];
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];
892
892
  connector: "OR" | "AND";
893
893
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
894
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
894
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
895
895
  };
896
896
  owner: {
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];
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];
899
899
  connector: "OR" | "AND";
900
900
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
901
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
901
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "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: "owner" | "admin" | "member";
1087
+ role: "member" | "admin" | "owner";
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: "owner" | "admin" | "member";
1097
+ role: "member" | "admin" | "owner";
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: "owner" | "admin" | "member";
1113
+ role: "member" | "admin" | "owner";
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: "owner" | "admin" | "member";
1127
+ role: "member" | "admin" | "owner";
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 "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];
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];
1208
1208
  connector: "OR" | "AND";
1209
1209
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1210
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1210
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1211
1211
  };
1212
1212
  admin: {
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];
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];
1215
1215
  connector: "OR" | "AND";
1216
1216
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1217
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1217
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins0.Statements>;
1218
1218
  };
1219
1219
  owner: {
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];
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];
1222
1222
  connector: "OR" | "AND";
1223
1223
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1224
- statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
1224
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "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 "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];
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];
10
10
  connector: "OR" | "AND";
11
11
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
12
- statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
12
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
13
13
  };
14
14
  declare const adminRole: {
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];
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];
17
17
  connector: "OR" | "AND";
18
18
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
19
- statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
19
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
20
20
  };
21
21
  declare const ownerRole: {
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];
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];
24
24
  connector: "OR" | "AND";
25
25
  } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
26
- statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
26
+ statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "ac" | "project" | "team", better_auth_plugins69.Statements>;
27
27
  };
28
28
  //#endregion
29
29
  export { ac, adminRole, memberRole, organizationClient, ownerRole };
@@ -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",
@@ -93,6 +93,10 @@ declare const SPAN_KEYS: {
93
93
  readonly ARTIFACT_DATA: "artifact.data";
94
94
  readonly ARTIFACT_NAME: "artifact.name";
95
95
  readonly ARTIFACT_DESCRIPTION: "artifact.description";
96
+ readonly ARTIFACT_IS_OVERSIZED: "artifact.is_oversized";
97
+ readonly ARTIFACT_RETRIEVAL_BLOCKED: "artifact.retrieval_blocked";
98
+ readonly ARTIFACT_ORIGINAL_TOKEN_SIZE: "artifact.original_token_size";
99
+ readonly ARTIFACT_CONTEXT_WINDOW_SIZE: "artifact.context_window_size";
96
100
  readonly CONTEXT_BREAKDOWN_SYSTEM_TEMPLATE: "context.breakdown.system_template_tokens";
97
101
  readonly CONTEXT_BREAKDOWN_CORE_INSTRUCTIONS: "context.breakdown.core_instructions_tokens";
98
102
  readonly CONTEXT_BREAKDOWN_AGENT_PROMPT: "context.breakdown.agent_prompt_tokens";
@@ -93,6 +93,10 @@ const SPAN_KEYS = {
93
93
  ARTIFACT_DATA: "artifact.data",
94
94
  ARTIFACT_NAME: "artifact.name",
95
95
  ARTIFACT_DESCRIPTION: "artifact.description",
96
+ ARTIFACT_IS_OVERSIZED: "artifact.is_oversized",
97
+ ARTIFACT_RETRIEVAL_BLOCKED: "artifact.retrieval_blocked",
98
+ ARTIFACT_ORIGINAL_TOKEN_SIZE: "artifact.original_token_size",
99
+ ARTIFACT_CONTEXT_WINDOW_SIZE: "artifact.context_window_size",
96
100
  CONTEXT_BREAKDOWN_SYSTEM_TEMPLATE: "context.breakdown.system_template_tokens",
97
101
  CONTEXT_BREAKDOWN_CORE_INSTRUCTIONS: "context.breakdown.core_instructions_tokens",
98
102
  CONTEXT_BREAKDOWN_AGENT_PROMPT: "context.breakdown.agent_prompt_tokens",
@@ -10,11 +10,13 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  }) => Promise<{
11
11
  id: string;
12
12
  name: string;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
13
17
  description: string | null;
14
18
  defaultSubAgentId: string | null;
15
- tenantId: string;
16
- projectId: string;
17
- prompt: string | null;
19
+ contextConfigId: string | null;
18
20
  models: {
19
21
  base?: {
20
22
  model?: string | undefined;
@@ -29,12 +31,7 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
29
31
  providerOptions?: Record<string, any> | undefined;
30
32
  } | undefined;
31
33
  } | null;
32
- stopWhen: {
33
- transferCountIs?: number | undefined;
34
- } | null;
35
- createdAt: string;
36
- updatedAt: string;
37
- contextConfigId: string | null;
34
+ prompt: string | null;
38
35
  statusUpdates: {
39
36
  enabled?: boolean | undefined;
40
37
  numEvents?: number | undefined;
@@ -50,17 +47,22 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
50
47
  } | undefined;
51
48
  }[] | undefined;
52
49
  } | 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
57
  id: string;
58
58
  name: string;
59
+ createdAt: string;
60
+ updatedAt: string;
61
+ projectId: string;
62
+ tenantId: string;
59
63
  description: string | null;
60
64
  defaultSubAgentId: string | null;
61
- tenantId: string;
62
- projectId: string;
63
- prompt: string | null;
65
+ contextConfigId: string | null;
64
66
  models: {
65
67
  base?: {
66
68
  model?: string | undefined;
@@ -75,12 +77,7 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
75
77
  providerOptions?: Record<string, any> | undefined;
76
78
  } | undefined;
77
79
  } | null;
78
- stopWhen: {
79
- transferCountIs?: number | undefined;
80
- } | null;
81
- createdAt: string;
82
- updatedAt: string;
83
- contextConfigId: string | null;
80
+ prompt: string | null;
84
81
  statusUpdates: {
85
82
  enabled?: boolean | undefined;
86
83
  numEvents?: number | undefined;
@@ -96,15 +93,18 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
96
93
  } | undefined;
97
94
  }[] | undefined;
98
95
  } | null;
96
+ stopWhen: {
97
+ transferCountIs?: number | undefined;
98
+ } | null;
99
99
  defaultSubAgent: {
100
100
  id: string;
101
101
  name: string;
102
- description: string | null;
103
- tenantId: string;
104
- projectId: string;
102
+ createdAt: string;
103
+ updatedAt: string;
105
104
  agentId: string;
106
- prompt: string | null;
107
- conversationHistoryConfig: ConversationHistoryConfig | null;
105
+ projectId: string;
106
+ tenantId: string;
107
+ description: string | null;
108
108
  models: {
109
109
  base?: {
110
110
  model?: string | undefined;
@@ -119,11 +119,11 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
119
119
  providerOptions?: Record<string, any> | undefined;
120
120
  } | undefined;
121
121
  } | null;
122
+ prompt: string | null;
122
123
  stopWhen: {
123
124
  stepCountIs?: number | undefined;
124
125
  } | null;
125
- createdAt: string;
126
- updatedAt: string;
126
+ conversationHistoryConfig: ConversationHistoryConfig | null;
127
127
  } | null;
128
128
  } | null>;
129
129
  declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
@@ -131,11 +131,13 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
131
131
  }) => Promise<{
132
132
  id: string;
133
133
  name: string;
134
+ createdAt: string;
135
+ updatedAt: string;
136
+ projectId: string;
137
+ tenantId: string;
134
138
  description: string | null;
135
139
  defaultSubAgentId: string | null;
136
- tenantId: string;
137
- projectId: string;
138
- prompt: string | null;
140
+ contextConfigId: string | null;
139
141
  models: {
140
142
  base?: {
141
143
  model?: string | undefined;
@@ -150,12 +152,7 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
150
152
  providerOptions?: Record<string, any> | undefined;
151
153
  } | undefined;
152
154
  } | null;
153
- stopWhen: {
154
- transferCountIs?: number | undefined;
155
- } | null;
156
- createdAt: string;
157
- updatedAt: string;
158
- contextConfigId: string | null;
155
+ prompt: string | null;
159
156
  statusUpdates: {
160
157
  enabled?: boolean | undefined;
161
158
  numEvents?: number | undefined;
@@ -171,6 +168,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
171
168
  } | undefined;
172
169
  }[] | undefined;
173
170
  } | null;
171
+ stopWhen: {
172
+ transferCountIs?: number | undefined;
173
+ } | null;
174
174
  }[]>;
175
175
  declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
176
176
  scopes: ProjectScopeConfig;
@@ -247,11 +247,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
247
247
  declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
248
248
  id: string;
249
249
  name: string;
250
+ createdAt: string;
251
+ updatedAt: string;
252
+ projectId: string;
253
+ tenantId: string;
250
254
  description: string | null;
251
255
  defaultSubAgentId: string | null;
252
- tenantId: string;
253
- projectId: string;
254
- prompt: string | null;
256
+ contextConfigId: string | null;
255
257
  models: {
256
258
  base?: {
257
259
  model?: string | undefined;
@@ -266,12 +268,7 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
266
268
  providerOptions?: Record<string, any> | undefined;
267
269
  } | undefined;
268
270
  } | null;
269
- stopWhen: {
270
- transferCountIs?: number | undefined;
271
- } | null;
272
- createdAt: string;
273
- updatedAt: string;
274
- contextConfigId: string | null;
271
+ prompt: string | null;
275
272
  statusUpdates: {
276
273
  enabled?: boolean | undefined;
277
274
  numEvents?: number | undefined;
@@ -287,6 +284,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
287
284
  } | undefined;
288
285
  }[] | undefined;
289
286
  } | null;
287
+ stopWhen: {
288
+ transferCountIs?: number | undefined;
289
+ } | null;
290
290
  }>;
291
291
  declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
292
292
  scopes: AgentScopeConfig;
@@ -10,11 +10,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
10
10
  }) => Promise<{
11
11
  id: string;
12
12
  name: string;
13
- description: string | null;
14
- tenantId: string;
15
- projectId: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
17
+ description: string | null;
18
18
  props: {
19
19
  [x: string]: unknown;
20
20
  type: "object";
@@ -66,11 +66,11 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
66
66
  declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
67
67
  id: string;
68
68
  name: string;
69
- description: string | null;
70
- tenantId: string;
71
- projectId: string;
72
69
  createdAt: string;
73
70
  updatedAt: string;
71
+ projectId: string;
72
+ tenantId: string;
73
+ description: string | null;
74
74
  props: {
75
75
  [x: string]: unknown;
76
76
  type: "object";
@@ -141,10 +141,10 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
141
141
  artifactComponentId: string;
142
142
  }) => Promise<{
143
143
  id: string;
144
- tenantId: string;
145
- projectId: string;
146
- agentId: string;
147
144
  createdAt: string;
145
+ agentId: string;
146
+ projectId: string;
147
+ tenantId: string;
148
148
  subAgentId: string;
149
149
  artifactComponentId: string;
150
150
  }>;
@@ -184,10 +184,10 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
184
184
  artifactComponentId: string;
185
185
  }) => Promise<{
186
186
  id: string;
187
- tenantId: string;
188
- projectId: string;
189
- agentId: string;
190
187
  createdAt: string;
188
+ agentId: string;
189
+ projectId: string;
190
+ tenantId: string;
191
191
  subAgentId: string;
192
192
  artifactComponentId: string;
193
193
  } | null>;