@inkeep/agents-core 0.0.0-dev-20260218233229 → 0.0.0-dev-20260219033751

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.
@@ -3,7 +3,7 @@ import * as zod0 from "zod";
3
3
  import * as _better_auth_sso0 from "@better-auth/sso";
4
4
  import * as better_auth0 from "better-auth";
5
5
  import { BetterAuthAdvancedOptions } from "better-auth";
6
- import * as better_auth_plugins0 from "better-auth/plugins";
6
+ import * as better_auth_plugins20 from "better-auth/plugins";
7
7
  import { GoogleOptions } from "better-auth/social-providers";
8
8
 
9
9
  //#region src/auth/auth.d.ts
@@ -247,7 +247,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
247
247
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
248
248
  }[];
249
249
  };
250
- options: better_auth_plugins0.BearerOptions | undefined;
250
+ options: better_auth_plugins20.BearerOptions | undefined;
251
251
  }, {
252
252
  id: "sso";
253
253
  endpoints: {
@@ -875,30 +875,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
875
875
  };
876
876
  }, {
877
877
  id: "organization";
878
- endpoints: better_auth_plugins0.OrganizationEndpoints<{
878
+ endpoints: better_auth_plugins20.OrganizationEndpoints<{
879
879
  allowUserToCreateOrganization: true;
880
- ac: better_auth_plugins0.AccessControl;
880
+ ac: better_auth_plugins20.AccessControl;
881
881
  roles: {
882
882
  member: {
883
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
884
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
883
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
884
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
885
885
  connector: "OR" | "AND";
886
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
887
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
886
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
887
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
888
888
  };
889
889
  admin: {
890
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
891
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
890
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
891
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
892
892
  connector: "OR" | "AND";
893
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
894
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
893
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
894
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
895
895
  };
896
896
  owner: {
897
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
898
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
897
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
898
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
899
899
  connector: "OR" | "AND";
900
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
901
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
900
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
901
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
902
902
  };
903
903
  };
904
904
  creatorRole: "admin";
@@ -909,9 +909,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
909
909
  id: string;
910
910
  role: string;
911
911
  email: string;
912
- organization: better_auth_plugins0.Organization;
913
- invitation: better_auth_plugins0.Invitation;
914
- inviter: better_auth_plugins0.Member & {
912
+ organization: better_auth_plugins20.Organization;
913
+ invitation: better_auth_plugins20.Invitation;
914
+ inviter: better_auth_plugins20.Member & {
915
915
  user: better_auth0.User;
916
916
  };
917
917
  }): Promise<void>;
@@ -932,28 +932,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
932
932
  user,
933
933
  organization: org
934
934
  }: {
935
- invitation: better_auth_plugins0.Invitation & Record<string, any>;
936
- member: better_auth_plugins0.Member & Record<string, any>;
935
+ invitation: better_auth_plugins20.Invitation & Record<string, any>;
936
+ member: better_auth_plugins20.Member & Record<string, any>;
937
937
  user: better_auth0.User & Record<string, any>;
938
- organization: better_auth_plugins0.Organization & Record<string, any>;
938
+ organization: better_auth_plugins20.Organization & Record<string, any>;
939
939
  }) => Promise<void>;
940
940
  beforeUpdateMemberRole: ({
941
941
  member,
942
942
  organization: org,
943
943
  newRole
944
944
  }: {
945
- member: better_auth_plugins0.Member & Record<string, any>;
945
+ member: better_auth_plugins20.Member & Record<string, any>;
946
946
  newRole: string;
947
947
  user: better_auth0.User & Record<string, any>;
948
- organization: better_auth_plugins0.Organization & Record<string, any>;
948
+ organization: better_auth_plugins20.Organization & Record<string, any>;
949
949
  }) => Promise<void>;
950
950
  afterRemoveMember: ({
951
951
  member,
952
952
  organization: org
953
953
  }: {
954
- member: better_auth_plugins0.Member & Record<string, any>;
954
+ member: better_auth_plugins20.Member & Record<string, any>;
955
955
  user: better_auth0.User & Record<string, any>;
956
- organization: better_auth_plugins0.Organization & Record<string, any>;
956
+ organization: better_auth_plugins20.Organization & Record<string, any>;
957
957
  }) => Promise<void>;
958
958
  };
959
959
  }>;
@@ -1084,8 +1084,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1084
1084
  id: string;
1085
1085
  organizationId: string;
1086
1086
  email: string;
1087
- role: "member" | "owner" | "admin";
1088
- status: better_auth_plugins0.InvitationStatus;
1087
+ role: "member" | "admin" | "owner";
1088
+ status: better_auth_plugins20.InvitationStatus;
1089
1089
  inviterId: string;
1090
1090
  expiresAt: Date;
1091
1091
  createdAt: 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" | "owner" | "admin";
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: "member" | "owner" | "admin";
1113
+ role: "member" | "admin" | "owner";
1114
1114
  createdAt: Date;
1115
1115
  userId: string;
1116
1116
  user: {
@@ -1124,8 +1124,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1124
1124
  id: string;
1125
1125
  organizationId: string;
1126
1126
  email: string;
1127
- role: "member" | "owner" | "admin";
1128
- status: better_auth_plugins0.InvitationStatus;
1127
+ role: "member" | "admin" | "owner";
1128
+ status: better_auth_plugins20.InvitationStatus;
1129
1129
  inviterId: string;
1130
1130
  expiresAt: Date;
1131
1131
  createdAt: Date;
@@ -1200,28 +1200,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1200
1200
  };
1201
1201
  options: NoInfer<{
1202
1202
  allowUserToCreateOrganization: true;
1203
- ac: better_auth_plugins0.AccessControl;
1203
+ ac: better_auth_plugins20.AccessControl;
1204
1204
  roles: {
1205
1205
  member: {
1206
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1207
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1206
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
1207
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1208
1208
  connector: "OR" | "AND";
1209
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1210
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1209
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1210
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1211
1211
  };
1212
1212
  admin: {
1213
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1214
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1213
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
1214
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1215
1215
  connector: "OR" | "AND";
1216
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1217
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1216
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1217
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1218
1218
  };
1219
1219
  owner: {
1220
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
1221
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1220
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key] | {
1221
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1222
1222
  connector: "OR" | "AND";
1223
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1224
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1223
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1224
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1225
1225
  };
1226
1226
  };
1227
1227
  creatorRole: "admin";
@@ -1232,9 +1232,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1232
1232
  id: string;
1233
1233
  role: string;
1234
1234
  email: string;
1235
- organization: better_auth_plugins0.Organization;
1236
- invitation: better_auth_plugins0.Invitation;
1237
- inviter: better_auth_plugins0.Member & {
1235
+ organization: better_auth_plugins20.Organization;
1236
+ invitation: better_auth_plugins20.Invitation;
1237
+ inviter: better_auth_plugins20.Member & {
1238
1238
  user: better_auth0.User;
1239
1239
  };
1240
1240
  }): Promise<void>;
@@ -1255,28 +1255,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1255
1255
  user,
1256
1256
  organization: org
1257
1257
  }: {
1258
- invitation: better_auth_plugins0.Invitation & Record<string, any>;
1259
- member: better_auth_plugins0.Member & Record<string, any>;
1258
+ invitation: better_auth_plugins20.Invitation & Record<string, any>;
1259
+ member: better_auth_plugins20.Member & Record<string, any>;
1260
1260
  user: better_auth0.User & Record<string, any>;
1261
- organization: better_auth_plugins0.Organization & Record<string, any>;
1261
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1262
1262
  }) => Promise<void>;
1263
1263
  beforeUpdateMemberRole: ({
1264
1264
  member,
1265
1265
  organization: org,
1266
1266
  newRole
1267
1267
  }: {
1268
- member: better_auth_plugins0.Member & Record<string, any>;
1268
+ member: better_auth_plugins20.Member & Record<string, any>;
1269
1269
  newRole: string;
1270
1270
  user: better_auth0.User & Record<string, any>;
1271
- organization: better_auth_plugins0.Organization & Record<string, any>;
1271
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1272
1272
  }) => Promise<void>;
1273
1273
  afterRemoveMember: ({
1274
1274
  member,
1275
1275
  organization: org
1276
1276
  }: {
1277
- member: better_auth_plugins0.Member & Record<string, any>;
1277
+ member: better_auth_plugins20.Member & Record<string, any>;
1278
1278
  user: better_auth0.User & Record<string, any>;
1279
- organization: better_auth_plugins0.Organization & Record<string, any>;
1279
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1280
1280
  }) => Promise<void>;
1281
1281
  };
1282
1282
  }>;
@@ -1613,8 +1613,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1613
1613
  readonly AUTHENTICATION_REQUIRED: "Authentication required";
1614
1614
  };
1615
1615
  options: Partial<{
1616
- expiresIn: better_auth_plugins0.TimeString;
1617
- interval: better_auth_plugins0.TimeString;
1616
+ expiresIn: better_auth_plugins20.TimeString;
1617
+ interval: better_auth_plugins20.TimeString;
1618
1618
  deviceCodeLength: number;
1619
1619
  userCodeLength: number;
1620
1620
  schema: {
@@ -1,29 +1,29 @@
1
- import * as better_auth_plugins69 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 "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
9
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key];
8
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
9
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key];
10
10
  connector: "OR" | "AND";
11
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
12
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>;
11
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
12
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>;
13
13
  };
14
14
  declare const adminRole: {
15
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
16
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key];
15
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
16
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key];
17
17
  connector: "OR" | "AND";
18
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
19
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>;
18
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
19
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>;
20
20
  };
21
21
  declare const ownerRole: {
22
- authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
23
- actions: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>[key];
22
+ authorize<K_1 extends "organization" | "member" | "invitation" | "project" | "team" | "ac">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key] | {
23
+ actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>[key];
24
24
  connector: "OR" | "AND";
25
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
26
- statements: better_auth_plugins69.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins69.Statements>;
25
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
26
+ statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins0.Statements>;
27
27
  };
28
28
  //#endregion
29
29
  export { ac, adminRole, memberRole, organizationClient, ownerRole };
@@ -10,9 +10,11 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  }) => Promise<{
11
11
  id: string;
12
12
  name: string;
13
- createdAt: string;
14
- updatedAt: string;
15
13
  description: string | null;
14
+ defaultSubAgentId: string | null;
15
+ tenantId: string;
16
+ projectId: string;
17
+ prompt: string | null;
16
18
  models: {
17
19
  base?: {
18
20
  model?: string | undefined;
@@ -30,10 +32,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
30
32
  stopWhen: {
31
33
  transferCountIs?: number | undefined;
32
34
  } | null;
33
- tenantId: string;
34
- defaultSubAgentId: string | null;
35
+ createdAt: string;
36
+ updatedAt: string;
35
37
  contextConfigId: string | null;
36
- prompt: string | null;
37
38
  statusUpdates: {
38
39
  enabled?: boolean | undefined;
39
40
  numEvents?: number | undefined;
@@ -49,16 +50,17 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
49
50
  } | undefined;
50
51
  }[] | undefined;
51
52
  } | null;
52
- projectId: string;
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
59
  description: string | null;
60
+ defaultSubAgentId: string | null;
61
+ tenantId: string;
62
+ projectId: string;
63
+ prompt: string | null;
62
64
  models: {
63
65
  base?: {
64
66
  model?: string | undefined;
@@ -76,10 +78,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
76
78
  stopWhen: {
77
79
  transferCountIs?: number | undefined;
78
80
  } | null;
79
- tenantId: string;
80
- defaultSubAgentId: string | null;
81
+ createdAt: string;
82
+ updatedAt: string;
81
83
  contextConfigId: string | null;
82
- prompt: string | null;
83
84
  statusUpdates: {
84
85
  enabled?: boolean | undefined;
85
86
  numEvents?: number | undefined;
@@ -95,13 +96,15 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
95
96
  } | undefined;
96
97
  }[] | undefined;
97
98
  } | null;
98
- projectId: string;
99
99
  defaultSubAgent: {
100
100
  id: string;
101
101
  name: string;
102
- createdAt: string;
103
- updatedAt: string;
104
102
  description: string | null;
103
+ tenantId: string;
104
+ projectId: string;
105
+ agentId: string;
106
+ prompt: string | null;
107
+ conversationHistoryConfig: ConversationHistoryConfig | null;
105
108
  models: {
106
109
  base?: {
107
110
  model?: string | undefined;
@@ -119,11 +122,8 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
119
122
  stopWhen: {
120
123
  stepCountIs?: number | undefined;
121
124
  } | null;
122
- tenantId: string;
123
- prompt: string | null;
124
- projectId: string;
125
- agentId: string;
126
- conversationHistoryConfig: ConversationHistoryConfig | null;
125
+ createdAt: string;
126
+ updatedAt: string;
127
127
  } | null;
128
128
  } | null>;
129
129
  declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
@@ -131,9 +131,11 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
131
131
  }) => Promise<{
132
132
  id: string;
133
133
  name: string;
134
- createdAt: string;
135
- updatedAt: string;
136
134
  description: string | null;
135
+ defaultSubAgentId: string | null;
136
+ tenantId: string;
137
+ projectId: string;
138
+ prompt: string | null;
137
139
  models: {
138
140
  base?: {
139
141
  model?: string | undefined;
@@ -151,10 +153,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
151
153
  stopWhen: {
152
154
  transferCountIs?: number | undefined;
153
155
  } | null;
154
- tenantId: string;
155
- defaultSubAgentId: string | null;
156
+ createdAt: string;
157
+ updatedAt: string;
156
158
  contextConfigId: string | null;
157
- prompt: string | null;
158
159
  statusUpdates: {
159
160
  enabled?: boolean | undefined;
160
161
  numEvents?: number | undefined;
@@ -170,7 +171,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
170
171
  } | undefined;
171
172
  }[] | undefined;
172
173
  } | null;
173
- projectId: string;
174
174
  }[]>;
175
175
  declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
176
176
  scopes: ProjectScopeConfig;
@@ -247,9 +247,11 @@ 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
250
  description: string | null;
251
+ defaultSubAgentId: string | null;
252
+ tenantId: string;
253
+ projectId: string;
254
+ prompt: string | null;
253
255
  models: {
254
256
  base?: {
255
257
  model?: string | undefined;
@@ -267,10 +269,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
267
269
  stopWhen: {
268
270
  transferCountIs?: number | undefined;
269
271
  } | null;
270
- tenantId: string;
271
- defaultSubAgentId: string | null;
272
+ createdAt: string;
273
+ updatedAt: string;
272
274
  contextConfigId: string | null;
273
- prompt: string | null;
274
275
  statusUpdates: {
275
276
  enabled?: boolean | undefined;
276
277
  numEvents?: number | undefined;
@@ -286,7 +287,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
286
287
  } | undefined;
287
288
  }[] | undefined;
288
289
  } | null;
289
- projectId: string;
290
290
  }>;
291
291
  declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
292
292
  scopes: AgentScopeConfig;
@@ -341,7 +341,7 @@ declare const deleteAgent: (db: AgentsManageDatabaseClient) => (params: {
341
341
  /**
342
342
  * Helper function to fetch component relationships using efficient joins
343
343
  */
344
- declare const fetchComponentRelationships: (db: AgentsManageDatabaseClient) => <T extends Record<string, unknown>>(scopes: ProjectScopeConfig, subAgentIds: string[], config: {
344
+ declare const fetchComponentRelationships: (db: AgentsManageDatabaseClient) => <T extends Record<string, unknown>>(scopes: AgentScopeConfig, subAgentIds: string[], config: {
345
345
  relationTable: PgTable<any>;
346
346
  componentTable: PgTable<any>;
347
347
  relationIdField: unknown;
@@ -117,7 +117,7 @@ const deleteAgent = (db) => async (params) => {
117
117
  const fetchComponentRelationships = (db) => async (scopes, subAgentIds, config) => {
118
118
  const componentsObject = {};
119
119
  if (subAgentIds.length > 0) {
120
- const results = await db.select(config.selectFields).from(config.relationTable).innerJoin(config.componentTable, eq(config.relationIdField, config.componentIdField)).where(and(eq(config.relationTable.tenantId, scopes.tenantId), eq(config.relationTable.projectId, scopes.projectId), inArray(config.subAgentIdField, subAgentIds)));
120
+ const results = await db.select(config.selectFields).from(config.relationTable).innerJoin(config.componentTable, eq(config.relationIdField, config.componentIdField)).where(and(eq(config.relationTable.tenantId, scopes.tenantId), eq(config.relationTable.projectId, scopes.projectId), eq(config.relationTable.agentId, scopes.agentId), inArray(config.subAgentIdField, subAgentIds)));
121
121
  for (const component of results) componentsObject[component.id] = component;
122
122
  }
123
123
  return componentsObject;
@@ -352,7 +352,8 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
352
352
  try {
353
353
  await fetchComponentRelationships(db)({
354
354
  tenantId,
355
- projectId
355
+ projectId,
356
+ agentId
356
357
  }, subAgentIds, {
357
358
  relationTable: subAgentDataComponents,
358
359
  componentTable: dataComponents,
@@ -372,7 +373,8 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
372
373
  try {
373
374
  await fetchComponentRelationships(db)({
374
375
  tenantId,
375
- projectId
376
+ projectId,
377
+ agentId
376
378
  }, subAgentIds, {
377
379
  relationTable: subAgentArtifactComponents,
378
380
  componentTable: artifactComponents,
@@ -429,7 +431,7 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
429
431
  await db.update(subAgents).set({
430
432
  stopWhen: agent$1.stopWhen,
431
433
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
432
- }).where(and(eq(subAgents.tenantId, tenantId), eq(subAgents.projectId, projectId), eq(subAgents.id, subAgentId)));
434
+ }).where(and(eq(subAgents.tenantId, tenantId), eq(subAgents.projectId, projectId), eq(subAgents.agentId, agentId), eq(subAgents.id, subAgentId)));
433
435
  result.subAgents[subAgentId] = {
434
436
  ...result.subAgents[subAgentId],
435
437
  stopWhen: agent$1.stopWhen
@@ -10,11 +10,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
10
10
  }) => Promise<{
11
11
  id: string;
12
12
  name: string;
13
- createdAt: string;
14
- updatedAt: string;
15
13
  description: string | null;
16
14
  tenantId: string;
17
15
  projectId: string;
16
+ createdAt: string;
17
+ updatedAt: string;
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
- createdAt: string;
70
- updatedAt: string;
71
69
  description: string | null;
72
70
  tenantId: string;
73
71
  projectId: string;
72
+ createdAt: string;
73
+ updatedAt: string;
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
- createdAt: string;
145
144
  tenantId: string;
146
145
  projectId: string;
147
146
  agentId: string;
147
+ createdAt: 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
- createdAt: string;
188
187
  tenantId: string;
189
188
  projectId: string;
190
189
  agentId: string;
190
+ createdAt: string;
191
191
  subAgentId: string;
192
192
  artifactComponentId: string;
193
193
  } | null>;
@@ -97,7 +97,7 @@ const getArtifactComponentsForAgent = (db) => async (params) => {
97
97
  render: artifactComponents.render,
98
98
  createdAt: artifactComponents.createdAt,
99
99
  updatedAt: artifactComponents.updatedAt
100
- }).from(artifactComponents).innerJoin(subAgentArtifactComponents, eq(artifactComponents.id, subAgentArtifactComponents.artifactComponentId)).where(and(eq(artifactComponents.tenantId, params.scopes.tenantId), eq(artifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(artifactComponents.createdAt));
100
+ }).from(artifactComponents).innerJoin(subAgentArtifactComponents, and(eq(artifactComponents.id, subAgentArtifactComponents.artifactComponentId), eq(artifactComponents.tenantId, subAgentArtifactComponents.tenantId), eq(artifactComponents.projectId, subAgentArtifactComponents.projectId))).where(and(eq(artifactComponents.tenantId, params.scopes.tenantId), eq(artifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(artifactComponents.createdAt));
101
101
  };
102
102
  const associateArtifactComponentWithAgent = (db) => async (params) => {
103
103
  const [association] = await db.insert(subAgentArtifactComponents).values({
@@ -120,7 +120,7 @@ const removeArtifactComponentFromAgent = (db) => async (params) => {
120
120
  }
121
121
  };
122
122
  const deleteAgentArtifactComponentRelationByAgent = (db) => async (params) => {
123
- return (await db.delete(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
123
+ return (await db.delete(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
124
124
  };
125
125
  const getAgentsUsingArtifactComponent = (db) => async (params) => {
126
126
  return await db.select({
@@ -133,7 +133,7 @@ const isArtifactComponentAssociatedWithAgent = (db) => async (params) => {
133
133
  return (await db.select({ id: subAgentArtifactComponents.id }).from(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId), eq(subAgentArtifactComponents.artifactComponentId, params.artifactComponentId))).limit(1)).length > 0;
134
134
  };
135
135
  const agentHasArtifactComponents = (db) => async (params) => {
136
- const total = (await db.select({ count: count() }).from(subAgentArtifactComponents).innerJoin(subAgents, and(eq(subAgentArtifactComponents.subAgentId, subAgents.id), eq(subAgentArtifactComponents.tenantId, subAgents.tenantId))).innerJoin(subAgentRelations, and(eq(subAgents.id, subAgentRelations.sourceSubAgentId), eq(subAgents.tenantId, subAgentRelations.tenantId), eq(subAgents.projectId, subAgentRelations.projectId), eq(subAgents.agentId, subAgentRelations.agentId))).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId))).limit(1))[0]?.count || 0;
136
+ const total = (await db.select({ count: count() }).from(subAgentArtifactComponents).innerJoin(subAgents, and(eq(subAgentArtifactComponents.subAgentId, subAgents.id), eq(subAgentArtifactComponents.tenantId, subAgents.tenantId), eq(subAgentArtifactComponents.projectId, subAgents.projectId), eq(subAgentArtifactComponents.agentId, subAgents.agentId))).innerJoin(subAgentRelations, and(eq(subAgents.id, subAgentRelations.sourceSubAgentId), eq(subAgents.tenantId, subAgentRelations.tenantId), eq(subAgents.projectId, subAgentRelations.projectId), eq(subAgents.agentId, subAgentRelations.agentId))).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId))).limit(1))[0]?.count || 0;
137
137
  return (typeof total === "string" ? Number.parseInt(total, 10) : total) > 0;
138
138
  };
139
139
  const countArtifactComponents = (db) => async (params) => {