@inkeep/agents-core 0.50.0 → 0.50.1
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-schema.d.ts +105 -105
- package/dist/auth/auth-validation-schemas.d.ts +148 -148
- package/dist/auth/auth.d.ts +22 -22
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +3 -4
- package/dist/data-access/manage/agents.d.ts +44 -44
- package/dist/data-access/manage/agents.js +8 -6
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/artifactComponents.js +3 -3
- package/dist/data-access/manage/contextConfigs.d.ts +20 -20
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/dataComponents.js +2 -2
- package/dist/data-access/manage/functionTools.d.ts +16 -16
- package/dist/data-access/manage/skills.d.ts +16 -16
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
- package/dist/data-access/manage/subAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +24 -24
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +27 -27
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +8 -8
- package/dist/db/manage/manage-schema.d.ts +449 -449
- package/dist/db/runtime/runtime-schema.d.ts +298 -298
- package/dist/setup/index.d.ts +2 -0
- package/dist/setup/index.js +3 -0
- package/dist/setup/setup.d.ts +24 -0
- package/dist/setup/setup.js +506 -0
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1953 -1953
- package/package.json +5 -1
package/dist/auth/auth.d.ts
CHANGED
|
@@ -880,25 +880,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
880
880
|
ac: better_auth_plugins0.AccessControl;
|
|
881
881
|
roles: {
|
|
882
882
|
member: {
|
|
883
|
-
authorize<K_1 extends "
|
|
884
|
-
actions: better_auth_plugins0.Subset<"
|
|
883
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
884
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
885
885
|
connector: "OR" | "AND";
|
|
886
886
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
887
|
-
statements: better_auth_plugins0.Subset<"
|
|
887
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
888
888
|
};
|
|
889
889
|
admin: {
|
|
890
|
-
authorize<K_1 extends "
|
|
891
|
-
actions: better_auth_plugins0.Subset<"
|
|
890
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
891
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
892
892
|
connector: "OR" | "AND";
|
|
893
893
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
894
|
-
statements: better_auth_plugins0.Subset<"
|
|
894
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
895
895
|
};
|
|
896
896
|
owner: {
|
|
897
|
-
authorize<K_1 extends "
|
|
898
|
-
actions: better_auth_plugins0.Subset<"
|
|
897
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
898
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
899
899
|
connector: "OR" | "AND";
|
|
900
900
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
901
|
-
statements: better_auth_plugins0.Subset<"
|
|
901
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
902
902
|
};
|
|
903
903
|
};
|
|
904
904
|
creatorRole: "admin";
|
|
@@ -1084,7 +1084,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1084
1084
|
id: string;
|
|
1085
1085
|
organizationId: string;
|
|
1086
1086
|
email: string;
|
|
1087
|
-
role: "
|
|
1087
|
+
role: "owner" | "admin" | "member";
|
|
1088
1088
|
status: better_auth_plugins0.InvitationStatus;
|
|
1089
1089
|
inviterId: string;
|
|
1090
1090
|
expiresAt: Date;
|
|
@@ -1094,7 +1094,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1094
1094
|
Member: {
|
|
1095
1095
|
id: string;
|
|
1096
1096
|
organizationId: string;
|
|
1097
|
-
role: "
|
|
1097
|
+
role: "owner" | "admin" | "member";
|
|
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: "
|
|
1113
|
+
role: "owner" | "admin" | "member";
|
|
1114
1114
|
createdAt: Date;
|
|
1115
1115
|
userId: string;
|
|
1116
1116
|
user: {
|
|
@@ -1124,7 +1124,7 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1124
1124
|
id: string;
|
|
1125
1125
|
organizationId: string;
|
|
1126
1126
|
email: string;
|
|
1127
|
-
role: "
|
|
1127
|
+
role: "owner" | "admin" | "member";
|
|
1128
1128
|
status: better_auth_plugins0.InvitationStatus;
|
|
1129
1129
|
inviterId: string;
|
|
1130
1130
|
expiresAt: Date;
|
|
@@ -1203,25 +1203,25 @@ declare function createAuth(config: BetterAuthConfig): better_auth0.Auth<{
|
|
|
1203
1203
|
ac: better_auth_plugins0.AccessControl;
|
|
1204
1204
|
roles: {
|
|
1205
1205
|
member: {
|
|
1206
|
-
authorize<K_1 extends "
|
|
1207
|
-
actions: better_auth_plugins0.Subset<"
|
|
1206
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1207
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1208
1208
|
connector: "OR" | "AND";
|
|
1209
1209
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1210
|
-
statements: better_auth_plugins0.Subset<"
|
|
1210
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1211
1211
|
};
|
|
1212
1212
|
admin: {
|
|
1213
|
-
authorize<K_1 extends "
|
|
1214
|
-
actions: better_auth_plugins0.Subset<"
|
|
1213
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1214
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1215
1215
|
connector: "OR" | "AND";
|
|
1216
1216
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1217
|
-
statements: better_auth_plugins0.Subset<"
|
|
1217
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1218
1218
|
};
|
|
1219
1219
|
owner: {
|
|
1220
|
-
authorize<K_1 extends "
|
|
1221
|
-
actions: better_auth_plugins0.Subset<"
|
|
1220
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key] | {
|
|
1221
|
+
actions: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>[key];
|
|
1222
1222
|
connector: "OR" | "AND";
|
|
1223
1223
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins0.AuthorizeResponse;
|
|
1224
|
-
statements: better_auth_plugins0.Subset<"
|
|
1224
|
+
statements: better_auth_plugins0.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins0.Statements>;
|
|
1225
1225
|
};
|
|
1226
1226
|
};
|
|
1227
1227
|
creatorRole: "admin";
|
|
@@ -5,25 +5,25 @@ import { organizationClient } from "better-auth/client/plugins";
|
|
|
5
5
|
//#region src/auth/permissions.d.ts
|
|
6
6
|
declare const ac: AccessControl;
|
|
7
7
|
declare const memberRole: {
|
|
8
|
-
authorize<K_1 extends "
|
|
9
|
-
actions: better_auth_plugins69.Subset<"
|
|
8
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
9
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
10
10
|
connector: "OR" | "AND";
|
|
11
11
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
12
|
-
statements: better_auth_plugins69.Subset<"
|
|
12
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
13
13
|
};
|
|
14
14
|
declare const adminRole: {
|
|
15
|
-
authorize<K_1 extends "
|
|
16
|
-
actions: better_auth_plugins69.Subset<"
|
|
15
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
16
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
17
17
|
connector: "OR" | "AND";
|
|
18
18
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
19
|
-
statements: better_auth_plugins69.Subset<"
|
|
19
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
20
20
|
};
|
|
21
21
|
declare const ownerRole: {
|
|
22
|
-
authorize<K_1 extends "
|
|
23
|
-
actions: better_auth_plugins69.Subset<"
|
|
22
|
+
authorize<K_1 extends "project" | "organization" | "member" | "invitation" | "ac" | "team">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key] | {
|
|
23
|
+
actions: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>[key];
|
|
24
24
|
connector: "OR" | "AND";
|
|
25
25
|
} | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins69.AuthorizeResponse;
|
|
26
|
-
statements: better_auth_plugins69.Subset<"
|
|
26
|
+
statements: better_auth_plugins69.Subset<"project" | "organization" | "member" | "invitation" | "ac" | "team", better_auth_plugins69.Statements>;
|
|
27
27
|
};
|
|
28
28
|
//#endregion
|
|
29
29
|
export { ac, adminRole, memberRole, organizationClient, ownerRole };
|
package/dist/client-exports.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { ConversationHistoryConfig, CredentialStoreType, MCPTransportType } from
|
|
|
6
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
|
-
import "./index.js";
|
|
10
9
|
import { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhen, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AgentWithinContextOfProjectSelectResponse, AgentWithinContextOfProjectSelectSchema, AgentWithinContextOfProjectSelectSchemaWithRelationIds, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ComponentJoin, ComponentJoinSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, CronExpressionSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, DataPartSchema, DatasetApiInsertSchema, DatasetApiSelectSchema, DatasetApiUpdateSchema, DatasetInsertSchema, DatasetItemApiInsertSchema, DatasetItemApiSelectSchema, DatasetItemApiUpdateSchema, DatasetItemInsertSchema, DatasetItemSelectSchema, DatasetItemUpdateSchema, DatasetRunApiInsertSchema, DatasetRunApiSelectSchema, DatasetRunApiUpdateSchema, DatasetRunConfigAgentRelationInsertSchema, DatasetRunConfigAgentRelationSelectSchema, DatasetRunConfigAgentRelationUpdateSchema, DatasetRunConfigApiInsertSchema, DatasetRunConfigApiSelectSchema, DatasetRunConfigApiUpdateSchema, DatasetRunConfigInsertSchema, DatasetRunConfigSelectSchema, DatasetRunConfigUpdateSchema, DatasetRunConversationRelationApiInsertSchema, DatasetRunConversationRelationApiSelectSchema, DatasetRunConversationRelationApiUpdateSchema, DatasetRunConversationRelationInsertSchema, DatasetRunConversationRelationSelectSchema, DatasetRunConversationRelationUpdateSchema, DatasetRunInsertSchema, DatasetRunItemSchema, DatasetRunSelectSchema, DatasetRunUpdateSchema, DatasetSelectSchema, DatasetUpdateSchema, DateTimeFilterQueryParamsSchema, ErrorResponseSchema, EvaluationJobConfigApiInsertSchema, EvaluationJobConfigApiSelectSchema, EvaluationJobConfigApiUpdateSchema, EvaluationJobConfigEvaluatorRelationApiInsertSchema, EvaluationJobConfigEvaluatorRelationApiSelectSchema, EvaluationJobConfigEvaluatorRelationApiUpdateSchema, EvaluationJobConfigEvaluatorRelationInsertSchema, EvaluationJobConfigEvaluatorRelationSelectSchema, EvaluationJobConfigEvaluatorRelationUpdateSchema, EvaluationJobConfigInsertSchema, EvaluationJobConfigSelectSchema, EvaluationJobConfigUpdateSchema, EvaluationJobFilterCriteriaSchema, EvaluationResultApiInsertSchema, EvaluationResultApiSelectSchema, EvaluationResultApiUpdateSchema, EvaluationResultInsertSchema, EvaluationResultSelectSchema, EvaluationResultUpdateSchema, EvaluationRunApiInsertSchema, EvaluationRunApiSelectSchema, EvaluationRunApiUpdateSchema, EvaluationRunConfigApiInsertSchema, EvaluationRunConfigApiSelectSchema, EvaluationRunConfigApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationApiUpdateSchema, EvaluationRunConfigEvaluationSuiteConfigRelationInsertSchema, EvaluationRunConfigEvaluationSuiteConfigRelationSelectSchema, EvaluationRunConfigEvaluationSuiteConfigRelationUpdateSchema, EvaluationRunConfigInsertSchema, EvaluationRunConfigSelectSchema, EvaluationRunConfigUpdateSchema, EvaluationRunConfigWithSuiteConfigsApiSelectSchema, EvaluationRunInsertSchema, EvaluationRunSelectSchema, EvaluationRunUpdateSchema, EvaluationSuiteConfigApiInsertSchema, EvaluationSuiteConfigApiSelectSchema, EvaluationSuiteConfigApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationApiInsertSchema, EvaluationSuiteConfigEvaluatorRelationApiSelectSchema, EvaluationSuiteConfigEvaluatorRelationApiUpdateSchema, EvaluationSuiteConfigEvaluatorRelationInsertSchema, EvaluationSuiteConfigEvaluatorRelationSelectSchema, EvaluationSuiteConfigEvaluatorRelationUpdateSchema, EvaluationSuiteConfigInsertSchema, EvaluationSuiteConfigSelectSchema, EvaluationSuiteConfigUpdateSchema, EvaluatorApiInsertSchema, EvaluatorApiSelectSchema, EvaluatorApiUpdateSchema, EvaluatorInsertSchema, EvaluatorSelectSchema, EvaluatorUpdateSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FilePartSchema, FullAgentAgentInsertSchema, FullAgentSubAgentSelectSchema, FullAgentSubAgentSelectSchemaWithRelationIds, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FullProjectSelectResponse, FullProjectSelectSchema, FullProjectSelectSchemaWithRelationIds, FullProjectSelectWithRelationIdsResponse, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfig, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettings, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PaginationWithRefQueryParamsSchema, PartSchema, PartSchemaType, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectMetadataInsertSchema, ProjectMetadataSelectSchema, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RefQueryParamSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, ResourceIdSchema, ScheduledTrigger, ScheduledTriggerApiInsertBaseSchema, ScheduledTriggerApiInsertSchema, ScheduledTriggerApiSelectSchema, ScheduledTriggerApiUpdateSchema, ScheduledTriggerInsert, ScheduledTriggerInsertSchema, ScheduledTriggerInvocation, ScheduledTriggerInvocationApiInsertSchema, ScheduledTriggerInvocationApiSelectSchema, ScheduledTriggerInvocationApiUpdateSchema, ScheduledTriggerInvocationInsert, ScheduledTriggerInvocationInsertSchema, ScheduledTriggerInvocationListResponse, ScheduledTriggerInvocationResponse, ScheduledTriggerInvocationSelectSchema, ScheduledTriggerInvocationStatus, ScheduledTriggerInvocationStatusEnum, ScheduledTriggerInvocationUpdate, ScheduledTriggerInvocationUpdateSchema, ScheduledTriggerListResponse, ScheduledTriggerResponse, ScheduledTriggerSelectSchema, ScheduledTriggerUpdate, ScheduledTriggerUpdateSchema, ScheduledTriggerWithRunInfoListResponse, ScheduledTriggerWithRunInfoSchema, ScheduledWorkflow, ScheduledWorkflowApiInsertSchema, ScheduledWorkflowApiSelectSchema, ScheduledWorkflowApiUpdateSchema, ScheduledWorkflowInsert, ScheduledWorkflowInsertSchema, ScheduledWorkflowListResponse, ScheduledWorkflowResponse, ScheduledWorkflowSelectSchema, ScheduledWorkflowUpdate, ScheduledWorkflowUpdateSchema, SignatureSource, SignatureSourceSchema, SignatureValidationOptions, SignatureValidationOptionsSchema, SignatureVerificationConfig, SignatureVerificationConfigSchema, SignedComponent, SignedComponentSchema, SimulationAgent, SimulationAgentSchema, SingleResponseSchema, SkillApiInsertSchema, SkillApiSelectSchema, SkillApiUpdateSchema, SkillFrontmatterSchema, SkillInsertSchema, SkillListResponse, SkillResponse, SkillSelectSchema, SkillUpdateSchema, StatusComponentSchema, StatusUpdateSchema, StopWhen, StopWhenSchema, StringRecordSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentFunctionToolRelationApiInsertSchema, SubAgentFunctionToolRelationApiSelectSchema, SubAgentFunctionToolRelationInsertSchema, SubAgentFunctionToolRelationListResponse, SubAgentFunctionToolRelationResponse, SubAgentFunctionToolRelationSelectSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentSkillApiInsertSchema, SubAgentSkillApiSelectSchema, SubAgentSkillApiUpdateSchema, SubAgentSkillInsertSchema, SubAgentSkillResponse, SubAgentSkillSelectSchema, SubAgentSkillUpdateSchema, SubAgentSkillWithIndexArrayResponse, SubAgentSkillWithIndexSchema, SubAgentStopWhen, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, TextPartSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, TriggerApiInsertSchema, TriggerApiSelectSchema, TriggerApiUpdateSchema, TriggerAuthHeaderInputSchema, TriggerAuthHeaderStoredSchema, TriggerAuthHeaderUpdateSchema, TriggerAuthenticationInputSchema, TriggerAuthenticationSchema, TriggerAuthenticationStoredSchema, TriggerAuthenticationUpdateSchema, TriggerBatchConversationEvaluationSchema, TriggerConversationEvaluationSchema, TriggerDatasetRunSchema, TriggerEvaluationJobSchema, TriggerInsertSchema, TriggerInvocationApiInsertSchema, TriggerInvocationApiSelectSchema, TriggerInvocationApiUpdateSchema, TriggerInvocationInsertSchema, TriggerInvocationListResponse, TriggerInvocationResponse, TriggerInvocationSelectSchema, TriggerInvocationStatusEnum, TriggerInvocationUpdateSchema, TriggerListResponse, TriggerOutputTransformSchema, TriggerResponse, TriggerSelectSchema, TriggerUpdateSchema, TriggerWithWebhookUrlListResponse, TriggerWithWebhookUrlResponse, TriggerWithWebhookUrlSchema, URL_SAFE_ID_PATTERN, WorkAppGitHubAccessGetResponseSchema, WorkAppGitHubAccessModeSchema, WorkAppGitHubAccessSetRequestSchema, WorkAppGitHubAccessSetResponseSchema, WorkAppGitHubAccountTypeSchema, WorkAppGitHubInstallationApiInsertSchema, WorkAppGitHubInstallationInsertSchema, WorkAppGitHubInstallationSelectSchema, WorkAppGitHubInstallationStatusSchema, WorkAppGitHubMcpToolRepositoryAccessSelectSchema, WorkAppGitHubProjectRepositoryAccessSelectSchema, WorkAppGitHubRepositoryApiInsertSchema, WorkAppGitHubRepositoryInsertSchema, WorkAppGitHubRepositorySelectSchema, WorkAppGithubInstallationApiSelectSchema, canDelegateToExternalAgentInsertSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentInsertSchema, canDelegateToTeamAgentSchema, canRelateToInternalSubAgentSchema } from "./validation/schemas.js";
|
|
11
10
|
import { transformToJson } from "./validation/extend-schemas.js";
|
|
12
11
|
import { z } from "@hono/zod-openapi";
|
|
@@ -19,10 +18,9 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
|
|
|
19
18
|
defaultSubAgentId: z.ZodOptional<z.ZodString>;
|
|
20
19
|
subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
21
20
|
id: z.ZodString;
|
|
22
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
23
21
|
name: z.ZodString;
|
|
24
|
-
updatedAt: z.ZodOptional<z.ZodString>;
|
|
25
22
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
|
|
26
24
|
models: z.ZodOptional<z.ZodObject<{
|
|
27
25
|
base: z.ZodOptional<z.ZodObject<{
|
|
28
26
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -46,7 +44,8 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
|
|
|
46
44
|
}, {
|
|
47
45
|
stepCountIs?: number | undefined;
|
|
48
46
|
}>>>>;
|
|
49
|
-
|
|
47
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
48
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
50
49
|
type: z.ZodLiteral<"internal">;
|
|
51
50
|
canUse: z.ZodArray<z.ZodObject<{
|
|
52
51
|
agentToolRelationId: z.ZodOptional<z.ZodString>;
|
|
@@ -9,14 +9,12 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
12
|
name: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
17
13
|
description: string | null;
|
|
18
14
|
defaultSubAgentId: string | null;
|
|
19
|
-
|
|
15
|
+
tenantId: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
prompt: string | null;
|
|
20
18
|
models: {
|
|
21
19
|
base?: {
|
|
22
20
|
model?: string | undefined;
|
|
@@ -31,7 +29,12 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
31
29
|
providerOptions?: Record<string, any> | undefined;
|
|
32
30
|
} | undefined;
|
|
33
31
|
} | null;
|
|
34
|
-
|
|
32
|
+
stopWhen: {
|
|
33
|
+
transferCountIs?: number | undefined;
|
|
34
|
+
} | null;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
contextConfigId: string | null;
|
|
35
38
|
statusUpdates: {
|
|
36
39
|
enabled?: boolean | undefined;
|
|
37
40
|
numEvents?: number | undefined;
|
|
@@ -47,22 +50,17 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
47
50
|
} | undefined;
|
|
48
51
|
}[] | undefined;
|
|
49
52
|
} | null;
|
|
50
|
-
stopWhen: {
|
|
51
|
-
transferCountIs?: number | undefined;
|
|
52
|
-
} | null;
|
|
53
53
|
} | null>;
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
56
56
|
}) => Promise<{
|
|
57
57
|
id: string;
|
|
58
|
-
createdAt: string;
|
|
59
58
|
name: string;
|
|
60
|
-
updatedAt: string;
|
|
61
|
-
projectId: string;
|
|
62
|
-
tenantId: string;
|
|
63
59
|
description: string | null;
|
|
64
60
|
defaultSubAgentId: string | null;
|
|
65
|
-
|
|
61
|
+
tenantId: string;
|
|
62
|
+
projectId: string;
|
|
63
|
+
prompt: string | null;
|
|
66
64
|
models: {
|
|
67
65
|
base?: {
|
|
68
66
|
model?: string | undefined;
|
|
@@ -77,7 +75,12 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
77
75
|
providerOptions?: Record<string, any> | undefined;
|
|
78
76
|
} | undefined;
|
|
79
77
|
} | null;
|
|
80
|
-
|
|
78
|
+
stopWhen: {
|
|
79
|
+
transferCountIs?: number | undefined;
|
|
80
|
+
} | null;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
contextConfigId: string | null;
|
|
81
84
|
statusUpdates: {
|
|
82
85
|
enabled?: boolean | undefined;
|
|
83
86
|
numEvents?: number | undefined;
|
|
@@ -93,18 +96,15 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
93
96
|
} | undefined;
|
|
94
97
|
}[] | undefined;
|
|
95
98
|
} | null;
|
|
96
|
-
stopWhen: {
|
|
97
|
-
transferCountIs?: number | undefined;
|
|
98
|
-
} | null;
|
|
99
99
|
defaultSubAgent: {
|
|
100
100
|
id: string;
|
|
101
|
-
createdAt: string;
|
|
102
101
|
name: string;
|
|
103
|
-
updatedAt: string;
|
|
104
|
-
agentId: string;
|
|
105
|
-
projectId: string;
|
|
106
|
-
tenantId: string;
|
|
107
102
|
description: string | null;
|
|
103
|
+
tenantId: string;
|
|
104
|
+
projectId: string;
|
|
105
|
+
agentId: string;
|
|
106
|
+
prompt: string | null;
|
|
107
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
108
108
|
models: {
|
|
109
109
|
base?: {
|
|
110
110
|
model?: string | undefined;
|
|
@@ -119,25 +119,23 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
119
119
|
providerOptions?: Record<string, any> | undefined;
|
|
120
120
|
} | undefined;
|
|
121
121
|
} | null;
|
|
122
|
-
prompt: string | null;
|
|
123
122
|
stopWhen: {
|
|
124
123
|
stepCountIs?: number | undefined;
|
|
125
124
|
} | null;
|
|
126
|
-
|
|
125
|
+
createdAt: string;
|
|
126
|
+
updatedAt: string;
|
|
127
127
|
} | null;
|
|
128
128
|
} | null>;
|
|
129
129
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
130
130
|
scopes: ProjectScopeConfig;
|
|
131
131
|
}) => Promise<{
|
|
132
132
|
id: string;
|
|
133
|
-
createdAt: string;
|
|
134
133
|
name: string;
|
|
135
|
-
updatedAt: string;
|
|
136
|
-
projectId: string;
|
|
137
|
-
tenantId: string;
|
|
138
134
|
description: string | null;
|
|
139
135
|
defaultSubAgentId: string | null;
|
|
140
|
-
|
|
136
|
+
tenantId: string;
|
|
137
|
+
projectId: string;
|
|
138
|
+
prompt: string | null;
|
|
141
139
|
models: {
|
|
142
140
|
base?: {
|
|
143
141
|
model?: string | undefined;
|
|
@@ -152,7 +150,12 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
152
150
|
providerOptions?: Record<string, any> | undefined;
|
|
153
151
|
} | undefined;
|
|
154
152
|
} | null;
|
|
155
|
-
|
|
153
|
+
stopWhen: {
|
|
154
|
+
transferCountIs?: number | undefined;
|
|
155
|
+
} | null;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
updatedAt: string;
|
|
158
|
+
contextConfigId: string | null;
|
|
156
159
|
statusUpdates: {
|
|
157
160
|
enabled?: boolean | undefined;
|
|
158
161
|
numEvents?: number | undefined;
|
|
@@ -168,9 +171,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
168
171
|
} | undefined;
|
|
169
172
|
}[] | undefined;
|
|
170
173
|
} | null;
|
|
171
|
-
stopWhen: {
|
|
172
|
-
transferCountIs?: number | undefined;
|
|
173
|
-
} | null;
|
|
174
174
|
}[]>;
|
|
175
175
|
declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
176
176
|
scopes: ProjectScopeConfig;
|
|
@@ -246,14 +246,12 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
246
246
|
}): Promise<AvailableAgentInfo[]>;
|
|
247
247
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
248
248
|
id: string;
|
|
249
|
-
createdAt: string;
|
|
250
249
|
name: string;
|
|
251
|
-
updatedAt: string;
|
|
252
|
-
projectId: string;
|
|
253
|
-
tenantId: string;
|
|
254
250
|
description: string | null;
|
|
255
251
|
defaultSubAgentId: string | null;
|
|
256
|
-
|
|
252
|
+
tenantId: string;
|
|
253
|
+
projectId: string;
|
|
254
|
+
prompt: string | null;
|
|
257
255
|
models: {
|
|
258
256
|
base?: {
|
|
259
257
|
model?: string | undefined;
|
|
@@ -268,7 +266,12 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
268
266
|
providerOptions?: Record<string, any> | undefined;
|
|
269
267
|
} | undefined;
|
|
270
268
|
} | null;
|
|
271
|
-
|
|
269
|
+
stopWhen: {
|
|
270
|
+
transferCountIs?: number | undefined;
|
|
271
|
+
} | null;
|
|
272
|
+
createdAt: string;
|
|
273
|
+
updatedAt: string;
|
|
274
|
+
contextConfigId: string | null;
|
|
272
275
|
statusUpdates: {
|
|
273
276
|
enabled?: boolean | undefined;
|
|
274
277
|
numEvents?: number | undefined;
|
|
@@ -284,9 +287,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
284
287
|
} | undefined;
|
|
285
288
|
}[] | undefined;
|
|
286
289
|
} | null;
|
|
287
|
-
stopWhen: {
|
|
288
|
-
transferCountIs?: number | undefined;
|
|
289
|
-
} | null;
|
|
290
290
|
}>;
|
|
291
291
|
declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
292
292
|
scopes: AgentScopeConfig;
|
|
@@ -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:
|
|
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;
|
|
@@ -260,8 +260,8 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
|
|
|
260
260
|
agentToolRelationId: subAgentFunctionToolRelations.id,
|
|
261
261
|
toolPolicies: subAgentFunctionToolRelations.toolPolicies
|
|
262
262
|
}).from(subAgentFunctionToolRelations).innerJoin(functionTools, and(eq(subAgentFunctionToolRelations.functionToolId, functionTools.id), eq(subAgentFunctionToolRelations.tenantId, functionTools.tenantId), eq(subAgentFunctionToolRelations.projectId, functionTools.projectId), eq(subAgentFunctionToolRelations.agentId, functionTools.agentId))).where(and(eq(subAgentFunctionToolRelations.tenantId, tenantId), eq(subAgentFunctionToolRelations.projectId, projectId), eq(subAgentFunctionToolRelations.agentId, agentId), eq(subAgentFunctionToolRelations.subAgentId, agent$1.id)));
|
|
263
|
-
const agentDataComponentIds = (await db.query.subAgentDataComponents.findMany({ where: and(eq(subAgentDataComponents.tenantId, tenantId), eq(subAgentDataComponents.subAgentId, agent$1.id)) })).map((rel) => rel.dataComponentId);
|
|
264
|
-
const agentArtifactComponentIds = (await db.query.subAgentArtifactComponents.findMany({ where: and(eq(subAgentArtifactComponents.tenantId, tenantId), eq(subAgentArtifactComponents.subAgentId, agent$1.id)) })).map((rel) => rel.artifactComponentId);
|
|
263
|
+
const agentDataComponentIds = (await db.query.subAgentDataComponents.findMany({ where: and(eq(subAgentDataComponents.tenantId, tenantId), eq(subAgentDataComponents.projectId, projectId), eq(subAgentDataComponents.agentId, agentId), eq(subAgentDataComponents.subAgentId, agent$1.id)) })).map((rel) => rel.dataComponentId);
|
|
264
|
+
const agentArtifactComponentIds = (await db.query.subAgentArtifactComponents.findMany({ where: and(eq(subAgentArtifactComponents.tenantId, tenantId), eq(subAgentArtifactComponents.projectId, projectId), eq(subAgentArtifactComponents.agentId, agentId), eq(subAgentArtifactComponents.subAgentId, agent$1.id)) })).map((rel) => rel.artifactComponentId);
|
|
265
265
|
const mcpToolCanUse = subAgentTools.map((tool) => ({
|
|
266
266
|
agentToolRelationId: tool.agentToolRelationId,
|
|
267
267
|
toolId: tool.id,
|
|
@@ -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
|
|
@@ -9,12 +9,12 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
12
|
name: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
17
13
|
description: string | null;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
18
|
props: {
|
|
19
19
|
[x: string]: unknown;
|
|
20
20
|
type: "object";
|
|
@@ -65,12 +65,12 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
}>;
|
|
66
66
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
67
67
|
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
68
|
name: string;
|
|
70
|
-
updatedAt: string;
|
|
71
|
-
projectId: string;
|
|
72
|
-
tenantId: string;
|
|
73
69
|
description: string | null;
|
|
70
|
+
tenantId: string;
|
|
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
|
-
agentId: string;
|
|
146
|
-
projectId: string;
|
|
147
144
|
tenantId: string;
|
|
145
|
+
projectId: string;
|
|
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
|
-
agentId: string;
|
|
189
|
-
projectId: string;
|
|
190
187
|
tenantId: string;
|
|
188
|
+
projectId: string;
|
|
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) => {
|
|
@@ -9,25 +9,25 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
tenantId: string;
|
|
13
|
+
projectId: string;
|
|
14
|
+
agentId: string;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
tenantId: string;
|
|
17
|
+
headersSchema: unknown;
|
|
18
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
22
22
|
}) => Promise<{
|
|
23
23
|
id: string;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
tenantId: string;
|
|
25
|
+
projectId: string;
|
|
26
|
+
agentId: string;
|
|
26
27
|
createdAt: string;
|
|
27
28
|
updatedAt: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
tenantId: string;
|
|
29
|
+
headersSchema: unknown;
|
|
30
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
31
31
|
}[]>;
|
|
32
32
|
declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
33
|
scopes: AgentScopeConfig;
|
|
@@ -43,13 +43,13 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
43
43
|
}>;
|
|
44
44
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
45
45
|
id: string;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
tenantId: string;
|
|
47
|
+
projectId: string;
|
|
48
|
+
agentId: string;
|
|
48
49
|
createdAt: string;
|
|
49
50
|
updatedAt: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
tenantId: string;
|
|
51
|
+
headersSchema: unknown;
|
|
52
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
53
53
|
}>;
|
|
54
54
|
declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -83,13 +83,13 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
data: ContextConfigInsert;
|
|
84
84
|
}) => Promise<{
|
|
85
85
|
id: string;
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
tenantId: string;
|
|
87
|
+
projectId: string;
|
|
88
|
+
agentId: string;
|
|
88
89
|
createdAt: string;
|
|
89
90
|
updatedAt: string;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
tenantId: string;
|
|
91
|
+
headersSchema: unknown;
|
|
92
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
93
93
|
}>;
|
|
94
94
|
//#endregion
|
|
95
95
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|