@inkeep/agents-core 0.0.0-dev-20260130213111 → 0.0.0-dev-20260131014302
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.
- package/dist/auth/auth.d.ts +53 -53
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +1 -2
- package/dist/constants/otel-attributes.d.ts +5 -0
- package/dist/constants/otel-attributes.js +8 -3
- package/dist/constants/signoz-queries.d.ts +1 -0
- package/dist/constants/signoz-queries.js +2 -1
- package/dist/data-access/manage/agentFull.js +41 -0
- package/dist/data-access/manage/agents.d.ts +20 -20
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +12 -12
- package/dist/data-access/manage/tools.d.ts +27 -27
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/db/manage/manage-schema.d.ts +301 -301
- package/dist/db/runtime/runtime-schema.d.ts +157 -157
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1454 -1454
- package/package.json +1 -1
package/dist/auth/auth.d.ts
CHANGED
|
@@ -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
|
|
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:
|
|
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:
|
|
850
|
+
endpoints: better_auth_plugins20.OrganizationEndpoints<{
|
|
851
851
|
allowUserToCreateOrganization: true;
|
|
852
|
-
ac:
|
|
852
|
+
ac: better_auth_plugins20.AccessControl;
|
|
853
853
|
roles: {
|
|
854
854
|
member: {
|
|
855
|
-
authorize<K_1 extends "organization" | "member" | "invitation" | "
|
|
856
|
-
actions:
|
|
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"):
|
|
859
|
-
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" | "
|
|
863
|
-
actions:
|
|
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"):
|
|
866
|
-
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" | "
|
|
870
|
-
actions:
|
|
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"):
|
|
873
|
-
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
|
creatorRole: "admin";
|
|
@@ -881,9 +881,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
881
881
|
id: string;
|
|
882
882
|
role: string;
|
|
883
883
|
email: string;
|
|
884
|
-
organization:
|
|
885
|
-
invitation:
|
|
886
|
-
inviter:
|
|
884
|
+
organization: better_auth_plugins20.Organization;
|
|
885
|
+
invitation: better_auth_plugins20.Invitation;
|
|
886
|
+
inviter: better_auth_plugins20.Member & {
|
|
887
887
|
user: better_auth0.User;
|
|
888
888
|
};
|
|
889
889
|
}): Promise<void>;
|
|
@@ -893,28 +893,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
893
893
|
user,
|
|
894
894
|
organization: org
|
|
895
895
|
}: {
|
|
896
|
-
invitation:
|
|
897
|
-
member:
|
|
896
|
+
invitation: better_auth_plugins20.Invitation & Record<string, any>;
|
|
897
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
898
898
|
user: better_auth0.User & Record<string, any>;
|
|
899
|
-
organization:
|
|
899
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
900
900
|
}) => Promise<void>;
|
|
901
901
|
beforeUpdateMemberRole: ({
|
|
902
902
|
member,
|
|
903
903
|
organization: org,
|
|
904
904
|
newRole
|
|
905
905
|
}: {
|
|
906
|
-
member:
|
|
906
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
907
907
|
newRole: string;
|
|
908
908
|
user: better_auth0.User & Record<string, any>;
|
|
909
|
-
organization:
|
|
909
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
910
910
|
}) => Promise<void>;
|
|
911
911
|
afterRemoveMember: ({
|
|
912
912
|
member,
|
|
913
913
|
organization: org
|
|
914
914
|
}: {
|
|
915
|
-
member:
|
|
915
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
916
916
|
user: better_auth0.User & Record<string, any>;
|
|
917
|
-
organization:
|
|
917
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
918
918
|
}) => Promise<void>;
|
|
919
919
|
};
|
|
920
920
|
}>;
|
|
@@ -1046,7 +1046,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1046
1046
|
organizationId: string;
|
|
1047
1047
|
email: string;
|
|
1048
1048
|
role: "member" | "admin" | "owner";
|
|
1049
|
-
status:
|
|
1049
|
+
status: better_auth_plugins20.InvitationStatus;
|
|
1050
1050
|
inviterId: string;
|
|
1051
1051
|
expiresAt: Date;
|
|
1052
1052
|
createdAt: Date;
|
|
@@ -1085,7 +1085,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1085
1085
|
organizationId: string;
|
|
1086
1086
|
email: string;
|
|
1087
1087
|
role: "member" | "admin" | "owner";
|
|
1088
|
-
status:
|
|
1088
|
+
status: better_auth_plugins20.InvitationStatus;
|
|
1089
1089
|
inviterId: string;
|
|
1090
1090
|
expiresAt: Date;
|
|
1091
1091
|
createdAt: Date;
|
|
@@ -1159,28 +1159,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1159
1159
|
};
|
|
1160
1160
|
options: NoInfer<{
|
|
1161
1161
|
allowUserToCreateOrganization: true;
|
|
1162
|
-
ac:
|
|
1162
|
+
ac: better_auth_plugins20.AccessControl;
|
|
1163
1163
|
roles: {
|
|
1164
1164
|
member: {
|
|
1165
|
-
authorize<K_1 extends "organization" | "member" | "invitation" | "
|
|
1166
|
-
actions:
|
|
1165
|
+
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] | {
|
|
1166
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
|
|
1167
1167
|
connector: "OR" | "AND";
|
|
1168
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1169
|
-
statements:
|
|
1168
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1169
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
|
|
1170
1170
|
};
|
|
1171
1171
|
admin: {
|
|
1172
|
-
authorize<K_1 extends "organization" | "member" | "invitation" | "
|
|
1173
|
-
actions:
|
|
1172
|
+
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] | {
|
|
1173
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
|
|
1174
1174
|
connector: "OR" | "AND";
|
|
1175
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1176
|
-
statements:
|
|
1175
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1176
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
|
|
1177
1177
|
};
|
|
1178
1178
|
owner: {
|
|
1179
|
-
authorize<K_1 extends "organization" | "member" | "invitation" | "
|
|
1180
|
-
actions:
|
|
1179
|
+
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] | {
|
|
1180
|
+
actions: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>[key];
|
|
1181
1181
|
connector: "OR" | "AND";
|
|
1182
|
-
} | undefined } : never, connector?: "OR" | "AND"):
|
|
1183
|
-
statements:
|
|
1182
|
+
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins20.AuthorizeResponse;
|
|
1183
|
+
statements: better_auth_plugins20.Subset<"organization" | "member" | "invitation" | "project" | "team" | "ac", better_auth_plugins20.Statements>;
|
|
1184
1184
|
};
|
|
1185
1185
|
};
|
|
1186
1186
|
creatorRole: "admin";
|
|
@@ -1191,9 +1191,9 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1191
1191
|
id: string;
|
|
1192
1192
|
role: string;
|
|
1193
1193
|
email: string;
|
|
1194
|
-
organization:
|
|
1195
|
-
invitation:
|
|
1196
|
-
inviter:
|
|
1194
|
+
organization: better_auth_plugins20.Organization;
|
|
1195
|
+
invitation: better_auth_plugins20.Invitation;
|
|
1196
|
+
inviter: better_auth_plugins20.Member & {
|
|
1197
1197
|
user: better_auth0.User;
|
|
1198
1198
|
};
|
|
1199
1199
|
}): Promise<void>;
|
|
@@ -1203,28 +1203,28 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1203
1203
|
user,
|
|
1204
1204
|
organization: org
|
|
1205
1205
|
}: {
|
|
1206
|
-
invitation:
|
|
1207
|
-
member:
|
|
1206
|
+
invitation: better_auth_plugins20.Invitation & Record<string, any>;
|
|
1207
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1208
1208
|
user: better_auth0.User & Record<string, any>;
|
|
1209
|
-
organization:
|
|
1209
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1210
1210
|
}) => Promise<void>;
|
|
1211
1211
|
beforeUpdateMemberRole: ({
|
|
1212
1212
|
member,
|
|
1213
1213
|
organization: org,
|
|
1214
1214
|
newRole
|
|
1215
1215
|
}: {
|
|
1216
|
-
member:
|
|
1216
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1217
1217
|
newRole: string;
|
|
1218
1218
|
user: better_auth0.User & Record<string, any>;
|
|
1219
|
-
organization:
|
|
1219
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1220
1220
|
}) => Promise<void>;
|
|
1221
1221
|
afterRemoveMember: ({
|
|
1222
1222
|
member,
|
|
1223
1223
|
organization: org
|
|
1224
1224
|
}: {
|
|
1225
|
-
member:
|
|
1225
|
+
member: better_auth_plugins20.Member & Record<string, any>;
|
|
1226
1226
|
user: better_auth0.User & Record<string, any>;
|
|
1227
|
-
organization:
|
|
1227
|
+
organization: better_auth_plugins20.Organization & Record<string, any>;
|
|
1228
1228
|
}) => Promise<void>;
|
|
1229
1229
|
};
|
|
1230
1230
|
}>;
|
|
@@ -1561,8 +1561,8 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1561
1561
|
readonly AUTHENTICATION_REQUIRED: "Authentication required";
|
|
1562
1562
|
};
|
|
1563
1563
|
options: Partial<{
|
|
1564
|
-
expiresIn:
|
|
1565
|
-
interval:
|
|
1564
|
+
expiresIn: better_auth_plugins20.TimeString;
|
|
1565
|
+
interval: better_auth_plugins20.TimeString;
|
|
1566
1566
|
deviceCodeLength: number;
|
|
1567
1567
|
userCodeLength: number;
|
|
1568
1568
|
schema: {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import * as
|
|
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" | "
|
|
9
|
-
actions:
|
|
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"):
|
|
12
|
-
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" | "
|
|
16
|
-
actions:
|
|
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"):
|
|
19
|
-
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" | "
|
|
23
|
-
actions:
|
|
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"):
|
|
26
|
-
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 };
|
package/dist/client-exports.d.ts
CHANGED
|
@@ -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, ResourceIdSchema, 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
|
|
|
@@ -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>;
|
|
@@ -15,6 +15,7 @@ declare const SPAN_NAMES: {
|
|
|
15
15
|
readonly TOOL_APPROVAL_APPROVED: "tool.approval_approved";
|
|
16
16
|
readonly TOOL_APPROVAL_DENIED: "tool.approval_denied";
|
|
17
17
|
readonly COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress";
|
|
18
|
+
readonly AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached";
|
|
18
19
|
};
|
|
19
20
|
declare const AI_OPERATIONS: {
|
|
20
21
|
readonly GENERATE_TEXT: "ai.generateText.doGenerate";
|
|
@@ -102,6 +103,9 @@ declare const SPAN_KEYS: {
|
|
|
102
103
|
readonly CONTEXT_BREAKDOWN_THINKING_PREPARATION: "context.breakdown.thinking_preparation_tokens";
|
|
103
104
|
readonly CONTEXT_BREAKDOWN_CONVERSATION_HISTORY: "context.breakdown.conversation_history_tokens";
|
|
104
105
|
readonly CONTEXT_BREAKDOWN_TOTAL: "context.breakdown.total_tokens";
|
|
106
|
+
readonly AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached";
|
|
107
|
+
readonly AGENT_STEPS_COMPLETED: "agent.steps_completed";
|
|
108
|
+
readonly AGENT_MAX_STEPS: "agent.max_steps";
|
|
105
109
|
};
|
|
106
110
|
declare const UNKNOWN_VALUE: "unknown";
|
|
107
111
|
/** Activity Types */
|
|
@@ -118,6 +122,7 @@ declare const ACTIVITY_TYPES: {
|
|
|
118
122
|
readonly TOOL_APPROVAL_APPROVED: "tool_approval_approved";
|
|
119
123
|
readonly TOOL_APPROVAL_DENIED: "tool_approval_denied";
|
|
120
124
|
readonly COMPRESSION: "compression";
|
|
125
|
+
readonly MAX_STEPS_REACHED: "max_steps_reached";
|
|
121
126
|
};
|
|
122
127
|
/** Activity Status Values */
|
|
123
128
|
declare const ACTIVITY_STATUS: {
|
|
@@ -14,7 +14,8 @@ const SPAN_NAMES = {
|
|
|
14
14
|
TOOL_APPROVAL_REQUESTED: "tool.approval_requested",
|
|
15
15
|
TOOL_APPROVAL_APPROVED: "tool.approval_approved",
|
|
16
16
|
TOOL_APPROVAL_DENIED: "tool.approval_denied",
|
|
17
|
-
COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress"
|
|
17
|
+
COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress",
|
|
18
|
+
AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached"
|
|
18
19
|
};
|
|
19
20
|
const AI_OPERATIONS = {
|
|
20
21
|
GENERATE_TEXT: "ai.generateText.doGenerate",
|
|
@@ -101,7 +102,10 @@ const SPAN_KEYS = {
|
|
|
101
102
|
CONTEXT_BREAKDOWN_DELEGATION_INSTRUCTIONS: "context.breakdown.delegation_instructions_tokens",
|
|
102
103
|
CONTEXT_BREAKDOWN_THINKING_PREPARATION: "context.breakdown.thinking_preparation_tokens",
|
|
103
104
|
CONTEXT_BREAKDOWN_CONVERSATION_HISTORY: "context.breakdown.conversation_history_tokens",
|
|
104
|
-
CONTEXT_BREAKDOWN_TOTAL: "context.breakdown.total_tokens"
|
|
105
|
+
CONTEXT_BREAKDOWN_TOTAL: "context.breakdown.total_tokens",
|
|
106
|
+
AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached",
|
|
107
|
+
AGENT_STEPS_COMPLETED: "agent.steps_completed",
|
|
108
|
+
AGENT_MAX_STEPS: "agent.max_steps"
|
|
105
109
|
};
|
|
106
110
|
const UNKNOWN_VALUE = "unknown";
|
|
107
111
|
/** Activity Types */
|
|
@@ -117,7 +121,8 @@ const ACTIVITY_TYPES = {
|
|
|
117
121
|
TOOL_APPROVAL_REQUESTED: "tool_approval_requested",
|
|
118
122
|
TOOL_APPROVAL_APPROVED: "tool_approval_approved",
|
|
119
123
|
TOOL_APPROVAL_DENIED: "tool_approval_denied",
|
|
120
|
-
COMPRESSION: "compression"
|
|
124
|
+
COMPRESSION: "compression",
|
|
125
|
+
MAX_STEPS_REACHED: "max_steps_reached"
|
|
121
126
|
};
|
|
122
127
|
/** Activity Status Values */
|
|
123
128
|
const ACTIVITY_STATUS = {
|
|
@@ -103,6 +103,7 @@ declare const QUERY_EXPRESSIONS: {
|
|
|
103
103
|
readonly TOOL_APPROVAL_APPROVED: "toolApprovalApproved";
|
|
104
104
|
readonly TOOL_APPROVAL_DENIED: "toolApprovalDenied";
|
|
105
105
|
readonly COMPRESSION: "compression";
|
|
106
|
+
readonly MAX_STEPS_REACHED: "maxStepsReached";
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
declare const REDUCE_OPERATIONS: {
|
|
@@ -102,7 +102,8 @@ const QUERY_EXPRESSIONS = {
|
|
|
102
102
|
TOOL_APPROVAL_REQUESTED: "toolApprovalRequested",
|
|
103
103
|
TOOL_APPROVAL_APPROVED: "toolApprovalApproved",
|
|
104
104
|
TOOL_APPROVAL_DENIED: "toolApprovalDenied",
|
|
105
|
-
COMPRESSION: "compression"
|
|
105
|
+
COMPRESSION: "compression",
|
|
106
|
+
MAX_STEPS_REACHED: "maxStepsReached"
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
const REDUCE_OPERATIONS = {
|
|
@@ -940,6 +940,47 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
940
940
|
await Promise.all(subAgentPromises);
|
|
941
941
|
const subAgentCount = Object.entries(typedAgentDefinition.subAgents).length;
|
|
942
942
|
logger.info({ subAgentCount }, "All sub-agents created/updated successfully");
|
|
943
|
+
const relinkToolRelationPromises = [];
|
|
944
|
+
for (const [subAgentId, agentData$1] of Object.entries(typedAgentDefinition.subAgents)) if (agentData$1.canUse && Array.isArray(agentData$1.canUse)) for (const canUseItem of agentData$1.canUse) {
|
|
945
|
+
if (!canUseItem.agentToolRelationId) continue;
|
|
946
|
+
relinkToolRelationPromises.push((async () => {
|
|
947
|
+
try {
|
|
948
|
+
const { toolId, toolSelection, headers, toolPolicies, agentToolRelationId } = canUseItem;
|
|
949
|
+
if (typedAgentDefinition.functionTools && toolId in typedAgentDefinition.functionTools) await upsertSubAgentFunctionToolRelation(db)({
|
|
950
|
+
scopes: {
|
|
951
|
+
tenantId,
|
|
952
|
+
projectId,
|
|
953
|
+
agentId: finalAgentId
|
|
954
|
+
},
|
|
955
|
+
subAgentId,
|
|
956
|
+
functionToolId: toolId,
|
|
957
|
+
toolPolicies,
|
|
958
|
+
relationId: agentToolRelationId
|
|
959
|
+
});
|
|
960
|
+
else await upsertSubAgentToolRelation(db)({
|
|
961
|
+
scopes: {
|
|
962
|
+
tenantId,
|
|
963
|
+
projectId,
|
|
964
|
+
agentId: finalAgentId
|
|
965
|
+
},
|
|
966
|
+
subAgentId,
|
|
967
|
+
toolId,
|
|
968
|
+
selectedTools: toolSelection,
|
|
969
|
+
headers,
|
|
970
|
+
toolPolicies,
|
|
971
|
+
relationId: agentToolRelationId
|
|
972
|
+
});
|
|
973
|
+
} catch (error) {
|
|
974
|
+
logger.error({
|
|
975
|
+
subAgentId,
|
|
976
|
+
relationId: canUseItem.agentToolRelationId,
|
|
977
|
+
toolId: canUseItem.toolId,
|
|
978
|
+
error
|
|
979
|
+
}, "Failed to relink tool relation during sub-agent update");
|
|
980
|
+
}
|
|
981
|
+
})());
|
|
982
|
+
}
|
|
983
|
+
if (relinkToolRelationPromises.length > 0) await Promise.all(relinkToolRelationPromises);
|
|
943
984
|
logger.info({}, "External agents are project-scoped and managed at the project level.");
|
|
944
985
|
const incomingSubAgentIds = new Set(Object.keys(typedAgentDefinition.subAgents));
|
|
945
986
|
const existingSubAgents = await listSubAgents(db)({ scopes: {
|
|
@@ -8,14 +8,14 @@ import { PgTable } from "drizzle-orm/pg-core";
|
|
|
8
8
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
}) => Promise<{
|
|
11
|
-
tenantId: string;
|
|
12
|
-
projectId: string;
|
|
13
11
|
id: string;
|
|
14
12
|
name: string;
|
|
15
|
-
description: string | null;
|
|
16
|
-
prompt: string | null;
|
|
17
13
|
createdAt: string;
|
|
18
14
|
updatedAt: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
prompt: string | null;
|
|
19
19
|
models: {
|
|
20
20
|
base?: {
|
|
21
21
|
model?: string | undefined;
|
|
@@ -54,14 +54,14 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
56
56
|
}) => Promise<{
|
|
57
|
-
tenantId: string;
|
|
58
|
-
projectId: string;
|
|
59
57
|
id: string;
|
|
60
58
|
name: string;
|
|
61
|
-
description: string | null;
|
|
62
|
-
prompt: string | null;
|
|
63
59
|
createdAt: string;
|
|
64
60
|
updatedAt: string;
|
|
61
|
+
description: string | null;
|
|
62
|
+
tenantId: string;
|
|
63
|
+
projectId: string;
|
|
64
|
+
prompt: string | null;
|
|
65
65
|
models: {
|
|
66
66
|
base?: {
|
|
67
67
|
model?: string | undefined;
|
|
@@ -97,15 +97,15 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
97
97
|
}[] | undefined;
|
|
98
98
|
} | null;
|
|
99
99
|
defaultSubAgent: {
|
|
100
|
-
tenantId: string;
|
|
101
|
-
projectId: string;
|
|
102
100
|
id: string;
|
|
103
101
|
name: string;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
104
|
description: string | null;
|
|
105
|
+
tenantId: string;
|
|
106
|
+
projectId: string;
|
|
105
107
|
prompt: string | null;
|
|
106
108
|
agentId: string;
|
|
107
|
-
createdAt: string;
|
|
108
|
-
updatedAt: string;
|
|
109
109
|
models: {
|
|
110
110
|
base?: {
|
|
111
111
|
model?: string | undefined;
|
|
@@ -129,14 +129,14 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
129
129
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
130
130
|
scopes: ProjectScopeConfig;
|
|
131
131
|
}) => Promise<{
|
|
132
|
-
tenantId: string;
|
|
133
|
-
projectId: string;
|
|
134
132
|
id: string;
|
|
135
133
|
name: string;
|
|
136
|
-
description: string | null;
|
|
137
|
-
prompt: string | null;
|
|
138
134
|
createdAt: string;
|
|
139
135
|
updatedAt: string;
|
|
136
|
+
description: string | null;
|
|
137
|
+
tenantId: string;
|
|
138
|
+
projectId: string;
|
|
139
|
+
prompt: string | null;
|
|
140
140
|
models: {
|
|
141
141
|
base?: {
|
|
142
142
|
model?: string | undefined;
|
|
@@ -228,14 +228,14 @@ declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params:
|
|
|
228
228
|
};
|
|
229
229
|
}>;
|
|
230
230
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
231
|
-
tenantId: string;
|
|
232
|
-
projectId: string;
|
|
233
231
|
id: string;
|
|
234
232
|
name: string;
|
|
235
|
-
description: string | null;
|
|
236
|
-
prompt: string | null;
|
|
237
233
|
createdAt: string;
|
|
238
234
|
updatedAt: string;
|
|
235
|
+
description: string | null;
|
|
236
|
+
tenantId: string;
|
|
237
|
+
projectId: string;
|
|
238
|
+
prompt: string | null;
|
|
239
239
|
models: {
|
|
240
240
|
base?: {
|
|
241
241
|
model?: string | undefined;
|
|
@@ -7,13 +7,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
7
7
|
scopes: ProjectScopeConfig;
|
|
8
8
|
id: string;
|
|
9
9
|
}) => Promise<{
|
|
10
|
-
tenantId: string;
|
|
11
|
-
projectId: string;
|
|
12
10
|
id: string;
|
|
13
11
|
name: string;
|
|
14
|
-
description: string | null;
|
|
15
12
|
createdAt: string;
|
|
16
13
|
updatedAt: string;
|
|
14
|
+
description: string | null;
|
|
15
|
+
tenantId: string;
|
|
16
|
+
projectId: string;
|
|
17
17
|
props: Record<string, unknown> | null;
|
|
18
18
|
render: {
|
|
19
19
|
component: string;
|
|
@@ -49,13 +49,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
49
49
|
};
|
|
50
50
|
}>;
|
|
51
51
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
52
|
-
tenantId: string;
|
|
53
|
-
projectId: string;
|
|
54
52
|
id: string;
|
|
55
53
|
name: string;
|
|
56
|
-
description: string | null;
|
|
57
54
|
createdAt: string;
|
|
58
55
|
updatedAt: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
tenantId: string;
|
|
58
|
+
projectId: string;
|
|
59
59
|
props: Record<string, unknown> | null;
|
|
60
60
|
render: {
|
|
61
61
|
component: string;
|
|
@@ -104,11 +104,11 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
104
104
|
scopes: SubAgentScopeConfig;
|
|
105
105
|
artifactComponentId: string;
|
|
106
106
|
}) => Promise<{
|
|
107
|
+
id: string;
|
|
108
|
+
createdAt: string;
|
|
107
109
|
tenantId: string;
|
|
108
110
|
projectId: string;
|
|
109
|
-
id: string;
|
|
110
111
|
agentId: string;
|
|
111
|
-
createdAt: string;
|
|
112
112
|
subAgentId: string;
|
|
113
113
|
artifactComponentId: string;
|
|
114
114
|
}>;
|
|
@@ -147,11 +147,11 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
147
147
|
scopes: SubAgentScopeConfig;
|
|
148
148
|
artifactComponentId: string;
|
|
149
149
|
}) => Promise<{
|
|
150
|
+
id: string;
|
|
151
|
+
createdAt: string;
|
|
150
152
|
tenantId: string;
|
|
151
153
|
projectId: string;
|
|
152
|
-
id: string;
|
|
153
154
|
agentId: string;
|
|
154
|
-
createdAt: string;
|
|
155
155
|
subAgentId: string;
|
|
156
156
|
artifactComponentId: string;
|
|
157
157
|
} | null>;
|