@inkeep/agents-core 0.41.2 → 0.42.0
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/api-client/base-client.d.ts +87 -8
- package/dist/api-client/base-client.js +174 -1
- package/dist/api-client/eval-api-client.d.ts +47 -0
- package/dist/api-client/eval-api-client.js +65 -0
- package/dist/api-client/index.d.ts +4 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/manage-api-client.d.ts +34 -0
- package/dist/api-client/manage-api-client.js +104 -0
- package/dist/auth/auth.d.ts +86 -20
- package/dist/auth/auth.js +55 -1
- package/dist/auth/authz/client.d.ts +81 -0
- package/dist/auth/authz/client.js +189 -0
- package/dist/auth/authz/config.d.ts +76 -0
- package/dist/auth/authz/config.js +76 -0
- package/dist/auth/authz/index.d.ts +5 -0
- package/dist/auth/authz/index.js +6 -0
- package/dist/auth/authz/permissions.d.ts +57 -0
- package/dist/auth/authz/permissions.js +83 -0
- package/dist/auth/authz/sync.d.ts +85 -0
- package/dist/auth/authz/sync.js +237 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/auth/permissions.js +2 -181
- package/dist/client-exports.d.ts +8 -3
- package/dist/client-exports.js +3 -2
- package/dist/constants/context-breakdown.d.ts +61 -0
- package/dist/constants/context-breakdown.js +124 -0
- package/dist/constants/otel-attributes.d.ts +4 -0
- package/dist/constants/otel-attributes.js +4 -0
- package/dist/context/ContextConfig.d.ts +2 -2
- package/dist/context/ContextConfig.js +3 -3
- package/dist/context/TemplateEngine.js +0 -1
- package/dist/context/index.d.ts +1 -5
- package/dist/context/index.js +1 -5
- package/dist/credential-stuffer/CredentialStuffer.d.ts +1 -1
- package/dist/data-access/index.d.ts +34 -26
- package/dist/data-access/index.js +34 -26
- package/dist/data-access/manage/agentFull.d.ts +36 -0
- package/dist/data-access/{agentFull.js → manage/agentFull.js} +205 -7
- package/dist/data-access/{agents.d.ts → manage/agents.d.ts} +23 -22
- package/dist/data-access/{agents.js → manage/agents.js} +52 -7
- package/dist/data-access/{artifactComponents.d.ts → manage/artifactComponents.d.ts} +21 -21
- package/dist/data-access/{artifactComponents.js → manage/artifactComponents.js} +5 -5
- package/dist/data-access/{contextConfigs.d.ts → manage/contextConfigs.d.ts} +14 -14
- package/dist/data-access/{contextConfigs.js → manage/contextConfigs.js} +3 -3
- package/dist/data-access/{credentialReferences.d.ts → manage/credentialReferences.d.ts} +17 -17
- package/dist/data-access/{credentialReferences.js → manage/credentialReferences.js} +2 -2
- package/dist/data-access/{dataComponents.d.ts → manage/dataComponents.d.ts} +20 -20
- package/dist/data-access/{dataComponents.js → manage/dataComponents.js} +7 -7
- package/dist/data-access/manage/evalConfig.d.ts +221 -0
- package/dist/data-access/manage/evalConfig.js +275 -0
- package/dist/data-access/{externalAgents.d.ts → manage/externalAgents.d.ts} +16 -16
- package/dist/data-access/{externalAgents.js → manage/externalAgents.js} +2 -2
- package/dist/data-access/{functionTools.d.ts → manage/functionTools.d.ts} +65 -15
- package/dist/data-access/{functionTools.js → manage/functionTools.js} +90 -8
- package/dist/data-access/{functions.d.ts → manage/functions.d.ts} +9 -9
- package/dist/data-access/{functions.js → manage/functions.js} +3 -3
- package/dist/data-access/manage/projectFull.d.ts +38 -0
- package/dist/data-access/{projectFull.js → manage/projectFull.js} +64 -65
- package/dist/data-access/manage/projectLifecycle.d.ts +119 -0
- package/dist/data-access/manage/projectLifecycle.js +234 -0
- package/dist/data-access/manage/projects.d.ts +75 -0
- package/dist/data-access/{projects.js → manage/projects.js} +15 -16
- package/dist/data-access/{subAgentExternalAgentRelations.d.ts → manage/subAgentExternalAgentRelations.d.ts} +19 -19
- package/dist/data-access/{subAgentExternalAgentRelations.js → manage/subAgentExternalAgentRelations.js} +2 -2
- package/dist/data-access/{subAgentRelations.d.ts → manage/subAgentRelations.d.ts} +29 -29
- package/dist/data-access/{subAgentRelations.js → manage/subAgentRelations.js} +3 -3
- package/dist/data-access/{subAgentTeamAgentRelations.d.ts → manage/subAgentTeamAgentRelations.d.ts} +19 -19
- package/dist/data-access/{subAgentTeamAgentRelations.js → manage/subAgentTeamAgentRelations.js} +2 -2
- package/dist/data-access/{subAgents.d.ts → manage/subAgents.d.ts} +13 -13
- package/dist/data-access/{subAgents.js → manage/subAgents.js} +4 -4
- package/dist/data-access/{tools.d.ts → manage/tools.d.ts} +26 -19
- package/dist/data-access/{tools.js → manage/tools.js} +57 -35
- package/dist/data-access/manage/triggers.d.ts +80 -0
- package/dist/data-access/manage/triggers.js +81 -0
- package/dist/data-access/{apiKeys.d.ts → runtime/apiKeys.d.ts} +17 -17
- package/dist/data-access/{apiKeys.js → runtime/apiKeys.js} +3 -3
- package/dist/data-access/runtime/cascade-delete.d.ts +77 -0
- package/dist/data-access/runtime/cascade-delete.js +111 -0
- package/dist/data-access/{contextCache.d.ts → runtime/contextCache.d.ts} +13 -13
- package/dist/data-access/{contextCache.js → runtime/contextCache.js} +5 -5
- package/dist/data-access/{conversations.d.ts → runtime/conversations.d.ts} +68 -19
- package/dist/data-access/{conversations.js → runtime/conversations.js} +13 -7
- package/dist/data-access/runtime/evalRuns.d.ts +120 -0
- package/dist/data-access/runtime/evalRuns.js +168 -0
- package/dist/data-access/{ledgerArtifacts.d.ts → runtime/ledgerArtifacts.d.ts} +13 -13
- package/dist/data-access/{ledgerArtifacts.js → runtime/ledgerArtifacts.js} +3 -3
- package/dist/data-access/{messages.d.ts → runtime/messages.d.ts} +15 -15
- package/dist/data-access/{messages.js → runtime/messages.js} +2 -2
- package/dist/data-access/{organizations.d.ts → runtime/organizations.d.ts} +16 -7
- package/dist/data-access/{organizations.js → runtime/organizations.js} +15 -3
- package/dist/data-access/runtime/projects.d.ts +62 -0
- package/dist/data-access/runtime/projects.js +90 -0
- package/dist/data-access/runtime/tasks.d.ts +55 -0
- package/dist/data-access/{tasks.js → runtime/tasks.js} +2 -2
- package/dist/data-access/runtime/triggerInvocations.d.ts +62 -0
- package/dist/data-access/runtime/triggerInvocations.js +54 -0
- package/dist/data-access/runtime/users.d.ts +19 -0
- package/dist/data-access/{users.js → runtime/users.js} +2 -2
- package/dist/data-access/validation.d.ts +4 -4
- package/dist/data-access/validation.js +1 -1
- package/dist/db/clean.d.ts +8 -4
- package/dist/db/clean.js +14 -105
- package/dist/db/delete.d.ts +1 -1
- package/dist/db/delete.js +7 -10
- package/dist/db/manage/dolt-cleanup.d.ts +51 -0
- package/dist/db/manage/dolt-cleanup.js +132 -0
- package/dist/db/manage/manage-client.d.ts +26 -0
- package/dist/db/manage/manage-client.js +68 -0
- package/dist/db/{schema.d.ts → manage/manage-schema.d.ts} +1459 -1285
- package/dist/db/{schema.js → manage/manage-schema.js} +433 -341
- package/dist/db/manage/test-manage-client.d.ts +27 -0
- package/dist/db/manage/test-manage-client.js +68 -0
- package/dist/db/runtime/runtime-client.d.ts +20 -0
- package/dist/db/runtime/runtime-client.js +30 -0
- package/dist/db/runtime/runtime-schema.d.ts +2834 -0
- package/dist/db/runtime/runtime-schema.js +483 -0
- package/dist/db/runtime/test-runtime-client.d.ts +27 -0
- package/dist/db/{test-client.js → runtime/test-runtime-client.js} +11 -25
- package/dist/dolt/branch.d.ts +62 -0
- package/dist/dolt/branch.js +82 -0
- package/dist/dolt/branches-api.d.ts +108 -0
- package/dist/dolt/branches-api.js +162 -0
- package/dist/dolt/commit.d.ts +94 -0
- package/dist/dolt/commit.js +103 -0
- package/dist/dolt/diff.d.ts +27 -0
- package/dist/dolt/diff.js +21 -0
- package/dist/dolt/index.d.ts +10 -0
- package/dist/dolt/index.js +11 -0
- package/dist/dolt/merge.d.ts +63 -0
- package/dist/dolt/merge.js +81 -0
- package/dist/dolt/migrate-all-branches.d.ts +4 -0
- package/dist/dolt/migrate-all-branches.js +78 -0
- package/dist/dolt/migrate-dolt.d.ts +1 -0
- package/dist/dolt/migrate-dolt.js +22 -0
- package/dist/dolt/ref-helpers.d.ts +19 -0
- package/dist/dolt/ref-helpers.js +65 -0
- package/dist/dolt/ref-middleware.d.ts +82 -0
- package/dist/dolt/ref-middleware.js +217 -0
- package/dist/dolt/ref-scope.d.ts +101 -0
- package/dist/dolt/ref-scope.js +231 -0
- package/dist/dolt/schema-sync.d.ts +134 -0
- package/dist/dolt/schema-sync.js +246 -0
- package/dist/env.d.ts +6 -4
- package/dist/env.js +3 -2
- package/dist/index.d.ts +71 -44
- package/dist/index.js +74 -47
- package/dist/types/entities.d.ts +81 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utility.d.ts +45 -4
- package/dist/utils/JsonTransformer.d.ts +44 -0
- package/dist/utils/JsonTransformer.js +112 -0
- package/dist/utils/apiKeys.d.ts +5 -1
- package/dist/utils/apiKeys.js +11 -1
- package/dist/utils/colors.d.ts +34 -0
- package/dist/utils/colors.js +49 -0
- package/dist/utils/credential-store-utils.d.ts +1 -1
- package/dist/utils/format-messages.d.ts +1 -1
- package/dist/utils/index.d.ts +7 -3
- package/dist/utils/index.js +7 -3
- package/dist/utils/internal-service-auth.d.ts +79 -0
- package/dist/utils/internal-service-auth.js +140 -0
- package/dist/utils/jwt-helpers.d.ts +56 -0
- package/dist/utils/jwt-helpers.js +90 -0
- package/dist/utils/service-token-auth.d.ts +9 -27
- package/dist/utils/service-token-auth.js +48 -96
- package/dist/utils/template-interpolation.d.ts +22 -0
- package/dist/utils/template-interpolation.js +62 -0
- package/dist/utils/third-party-mcp-servers/composio-client.js +23 -23
- package/dist/utils/trigger-auth.d.ts +62 -0
- package/dist/utils/trigger-auth.js +125 -0
- package/dist/validation/agentFull.js +2 -4
- package/dist/validation/dolt-schemas.d.ts +49 -0
- package/dist/validation/dolt-schemas.js +44 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +4 -26
- package/dist/validation/drizzle-schema-helpers.js +5 -151
- package/dist/validation/index.d.ts +4 -3
- package/dist/validation/index.js +3 -2
- package/dist/validation/schemas.d.ts +17647 -4789
- package/dist/validation/schemas.js +328 -11
- package/drizzle/manage/0000_tearful_rhodey.sql +414 -0
- package/drizzle/manage/0001_broken_wendell_vaughn.sql +19 -0
- package/drizzle/manage/0002_bent_sunfire.sql +1 -0
- package/drizzle/manage/meta/0000_snapshot.json +2987 -0
- package/drizzle/manage/meta/0001_snapshot.json +3115 -0
- package/drizzle/manage/meta/0002_snapshot.json +3115 -0
- package/drizzle/manage/meta/_journal.json +27 -0
- package/drizzle/runtime/0008_silly_preak.sql +127 -0
- package/drizzle/runtime/0009_freezing_leo.sql +17 -0
- package/drizzle/runtime/meta/0008_snapshot.json +2263 -0
- package/drizzle/runtime/meta/0009_snapshot.json +2397 -0
- package/drizzle/{meta → runtime/meta}/_journal.json +14 -0
- package/package.json +48 -15
- package/dist/context/ContextFetcher.d.ts +0 -73
- package/dist/context/ContextFetcher.js +0 -291
- package/dist/context/ContextResolver.d.ts +0 -60
- package/dist/context/ContextResolver.js +0 -278
- package/dist/context/context.d.ts +0 -27
- package/dist/context/context.js +0 -128
- package/dist/context/contextCache.d.ts +0 -58
- package/dist/context/contextCache.js +0 -177
- package/dist/data-access/agentFull.d.ts +0 -33
- package/dist/data-access/projectFull.d.ts +0 -32
- package/dist/data-access/projects.d.ts +0 -71
- package/dist/data-access/tasks.d.ts +0 -45
- package/dist/data-access/users.d.ts +0 -19
- package/dist/db/client.d.ts +0 -20
- package/dist/db/client.js +0 -28
- package/dist/db/test-client.d.ts +0 -31
- package/dist/middleware/contextValidation.d.ts +0 -46
- package/dist/middleware/contextValidation.js +0 -280
- package/dist/middleware/index.d.ts +0 -2
- package/dist/middleware/index.js +0 -3
- package/dist/utils/execution.d.ts +0 -22
- package/dist/utils/execution.js +0 -25
- /package/drizzle/{0000_exotic_mysterio.sql → runtime/0000_exotic_mysterio.sql} +0 -0
- /package/drizzle/{0001_calm_sheva_callister.sql → runtime/0001_calm_sheva_callister.sql} +0 -0
- /package/drizzle/{0002_puzzling_goblin_queen.sql → runtime/0002_puzzling_goblin_queen.sql} +0 -0
- /package/drizzle/{0003_sweet_human_robot.sql → runtime/0003_sweet_human_robot.sql} +0 -0
- /package/drizzle/{0004_cuddly_shooting_star.sql → runtime/0004_cuddly_shooting_star.sql} +0 -0
- /package/drizzle/{0005_reflective_starfox.sql → runtime/0005_reflective_starfox.sql} +0 -0
- /package/drizzle/{0006_stale_thaddeus_ross.sql → runtime/0006_stale_thaddeus_ross.sql} +0 -0
- /package/drizzle/{0007_slim_karma.sql → runtime/0007_slim_karma.sql} +0 -0
- /package/drizzle/{meta → runtime/meta}/0000_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0001_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0003_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0005_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0006_snapshot.json +0 -0
- /package/drizzle/{meta → runtime/meta}/0007_snapshot.json +0 -0
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig } from "./contextConfigs.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./externalAgents.js";
|
|
11
|
-
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./functions.js";
|
|
12
|
-
import { addFunctionToolToSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, listFunctionTools, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./functionTools.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
1
|
+
import { AgentsManageDatabaseClient, AgentsManageDatabaseConfig, createAgentManageDatabaseConnection, createAgentsManageDatabaseClient, createAgentsManageDatabasePool } from "../db/manage/manage-client.js";
|
|
2
|
+
import { AgentsRunDatabaseClient, AgentsRunDatabaseConfig, createAgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
3
|
+
import { AgentLogger, createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentWithRelationIds, updateFullAgentServerSide } from "./manage/agentFull.js";
|
|
4
|
+
import { createAgent, deleteAgent, fetchComponentRelationships, getAgentById, getAgentSubAgentInfos, getAgentWithDefaultSubAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, listAgents, listAgentsPaginated, updateAgent, upsertAgent } from "./manage/agents.js";
|
|
5
|
+
import { agentHasArtifactComponents, associateArtifactComponentWithAgent, countArtifactComponents, countArtifactComponentsForAgent, createArtifactComponent, deleteAgentArtifactComponentRelationByAgent, deleteArtifactComponent, getAgentsUsingArtifactComponent, getArtifactComponentById, getArtifactComponentsForAgent, isArtifactComponentAssociatedWithAgent, listArtifactComponents, listArtifactComponentsPaginated, removeArtifactComponentFromAgent, updateArtifactComponent, upsertAgentArtifactComponentRelation, upsertArtifactComponent } from "./manage/artifactComponents.js";
|
|
6
|
+
import { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig } from "./manage/contextConfigs.js";
|
|
7
|
+
import { CredentialReferenceWithResources, countCredentialReferences, createCredentialReference, deleteCredentialReference, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getUserScopedCredentialReference, hasCredentialReference, listCredentialReferences, listCredentialReferencesPaginated, updateCredentialReference, upsertCredentialReference } from "./manage/credentialReferences.js";
|
|
8
|
+
import { associateDataComponentWithAgent, countDataComponents, createDataComponent, deleteAgentDataComponentRelationByAgent, deleteDataComponent, getAgentsUsingDataComponent, getDataComponent, getDataComponentsForAgent, isDataComponentAssociatedWithAgent, listDataComponents, listDataComponentsPaginated, removeDataComponentFromAgent, updateDataComponent, upsertAgentDataComponentRelation, upsertDataComponent } from "./manage/dataComponents.js";
|
|
9
|
+
import { createDataset, createDatasetItem, createDatasetItems, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, getDatasetById, getDatasetItemById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, linkDatasetRunToEvaluationJobConfig, listDatasetItems, listDatasetRunConfigs, listDatasets, listEvaluationJobConfigs, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationSuiteConfigs, listEvaluators, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator } from "./manage/evalConfig.js";
|
|
10
|
+
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./manage/externalAgents.js";
|
|
11
|
+
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./manage/functions.js";
|
|
12
|
+
import { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./manage/functionTools.js";
|
|
13
|
+
import { ProjectLogger, createFullProjectServerSide, deleteFullProject, getFullProject, getFullProjectWithRelationIds, updateFullProjectServerSide } from "./manage/projectFull.js";
|
|
14
|
+
import { CreateProjectWithBranchParams, CreateProjectWithBranchResult, DeleteProjectWithBranchParams, ListProjectsWithMetadataResult, ProjectConfigMetadata, ProjectWithMetadata, createProjectMetadataAndBranch, deleteProjectWithBranch, getProjectMainBranchName, getProjectWithBranchInfo, getProjectWithMetadata, listProjectsWithMetadataPaginated } from "./manage/projectLifecycle.js";
|
|
15
|
+
import { countProjects, createProject, deleteProject, getProject, getProjectResourceCounts, listProjects, listProjectsPaginated, projectExists, projectExistsInTable, projectHasResources, updateProject } from "./manage/projects.js";
|
|
16
|
+
import { createSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, getExternalAgentsForSubAgent, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentsForExternalAgent, listSubAgentExternalAgentRelations, updateSubAgentExternalAgentRelation, upsertSubAgentExternalAgentRelation } from "./manage/subAgentExternalAgentRelations.js";
|
|
17
|
+
import { createAgentToolRelation, createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteSubAgentRelation, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsForTool, getRelatedAgentsForAgent, getSubAgentRelationsByTarget, getToolsForAgent, listAgentRelations, listAgentToolRelations, updateAgentRelation, updateAgentToolRelation, upsertSubAgentRelation, validateSubAgent } from "./manage/subAgentRelations.js";
|
|
18
|
+
import { SubAgentIsDefaultError, createSubAgent, deleteSubAgent, getSubAgentById, getSubAgentsByIds, listSubAgents, listSubAgentsPaginated, updateSubAgent, upsertSubAgent } from "./manage/subAgents.js";
|
|
19
|
+
import { createSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsForTeamAgent, getTeamAgentsForSubAgent, listSubAgentTeamAgentRelations, updateSubAgentTeamAgentRelation, upsertSubAgentTeamAgentRelation } from "./manage/subAgentTeamAgentRelations.js";
|
|
20
|
+
import { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool } from "./manage/tools.js";
|
|
21
|
+
import { createTrigger, deleteTrigger, getTriggerById, listTriggers, listTriggersPaginated, updateTrigger, upsertTrigger } from "./manage/triggers.js";
|
|
22
|
+
import { countApiKeys, createApiKey, deleteApiKey, generateAndCreateApiKey, getApiKeyById, getApiKeyByPublicId, hasApiKey, listApiKeys, listApiKeysPaginated, updateApiKey, updateApiKeyLastUsed, validateAndGetApiKey } from "./runtime/apiKeys.js";
|
|
23
|
+
import { CascadeDeleteResult, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent } from "./runtime/cascade-delete.js";
|
|
24
|
+
import { cleanupTenantCache, clearContextConfigCache, clearConversationCache, getCacheEntry, getContextConfigCacheEntries, getConversationCacheEntries, invalidateHeadersCache, invalidateInvocationDefinitionsCache, setCacheEntry } from "./runtime/contextCache.js";
|
|
25
|
+
import { createConversation, createOrGetConversation, deleteConversation, getActiveAgentForConversation, getConversation, getConversationHistory, listConversations, setActiveAgentForConversation, setActiveAgentForThread, updateConversation, updateConversationActiveSubAgent } from "./runtime/conversations.js";
|
|
26
|
+
import { createDatasetRun, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationResult, createEvaluationResults, createEvaluationRun, deleteDatasetRun, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, filterConversationsForJob, getDatasetRunById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, listDatasetRuns, listDatasetRunsByConfig, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRuns, listEvaluationRunsByJobConfigId, updateEvaluationResult, updateEvaluationRun } from "./runtime/evalRuns.js";
|
|
27
|
+
import { addLedgerArtifacts, countLedgerArtifactsByTask, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, getLedgerArtifacts, getLedgerArtifactsByContext, upsertLedgerArtifact } from "./runtime/ledgerArtifacts.js";
|
|
28
|
+
import { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage } from "./runtime/messages.js";
|
|
29
|
+
import { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations, upsertOrganization } from "./runtime/organizations.js";
|
|
30
|
+
import { ProjectMetadataPaginatedResult, countProjectsInRuntime, createProjectMetadata, deleteProjectMetadata, getProjectMetadata, listProjectsMetadata, listProjectsMetadataPaginated, projectsMetadataExists } from "./runtime/projects.js";
|
|
31
|
+
import { createTask, getTask, listTaskIdsByContextId, updateTask } from "./runtime/tasks.js";
|
|
32
|
+
import { createTriggerInvocation, getTriggerInvocationById, listTriggerInvocationsPaginated, updateTriggerInvocationStatus } from "./runtime/triggerInvocations.js";
|
|
33
|
+
import { getUserByEmail, getUserById } from "./runtime/users.js";
|
|
25
34
|
import { createValidatedDataAccess, validateProjectExists, withProjectValidation } from "./validation.js";
|
|
26
|
-
|
|
27
|
-
export { AgentLogger, CredentialReferenceWithResources, DatabaseClient, DatabaseConfig, ProjectLogger, SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getUserByEmail, getUserById, getUserOrganizations, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listFunctionsPaginated, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAndGetApiKey, validateProjectExists, validateSubAgent, withProjectValidation };
|
|
35
|
+
export { AgentLogger, AgentsManageDatabaseClient, AgentsManageDatabaseConfig, AgentsRunDatabaseClient, AgentsRunDatabaseConfig, CascadeDeleteResult, CreateProjectWithBranchParams, CreateProjectWithBranchResult, CredentialReferenceWithResources, DeleteProjectWithBranchParams, ListProjectsWithMetadataResult, ProjectConfigMetadata, ProjectLogger, ProjectMetadataPaginatedResult, ProjectWithMetadata, SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, countProjectsInRuntime, createAgent, createAgentManageDatabaseConnection, createAgentToolRelation, createAgentsManageDatabaseClient, createAgentsManageDatabasePool, createAgentsRunDatabaseClient, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDataset, createDatasetItem, createDatasetItems, createDatasetRun, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationResult, createEvaluationResults, createEvaluationRun, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRun, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteProjectMetadata, deleteProjectWithBranch, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getDatasetById, getDatasetItemById, getDatasetRunById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, getFullAgentWithRelationIds, getFullProject, getFullProjectWithRelationIds, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolById, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectMainBranchName, getProjectMetadata, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizations, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, linkDatasetRunToEvaluationJobConfig, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listDatasetItems, listDatasetRunConfigs, listDatasetRuns, listDatasetRunsByConfig, listDatasets, listEvaluationJobConfigs, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationRuns, listEvaluationRunsByJobConfigId, listEvaluationSuiteConfigs, listEvaluators, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listFunctionsPaginated, listMessages, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, validateAndGetApiKey, validateProjectExists, validateSubAgent, withProjectValidation };
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
1
|
+
import { createAgentManageDatabaseConnection, createAgentsManageDatabaseClient, createAgentsManageDatabasePool } from "../db/manage/manage-client.js";
|
|
2
|
+
import { createAgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
3
|
+
import { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig } from "./manage/contextConfigs.js";
|
|
4
|
+
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./manage/externalAgents.js";
|
|
5
|
+
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./manage/functions.js";
|
|
6
|
+
import { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./manage/functionTools.js";
|
|
7
|
+
import { createSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, getExternalAgentsForSubAgent, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentsForExternalAgent, listSubAgentExternalAgentRelations, updateSubAgentExternalAgentRelation, upsertSubAgentExternalAgentRelation } from "./manage/subAgentExternalAgentRelations.js";
|
|
8
|
+
import { createAgentToolRelation, createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteSubAgentRelation, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsForTool, getRelatedAgentsForAgent, getSubAgentRelationsByTarget, getToolsForAgent, listAgentRelations, listAgentToolRelations, updateAgentRelation, updateAgentToolRelation, upsertSubAgentRelation, validateSubAgent } from "./manage/subAgentRelations.js";
|
|
9
|
+
import { SubAgentIsDefaultError, createSubAgent, deleteSubAgent, getSubAgentById, getSubAgentsByIds, listSubAgents, listSubAgentsPaginated, updateSubAgent, upsertSubAgent } from "./manage/subAgents.js";
|
|
10
|
+
import { createSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsForTeamAgent, getTeamAgentsForSubAgent, listSubAgentTeamAgentRelations, updateSubAgentTeamAgentRelation, upsertSubAgentTeamAgentRelation } from "./manage/subAgentTeamAgentRelations.js";
|
|
11
|
+
import { countCredentialReferences, createCredentialReference, deleteCredentialReference, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getUserScopedCredentialReference, hasCredentialReference, listCredentialReferences, listCredentialReferencesPaginated, updateCredentialReference, upsertCredentialReference } from "./manage/credentialReferences.js";
|
|
12
|
+
import { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool } from "./manage/tools.js";
|
|
13
|
+
import { createTrigger, deleteTrigger, getTriggerById, listTriggers, listTriggersPaginated, updateTrigger, upsertTrigger } from "./manage/triggers.js";
|
|
14
|
+
import { createAgent, deleteAgent, fetchComponentRelationships, getAgentById, getAgentSubAgentInfos, getAgentWithDefaultSubAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, listAgents, listAgentsPaginated, updateAgent, upsertAgent } from "./manage/agents.js";
|
|
15
|
+
import { agentHasArtifactComponents, associateArtifactComponentWithAgent, countArtifactComponents, countArtifactComponentsForAgent, createArtifactComponent, deleteAgentArtifactComponentRelationByAgent, deleteArtifactComponent, getAgentsUsingArtifactComponent, getArtifactComponentById, getArtifactComponentsForAgent, isArtifactComponentAssociatedWithAgent, listArtifactComponents, listArtifactComponentsPaginated, removeArtifactComponentFromAgent, updateArtifactComponent, upsertAgentArtifactComponentRelation, upsertArtifactComponent } from "./manage/artifactComponents.js";
|
|
16
|
+
import { associateDataComponentWithAgent, countDataComponents, createDataComponent, deleteAgentDataComponentRelationByAgent, deleteDataComponent, getAgentsUsingDataComponent, getDataComponent, getDataComponentsForAgent, isDataComponentAssociatedWithAgent, listDataComponents, listDataComponentsPaginated, removeDataComponentFromAgent, updateDataComponent, upsertAgentDataComponentRelation, upsertDataComponent } from "./manage/dataComponents.js";
|
|
17
|
+
import { createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentWithRelationIds, updateFullAgentServerSide } from "./manage/agentFull.js";
|
|
18
|
+
import { createDataset, createDatasetItem, createDatasetItems, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, getDatasetById, getDatasetItemById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, linkDatasetRunToEvaluationJobConfig, listDatasetItems, listDatasetRunConfigs, listDatasets, listEvaluationJobConfigs, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationSuiteConfigs, listEvaluators, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator } from "./manage/evalConfig.js";
|
|
19
|
+
import { countProjects, createProject, deleteProject, getProject, getProjectResourceCounts, listProjects, listProjectsPaginated, projectExists, projectExistsInTable, projectHasResources, updateProject } from "./manage/projects.js";
|
|
20
|
+
import { createFullProjectServerSide, deleteFullProject, getFullProject, getFullProjectWithRelationIds, updateFullProjectServerSide } from "./manage/projectFull.js";
|
|
21
|
+
import { countProjectsInRuntime, createProjectMetadata, deleteProjectMetadata, getProjectMetadata, listProjectsMetadata, listProjectsMetadataPaginated, projectsMetadataExists } from "./runtime/projects.js";
|
|
22
|
+
import { createProjectMetadataAndBranch, deleteProjectWithBranch, getProjectMainBranchName, getProjectWithBranchInfo, getProjectWithMetadata, listProjectsWithMetadataPaginated } from "./manage/projectLifecycle.js";
|
|
23
|
+
import { countApiKeys, createApiKey, deleteApiKey, generateAndCreateApiKey, getApiKeyById, getApiKeyByPublicId, hasApiKey, listApiKeys, listApiKeysPaginated, updateApiKey, updateApiKeyLastUsed, validateAndGetApiKey } from "./runtime/apiKeys.js";
|
|
24
|
+
import { cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent } from "./runtime/cascade-delete.js";
|
|
25
|
+
import { cleanupTenantCache, clearContextConfigCache, clearConversationCache, getCacheEntry, getContextConfigCacheEntries, getConversationCacheEntries, invalidateHeadersCache, invalidateInvocationDefinitionsCache, setCacheEntry } from "./runtime/contextCache.js";
|
|
26
|
+
import { createConversation, createOrGetConversation, deleteConversation, getActiveAgentForConversation, getConversation, getConversationHistory, listConversations, setActiveAgentForConversation, setActiveAgentForThread, updateConversation, updateConversationActiveSubAgent } from "./runtime/conversations.js";
|
|
27
|
+
import { createDatasetRun, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationResult, createEvaluationResults, createEvaluationRun, deleteDatasetRun, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, filterConversationsForJob, getDatasetRunById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, listDatasetRuns, listDatasetRunsByConfig, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRuns, listEvaluationRunsByJobConfigId, updateEvaluationResult, updateEvaluationRun } from "./runtime/evalRuns.js";
|
|
28
|
+
import { addLedgerArtifacts, countLedgerArtifactsByTask, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, getLedgerArtifacts, getLedgerArtifactsByContext, upsertLedgerArtifact } from "./runtime/ledgerArtifacts.js";
|
|
29
|
+
import { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage } from "./runtime/messages.js";
|
|
30
|
+
import { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizations, upsertOrganization } from "./runtime/organizations.js";
|
|
31
|
+
import { createTask, getTask, listTaskIdsByContextId, updateTask } from "./runtime/tasks.js";
|
|
32
|
+
import { createTriggerInvocation, getTriggerInvocationById, listTriggerInvocationsPaginated, updateTriggerInvocationStatus } from "./runtime/triggerInvocations.js";
|
|
33
|
+
import { getUserByEmail, getUserById } from "./runtime/users.js";
|
|
26
34
|
import { createValidatedDataAccess, validateProjectExists, withProjectValidation } from "./validation.js";
|
|
27
35
|
|
|
28
|
-
export { SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent,
|
|
36
|
+
export { SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, countProjectsInRuntime, createAgent, createAgentManageDatabaseConnection, createAgentToolRelation, createAgentsManageDatabaseClient, createAgentsManageDatabasePool, createAgentsRunDatabaseClient, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDataset, createDatasetItem, createDatasetItems, createDatasetRun, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationResult, createEvaluationResults, createEvaluationRun, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteDataset, deleteDatasetItem, deleteDatasetItemsByDataset, deleteDatasetRun, deleteDatasetRunConfig, deleteDatasetRunConfigAgentRelation, deleteDatasetRunConversationRelation, deleteDatasetRunConversationRelationsByRun, deleteEvaluationJobConfig, deleteEvaluationJobConfigEvaluatorRelation, deleteEvaluationJobConfigEvaluatorRelationsByEvaluator, deleteEvaluationResult, deleteEvaluationResultsByRun, deleteEvaluationRun, deleteEvaluationRunConfig, deleteEvaluationRunConfigEvaluationSuiteConfigRelation, deleteEvaluationSuiteConfig, deleteEvaluationSuiteConfigEvaluatorRelation, deleteEvaluationSuiteConfigEvaluatorRelationsByEvaluator, deleteEvaluator, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteProjectMetadata, deleteProjectWithBranch, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getDatasetById, getDatasetItemById, getDatasetRunById, getDatasetRunConfigAgentRelations, getDatasetRunConfigById, getDatasetRunConversationRelationByConversation, getDatasetRunConversationRelations, getEvaluationJobConfigById, getEvaluationJobConfigEvaluatorRelations, getEvaluationResultById, getEvaluationRunById, getEvaluationRunByJobConfigId, getEvaluationRunConfigById, getEvaluationRunConfigEvaluationSuiteConfigRelations, getEvaluationSuiteConfigById, getEvaluationSuiteConfigEvaluatorRelations, getEvaluatorById, getEvaluatorsByIds, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, getFullAgentWithRelationIds, getFullProject, getFullProjectWithRelationIds, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolById, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectMainBranchName, getProjectMetadata, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizations, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, linkDatasetRunToEvaluationJobConfig, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listDatasetItems, listDatasetRunConfigs, listDatasetRuns, listDatasetRunsByConfig, listDatasets, listEvaluationJobConfigs, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationRuns, listEvaluationRunsByJobConfigId, listEvaluationSuiteConfigs, listEvaluators, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listFunctionsPaginated, listMessages, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, validateAndGetApiKey, validateProjectExists, validateSubAgent, withProjectValidation };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AgentScopeConfig, ProjectScopeConfig } from "../../types/utility.js";
|
|
2
|
+
import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
|
|
3
|
+
import { FullAgentDefinition, FullAgentSelectWithRelationIds } from "../../types/entities.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-access/manage/agentFull.d.ts
|
|
6
|
+
interface AgentLogger {
|
|
7
|
+
info(obj: Record<string, any>, msg?: string): void;
|
|
8
|
+
error(obj: Record<string, any>, msg?: string): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Server-side implementation of createFullAgent that performs actual database operations.
|
|
12
|
+
* This function creates a complete agent with all agents, tools, and relationships.
|
|
13
|
+
*/
|
|
14
|
+
declare const createFullAgentServerSide: (db: AgentsManageDatabaseClient, logger?: AgentLogger) => (scopes: ProjectScopeConfig, agentData: FullAgentDefinition) => Promise<FullAgentDefinition>;
|
|
15
|
+
/**
|
|
16
|
+
* Server-side implementation of updateFullAgent that performs actual database operations.
|
|
17
|
+
* This function updates a complete agent with all agents, tools, and relationships.
|
|
18
|
+
*/
|
|
19
|
+
declare const updateFullAgentServerSide: (db: AgentsManageDatabaseClient, logger?: AgentLogger) => (scopes: ProjectScopeConfig, agentData: FullAgentDefinition) => Promise<FullAgentDefinition>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a complete agent definition by ID
|
|
22
|
+
*/
|
|
23
|
+
declare const getFullAgent: (db: AgentsManageDatabaseClient, logger?: AgentLogger) => (params: {
|
|
24
|
+
scopes: AgentScopeConfig;
|
|
25
|
+
}) => Promise<FullAgentDefinition | null>;
|
|
26
|
+
declare const getFullAgentWithRelationIds: (db: AgentsManageDatabaseClient, logger?: AgentLogger) => (params: {
|
|
27
|
+
scopes: AgentScopeConfig;
|
|
28
|
+
}) => Promise<FullAgentSelectWithRelationIds | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a complete agent and cascade to all related entities
|
|
31
|
+
*/
|
|
32
|
+
declare const deleteFullAgent: (db: AgentsManageDatabaseClient, logger?: AgentLogger) => (params: {
|
|
33
|
+
scopes: AgentScopeConfig;
|
|
34
|
+
}) => Promise<boolean>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { AgentLogger, createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentWithRelationIds, updateFullAgentServerSide };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { projects, subAgentToolRelations, subAgents } from "
|
|
2
|
-
import { generateId } from "
|
|
3
|
-
import { validateAgentStructure, validateAndTypeAgentData } from "
|
|
1
|
+
import { projects, subAgentFunctionToolRelations, subAgentToolRelations, subAgents } from "../../db/manage/manage-schema.js";
|
|
2
|
+
import { generateId } from "../../utils/conversations.js";
|
|
3
|
+
import { validateAgentStructure, validateAndTypeAgentData } from "../../validation/agentFull.js";
|
|
4
4
|
import { upsertContextConfig } from "./contextConfigs.js";
|
|
5
5
|
import { upsertFunction } from "./functions.js";
|
|
6
|
-
import { upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./functionTools.js";
|
|
6
|
+
import { deleteFunctionTool, listFunctionTools, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./functionTools.js";
|
|
7
7
|
import { deleteSubAgentExternalAgentRelation, getSubAgentExternalAgentRelationsByAgent, upsertSubAgentExternalAgentRelation } from "./subAgentExternalAgentRelations.js";
|
|
8
8
|
import { createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRelationByAgent, upsertSubAgentRelation } from "./subAgentRelations.js";
|
|
9
9
|
import { deleteSubAgent, listSubAgents, upsertSubAgent } from "./subAgents.js";
|
|
10
10
|
import { deleteSubAgentTeamAgentRelation, getSubAgentTeamAgentRelationsByAgent, upsertSubAgentTeamAgentRelation } from "./subAgentTeamAgentRelations.js";
|
|
11
11
|
import { upsertSubAgentToolRelation } from "./tools.js";
|
|
12
|
-
import {
|
|
12
|
+
import { deleteTrigger, listTriggers, upsertTrigger } from "./triggers.js";
|
|
13
|
+
import { deleteAgent, getAgentById, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, updateAgent, upsertAgent } from "./agents.js";
|
|
13
14
|
import { associateArtifactComponentWithAgent, deleteAgentArtifactComponentRelationByAgent, upsertAgentArtifactComponentRelation } from "./artifactComponents.js";
|
|
14
15
|
import { associateDataComponentWithAgent, deleteAgentDataComponentRelationByAgent, upsertAgentDataComponentRelation } from "./dataComponents.js";
|
|
15
16
|
import { and, eq, inArray, not } from "drizzle-orm";
|
|
16
17
|
|
|
17
|
-
//#region src/data-access/agentFull.ts
|
|
18
|
+
//#region src/data-access/manage/agentFull.ts
|
|
18
19
|
const defaultLogger = {
|
|
19
20
|
info: () => {},
|
|
20
21
|
error: () => {}
|
|
@@ -246,6 +247,50 @@ const createFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
246
247
|
functionToolCount: Object.keys(typed.functionTools).length
|
|
247
248
|
}, "All function tools created successfully");
|
|
248
249
|
}
|
|
250
|
+
if (typed.triggers && Object.keys(typed.triggers).length > 0) {
|
|
251
|
+
logger.info({
|
|
252
|
+
agentId: finalAgentId,
|
|
253
|
+
triggerCount: Object.keys(typed.triggers).length
|
|
254
|
+
}, "Creating triggers for agent");
|
|
255
|
+
const triggerPromises = Object.entries(typed.triggers).map(async ([triggerId, triggerData]) => {
|
|
256
|
+
try {
|
|
257
|
+
logger.info({
|
|
258
|
+
agentId: finalAgentId,
|
|
259
|
+
triggerId
|
|
260
|
+
}, "Creating trigger in agent");
|
|
261
|
+
await upsertTrigger(db)({
|
|
262
|
+
scopes: {
|
|
263
|
+
tenantId,
|
|
264
|
+
projectId,
|
|
265
|
+
agentId: finalAgentId
|
|
266
|
+
},
|
|
267
|
+
data: {
|
|
268
|
+
...triggerData,
|
|
269
|
+
id: triggerId,
|
|
270
|
+
tenantId,
|
|
271
|
+
projectId,
|
|
272
|
+
agentId: finalAgentId
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
logger.info({
|
|
276
|
+
agentId: finalAgentId,
|
|
277
|
+
triggerId
|
|
278
|
+
}, "Trigger created successfully");
|
|
279
|
+
} catch (error) {
|
|
280
|
+
logger.error({
|
|
281
|
+
agentId: finalAgentId,
|
|
282
|
+
triggerId,
|
|
283
|
+
error
|
|
284
|
+
}, "Failed to create trigger in agent");
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
await Promise.all(triggerPromises);
|
|
289
|
+
logger.info({
|
|
290
|
+
agentId: finalAgentId,
|
|
291
|
+
triggerCount: Object.keys(typed.triggers).length
|
|
292
|
+
}, "All triggers created successfully");
|
|
293
|
+
}
|
|
249
294
|
const subAgentPromises = Object.entries(typed.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
250
295
|
const subAgent = agentData$1;
|
|
251
296
|
try {
|
|
@@ -735,6 +780,106 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
735
780
|
functionToolCount: Object.keys(typedAgentDefinition.functionTools).length
|
|
736
781
|
}, "All function tools updated successfully");
|
|
737
782
|
}
|
|
783
|
+
const incomingFunctionToolIds = new Set(typedAgentDefinition.functionTools ? Object.keys(typedAgentDefinition.functionTools) : []);
|
|
784
|
+
const existingFunctionTools = await listFunctionTools(db)({
|
|
785
|
+
scopes: {
|
|
786
|
+
tenantId,
|
|
787
|
+
projectId,
|
|
788
|
+
agentId: finalAgentId
|
|
789
|
+
},
|
|
790
|
+
pagination: {
|
|
791
|
+
page: 1,
|
|
792
|
+
limit: 1e3
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
let deletedFunctionToolCount = 0;
|
|
796
|
+
for (const functionTool of existingFunctionTools.data) if (!incomingFunctionToolIds.has(functionTool.id)) try {
|
|
797
|
+
await deleteFunctionTool(db)({
|
|
798
|
+
scopes: {
|
|
799
|
+
tenantId,
|
|
800
|
+
projectId,
|
|
801
|
+
agentId: finalAgentId
|
|
802
|
+
},
|
|
803
|
+
functionToolId: functionTool.id
|
|
804
|
+
});
|
|
805
|
+
deletedFunctionToolCount++;
|
|
806
|
+
logger.info({ functionToolId: functionTool.id }, "Deleted orphaned function tool");
|
|
807
|
+
} catch (error) {
|
|
808
|
+
logger.error({
|
|
809
|
+
functionToolId: functionTool.id,
|
|
810
|
+
error
|
|
811
|
+
}, "Failed to delete orphaned function tool");
|
|
812
|
+
}
|
|
813
|
+
if (deletedFunctionToolCount > 0) logger.info({ deletedFunctionToolCount }, "Deleted orphaned function tools from agent");
|
|
814
|
+
if (typedAgentDefinition.triggers && Object.keys(typedAgentDefinition.triggers).length > 0) {
|
|
815
|
+
logger.info({
|
|
816
|
+
agentId: finalAgentId,
|
|
817
|
+
triggerCount: Object.keys(typedAgentDefinition.triggers).length
|
|
818
|
+
}, "Updating triggers for agent");
|
|
819
|
+
const triggerPromises = Object.entries(typedAgentDefinition.triggers).map(async ([triggerId, triggerData]) => {
|
|
820
|
+
try {
|
|
821
|
+
logger.info({
|
|
822
|
+
agentId: finalAgentId,
|
|
823
|
+
triggerId
|
|
824
|
+
}, "Updating trigger in agent");
|
|
825
|
+
await upsertTrigger(db)({
|
|
826
|
+
scopes: {
|
|
827
|
+
tenantId,
|
|
828
|
+
projectId,
|
|
829
|
+
agentId: finalAgentId
|
|
830
|
+
},
|
|
831
|
+
data: {
|
|
832
|
+
...triggerData,
|
|
833
|
+
id: triggerId,
|
|
834
|
+
tenantId,
|
|
835
|
+
projectId,
|
|
836
|
+
agentId: finalAgentId
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
logger.info({
|
|
840
|
+
agentId: finalAgentId,
|
|
841
|
+
triggerId
|
|
842
|
+
}, "Trigger updated successfully");
|
|
843
|
+
} catch (error) {
|
|
844
|
+
logger.error({
|
|
845
|
+
agentId: finalAgentId,
|
|
846
|
+
triggerId,
|
|
847
|
+
error
|
|
848
|
+
}, "Failed to update trigger in agent");
|
|
849
|
+
throw error;
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
await Promise.all(triggerPromises);
|
|
853
|
+
logger.info({
|
|
854
|
+
agentId: finalAgentId,
|
|
855
|
+
triggerCount: Object.keys(typedAgentDefinition.triggers).length
|
|
856
|
+
}, "All triggers updated successfully");
|
|
857
|
+
}
|
|
858
|
+
const incomingTriggerIds = new Set(typedAgentDefinition.triggers ? Object.keys(typedAgentDefinition.triggers) : []);
|
|
859
|
+
const existingTriggers = await listTriggers(db)({ scopes: {
|
|
860
|
+
tenantId,
|
|
861
|
+
projectId,
|
|
862
|
+
agentId: finalAgentId
|
|
863
|
+
} });
|
|
864
|
+
let deletedTriggerCount = 0;
|
|
865
|
+
for (const trigger of existingTriggers) if (!incomingTriggerIds.has(trigger.id)) try {
|
|
866
|
+
await deleteTrigger(db)({
|
|
867
|
+
scopes: {
|
|
868
|
+
tenantId,
|
|
869
|
+
projectId,
|
|
870
|
+
agentId: finalAgentId
|
|
871
|
+
},
|
|
872
|
+
triggerId: trigger.id
|
|
873
|
+
});
|
|
874
|
+
deletedTriggerCount++;
|
|
875
|
+
logger.info({ triggerId: trigger.id }, "Deleted orphaned trigger");
|
|
876
|
+
} catch (error) {
|
|
877
|
+
logger.error({
|
|
878
|
+
triggerId: trigger.id,
|
|
879
|
+
error
|
|
880
|
+
}, "Failed to delete orphaned trigger");
|
|
881
|
+
}
|
|
882
|
+
if (deletedTriggerCount > 0) logger.info({ deletedTriggerCount }, "Deleted orphaned triggers from agent");
|
|
738
883
|
const subAgentPromises = Object.entries(typedAgentDefinition.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
739
884
|
const subAgent = agentData$1;
|
|
740
885
|
let existingSubAgent = null;
|
|
@@ -910,6 +1055,24 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
910
1055
|
error
|
|
911
1056
|
}, "Failed to delete orphaned agent-tool relations");
|
|
912
1057
|
}
|
|
1058
|
+
const incomingFunctionToolRelationIds = /* @__PURE__ */ new Set();
|
|
1059
|
+
for (const [_subAgentId, agentData$1] of Object.entries(typedAgentDefinition.subAgents)) if (agentData$1.canUse && Array.isArray(agentData$1.canUse)) {
|
|
1060
|
+
for (const canUseItem of agentData$1.canUse) if (typedAgentDefinition.functionTools && canUseItem.toolId in typedAgentDefinition.functionTools && canUseItem.agentToolRelationId) incomingFunctionToolRelationIds.add(canUseItem.agentToolRelationId);
|
|
1061
|
+
}
|
|
1062
|
+
for (const subAgentId of Object.keys(typedAgentDefinition.subAgents)) try {
|
|
1063
|
+
let deletedFunctionToolRelationCount = 0;
|
|
1064
|
+
if (incomingFunctionToolRelationIds.size === 0) deletedFunctionToolRelationCount = (await db.delete(subAgentFunctionToolRelations).where(and(eq(subAgentFunctionToolRelations.tenantId, tenantId), eq(subAgentFunctionToolRelations.projectId, projectId), eq(subAgentFunctionToolRelations.agentId, finalAgentId), eq(subAgentFunctionToolRelations.subAgentId, subAgentId))).returning()).length;
|
|
1065
|
+
else deletedFunctionToolRelationCount = (await db.delete(subAgentFunctionToolRelations).where(and(eq(subAgentFunctionToolRelations.tenantId, tenantId), eq(subAgentFunctionToolRelations.projectId, projectId), eq(subAgentFunctionToolRelations.agentId, finalAgentId), eq(subAgentFunctionToolRelations.subAgentId, subAgentId), not(inArray(subAgentFunctionToolRelations.id, Array.from(incomingFunctionToolRelationIds))))).returning()).length;
|
|
1066
|
+
if (deletedFunctionToolRelationCount > 0) logger.info({
|
|
1067
|
+
subAgentId,
|
|
1068
|
+
deletedCount: deletedFunctionToolRelationCount
|
|
1069
|
+
}, "Deleted orphaned sub-agent-function tool relations");
|
|
1070
|
+
} catch (error) {
|
|
1071
|
+
logger.error({
|
|
1072
|
+
subAgentId,
|
|
1073
|
+
error
|
|
1074
|
+
}, "Failed to delete orphaned sub-agent-function tool relations");
|
|
1075
|
+
}
|
|
913
1076
|
const subAgentToolPromises = [];
|
|
914
1077
|
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) subAgentToolPromises.push((async () => {
|
|
915
1078
|
try {
|
|
@@ -1211,6 +1374,41 @@ const getFullAgent = (db, logger = defaultLogger) => async (params) => {
|
|
|
1211
1374
|
throw error;
|
|
1212
1375
|
}
|
|
1213
1376
|
};
|
|
1377
|
+
const getFullAgentWithRelationIds = (db, logger = defaultLogger) => async (params) => {
|
|
1378
|
+
const { scopes } = params;
|
|
1379
|
+
const { tenantId, projectId } = scopes;
|
|
1380
|
+
logger.info({
|
|
1381
|
+
tenantId,
|
|
1382
|
+
agentId: scopes.agentId
|
|
1383
|
+
}, "Retrieving full agent definition with relation ids");
|
|
1384
|
+
try {
|
|
1385
|
+
const agent = await getFullAgentDefinitionWithRelationIds(db)({ scopes: {
|
|
1386
|
+
tenantId,
|
|
1387
|
+
projectId,
|
|
1388
|
+
agentId: scopes.agentId
|
|
1389
|
+
} });
|
|
1390
|
+
if (!agent) {
|
|
1391
|
+
logger.info({
|
|
1392
|
+
tenantId,
|
|
1393
|
+
agentId: scopes.agentId
|
|
1394
|
+
}, "Agent not found");
|
|
1395
|
+
return null;
|
|
1396
|
+
}
|
|
1397
|
+
logger.info({
|
|
1398
|
+
tenantId,
|
|
1399
|
+
agentId: scopes.agentId,
|
|
1400
|
+
agentCount: Object.keys(agent.subAgents).length
|
|
1401
|
+
}, "Full agent with relation ids retrieved successfully");
|
|
1402
|
+
return agent;
|
|
1403
|
+
} catch (error) {
|
|
1404
|
+
logger.error({
|
|
1405
|
+
tenantId,
|
|
1406
|
+
agentId: scopes.agentId,
|
|
1407
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
1408
|
+
}, "Failed to retrieve full agent with relation ids");
|
|
1409
|
+
throw error;
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1214
1412
|
/**
|
|
1215
1413
|
* Delete a complete agent and cascade to all related entities
|
|
1216
1414
|
*/
|
|
@@ -1281,4 +1479,4 @@ const deleteFullAgent = (db, logger = defaultLogger) => async (params) => {
|
|
|
1281
1479
|
};
|
|
1282
1480
|
|
|
1283
1481
|
//#endregion
|
|
1284
|
-
export { createFullAgentServerSide, deleteFullAgent, getFullAgent, updateFullAgentServerSide };
|
|
1482
|
+
export { createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentWithRelationIds, updateFullAgentServerSide };
|