@inkeep/agents-core 0.0.0-dev-20260212154015 → 0.0.0-dev-20260212170401
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth.d.ts +18 -18
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +10 -5
- package/dist/client-exports.js +2 -2
- package/dist/data-access/index.d.ts +4 -1
- package/dist/data-access/index.js +4 -1
- package/dist/data-access/manage/agentFull.js +116 -0
- package/dist/data-access/manage/agents.d.ts +42 -42
- package/dist/data-access/manage/agents.js +28 -0
- package/dist/data-access/manage/artifactComponents.d.ts +12 -12
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/scheduledTriggers.d.ts +80 -0
- package/dist/data-access/manage/scheduledTriggers.js +76 -0
- package/dist/data-access/manage/scheduledWorkflows.d.ts +29 -0
- package/dist/data-access/manage/scheduledWorkflows.js +32 -0
- package/dist/data-access/manage/skills.d.ts +13 -13
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +18 -18
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/conversations.d.ts +31 -31
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +233 -0
- package/dist/data-access/runtime/scheduledTriggerInvocations.js +226 -0
- package/dist/data-access/runtime/tasks.d.ts +8 -8
- package/dist/db/manage/manage-schema.d.ts +534 -2
- package/dist/db/manage/manage-schema.js +128 -2
- package/dist/db/runtime/runtime-schema.d.ts +549 -281
- package/dist/db/runtime/runtime-schema.js +32 -2
- package/dist/index.d.ts +7 -4
- package/dist/index.js +7 -4
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +4232 -1605
- package/dist/validation/schemas.js +96 -3
- package/drizzle/manage/0009_chilly_old_lace.sql +39 -0
- package/drizzle/manage/meta/0009_snapshot.json +3670 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0013_huge_white_queen.sql +19 -0
- package/drizzle/runtime/meta/0013_snapshot.json +3746 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { countContextConfigs, createContextConfig, deleteContextConfig, getConte
|
|
|
6
6
|
import { countExternalAgents, createExternalAgent, deleteExternalAgent, externalAgentExists, externalAgentUrlExists, getExternalAgent, getExternalAgentByUrl, listExternalAgents, listExternalAgentsPaginated, updateExternalAgent, upsertExternalAgent } from "./manage/externalAgents.js";
|
|
7
7
|
import { deleteFunction, getFunction, listFunctions, listFunctionsPaginated, upsertFunction } from "./manage/functions.js";
|
|
8
8
|
import { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./manage/functionTools.js";
|
|
9
|
+
import { createScheduledTrigger, deleteScheduledTrigger, getScheduledTriggerById, listScheduledTriggers, listScheduledTriggersPaginated, updateScheduledTrigger, upsertScheduledTrigger } from "./manage/scheduledTriggers.js";
|
|
9
10
|
import { createSkill, deleteSkill, deleteSubAgentSkill, getSkillById, getSkillsForSubAgents, listSkills, updateSkill, upsertSkill, upsertSubAgentSkill } from "./manage/skills.js";
|
|
10
11
|
import { createSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, getExternalAgentsForSubAgent, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentsForExternalAgent, listSubAgentExternalAgentRelations, updateSubAgentExternalAgentRelation, upsertSubAgentExternalAgentRelation } from "./manage/subAgentExternalAgentRelations.js";
|
|
11
12
|
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";
|
|
@@ -23,6 +24,7 @@ import { createFullAgentServerSide, deleteFullAgent, getFullAgent, getFullAgentW
|
|
|
23
24
|
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";
|
|
24
25
|
import { countProjects, createProject, deleteProject, getProject, getProjectResourceCounts, listProjects, listProjectsPaginated, projectExists, projectExistsInTable, projectHasResources, updateProject } from "./manage/projects.js";
|
|
25
26
|
import { createFullProjectServerSide, deleteFullProject, getFullProject, getFullProjectWithRelationIds, updateFullProjectServerSide } from "./manage/projectFull.js";
|
|
27
|
+
import { createScheduledWorkflow, getScheduledWorkflowByTriggerId, updateScheduledWorkflowRunId } from "./manage/scheduledWorkflows.js";
|
|
26
28
|
import { countApiKeys, createApiKey, deleteApiKey, generateAndCreateApiKey, getApiKeyById, getApiKeyByPublicId, hasApiKey, listApiKeys, listApiKeysPaginated, updateApiKey, updateApiKeyLastUsed, validateAndGetApiKey } from "./runtime/apiKeys.js";
|
|
27
29
|
import { cleanupTenantCache, clearContextConfigCache, clearConversationCache, getCacheEntry, getContextConfigCacheEntries, getConversationCacheEntries, invalidateHeadersCache, invalidateInvocationDefinitionsCache, setCacheEntry } from "./runtime/contextCache.js";
|
|
28
30
|
import { createConversation, createOrGetConversation, deleteConversation, getActiveAgentForConversation, getConversation, getConversationHistory, listConversations, setActiveAgentForConversation, setActiveAgentForThread, updateConversation, updateConversationActiveSubAgent } from "./runtime/conversations.js";
|
|
@@ -30,10 +32,11 @@ import { createDatasetRun, createDatasetRunConversationRelation, createDatasetRu
|
|
|
30
32
|
import { addLedgerArtifacts, countLedgerArtifactsByTask, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, getLedgerArtifacts, getLedgerArtifactsByContext, upsertLedgerArtifact } from "./runtime/ledgerArtifacts.js";
|
|
31
33
|
import { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage } from "./runtime/messages.js";
|
|
32
34
|
import { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization } from "./runtime/organizations.js";
|
|
35
|
+
import { addConversationIdToInvocation, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, createScheduledTriggerInvocation, deletePendingInvocationsForTrigger, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerRunInfoBatch, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listScheduledTriggerInvocationsPaginated, listUpcomingInvocationsForAgentPaginated, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, updateScheduledTriggerInvocationStatus } from "./runtime/scheduledTriggerInvocations.js";
|
|
33
36
|
import { createTask, getTask, listTaskIdsByContextId, updateTask } from "./runtime/tasks.js";
|
|
34
37
|
import { createTriggerInvocation, getTriggerInvocationById, listTriggerInvocationsPaginated, updateTriggerInvocationStatus } from "./runtime/triggerInvocations.js";
|
|
35
38
|
import { getUserByEmail, getUserById } from "./runtime/users.js";
|
|
36
39
|
import { createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, updateWorkAppSlackWorkspace, upsertWorkAppSlackChannelAgentConfig } from "./runtime/workAppSlack.js";
|
|
37
40
|
import { createValidatedDataAccess, validateProjectExists, withProjectValidation } from "./validation.js";
|
|
38
41
|
|
|
39
|
-
export { SubAgentIsDefaultError, addFunctionToolToSubAgent, addLedgerArtifacts, addRepositories, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cascadeDeleteByTool, cascadeDeleteGitHubAccessByProject, checkProjectRepositoryAccess, cleanupTenantCache, clearContextConfigCache, clearConversationCache, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, 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, createInstallation, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createSkill, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createValidatedDataAccess, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, 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, deleteInstallation, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMcpToolAccessMode, deleteMessage, deleteProject, deleteProjectAccessMode, deleteProjectMetadata, deleteProjectWithBranch, deleteSkill, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentSkill, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, disconnectInstallation, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, 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, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolAccessMode, getMcpToolById, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectAccessMode, getProjectMainBranchName, getProjectMetadata, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, getSkillById, getSkillsForSubAgents, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizationsFromDb, getUserProvidersFromDb, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, isGithubWorkAppTool, linkDatasetRunToEvaluationJobConfig, listAgentRelations, listAgentToolRelations, listAgents, listAgentsAcrossProjectMainBranches, 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, listSkills, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeRepositories, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, syncRepositories, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateInstallationStatus, updateInstallationStatusByGitHubId, updateMessage, updateProject, updateSkill, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, updateWorkAppSlackWorkspace, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertSkill, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentSkill, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, upsertWorkAppSlackChannelAgentConfig, validateAndGetApiKey, validateProjectExists, validateRepositoryOwnership, validateSubAgent, withProjectValidation };
|
|
42
|
+
export { SubAgentIsDefaultError, addConversationIdToInvocation, addFunctionToolToSubAgent, addLedgerArtifacts, addRepositories, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cascadeDeleteByTool, cascadeDeleteGitHubAccessByProject, checkProjectRepositoryAccess, cleanupTenantCache, clearContextConfigCache, clearConversationCache, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, 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, createInstallation, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createScheduledTrigger, createScheduledTriggerInvocation, createScheduledWorkflow, createSkill, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createValidatedDataAccess, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, 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, deleteInstallation, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMcpToolAccessMode, deleteMessage, deletePendingInvocationsForTrigger, deleteProject, deleteProjectAccessMode, deleteProjectMetadata, deleteProjectWithBranch, deleteScheduledTrigger, deleteSkill, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentSkill, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, disconnectInstallation, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, 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, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolAccessMode, getMcpToolById, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectAccessMode, getProjectMainBranchName, getProjectMetadata, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, getScheduledTriggerById, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerRunInfoBatch, getScheduledWorkflowByTriggerId, getSkillById, getSkillsForSubAgents, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizationsFromDb, getUserProvidersFromDb, getUserScopedCredentialReference, getVisibleMessages, hasApiKey, hasContextConfig, hasCredentialReference, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, isGithubWorkAppTool, linkDatasetRunToEvaluationJobConfig, listAgentRelations, listAgentToolRelations, listAgents, listAgentsAcrossProjectMainBranches, 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, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listScheduledTriggerInvocationsPaginated, listScheduledTriggers, listScheduledTriggersPaginated, listSkills, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, listUpcomingInvocationsForAgentPaginated, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeRepositories, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, syncRepositories, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateInstallationStatus, updateInstallationStatusByGitHubId, updateMessage, updateProject, updateScheduledTrigger, updateScheduledTriggerInvocationStatus, updateScheduledWorkflowRunId, updateSkill, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, updateWorkAppSlackWorkspace, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertScheduledTrigger, upsertSkill, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentSkill, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, upsertWorkAppSlackChannelAgentConfig, validateAndGetApiKey, validateProjectExists, validateRepositoryOwnership, validateSubAgent, withProjectValidation };
|
|
@@ -4,6 +4,7 @@ import { generateId } from "../../utils/conversations.js";
|
|
|
4
4
|
import { upsertContextConfig } from "./contextConfigs.js";
|
|
5
5
|
import { upsertFunction } from "./functions.js";
|
|
6
6
|
import { deleteFunctionTool, listFunctionTools, upsertFunctionTool, upsertSubAgentFunctionToolRelation } from "./functionTools.js";
|
|
7
|
+
import { deleteScheduledTrigger, listScheduledTriggers, upsertScheduledTrigger } from "./scheduledTriggers.js";
|
|
7
8
|
import { upsertSubAgentSkill } from "./skills.js";
|
|
8
9
|
import { deleteSubAgentExternalAgentRelation, getSubAgentExternalAgentRelationsByAgent, upsertSubAgentExternalAgentRelation } from "./subAgentExternalAgentRelations.js";
|
|
9
10
|
import { createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRelationByAgent, upsertSubAgentRelation } from "./subAgentRelations.js";
|
|
@@ -318,6 +319,50 @@ const createFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
318
319
|
triggerCount: Object.keys(typed.triggers).length
|
|
319
320
|
}, "All triggers created successfully");
|
|
320
321
|
}
|
|
322
|
+
if (typed.scheduledTriggers && Object.keys(typed.scheduledTriggers).length > 0) {
|
|
323
|
+
logger.info({
|
|
324
|
+
agentId: finalAgentId,
|
|
325
|
+
scheduledTriggerCount: Object.keys(typed.scheduledTriggers).length
|
|
326
|
+
}, "Creating scheduled triggers for agent");
|
|
327
|
+
const scheduledTriggerPromises = Object.entries(typed.scheduledTriggers).map(async ([scheduledTriggerId, scheduledTriggerData]) => {
|
|
328
|
+
try {
|
|
329
|
+
logger.info({
|
|
330
|
+
agentId: finalAgentId,
|
|
331
|
+
scheduledTriggerId
|
|
332
|
+
}, "Creating scheduled trigger in agent");
|
|
333
|
+
await upsertScheduledTrigger(db)({
|
|
334
|
+
scopes: {
|
|
335
|
+
tenantId,
|
|
336
|
+
projectId,
|
|
337
|
+
agentId: finalAgentId
|
|
338
|
+
},
|
|
339
|
+
data: {
|
|
340
|
+
...scheduledTriggerData,
|
|
341
|
+
id: scheduledTriggerId,
|
|
342
|
+
tenantId,
|
|
343
|
+
projectId,
|
|
344
|
+
agentId: finalAgentId
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
logger.info({
|
|
348
|
+
agentId: finalAgentId,
|
|
349
|
+
scheduledTriggerId
|
|
350
|
+
}, "Scheduled trigger created successfully");
|
|
351
|
+
} catch (error) {
|
|
352
|
+
logger.error({
|
|
353
|
+
agentId: finalAgentId,
|
|
354
|
+
scheduledTriggerId,
|
|
355
|
+
error
|
|
356
|
+
}, "Failed to create scheduled trigger in agent");
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
await Promise.all(scheduledTriggerPromises);
|
|
361
|
+
logger.info({
|
|
362
|
+
agentId: finalAgentId,
|
|
363
|
+
scheduledTriggerCount: Object.keys(typed.scheduledTriggers).length
|
|
364
|
+
}, "All scheduled triggers created successfully");
|
|
365
|
+
}
|
|
321
366
|
const subAgentPromises = Object.entries(typed.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
322
367
|
const subAgent = agentData$1;
|
|
323
368
|
try {
|
|
@@ -915,6 +960,77 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
915
960
|
}
|
|
916
961
|
if (deletedTriggerCount > 0) logger.info({ deletedTriggerCount }, "Deleted orphaned triggers from agent");
|
|
917
962
|
}
|
|
963
|
+
if (typedAgentDefinition.scheduledTriggers && Object.keys(typedAgentDefinition.scheduledTriggers).length > 0) {
|
|
964
|
+
logger.info({
|
|
965
|
+
agentId: finalAgentId,
|
|
966
|
+
scheduledTriggerCount: Object.keys(typedAgentDefinition.scheduledTriggers).length
|
|
967
|
+
}, "Updating scheduled triggers for agent");
|
|
968
|
+
const scheduledTriggerPromises = Object.entries(typedAgentDefinition.scheduledTriggers).map(async ([scheduledTriggerId, scheduledTriggerData]) => {
|
|
969
|
+
try {
|
|
970
|
+
logger.info({
|
|
971
|
+
agentId: finalAgentId,
|
|
972
|
+
scheduledTriggerId
|
|
973
|
+
}, "Updating scheduled trigger in agent");
|
|
974
|
+
await upsertScheduledTrigger(db)({
|
|
975
|
+
scopes: {
|
|
976
|
+
tenantId,
|
|
977
|
+
projectId,
|
|
978
|
+
agentId: finalAgentId
|
|
979
|
+
},
|
|
980
|
+
data: {
|
|
981
|
+
...scheduledTriggerData,
|
|
982
|
+
id: scheduledTriggerId,
|
|
983
|
+
tenantId,
|
|
984
|
+
projectId,
|
|
985
|
+
agentId: finalAgentId
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
logger.info({
|
|
989
|
+
agentId: finalAgentId,
|
|
990
|
+
scheduledTriggerId
|
|
991
|
+
}, "Scheduled trigger updated successfully");
|
|
992
|
+
} catch (error) {
|
|
993
|
+
logger.error({
|
|
994
|
+
agentId: finalAgentId,
|
|
995
|
+
scheduledTriggerId,
|
|
996
|
+
error
|
|
997
|
+
}, "Failed to update scheduled trigger in agent");
|
|
998
|
+
throw error;
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
await Promise.all(scheduledTriggerPromises);
|
|
1002
|
+
logger.info({
|
|
1003
|
+
agentId: finalAgentId,
|
|
1004
|
+
scheduledTriggerCount: Object.keys(typedAgentDefinition.scheduledTriggers).length
|
|
1005
|
+
}, "All scheduled triggers updated successfully");
|
|
1006
|
+
}
|
|
1007
|
+
if (typedAgentDefinition.scheduledTriggers !== void 0) {
|
|
1008
|
+
const incomingScheduledTriggerIds = new Set(Object.keys(typedAgentDefinition.scheduledTriggers));
|
|
1009
|
+
const existingScheduledTriggers = await listScheduledTriggers(db)({ scopes: {
|
|
1010
|
+
tenantId,
|
|
1011
|
+
projectId,
|
|
1012
|
+
agentId: finalAgentId
|
|
1013
|
+
} });
|
|
1014
|
+
let deletedScheduledTriggerCount = 0;
|
|
1015
|
+
for (const scheduledTrigger of existingScheduledTriggers) if (!incomingScheduledTriggerIds.has(scheduledTrigger.id)) try {
|
|
1016
|
+
await deleteScheduledTrigger(db)({
|
|
1017
|
+
scopes: {
|
|
1018
|
+
tenantId,
|
|
1019
|
+
projectId,
|
|
1020
|
+
agentId: finalAgentId
|
|
1021
|
+
},
|
|
1022
|
+
scheduledTriggerId: scheduledTrigger.id
|
|
1023
|
+
});
|
|
1024
|
+
deletedScheduledTriggerCount++;
|
|
1025
|
+
logger.info({ scheduledTriggerId: scheduledTrigger.id }, "Deleted orphaned scheduled trigger");
|
|
1026
|
+
} catch (error) {
|
|
1027
|
+
logger.error({
|
|
1028
|
+
scheduledTriggerId: scheduledTrigger.id,
|
|
1029
|
+
error
|
|
1030
|
+
}, "Failed to delete orphaned scheduled trigger");
|
|
1031
|
+
}
|
|
1032
|
+
if (deletedScheduledTriggerCount > 0) logger.info({ deletedScheduledTriggerCount }, "Deleted orphaned scheduled triggers from agent");
|
|
1033
|
+
}
|
|
918
1034
|
const subAgentPromises = Object.entries(typedAgentDefinition.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
919
1035
|
const subAgent = agentData$1;
|
|
920
1036
|
let existingSubAgent = null;
|
|
@@ -10,11 +10,13 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
12
|
name: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
13
15
|
description: string | null;
|
|
14
|
-
defaultSubAgentId: string | null;
|
|
15
|
-
tenantId: string;
|
|
16
16
|
projectId: string;
|
|
17
|
-
|
|
17
|
+
tenantId: string;
|
|
18
|
+
defaultSubAgentId: string | null;
|
|
19
|
+
contextConfigId: string | null;
|
|
18
20
|
models: {
|
|
19
21
|
base?: {
|
|
20
22
|
model?: string | undefined;
|
|
@@ -29,12 +31,7 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
29
31
|
providerOptions?: Record<string, any> | undefined;
|
|
30
32
|
} | undefined;
|
|
31
33
|
} | null;
|
|
32
|
-
|
|
33
|
-
transferCountIs?: number | undefined;
|
|
34
|
-
} | null;
|
|
35
|
-
createdAt: string;
|
|
36
|
-
updatedAt: string;
|
|
37
|
-
contextConfigId: string | null;
|
|
34
|
+
prompt: string | null;
|
|
38
35
|
statusUpdates: {
|
|
39
36
|
enabled?: boolean | undefined;
|
|
40
37
|
numEvents?: number | undefined;
|
|
@@ -50,17 +47,22 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
50
47
|
} | undefined;
|
|
51
48
|
}[] | undefined;
|
|
52
49
|
} | 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
58
|
name: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
updatedAt: string;
|
|
59
61
|
description: string | null;
|
|
60
|
-
defaultSubAgentId: string | null;
|
|
61
|
-
tenantId: string;
|
|
62
62
|
projectId: string;
|
|
63
|
-
|
|
63
|
+
tenantId: string;
|
|
64
|
+
defaultSubAgentId: string | null;
|
|
65
|
+
contextConfigId: string | null;
|
|
64
66
|
models: {
|
|
65
67
|
base?: {
|
|
66
68
|
model?: string | undefined;
|
|
@@ -75,12 +77,7 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
75
77
|
providerOptions?: Record<string, any> | undefined;
|
|
76
78
|
} | undefined;
|
|
77
79
|
} | null;
|
|
78
|
-
|
|
79
|
-
transferCountIs?: number | undefined;
|
|
80
|
-
} | null;
|
|
81
|
-
createdAt: string;
|
|
82
|
-
updatedAt: string;
|
|
83
|
-
contextConfigId: string | null;
|
|
80
|
+
prompt: string | null;
|
|
84
81
|
statusUpdates: {
|
|
85
82
|
enabled?: boolean | undefined;
|
|
86
83
|
numEvents?: number | undefined;
|
|
@@ -96,15 +93,18 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
96
93
|
} | undefined;
|
|
97
94
|
}[] | undefined;
|
|
98
95
|
} | null;
|
|
96
|
+
stopWhen: {
|
|
97
|
+
transferCountIs?: number | undefined;
|
|
98
|
+
} | null;
|
|
99
99
|
defaultSubAgent: {
|
|
100
100
|
id: string;
|
|
101
101
|
name: string;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
102
104
|
description: string | null;
|
|
103
|
-
tenantId: string;
|
|
104
|
-
projectId: string;
|
|
105
105
|
agentId: string;
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
projectId: string;
|
|
107
|
+
tenantId: string;
|
|
108
108
|
models: {
|
|
109
109
|
base?: {
|
|
110
110
|
model?: string | undefined;
|
|
@@ -119,11 +119,11 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
119
119
|
providerOptions?: Record<string, any> | undefined;
|
|
120
120
|
} | undefined;
|
|
121
121
|
} | null;
|
|
122
|
+
prompt: string | null;
|
|
122
123
|
stopWhen: {
|
|
123
124
|
stepCountIs?: number | undefined;
|
|
124
125
|
} | null;
|
|
125
|
-
|
|
126
|
-
updatedAt: string;
|
|
126
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
127
127
|
} | null;
|
|
128
128
|
} | null>;
|
|
129
129
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -131,11 +131,13 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
131
131
|
}) => Promise<{
|
|
132
132
|
id: string;
|
|
133
133
|
name: string;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
updatedAt: string;
|
|
134
136
|
description: string | null;
|
|
135
|
-
defaultSubAgentId: string | null;
|
|
136
|
-
tenantId: string;
|
|
137
137
|
projectId: string;
|
|
138
|
-
|
|
138
|
+
tenantId: string;
|
|
139
|
+
defaultSubAgentId: string | null;
|
|
140
|
+
contextConfigId: string | null;
|
|
139
141
|
models: {
|
|
140
142
|
base?: {
|
|
141
143
|
model?: string | undefined;
|
|
@@ -150,12 +152,7 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
150
152
|
providerOptions?: Record<string, any> | undefined;
|
|
151
153
|
} | undefined;
|
|
152
154
|
} | null;
|
|
153
|
-
|
|
154
|
-
transferCountIs?: number | undefined;
|
|
155
|
-
} | null;
|
|
156
|
-
createdAt: string;
|
|
157
|
-
updatedAt: string;
|
|
158
|
-
contextConfigId: string | null;
|
|
155
|
+
prompt: string | null;
|
|
159
156
|
statusUpdates: {
|
|
160
157
|
enabled?: boolean | undefined;
|
|
161
158
|
numEvents?: number | undefined;
|
|
@@ -171,6 +168,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
171
168
|
} | undefined;
|
|
172
169
|
}[] | undefined;
|
|
173
170
|
} | null;
|
|
171
|
+
stopWhen: {
|
|
172
|
+
transferCountIs?: number | undefined;
|
|
173
|
+
} | null;
|
|
174
174
|
}[]>;
|
|
175
175
|
declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
176
176
|
scopes: ProjectScopeConfig;
|
|
@@ -247,11 +247,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
247
247
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
248
248
|
id: string;
|
|
249
249
|
name: string;
|
|
250
|
+
createdAt: string;
|
|
251
|
+
updatedAt: string;
|
|
250
252
|
description: string | null;
|
|
251
|
-
defaultSubAgentId: string | null;
|
|
252
|
-
tenantId: string;
|
|
253
253
|
projectId: string;
|
|
254
|
-
|
|
254
|
+
tenantId: string;
|
|
255
|
+
defaultSubAgentId: string | null;
|
|
256
|
+
contextConfigId: string | null;
|
|
255
257
|
models: {
|
|
256
258
|
base?: {
|
|
257
259
|
model?: string | undefined;
|
|
@@ -266,12 +268,7 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
266
268
|
providerOptions?: Record<string, any> | undefined;
|
|
267
269
|
} | undefined;
|
|
268
270
|
} | null;
|
|
269
|
-
|
|
270
|
-
transferCountIs?: number | undefined;
|
|
271
|
-
} | null;
|
|
272
|
-
createdAt: string;
|
|
273
|
-
updatedAt: string;
|
|
274
|
-
contextConfigId: string | null;
|
|
271
|
+
prompt: string | null;
|
|
275
272
|
statusUpdates: {
|
|
276
273
|
enabled?: boolean | undefined;
|
|
277
274
|
numEvents?: number | undefined;
|
|
@@ -287,6 +284,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
287
284
|
} | undefined;
|
|
288
285
|
}[] | undefined;
|
|
289
286
|
} | null;
|
|
287
|
+
stopWhen: {
|
|
288
|
+
transferCountIs?: number | undefined;
|
|
289
|
+
} | null;
|
|
290
290
|
}>;
|
|
291
291
|
declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
292
292
|
scopes: AgentScopeConfig;
|
|
@@ -6,6 +6,7 @@ import { getContextConfigById } from "./contextConfigs.js";
|
|
|
6
6
|
import { getExternalAgent } from "./externalAgents.js";
|
|
7
7
|
import { getFunction } from "./functions.js";
|
|
8
8
|
import { listFunctionTools } from "./functionTools.js";
|
|
9
|
+
import { listScheduledTriggers } from "./scheduledTriggers.js";
|
|
9
10
|
import { getSkillsForSubAgents } from "./skills.js";
|
|
10
11
|
import { getSubAgentExternalAgentRelationsByAgent } from "./subAgentExternalAgentRelations.js";
|
|
11
12
|
import { getAgentRelations, getAgentRelationsByAgent } from "./subAgentRelations.js";
|
|
@@ -540,6 +541,33 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
|
|
|
540
541
|
} catch (error) {
|
|
541
542
|
console.warn("Failed to load triggers:", error);
|
|
542
543
|
}
|
|
544
|
+
try {
|
|
545
|
+
const scheduledTriggersList = await listScheduledTriggers(db)({ scopes: {
|
|
546
|
+
tenantId,
|
|
547
|
+
projectId,
|
|
548
|
+
agentId
|
|
549
|
+
} });
|
|
550
|
+
if (scheduledTriggersList.length > 0) {
|
|
551
|
+
const scheduledTriggersObject = {};
|
|
552
|
+
for (const scheduledTrigger of scheduledTriggersList) scheduledTriggersObject[scheduledTrigger.id] = {
|
|
553
|
+
id: scheduledTrigger.id,
|
|
554
|
+
name: scheduledTrigger.name,
|
|
555
|
+
description: scheduledTrigger.description,
|
|
556
|
+
enabled: scheduledTrigger.enabled,
|
|
557
|
+
cronExpression: scheduledTrigger.cronExpression,
|
|
558
|
+
cronTimezone: scheduledTrigger.cronTimezone,
|
|
559
|
+
runAt: scheduledTrigger.runAt,
|
|
560
|
+
payload: scheduledTrigger.payload,
|
|
561
|
+
messageTemplate: scheduledTrigger.messageTemplate,
|
|
562
|
+
maxRetries: scheduledTrigger.maxRetries,
|
|
563
|
+
retryDelaySeconds: scheduledTrigger.retryDelaySeconds,
|
|
564
|
+
timeoutSeconds: scheduledTrigger.timeoutSeconds
|
|
565
|
+
};
|
|
566
|
+
result.scheduledTriggers = scheduledTriggersObject;
|
|
567
|
+
}
|
|
568
|
+
} catch (error) {
|
|
569
|
+
console.warn("Failed to load scheduled triggers:", error);
|
|
570
|
+
}
|
|
543
571
|
return result;
|
|
544
572
|
};
|
|
545
573
|
const getFullAgentDefinition = (db) => async ({ scopes }) => {
|
|
@@ -10,11 +10,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
12
|
name: string;
|
|
13
|
-
description: string | null;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
13
|
createdAt: string;
|
|
17
14
|
updatedAt: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
projectId: string;
|
|
17
|
+
tenantId: string;
|
|
18
18
|
props: {
|
|
19
19
|
[x: string]: unknown;
|
|
20
20
|
type: "object";
|
|
@@ -66,11 +66,11 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
66
66
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
67
67
|
id: string;
|
|
68
68
|
name: string;
|
|
69
|
-
description: string | null;
|
|
70
|
-
tenantId: string;
|
|
71
|
-
projectId: string;
|
|
72
69
|
createdAt: string;
|
|
73
70
|
updatedAt: string;
|
|
71
|
+
description: string | null;
|
|
72
|
+
projectId: string;
|
|
73
|
+
tenantId: 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
|
-
tenantId: string;
|
|
145
|
-
projectId: string;
|
|
146
|
-
agentId: string;
|
|
147
144
|
createdAt: string;
|
|
145
|
+
agentId: string;
|
|
146
|
+
projectId: string;
|
|
147
|
+
tenantId: 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
|
-
tenantId: string;
|
|
188
|
-
projectId: string;
|
|
189
|
-
agentId: string;
|
|
190
187
|
createdAt: string;
|
|
188
|
+
agentId: string;
|
|
189
|
+
projectId: string;
|
|
190
|
+
tenantId: string;
|
|
191
191
|
subAgentId: string;
|
|
192
192
|
artifactComponentId: string;
|
|
193
193
|
} | null>;
|
|
@@ -9,25 +9,25 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
tenantId: string;
|
|
13
|
-
projectId: string;
|
|
14
|
-
agentId: string;
|
|
15
12
|
createdAt: string;
|
|
16
13
|
updatedAt: string;
|
|
17
14
|
headersSchema: unknown;
|
|
18
15
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
16
|
+
agentId: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
22
22
|
}) => Promise<{
|
|
23
23
|
id: string;
|
|
24
|
-
tenantId: string;
|
|
25
|
-
projectId: string;
|
|
26
|
-
agentId: string;
|
|
27
24
|
createdAt: string;
|
|
28
25
|
updatedAt: string;
|
|
29
26
|
headersSchema: unknown;
|
|
30
27
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
28
|
+
agentId: string;
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
31
|
}[]>;
|
|
32
32
|
declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
33
|
scopes: AgentScopeConfig;
|
|
@@ -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
|
-
tenantId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
agentId: string;
|
|
49
46
|
createdAt: string;
|
|
50
47
|
updatedAt: string;
|
|
51
48
|
headersSchema: unknown;
|
|
52
49
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
50
|
+
agentId: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
tenantId: string;
|
|
53
53
|
}>;
|
|
54
54
|
declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -83,13 +83,13 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
data: ContextConfigInsert;
|
|
84
84
|
}) => Promise<{
|
|
85
85
|
id: string;
|
|
86
|
-
tenantId: string;
|
|
87
|
-
projectId: string;
|
|
88
|
-
agentId: string;
|
|
89
86
|
createdAt: string;
|
|
90
87
|
updatedAt: string;
|
|
91
88
|
headersSchema: unknown;
|
|
92
89
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
90
|
+
agentId: string;
|
|
91
|
+
projectId: string;
|
|
92
|
+
tenantId: string;
|
|
93
93
|
}>;
|
|
94
94
|
//#endregion
|
|
95
95
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|
|
@@ -65,10 +65,10 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
dataComponentId: string;
|
|
66
66
|
}) => Promise<{
|
|
67
67
|
id: string;
|
|
68
|
-
tenantId: string;
|
|
69
|
-
projectId: string;
|
|
70
|
-
agentId: string;
|
|
71
68
|
createdAt: string;
|
|
69
|
+
agentId: string;
|
|
70
|
+
projectId: string;
|
|
71
|
+
tenantId: string;
|
|
72
72
|
subAgentId: string;
|
|
73
73
|
dataComponentId: string;
|
|
74
74
|
}>;
|
|
@@ -107,10 +107,10 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
107
107
|
dataComponentId: string;
|
|
108
108
|
}) => Promise<{
|
|
109
109
|
id: string;
|
|
110
|
-
tenantId: string;
|
|
111
|
-
projectId: string;
|
|
112
|
-
agentId: string;
|
|
113
110
|
createdAt: string;
|
|
111
|
+
agentId: string;
|
|
112
|
+
projectId: string;
|
|
113
|
+
tenantId: string;
|
|
114
114
|
subAgentId: string;
|
|
115
115
|
dataComponentId: string;
|
|
116
116
|
} | null>;
|
|
@@ -55,12 +55,12 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
55
55
|
}) => Promise<{
|
|
56
56
|
id: string;
|
|
57
57
|
name: string;
|
|
58
|
-
description: string | null;
|
|
59
|
-
tenantId: string;
|
|
60
|
-
projectId: string;
|
|
61
|
-
agentId: string;
|
|
62
58
|
createdAt: string;
|
|
63
59
|
updatedAt: string;
|
|
60
|
+
description: string | null;
|
|
61
|
+
agentId: string;
|
|
62
|
+
projectId: string;
|
|
63
|
+
tenantId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -97,12 +97,12 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
97
97
|
}) => Promise<{
|
|
98
98
|
id: string;
|
|
99
99
|
name: string;
|
|
100
|
-
description: string | null;
|
|
101
|
-
tenantId: string;
|
|
102
|
-
projectId: string;
|
|
103
|
-
agentId: string;
|
|
104
100
|
createdAt: string;
|
|
105
101
|
updatedAt: string;
|
|
102
|
+
description: string | null;
|
|
103
|
+
agentId: string;
|
|
104
|
+
projectId: string;
|
|
105
|
+
tenantId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -162,11 +162,11 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
162
162
|
}> | null;
|
|
163
163
|
}) => Promise<{
|
|
164
164
|
id: string;
|
|
165
|
-
tenantId: string;
|
|
166
|
-
projectId: string;
|
|
167
|
-
agentId: string;
|
|
168
165
|
createdAt: string;
|
|
169
166
|
updatedAt: string;
|
|
167
|
+
agentId: string;
|
|
168
|
+
projectId: string;
|
|
169
|
+
tenantId: string;
|
|
170
170
|
toolPolicies: Record<string, {
|
|
171
171
|
needsApproval?: boolean;
|
|
172
172
|
}> | null;
|
|
@@ -227,11 +227,11 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
227
227
|
}> | null;
|
|
228
228
|
}) => Promise<{
|
|
229
229
|
id: string;
|
|
230
|
-
tenantId: string;
|
|
231
|
-
projectId: string;
|
|
232
|
-
agentId: string;
|
|
233
230
|
createdAt: string;
|
|
234
231
|
updatedAt: string;
|
|
232
|
+
agentId: string;
|
|
233
|
+
projectId: string;
|
|
234
|
+
tenantId: string;
|
|
235
235
|
toolPolicies: Record<string, {
|
|
236
236
|
needsApproval?: boolean;
|
|
237
237
|
}> | null;
|