@inkeep/agents-core 0.0.0-dev-20260123215311 → 0.0.0-dev-20260123215736

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.
@@ -2,7 +2,7 @@ import { AgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
2
2
  import * as _better_auth_sso0 from "@better-auth/sso";
3
3
  import * as better_auth0 from "better-auth";
4
4
  import { BetterAuthAdvancedOptions } from "better-auth";
5
- import * as better_auth_plugins0 from "better-auth/plugins";
5
+ import * as better_auth_plugins20 from "better-auth/plugins";
6
6
  import * as zod0 from "zod";
7
7
  import { GoogleOptions } from "better-auth/social-providers";
8
8
 
@@ -219,7 +219,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
219
219
  handler: (inputContext: better_auth0.MiddlewareInputContext<better_auth0.MiddlewareOptions>) => Promise<void>;
220
220
  }[];
221
221
  };
222
- options: better_auth_plugins0.BearerOptions | undefined;
222
+ options: better_auth_plugins20.BearerOptions | undefined;
223
223
  }, {
224
224
  id: "sso";
225
225
  endpoints: {
@@ -847,30 +847,30 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
847
847
  };
848
848
  }, {
849
849
  id: "organization";
850
- endpoints: better_auth_plugins0.OrganizationEndpoints<{
850
+ endpoints: better_auth_plugins20.OrganizationEndpoints<{
851
851
  allowUserToCreateOrganization: true;
852
- ac: better_auth_plugins0.AccessControl;
852
+ ac: better_auth_plugins20.AccessControl;
853
853
  roles: {
854
854
  member: {
855
- 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] | {
856
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
855
+ 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] | {
856
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
857
857
  connector: "OR" | "AND";
858
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
859
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
858
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
859
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
860
860
  };
861
861
  admin: {
862
- 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] | {
863
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
862
+ 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] | {
863
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
864
864
  connector: "OR" | "AND";
865
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
866
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
865
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
866
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
867
867
  };
868
868
  owner: {
869
- 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] | {
870
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
869
+ 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] | {
870
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
871
871
  connector: "OR" | "AND";
872
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
873
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
872
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
873
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
874
874
  };
875
875
  };
876
876
  membershipLimit: number;
@@ -880,9 +880,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
880
880
  id: string;
881
881
  role: string;
882
882
  email: string;
883
- organization: better_auth_plugins0.Organization;
884
- invitation: better_auth_plugins0.Invitation;
885
- inviter: better_auth_plugins0.Member & {
883
+ organization: better_auth_plugins20.Organization;
884
+ invitation: better_auth_plugins20.Invitation;
885
+ inviter: better_auth_plugins20.Member & {
886
886
  user: better_auth0.User;
887
887
  };
888
888
  }): Promise<void>;
@@ -892,28 +892,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
892
892
  user,
893
893
  organization: org
894
894
  }: {
895
- invitation: better_auth_plugins0.Invitation & Record<string, any>;
896
- member: better_auth_plugins0.Member & Record<string, any>;
895
+ invitation: better_auth_plugins20.Invitation & Record<string, any>;
896
+ member: better_auth_plugins20.Member & Record<string, any>;
897
897
  user: better_auth0.User & Record<string, any>;
898
- organization: better_auth_plugins0.Organization & Record<string, any>;
898
+ organization: better_auth_plugins20.Organization & Record<string, any>;
899
899
  }) => Promise<void>;
900
900
  beforeUpdateMemberRole: ({
901
901
  member,
902
902
  organization: org,
903
903
  newRole
904
904
  }: {
905
- member: better_auth_plugins0.Member & Record<string, any>;
905
+ member: better_auth_plugins20.Member & Record<string, any>;
906
906
  newRole: string;
907
907
  user: better_auth0.User & Record<string, any>;
908
- organization: better_auth_plugins0.Organization & Record<string, any>;
908
+ organization: better_auth_plugins20.Organization & Record<string, any>;
909
909
  }) => Promise<void>;
910
910
  afterRemoveMember: ({
911
911
  member,
912
912
  organization: org
913
913
  }: {
914
- member: better_auth_plugins0.Member & Record<string, any>;
914
+ member: better_auth_plugins20.Member & Record<string, any>;
915
915
  user: better_auth0.User & Record<string, any>;
916
- organization: better_auth_plugins0.Organization & Record<string, any>;
916
+ organization: better_auth_plugins20.Organization & Record<string, any>;
917
917
  }) => Promise<void>;
918
918
  };
919
919
  }>;
@@ -1044,8 +1044,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1044
1044
  id: string;
1045
1045
  organizationId: string;
1046
1046
  email: string;
1047
- role: "member" | "owner" | "admin";
1048
- status: better_auth_plugins0.InvitationStatus;
1047
+ role: "member" | "admin" | "owner";
1048
+ status: better_auth_plugins20.InvitationStatus;
1049
1049
  inviterId: string;
1050
1050
  expiresAt: Date;
1051
1051
  createdAt: Date;
@@ -1053,7 +1053,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1053
1053
  Member: {
1054
1054
  id: string;
1055
1055
  organizationId: string;
1056
- role: "member" | "owner" | "admin";
1056
+ role: "member" | "admin" | "owner";
1057
1057
  createdAt: Date;
1058
1058
  userId: string;
1059
1059
  user: {
@@ -1069,7 +1069,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1069
1069
  members: {
1070
1070
  id: string;
1071
1071
  organizationId: string;
1072
- role: "member" | "owner" | "admin";
1072
+ role: "member" | "admin" | "owner";
1073
1073
  createdAt: Date;
1074
1074
  userId: string;
1075
1075
  user: {
@@ -1083,8 +1083,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1083
1083
  id: string;
1084
1084
  organizationId: string;
1085
1085
  email: string;
1086
- role: "member" | "owner" | "admin";
1087
- status: better_auth_plugins0.InvitationStatus;
1086
+ role: "member" | "admin" | "owner";
1087
+ status: better_auth_plugins20.InvitationStatus;
1088
1088
  inviterId: string;
1089
1089
  expiresAt: Date;
1090
1090
  createdAt: Date;
@@ -1158,28 +1158,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1158
1158
  };
1159
1159
  options: NoInfer<{
1160
1160
  allowUserToCreateOrganization: true;
1161
- ac: better_auth_plugins0.AccessControl;
1161
+ ac: better_auth_plugins20.AccessControl;
1162
1162
  roles: {
1163
1163
  member: {
1164
- 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] | {
1165
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1164
+ 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] | {
1165
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1166
1166
  connector: "OR" | "AND";
1167
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1168
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1167
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1168
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1169
1169
  };
1170
1170
  admin: {
1171
- 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] | {
1172
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1171
+ 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] | {
1172
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1173
1173
  connector: "OR" | "AND";
1174
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1175
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1174
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1175
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1176
1176
  };
1177
1177
  owner: {
1178
- 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] | {
1179
- actions: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>[key];
1178
+ 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] | {
1179
+ actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
1180
1180
  connector: "OR" | "AND";
1181
- } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
1182
- statements: better_auth_plugins0.Subset<"organization" | "member" | "invitation" | "project" | "ac" | "team", better_auth_plugins0.Statements>;
1181
+ } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
1182
+ statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
1183
1183
  };
1184
1184
  };
1185
1185
  membershipLimit: number;
@@ -1189,9 +1189,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1189
1189
  id: string;
1190
1190
  role: string;
1191
1191
  email: string;
1192
- organization: better_auth_plugins0.Organization;
1193
- invitation: better_auth_plugins0.Invitation;
1194
- inviter: better_auth_plugins0.Member & {
1192
+ organization: better_auth_plugins20.Organization;
1193
+ invitation: better_auth_plugins20.Invitation;
1194
+ inviter: better_auth_plugins20.Member & {
1195
1195
  user: better_auth0.User;
1196
1196
  };
1197
1197
  }): Promise<void>;
@@ -1201,28 +1201,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1201
1201
  user,
1202
1202
  organization: org
1203
1203
  }: {
1204
- invitation: better_auth_plugins0.Invitation & Record<string, any>;
1205
- member: better_auth_plugins0.Member & Record<string, any>;
1204
+ invitation: better_auth_plugins20.Invitation & Record<string, any>;
1205
+ member: better_auth_plugins20.Member & Record<string, any>;
1206
1206
  user: better_auth0.User & Record<string, any>;
1207
- organization: better_auth_plugins0.Organization & Record<string, any>;
1207
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1208
1208
  }) => Promise<void>;
1209
1209
  beforeUpdateMemberRole: ({
1210
1210
  member,
1211
1211
  organization: org,
1212
1212
  newRole
1213
1213
  }: {
1214
- member: better_auth_plugins0.Member & Record<string, any>;
1214
+ member: better_auth_plugins20.Member & Record<string, any>;
1215
1215
  newRole: string;
1216
1216
  user: better_auth0.User & Record<string, any>;
1217
- organization: better_auth_plugins0.Organization & Record<string, any>;
1217
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1218
1218
  }) => Promise<void>;
1219
1219
  afterRemoveMember: ({
1220
1220
  member,
1221
1221
  organization: org
1222
1222
  }: {
1223
- member: better_auth_plugins0.Member & Record<string, any>;
1223
+ member: better_auth_plugins20.Member & Record<string, any>;
1224
1224
  user: better_auth0.User & Record<string, any>;
1225
- organization: better_auth_plugins0.Organization & Record<string, any>;
1225
+ organization: better_auth_plugins20.Organization & Record<string, any>;
1226
1226
  }) => Promise<void>;
1227
1227
  };
1228
1228
  }>;
@@ -1559,8 +1559,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
1559
1559
  readonly AUTHENTICATION_REQUIRED: "Authentication required";
1560
1560
  };
1561
1561
  options: Partial<{
1562
- expiresIn: better_auth_plugins0.TimeString;
1563
- interval: better_auth_plugins0.TimeString;
1562
+ expiresIn: better_auth_plugins20.TimeString;
1563
+ interval: better_auth_plugins20.TimeString;
1564
1564
  deviceCodeLength: number;
1565
1565
  userCodeLength: number;
1566
1566
  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 };
@@ -7,7 +7,6 @@ import "./types/index.js";
7
7
  import { DEFAULT_NANGO_STORE_ID } from "./credential-stores/default-constants.js";
8
8
  import { detectAuthenticationRequired } from "./utils/auth-detection.js";
9
9
  import { validatePropsAsJsonSchema } from "./validation/props-validation.js";
10
- import "./index.js";
11
10
  import { AgentStopWhen, AgentStopWhenSchema, ApiKeyApiUpdateSchema, FullAgentAgentInsertSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettings, ModelSettingsSchema, SignatureSource, SignatureVerificationConfig, SignatureVerificationConfigSchema, SignedComponent, StopWhen, StopWhenSchema, SubAgentStopWhen, SubAgentStopWhenSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerInvocationApiSelectSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationStatusEnum, TriggerListResponse, TriggerResponse, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema } from "./validation/schemas.js";
12
11
  import { z } from "@hono/zod-openapi";
13
12
 
@@ -66,8 +65,8 @@ declare const AgentApiInsertSchema: z.ZodObject<{
66
65
  canTransferTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
66
  canDelegateTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
67
  type: z.ZodOptional<z.ZodEnum<{
69
- internal: "internal";
70
68
  external: "external";
69
+ internal: "internal";
71
70
  }>>;
72
71
  }, z.core.$strip>;
73
72
  declare const ToolApiInsertSchema: z.ZodObject<{
@@ -194,9 +193,9 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
194
193
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
195
194
  id: z.ZodString;
196
195
  name: z.ZodString;
197
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
198
196
  createdAt: z.ZodOptional<z.ZodString>;
199
197
  updatedAt: z.ZodOptional<z.ZodString>;
198
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
199
  models: z.ZodOptional<z.ZodObject<{
201
200
  base: z.ZodOptional<z.ZodObject<{
202
201
  model: z.ZodOptional<z.ZodString>;
@@ -13,8 +13,8 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
15
  description: string | null;
16
- tenantId: string;
17
16
  projectId: string;
17
+ tenantId: string;
18
18
  defaultSubAgentId: string | null;
19
19
  contextConfigId: string | null;
20
20
  models: {
@@ -59,8 +59,8 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
59
59
  createdAt: string;
60
60
  updatedAt: string;
61
61
  description: string | null;
62
- tenantId: string;
63
62
  projectId: string;
63
+ tenantId: string;
64
64
  defaultSubAgentId: string | null;
65
65
  contextConfigId: string | null;
66
66
  models: {
@@ -102,8 +102,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
102
102
  createdAt: string;
103
103
  updatedAt: string;
104
104
  description: string | null;
105
- tenantId: string;
105
+ agentId: string;
106
106
  projectId: string;
107
+ tenantId: string;
107
108
  models: {
108
109
  base?: {
109
110
  model?: string | undefined;
@@ -122,7 +123,6 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
122
123
  stopWhen: {
123
124
  stepCountIs?: number | undefined;
124
125
  } | null;
125
- agentId: string;
126
126
  conversationHistoryConfig: ConversationHistoryConfig | null;
127
127
  } | null;
128
128
  } | null>;
@@ -134,8 +134,8 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
134
134
  createdAt: string;
135
135
  updatedAt: string;
136
136
  description: string | null;
137
- tenantId: string;
138
137
  projectId: string;
138
+ tenantId: string;
139
139
  defaultSubAgentId: string | null;
140
140
  contextConfigId: string | null;
141
141
  models: {
@@ -233,8 +233,8 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
233
233
  createdAt: string;
234
234
  updatedAt: string;
235
235
  description: string | null;
236
- tenantId: string;
237
236
  projectId: string;
237
+ tenantId: string;
238
238
  defaultSubAgentId: string | null;
239
239
  contextConfigId: string | null;
240
240
  models: {
@@ -390,25 +390,31 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
390
390
  console.warn("Failed to apply agent stepCountIs inheritance:", error);
391
391
  }
392
392
  try {
393
- const toolsList = await listTools(db)({
394
- scopes: {
395
- tenantId,
396
- projectId
397
- },
398
- pagination: {
399
- page: 1,
400
- limit: 1e3
401
- }
402
- });
393
+ const usedToolIds = new Set(Object.values(agentsObject).flatMap((a) => Array.isArray(a?.canUse) ? a.canUse : []).map((ref) => ref?.toolId).filter(Boolean));
403
394
  const toolsObject = {};
404
- for (const tool of toolsList.data) toolsObject[tool.id] = {
405
- id: tool.id,
406
- name: tool.name,
407
- description: tool.description,
408
- config: tool.config,
409
- credentialReferenceId: tool.credentialReferenceId,
410
- imageUrl: tool.imageUrl
411
- };
395
+ if (usedToolIds.size > 0) {
396
+ const { data } = await listTools(db)({
397
+ scopes: {
398
+ tenantId,
399
+ projectId
400
+ },
401
+ pagination: {
402
+ page: 1,
403
+ limit: 1e3
404
+ }
405
+ });
406
+ for (const tool of data) {
407
+ if (!usedToolIds.has(tool.id)) continue;
408
+ toolsObject[tool.id] = {
409
+ id: tool.id,
410
+ name: tool.name,
411
+ description: tool.description,
412
+ config: tool.config,
413
+ credentialReferenceId: tool.credentialReferenceId,
414
+ imageUrl: tool.imageUrl
415
+ };
416
+ }
417
+ }
412
418
  result.tools = toolsObject;
413
419
  const functionToolsList = await listFunctionTools(db)({
414
420
  scopes: {
@@ -12,8 +12,8 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
12
12
  createdAt: string;
13
13
  updatedAt: string;
14
14
  description: string | null;
15
- tenantId: string;
16
15
  projectId: string;
16
+ tenantId: string;
17
17
  props: Record<string, unknown> | null;
18
18
  render: {
19
19
  component: string;
@@ -54,8 +54,8 @@ declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (para
54
54
  createdAt: string;
55
55
  updatedAt: string;
56
56
  description: string | null;
57
- tenantId: string;
58
57
  projectId: string;
58
+ tenantId: string;
59
59
  props: Record<string, unknown> | null;
60
60
  render: {
61
61
  component: string;
@@ -106,10 +106,10 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
106
106
  }) => Promise<{
107
107
  id: string;
108
108
  createdAt: string;
109
- tenantId: string;
109
+ agentId: string;
110
110
  projectId: string;
111
+ tenantId: string;
111
112
  subAgentId: string;
112
- agentId: string;
113
113
  artifactComponentId: string;
114
114
  }>;
115
115
  declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -149,10 +149,10 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
149
149
  }) => Promise<{
150
150
  id: string;
151
151
  createdAt: string;
152
- tenantId: string;
152
+ agentId: string;
153
153
  projectId: string;
154
+ tenantId: string;
154
155
  subAgentId: string;
155
- agentId: string;
156
156
  artifactComponentId: string;
157
157
  } | null>;
158
158
  /**
@@ -11,11 +11,11 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
11
11
  id: string;
12
12
  createdAt: string;
13
13
  updatedAt: string;
14
- tenantId: string;
15
- projectId: string;
16
- agentId: string;
17
14
  headersSchema: unknown;
18
15
  contextVariables: Record<string, ContextFetchDefinition> | null;
16
+ agentId: string;
17
+ projectId: string;
18
+ tenantId: string;
19
19
  } | undefined>;
20
20
  declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
21
21
  scopes: AgentScopeConfig;
@@ -23,11 +23,11 @@ declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
23
23
  id: string;
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
- tenantId: string;
27
- projectId: string;
28
- agentId: string;
29
26
  headersSchema: unknown;
30
27
  contextVariables: Record<string, ContextFetchDefinition> | null;
28
+ agentId: string;
29
+ projectId: string;
30
+ tenantId: string;
31
31
  }[]>;
32
32
  declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
33
33
  scopes: AgentScopeConfig;
@@ -45,11 +45,11 @@ declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params:
45
45
  id: string;
46
46
  createdAt: string;
47
47
  updatedAt: string;
48
- tenantId: string;
49
- projectId: string;
50
- agentId: string;
51
48
  headersSchema: unknown;
52
49
  contextVariables: Record<string, ContextFetchDefinition> | null;
50
+ agentId: string;
51
+ projectId: string;
52
+ tenantId: string;
53
53
  }>;
54
54
  declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
55
55
  scopes: AgentScopeConfig;
@@ -85,11 +85,11 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
85
85
  id: string;
86
86
  createdAt: string;
87
87
  updatedAt: string;
88
- tenantId: string;
89
- projectId: string;
90
- agentId: string;
91
88
  headersSchema: unknown;
92
89
  contextVariables: Record<string, ContextFetchDefinition> | null;
90
+ agentId: string;
91
+ projectId: string;
92
+ tenantId: string;
93
93
  }>;
94
94
  //#endregion
95
95
  export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
@@ -66,11 +66,11 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
66
66
  }) => Promise<{
67
67
  id: string;
68
68
  createdAt: string;
69
- tenantId: string;
70
- projectId: string;
71
- subAgentId: string;
72
69
  agentId: string;
70
+ projectId: string;
71
+ tenantId: string;
73
72
  dataComponentId: string;
73
+ subAgentId: string;
74
74
  }>;
75
75
  /**
76
76
  * Remove association between data component and agent
@@ -108,11 +108,11 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
108
108
  }) => Promise<{
109
109
  id: string;
110
110
  createdAt: string;
111
- tenantId: string;
112
- projectId: string;
113
- subAgentId: string;
114
111
  agentId: string;
112
+ projectId: string;
113
+ tenantId: string;
115
114
  dataComponentId: string;
115
+ subAgentId: string;
116
116
  } | null>;
117
117
  /**
118
118
  * Count data components for a tenant/project
@@ -58,9 +58,9 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
58
58
  createdAt: string;
59
59
  updatedAt: string;
60
60
  description: string | null;
61
- tenantId: string;
62
- projectId: string;
63
61
  agentId: string;
62
+ projectId: string;
63
+ tenantId: string;
64
64
  functionId: string;
65
65
  }>;
66
66
  /**
@@ -100,9 +100,9 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
100
100
  createdAt: string;
101
101
  updatedAt: string;
102
102
  description: string | null;
103
- tenantId: string;
104
- projectId: string;
105
103
  agentId: string;
104
+ projectId: string;
105
+ tenantId: string;
106
106
  functionId: string;
107
107
  }>;
108
108
  declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -164,10 +164,10 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
164
164
  id: string;
165
165
  createdAt: string;
166
166
  updatedAt: string;
167
- tenantId: string;
167
+ agentId: string;
168
168
  projectId: string;
169
+ tenantId: string;
169
170
  subAgentId: string;
170
- agentId: string;
171
171
  toolPolicies: Record<string, {
172
172
  needsApproval?: boolean;
173
173
  }> | null;
@@ -229,10 +229,10 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
229
229
  id: string;
230
230
  createdAt: string;
231
231
  updatedAt: string;
232
- tenantId: string;
232
+ agentId: string;
233
233
  projectId: string;
234
+ tenantId: string;
234
235
  subAgentId: string;
235
- agentId: string;
236
236
  toolPolicies: Record<string, {
237
237
  needsApproval?: boolean;
238
238
  }> | null;