@inkeep/agents-core 0.66.1 → 0.67.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/auth/auth-schema.d.ts +86 -86
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/auth.d.ts +6 -6
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/constants/otel-attributes.d.ts +2 -0
- package/dist/constants/otel-attributes.js +2 -0
- package/dist/data-access/index.d.ts +2 -2
- package/dist/data-access/index.js +2 -2
- package/dist/data-access/manage/agentFull.js +23 -3
- package/dist/data-access/manage/agents.d.ts +25 -25
- package/dist/data-access/manage/agents.js +12 -1
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- 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 +20 -20
- package/dist/data-access/manage/skills.d.ts +15 -15
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +28 -28
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +30 -30
- package/dist/data-access/manage/triggerCleanup.js +6 -1
- package/dist/data-access/manage/triggers.d.ts +60 -1
- package/dist/data-access/manage/triggers.js +88 -3
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/apps.d.ts +12 -12
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/feedback.d.ts +6 -6
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +7 -7
- package/dist/data-access/runtime/triggerInvocations.d.ts +2 -0
- package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
- package/dist/db/manage/manage-schema.d.ts +583 -447
- package/dist/db/manage/manage-schema.js +43 -2
- package/dist/db/runtime/runtime-schema.d.ts +445 -407
- package/dist/db/runtime/runtime-schema.js +4 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/signature-validation.d.ts +2 -2
- package/dist/utils/signature-validation.js +2 -2
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas/skills.d.ts +59 -59
- package/dist/validation/schemas.d.ts +2464 -2270
- package/dist/validation/schemas.js +35 -13
- package/drizzle/manage/0018_gorgeous_captain_america.sql +14 -0
- package/drizzle/manage/meta/0018_snapshot.json +3884 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0035_many_steel_serpent.sql +3 -0
- package/drizzle/runtime/meta/0035_snapshot.json +5321 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ import { createSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelation, delet
|
|
|
19
19
|
import { addRepositories, checkProjectRepositoryAccess, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, createInstallation, deleteInstallation, deleteMcpToolAccessMode, deleteProjectAccessMode, disconnectInstallation, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getMcpToolAccessMode, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getProjectAccessMode, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, isGithubWorkAppTool, removeRepositories, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, syncRepositories, updateInstallationStatus, updateInstallationStatusByGitHubId, validateRepositoryOwnership } from "./runtime/github-work-app-installations.js";
|
|
20
20
|
import { countCredentialReferences, createCredentialReference, deleteCredentialReference, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getUserScopedCredentialReference, hasCredentialReference, listCredentialReferences, listCredentialReferencesPaginated, updateCredentialReference, upsertCredentialReference } from "./manage/credentialReferences.js";
|
|
21
21
|
import { addToolToAgent, createTool, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool } from "./manage/tools.js";
|
|
22
|
-
import { createTrigger, deleteTrigger, deleteTriggersByRunAsUserId, getTriggerById, listTriggers, listTriggersPaginated, updateTrigger, upsertTrigger } from "./manage/triggers.js";
|
|
22
|
+
import { createTrigger, createTriggerUser, createTriggerWithUsers, deleteTrigger, deleteTriggerUser, deleteTriggersByRunAsUserId, getTriggerById, getTriggerUserCount, getTriggerUsers, getTriggerUsersBatch, getWebhookTriggerIdsWithUser, listTriggers, listTriggersPaginated, removeUserFromProjectTriggerUsers, setTriggerUsers, updateTrigger, upsertTrigger } from "./manage/triggers.js";
|
|
23
23
|
import { createAgent, deleteAgent, fetchComponentRelationships, getAgentById, getAgentSubAgentInfos, getAgentWithDefaultSubAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, listAgents, listAgentsAcrossProjectMainBranches, listAgentsPaginated, updateAgent, upsertAgent } from "./manage/agents.js";
|
|
24
24
|
import { agentHasArtifactComponents, associateArtifactComponentWithAgent, countArtifactComponents, countArtifactComponentsForAgent, createArtifactComponent, deleteAgentArtifactComponentRelationByAgent, deleteArtifactComponent, getAgentsUsingArtifactComponent, getArtifactComponentById, getArtifactComponentsForAgent, isArtifactComponentAssociatedWithAgent, listArtifactComponents, listArtifactComponentsPaginated, removeArtifactComponentFromAgent, updateArtifactComponent, upsertAgentArtifactComponentRelation, upsertArtifactComponent } from "./manage/artifactComponents.js";
|
|
25
25
|
import { associateDataComponentWithAgent, countDataComponents, createDataComponent, deleteAgentDataComponentRelationByAgent, deleteDataComponent, getAgentsUsingDataComponent, getDataComponent, getDataComponentsForAgent, isDataComponentAssociatedWithAgent, listDataComponents, listDataComponentsPaginated, removeDataComponentFromAgent, updateDataComponent, upsertAgentDataComponentRelation, upsertDataComponent } from "./manage/dataComponents.js";
|
|
@@ -49,4 +49,4 @@ import { getOrganizationMemberByEmail, getOrganizationMemberByUserId, getUserByE
|
|
|
49
49
|
import { createWorkflowExecution, getWorkflowExecution, getWorkflowExecutionByConversation, updateWorkflowExecutionStatus } from "./runtime/workflowExecutions.js";
|
|
50
50
|
import { createValidatedDataAccess, validateProjectExists, withProjectValidation } from "./validation.js";
|
|
51
51
|
|
|
52
|
-
export { SubAgentIsDefaultError, addConversationIdToInvocation, addFunctionToolToSubAgent, addLedgerArtifacts, addRepositories, addToolToAgent, addUserToOrganization, advanceScheduledTriggerNextRunAt, agentHasArtifactComponents, allowedMethodsToMethodOptions, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cascadeDeleteByTool, cascadeDeleteGitHubAccessByProject, checkProjectRepositoryAccess, cleanupExpiredStreamChunks, cleanupTenantCache, clearAppDefaultsByAgent, clearAppDefaultsByProject, clearContextConfigCache, clearConversationCache, clearDevConfigWorkspaceDefaultsByAgent, clearDevConfigWorkspaceDefaultsByProject, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, clearSchedulerState, clearWorkspaceDefaultsByAgent, clearWorkspaceDefaultsByProject, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, countProjectsInRuntime, countVisibleMessages, createAgent, createAgentDatasetRelation, createAgentEvaluatorRelation, createAgentManageDatabaseConnection, createAgentToolRelation, createAgentsManageDatabaseClient, createAgentsManageDatabasePool, createAgentsRunDatabaseClient, createApiKey, createApp, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDataset, createDatasetItem, createDatasetItems, createDatasetRun, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationResult, createEvaluationResults, createEvaluationRun, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, createExternalAgent, createFeedback, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createInstallation, createInvitationInDb, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createScheduledTrigger, createScheduledTriggerInvocation, createScheduledTriggerUser, createSkill, createSkillFileById, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createUserProfileIfNotExists, createValidatedDataAccess, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, createWorkflowExecution, dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentDatasetRelation, deleteAgentEvaluatorRelation, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteAllSlackMcpToolAccessConfigsByTenant, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteApiKey, deleteApp, deleteAppForProject, deleteAppForTenant, deleteAppsByProject, 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, deleteFeedback, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteInstallation, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMcpToolAccessMode, deleteMessage, deletePendingInvocationsForTrigger, deleteProject, deleteProjectAccessMode, deleteProjectAndBranches, deleteProjectMetadata, deleteScheduledTrigger, deleteScheduledTriggerUser, deleteScheduledTriggersByRunAsUserId, deleteSkill, deleteSkillFileById, deleteSlackMcpToolAccessConfig, deleteStreamChunks, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentSkill, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, deleteTriggersByRunAsUserId, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackChannelAgentConfigsByAgent, deleteWorkAppSlackChannelAgentConfigsByProject, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, disconnectInstallation, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, findDueScheduledTriggersAcrossProjects, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentDatasetRelationsByAgent, getAgentDatasetRelationsByDataset, getAgentEvaluatorRelationsByAgent, getAgentEvaluatorRelationsByEvaluator, getAgentIdsForEvaluators, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getAllowedAuthMethods, getApiKeyById, getApiKeyByPublicId, getAppAuthKeysForProject, getAppById, getAppByIdForProject, getAppByIdForTenant, getArtifactComponentById, getArtifactComponentsForAgent, getAuthLookupForEmail, 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, getFeedbackById, getFilteredAuthMethodsForEmail, getFullAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, getFullAgentWithRelationIds, getFullProject, getFullProjectWithRelationIds, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolAccessMode, getMcpToolById, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getMessageById, getMessagesByConversation, getMessagesByTask, getOrganizationMemberByEmail, getOrganizationMemberByUserId, getPendingInvitationsByEmail, getProject, getProjectAccessMode, getProjectMainBranchName, getProjectMetadata, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, getSSOProvidersByDomain, getScheduledTriggerById, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerInvocationStatusSummary, getScheduledTriggerRunInfoBatch, getScheduledTriggerUserCount, getScheduledTriggerUsers, getScheduledTriggerUsersBatch, getSchedulerState, getSkillById, getSkillByIdWithFiles, getSkillFileById, getSkillFilesBySkillIds, getSkillsForSubAgents, getSlackMcpToolAccessConfig, getStreamChunks, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerIdsWithUser, getTriggerInvocationById, getUserByEmail, getUserById, getUserOrganizationsFromDb, getUserProfile, getUserProvidersFromDb, getUserScopedCredentialReference, getVisibleMessages, getWorkflowExecution, getWorkflowExecutionByConversation, hasApiKey, hasContextConfig, hasCredentialReference, insertStreamChunks, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, isGithubWorkAppTool, isSlackWorkAppTool, linkDatasetRunToEvaluationJobConfig, listAgentIdsByProject, listAgentRelations, listAgentToolRelations, listAgents, listAgentsAcrossProjectMainBranches, listAgentsPaginated, listApiKeys, listApiKeysByProject, listApiKeysPaginated, listAppsPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextCacheByProject, listContextConfigIdsByProject, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listDatasetItems, listDatasetRunConfigs, listDatasetRuns, listDatasetRunsByConfig, listDatasets, listDatasetsForAgent, listEvaluationJobConfigs, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationRuns, listEvaluationRunsByJobConfigId, listEvaluationSuiteConfigs, listEvaluators, listEvaluatorsForAgent, listExternalAgents, listExternalAgentsPaginated, listFeedback, listFeedbackByConversation, listFunctionTools, listFunctions, listFunctionsPaginated, listGitHubToolAccessByProject, listGitHubToolAccessModeByProject, listMessages, listOrgEntitlements, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listScheduledTriggerInvocationsByTriggerId, listScheduledTriggerInvocationsPaginated, listScheduledTriggers, listScheduledTriggersPaginated, listSkills, listSkillsWithFiles, listSlackChannelAgentConfigsByProject, listSlackToolAccessConfigByProject, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listToolIdsByProject, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, listUpcomingInvocationsForAgentPaginated, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, markStreamComplete, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeRepositories, removeToolFromAgent, removeUserFromProjectScheduledTriggers, resetCancelledInvocationToPending, resolveSlackUserContext, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, setScheduledTriggerUsers, setSlackMcpToolAccessConfig, syncRepositories, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateApp, updateAppAuthKeysForProject, updateAppForProject, updateAppForTenant, updateAppLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFeedback, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateInstallationStatus, updateInstallationStatusByGitHubId, updateLedgerArtifactParts, updateMessage, updateProject, updateScheduledTrigger, updateScheduledTriggerInvocationStatus, updateSkill, updateSkillFileById, updateSlackMcpToolAccessChannelIds, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, updateWorkAppSlackWorkspace, updateWorkflowExecutionStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertScheduledTrigger, upsertSchedulerState, upsertSkill, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentSkill, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, upsertUserProfile, upsertWorkAppSlackChannelAgentConfig, validateAndGetApiKey, validateProjectExists, validateRepositoryOwnership, validateSubAgent, withProjectValidation };
|
|
52
|
+
export { SubAgentIsDefaultError, addConversationIdToInvocation, addFunctionToolToSubAgent, addLedgerArtifacts, addRepositories, addToolToAgent, addUserToOrganization, advanceScheduledTriggerNextRunAt, agentHasArtifactComponents, allowedMethodsToMethodOptions, associateArtifactComponentWithAgent, associateDataComponentWithAgent, associateFunctionToolWithSubAgent, cancelPastPendingInvocationsForTrigger, cancelPendingInvocationsForTrigger, cascadeDeleteByAgent, cascadeDeleteByBranch, cascadeDeleteByContextConfig, cascadeDeleteByProject, cascadeDeleteBySubAgent, cascadeDeleteByTool, cascadeDeleteGitHubAccessByProject, checkProjectRepositoryAccess, cleanupExpiredStreamChunks, cleanupTenantCache, clearAppDefaultsByAgent, clearAppDefaultsByProject, clearContextConfigCache, clearConversationCache, clearDevConfigWorkspaceDefaultsByAgent, clearDevConfigWorkspaceDefaultsByProject, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, clearSchedulerState, clearWorkspaceDefaultsByAgent, clearWorkspaceDefaultsByProject, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, countProjectsInRuntime, countVisibleMessages, createAgent, createAgentDatasetRelation, createAgentEvaluatorRelation, createAgentManageDatabaseConnection, createAgentToolRelation, createAgentsManageDatabaseClient, createAgentsManageDatabasePool, createAgentsRunDatabaseClient, createApiKey, createApp, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDataset, createDatasetItem, createDatasetItems, createDatasetRun, createDatasetRunConfig, createDatasetRunConfigAgentRelation, createDatasetRunConversationRelation, createDatasetRunConversationRelations, createEvaluationJobConfig, createEvaluationJobConfigEvaluatorRelation, createEvaluationResult, createEvaluationResults, createEvaluationRun, createEvaluationRunConfig, createEvaluationRunConfigEvaluationSuiteConfigRelation, createEvaluationSuiteConfig, createEvaluationSuiteConfigEvaluatorRelation, createEvaluator, createExternalAgent, createFeedback, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createInstallation, createInvitationInDb, createMessage, createOrGetConversation, createProject, createProjectMetadata, createProjectMetadataAndBranch, createScheduledTrigger, createScheduledTriggerInvocation, createScheduledTriggerUser, createSkill, createSkillFileById, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createTrigger, createTriggerInvocation, createTriggerUser, createTriggerWithUsers, createUserProfileIfNotExists, createValidatedDataAccess, createWorkAppSlackChannelAgentConfig, createWorkAppSlackUserMapping, createWorkAppSlackWorkspace, createWorkflowExecution, dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, dbResultToMcpTool, dbResultToMcpToolSkeleton, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentDatasetRelation, deleteAgentEvaluatorRelation, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteAllSlackMcpToolAccessConfigsByTenant, deleteAllWorkAppSlackChannelAgentConfigsByTeam, deleteAllWorkAppSlackUserMappingsByTeam, deleteApiKey, deleteApp, deleteAppForProject, deleteAppForTenant, deleteAppsByProject, 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, deleteFeedback, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteInstallation, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMcpToolAccessMode, deleteMessage, deletePendingInvocationsForTrigger, deleteProject, deleteProjectAccessMode, deleteProjectAndBranches, deleteProjectMetadata, deleteScheduledTrigger, deleteScheduledTriggerUser, deleteScheduledTriggersByRunAsUserId, deleteSkill, deleteSkillFileById, deleteSlackMcpToolAccessConfig, deleteStreamChunks, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentSkill, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, deleteTrigger, deleteTriggerUser, deleteTriggersByRunAsUserId, deleteWorkAppSlackChannelAgentConfig, deleteWorkAppSlackChannelAgentConfigsByAgent, deleteWorkAppSlackChannelAgentConfigsByProject, deleteWorkAppSlackUserMapping, deleteWorkAppSlackWorkspace, deleteWorkAppSlackWorkspaceByNangoConnectionId, disconnectInstallation, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, filterConversationsForJob, findDueScheduledTriggersAcrossProjects, findWorkAppSlackChannelAgentConfig, findWorkAppSlackUserMapping, findWorkAppSlackUserMappingByInkeepUserId, findWorkAppSlackUserMappingBySlackUser, findWorkAppSlackWorkspaceByNangoConnectionId, findWorkAppSlackWorkspaceBySlackTeamId, findWorkAppSlackWorkspaceByTeamId, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentDatasetRelationsByAgent, getAgentDatasetRelationsByDataset, getAgentEvaluatorRelationsByAgent, getAgentEvaluatorRelationsByEvaluator, getAgentIdsForEvaluators, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getAllowedAuthMethods, getApiKeyById, getApiKeyByPublicId, getAppAuthKeysForProject, getAppById, getAppByIdForProject, getAppByIdForTenant, getArtifactComponentById, getArtifactComponentsForAgent, getAuthLookupForEmail, 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, getFeedbackById, getFilteredAuthMethodsForEmail, getFullAgent, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, getFullAgentWithRelationIds, getFullProject, getFullProjectWithRelationIds, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getLedgerArtifacts, getLedgerArtifactsByContext, getMcpToolAccessMode, getMcpToolById, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getMessageById, getMessagesByConversation, getMessagesByTask, getOrganizationMemberByEmail, getOrganizationMemberByUserId, getPendingInvitationsByEmail, getProject, getProjectAccessMode, getProjectMainBranchName, getProjectMetadata, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getProjectResourceCounts, getProjectWithBranchInfo, getProjectWithMetadata, getRelatedAgentsForAgent, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, getSSOProvidersByDomain, getScheduledTriggerById, getScheduledTriggerInvocationById, getScheduledTriggerInvocationByIdempotencyKey, getScheduledTriggerInvocationStatusSummary, getScheduledTriggerRunInfoBatch, getScheduledTriggerUserCount, getScheduledTriggerUsers, getScheduledTriggerUsersBatch, getSchedulerState, getSkillById, getSkillByIdWithFiles, getSkillFileById, getSkillFilesBySkillIds, getSkillsForSubAgents, getSlackMcpToolAccessConfig, getStreamChunks, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getSubAgentsUsingFunctionTool, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTriggerById, getTriggerIdsWithUser, getTriggerInvocationById, getTriggerUserCount, getTriggerUsers, getTriggerUsersBatch, getUserByEmail, getUserById, getUserOrganizationsFromDb, getUserProfile, getUserProvidersFromDb, getUserScopedCredentialReference, getVisibleMessages, getWebhookTriggerIdsWithUser, getWorkflowExecution, getWorkflowExecutionByConversation, hasApiKey, hasContextConfig, hasCredentialReference, insertStreamChunks, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isFunctionToolAssociatedWithSubAgent, isGithubWorkAppTool, isSlackWorkAppTool, linkDatasetRunToEvaluationJobConfig, listAgentIdsByProject, listAgentRelations, listAgentToolRelations, listAgents, listAgentsAcrossProjectMainBranches, listAgentsPaginated, listApiKeys, listApiKeysByProject, listApiKeysPaginated, listAppsPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextCacheByProject, listContextConfigIdsByProject, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listDatasetItems, listDatasetRunConfigs, listDatasetRuns, listDatasetRunsByConfig, listDatasets, listDatasetsForAgent, listEvaluationJobConfigs, listEvaluationResults, listEvaluationResultsByConversation, listEvaluationResultsByRun, listEvaluationRunConfigs, listEvaluationRunConfigsWithSuiteConfigs, listEvaluationRuns, listEvaluationRunsByJobConfigId, listEvaluationSuiteConfigs, listEvaluators, listEvaluatorsForAgent, listExternalAgents, listExternalAgentsPaginated, listFeedback, listFeedbackByConversation, listFunctionTools, listFunctions, listFunctionsPaginated, listGitHubToolAccessByProject, listGitHubToolAccessModeByProject, listMessages, listOrgEntitlements, listPendingScheduledTriggerInvocations, listProjectScheduledTriggerInvocationsPaginated, listProjects, listProjectsMetadata, listProjectsMetadataPaginated, listProjectsPaginated, listProjectsWithMetadataPaginated, listScheduledTriggerInvocationsByTriggerId, listScheduledTriggerInvocationsPaginated, listScheduledTriggers, listScheduledTriggersPaginated, listSkills, listSkillsWithFiles, listSlackChannelAgentConfigsByProject, listSlackToolAccessConfigByProject, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listToolIdsByProject, listTools, listTriggerInvocationsPaginated, listTriggers, listTriggersPaginated, listUpcomingInvocationsForAgentPaginated, listWorkAppSlackChannelAgentConfigsByTeam, listWorkAppSlackUserMappingsByTeam, listWorkAppSlackWorkspacesByTenant, markScheduledTriggerInvocationCancelled, markScheduledTriggerInvocationCompleted, markScheduledTriggerInvocationFailed, markScheduledTriggerInvocationRunning, markStreamComplete, projectExists, projectExistsInTable, projectHasResources, projectsMetadataExists, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeFunctionToolFromSubAgent, removeRepositories, removeToolFromAgent, removeUserFromProjectScheduledTriggers, removeUserFromProjectTriggerUsers, resetCancelledInvocationToPending, resolveSlackUserContext, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, setScheduledTriggerUsers, setSlackMcpToolAccessConfig, setTriggerUsers, syncRepositories, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateApp, updateAppAuthKeysForProject, updateAppForProject, updateAppForTenant, updateAppLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveSubAgent, updateCredentialReference, updateDataComponent, updateDataset, updateDatasetItem, updateDatasetRunConfig, updateEvaluationResult, updateEvaluationRun, updateEvaluationRunConfig, updateEvaluationSuiteConfig, updateEvaluator, updateExternalAgent, updateFeedback, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateInstallationStatus, updateInstallationStatusByGitHubId, updateLedgerArtifactParts, updateMessage, updateProject, updateScheduledTrigger, updateScheduledTriggerInvocationStatus, updateSkill, updateSkillFileById, updateSlackMcpToolAccessChannelIds, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, updateTrigger, updateTriggerInvocationStatus, updateWorkAppSlackWorkspace, updateWorkflowExecutionStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertOrganization, upsertScheduledTrigger, upsertSchedulerState, upsertSkill, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentSkill, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, upsertTrigger, upsertUserProfile, upsertWorkAppSlackChannelAgentConfig, validateAndGetApiKey, validateProjectExists, validateRepositoryOwnership, validateSubAgent, withProjectValidation };
|
|
@@ -12,7 +12,7 @@ import { createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRel
|
|
|
12
12
|
import { deleteSubAgent, listSubAgents, upsertSubAgent } from "./subAgents.js";
|
|
13
13
|
import { deleteSubAgentTeamAgentRelation, getSubAgentTeamAgentRelationsByAgent, upsertSubAgentTeamAgentRelation } from "./subAgentTeamAgentRelations.js";
|
|
14
14
|
import { upsertSubAgentToolRelation } from "./tools.js";
|
|
15
|
-
import { deleteTrigger, listTriggers, upsertTrigger } from "./triggers.js";
|
|
15
|
+
import { deleteTrigger, listTriggers, setTriggerUsers, upsertTrigger } from "./triggers.js";
|
|
16
16
|
import { deleteAgent, getAgentById, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, updateAgent, upsertAgent } from "./agents.js";
|
|
17
17
|
import { associateArtifactComponentWithAgent, deleteAgentArtifactComponentRelationByAgent, upsertAgentArtifactComponentRelation } from "./artifactComponents.js";
|
|
18
18
|
import { associateDataComponentWithAgent, deleteAgentDataComponentRelationByAgent, upsertAgentDataComponentRelation } from "./dataComponents.js";
|
|
@@ -285,6 +285,7 @@ const createFullAgentServerSide = (db) => async (scopes, agentData) => {
|
|
|
285
285
|
agentId: finalAgentId,
|
|
286
286
|
triggerId
|
|
287
287
|
}, "Creating trigger in agent");
|
|
288
|
+
const { runAsUserIds, ...triggerInsertData } = triggerData;
|
|
288
289
|
await upsertTrigger(db)({
|
|
289
290
|
scopes: {
|
|
290
291
|
tenantId,
|
|
@@ -292,13 +293,22 @@ const createFullAgentServerSide = (db) => async (scopes, agentData) => {
|
|
|
292
293
|
agentId: finalAgentId
|
|
293
294
|
},
|
|
294
295
|
data: {
|
|
295
|
-
...
|
|
296
|
+
...triggerInsertData,
|
|
296
297
|
id: triggerId,
|
|
297
298
|
tenantId,
|
|
298
299
|
projectId,
|
|
299
300
|
agentId: finalAgentId
|
|
300
301
|
}
|
|
301
302
|
});
|
|
303
|
+
if (runAsUserIds && runAsUserIds.length > 0) await setTriggerUsers(db)({
|
|
304
|
+
scopes: {
|
|
305
|
+
tenantId,
|
|
306
|
+
projectId,
|
|
307
|
+
agentId: finalAgentId
|
|
308
|
+
},
|
|
309
|
+
triggerId,
|
|
310
|
+
userIds: runAsUserIds
|
|
311
|
+
});
|
|
302
312
|
logger.info({
|
|
303
313
|
agentId: finalAgentId,
|
|
304
314
|
triggerId
|
|
@@ -857,6 +867,7 @@ const updateFullAgentServerSide = (db) => async (scopes, agentData) => {
|
|
|
857
867
|
agentId: finalAgentId,
|
|
858
868
|
triggerId
|
|
859
869
|
}, "Updating trigger in agent");
|
|
870
|
+
const { runAsUserIds, ...triggerInsertData } = triggerData;
|
|
860
871
|
await upsertTrigger(db)({
|
|
861
872
|
scopes: {
|
|
862
873
|
tenantId,
|
|
@@ -864,13 +875,22 @@ const updateFullAgentServerSide = (db) => async (scopes, agentData) => {
|
|
|
864
875
|
agentId: finalAgentId
|
|
865
876
|
},
|
|
866
877
|
data: {
|
|
867
|
-
...
|
|
878
|
+
...triggerInsertData,
|
|
868
879
|
id: triggerId,
|
|
869
880
|
tenantId,
|
|
870
881
|
projectId,
|
|
871
882
|
agentId: finalAgentId
|
|
872
883
|
}
|
|
873
884
|
});
|
|
885
|
+
if (runAsUserIds !== void 0) await setTriggerUsers(db)({
|
|
886
|
+
scopes: {
|
|
887
|
+
tenantId,
|
|
888
|
+
projectId,
|
|
889
|
+
agentId: finalAgentId
|
|
890
|
+
},
|
|
891
|
+
triggerId,
|
|
892
|
+
userIds: runAsUserIds
|
|
893
|
+
});
|
|
874
894
|
logger.info({
|
|
875
895
|
agentId: finalAgentId,
|
|
876
896
|
triggerId
|
|
@@ -10,13 +10,13 @@ import { PgColumn } from "drizzle-orm/pg-core";
|
|
|
10
10
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
11
11
|
scopes: AgentScopeConfig;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
|
|
14
|
-
projectId: string;
|
|
13
|
+
description: string | null;
|
|
15
14
|
id: string;
|
|
16
|
-
createdAt: string;
|
|
17
15
|
name: string;
|
|
16
|
+
createdAt: string;
|
|
18
17
|
updatedAt: string;
|
|
19
|
-
|
|
18
|
+
projectId: string;
|
|
19
|
+
tenantId: string;
|
|
20
20
|
models: {
|
|
21
21
|
base?: {
|
|
22
22
|
model?: string | undefined;
|
|
@@ -40,9 +40,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
40
40
|
stopWhen: {
|
|
41
41
|
transferCountIs?: number | undefined;
|
|
42
42
|
} | null;
|
|
43
|
+
prompt: string | null;
|
|
43
44
|
defaultSubAgentId: string | null;
|
|
44
45
|
contextConfigId: string | null;
|
|
45
|
-
prompt: string | null;
|
|
46
46
|
statusUpdates: {
|
|
47
47
|
enabled?: boolean | undefined;
|
|
48
48
|
numEvents?: number | undefined;
|
|
@@ -63,13 +63,13 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
63
63
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
64
64
|
scopes: AgentScopeConfig;
|
|
65
65
|
}) => Promise<{
|
|
66
|
-
|
|
67
|
-
projectId: string;
|
|
66
|
+
description: string | null;
|
|
68
67
|
id: string;
|
|
69
|
-
createdAt: string;
|
|
70
68
|
name: string;
|
|
69
|
+
createdAt: string;
|
|
71
70
|
updatedAt: string;
|
|
72
|
-
|
|
71
|
+
projectId: string;
|
|
72
|
+
tenantId: string;
|
|
73
73
|
models: {
|
|
74
74
|
base?: {
|
|
75
75
|
model?: string | undefined;
|
|
@@ -93,9 +93,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
93
93
|
stopWhen: {
|
|
94
94
|
transferCountIs?: number | undefined;
|
|
95
95
|
} | null;
|
|
96
|
+
prompt: string | null;
|
|
96
97
|
defaultSubAgentId: string | null;
|
|
97
98
|
contextConfigId: string | null;
|
|
98
|
-
prompt: string | null;
|
|
99
99
|
statusUpdates: {
|
|
100
100
|
enabled?: boolean | undefined;
|
|
101
101
|
numEvents?: number | undefined;
|
|
@@ -113,14 +113,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
113
113
|
} | null;
|
|
114
114
|
executionMode: "classic" | "durable";
|
|
115
115
|
defaultSubAgent: {
|
|
116
|
-
|
|
117
|
-
projectId: string;
|
|
118
|
-
agentId: string;
|
|
116
|
+
description: string | null;
|
|
119
117
|
id: string;
|
|
120
|
-
createdAt: string;
|
|
121
118
|
name: string;
|
|
119
|
+
createdAt: string;
|
|
122
120
|
updatedAt: string;
|
|
123
|
-
|
|
121
|
+
projectId: string;
|
|
122
|
+
tenantId: string;
|
|
124
123
|
models: {
|
|
125
124
|
base?: {
|
|
126
125
|
model?: string | undefined;
|
|
@@ -144,6 +143,7 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
144
143
|
stopWhen: {
|
|
145
144
|
stepCountIs?: number | undefined;
|
|
146
145
|
} | null;
|
|
146
|
+
agentId: string;
|
|
147
147
|
prompt: string | null;
|
|
148
148
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
149
149
|
} | null;
|
|
@@ -151,13 +151,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
151
151
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
152
152
|
scopes: ProjectScopeConfig;
|
|
153
153
|
}) => Promise<{
|
|
154
|
-
|
|
155
|
-
projectId: string;
|
|
154
|
+
description: string | null;
|
|
156
155
|
id: string;
|
|
157
|
-
createdAt: string;
|
|
158
156
|
name: string;
|
|
157
|
+
createdAt: string;
|
|
159
158
|
updatedAt: string;
|
|
160
|
-
|
|
159
|
+
projectId: string;
|
|
160
|
+
tenantId: string;
|
|
161
161
|
models: {
|
|
162
162
|
base?: {
|
|
163
163
|
model?: string | undefined;
|
|
@@ -181,9 +181,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
181
181
|
stopWhen: {
|
|
182
182
|
transferCountIs?: number | undefined;
|
|
183
183
|
} | null;
|
|
184
|
+
prompt: string | null;
|
|
184
185
|
defaultSubAgentId: string | null;
|
|
185
186
|
contextConfigId: string | null;
|
|
186
|
-
prompt: string | null;
|
|
187
187
|
statusUpdates: {
|
|
188
188
|
enabled?: boolean | undefined;
|
|
189
189
|
numEvents?: number | undefined;
|
|
@@ -281,13 +281,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
281
281
|
projectIds: string[];
|
|
282
282
|
}): Promise<AvailableAgentInfo[]>;
|
|
283
283
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
284
|
-
|
|
285
|
-
projectId: string;
|
|
284
|
+
description: string | null;
|
|
286
285
|
id: string;
|
|
287
|
-
createdAt: string;
|
|
288
286
|
name: string;
|
|
287
|
+
createdAt: string;
|
|
289
288
|
updatedAt: string;
|
|
290
|
-
|
|
289
|
+
projectId: string;
|
|
290
|
+
tenantId: string;
|
|
291
291
|
models: {
|
|
292
292
|
base?: {
|
|
293
293
|
model?: string | undefined;
|
|
@@ -311,9 +311,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
311
311
|
stopWhen: {
|
|
312
312
|
transferCountIs?: number | undefined;
|
|
313
313
|
} | null;
|
|
314
|
+
prompt: string | null;
|
|
314
315
|
defaultSubAgentId: string | null;
|
|
315
316
|
contextConfigId: string | null;
|
|
316
|
-
prompt: string | null;
|
|
317
317
|
statusUpdates: {
|
|
318
318
|
enabled?: boolean | undefined;
|
|
319
319
|
numEvents?: number | undefined;
|
|
@@ -16,7 +16,7 @@ import { getAgentRelations, getAgentRelationsByAgent } from "./subAgentRelations
|
|
|
16
16
|
import { getSubAgentById } from "./subAgents.js";
|
|
17
17
|
import { getSubAgentTeamAgentRelationsByAgent } from "./subAgentTeamAgentRelations.js";
|
|
18
18
|
import { listTools } from "./tools.js";
|
|
19
|
-
import { listTriggers } from "./triggers.js";
|
|
19
|
+
import { getTriggerUsersBatch, listTriggers } from "./triggers.js";
|
|
20
20
|
import { and, count, desc, eq, inArray, sql } from "drizzle-orm";
|
|
21
21
|
|
|
22
22
|
//#region src/data-access/manage/agents.ts
|
|
@@ -552,6 +552,15 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
|
|
|
552
552
|
count: triggersList.length
|
|
553
553
|
}, "Fetched triggers for agent");
|
|
554
554
|
if (triggersList.length > 0) {
|
|
555
|
+
const triggerIds = triggersList.map((t) => t.id);
|
|
556
|
+
const usersByTrigger = await getTriggerUsersBatch(db)({
|
|
557
|
+
scopes: {
|
|
558
|
+
tenantId,
|
|
559
|
+
projectId,
|
|
560
|
+
agentId
|
|
561
|
+
},
|
|
562
|
+
triggerIds
|
|
563
|
+
});
|
|
555
564
|
const triggersObject = {};
|
|
556
565
|
for (const trigger of triggersList) triggersObject[trigger.id] = {
|
|
557
566
|
id: trigger.id,
|
|
@@ -564,7 +573,9 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
|
|
|
564
573
|
authentication: trigger.authentication,
|
|
565
574
|
signingSecretCredentialReferenceId: trigger.signingSecretCredentialReferenceId,
|
|
566
575
|
signatureVerification: trigger.signatureVerification,
|
|
576
|
+
dispatchDelayMs: trigger.dispatchDelayMs,
|
|
567
577
|
runAsUserId: trigger.runAsUserId,
|
|
578
|
+
runAsUserIds: usersByTrigger.get(trigger.id) ?? [],
|
|
568
579
|
createdBy: trigger.createdBy
|
|
569
580
|
};
|
|
570
581
|
result.triggers = triggersObject;
|
|
@@ -9,13 +9,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
scopes: ProjectScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
|
|
13
|
-
projectId: string;
|
|
12
|
+
description: string | null;
|
|
14
13
|
id: string;
|
|
15
|
-
createdAt: string;
|
|
16
14
|
name: string;
|
|
15
|
+
createdAt: string;
|
|
17
16
|
updatedAt: string;
|
|
18
|
-
|
|
17
|
+
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
props: {
|
|
20
20
|
[x: string]: unknown;
|
|
21
21
|
type: "object";
|
|
@@ -65,13 +65,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
68
|
-
|
|
69
|
-
projectId: string;
|
|
68
|
+
description: string | null;
|
|
70
69
|
id: string;
|
|
71
|
-
createdAt: string;
|
|
72
70
|
name: string;
|
|
71
|
+
createdAt: string;
|
|
73
72
|
updatedAt: string;
|
|
74
|
-
|
|
73
|
+
projectId: string;
|
|
74
|
+
tenantId: string;
|
|
75
75
|
props: {
|
|
76
76
|
[x: string]: unknown;
|
|
77
77
|
type: "object";
|
|
@@ -141,12 +141,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
141
141
|
scopes: SubAgentScopeConfig;
|
|
142
142
|
artifactComponentId: string;
|
|
143
143
|
}) => Promise<{
|
|
144
|
-
|
|
144
|
+
id: string;
|
|
145
|
+
createdAt: string;
|
|
145
146
|
projectId: string;
|
|
147
|
+
tenantId: string;
|
|
146
148
|
agentId: string;
|
|
147
149
|
subAgentId: string;
|
|
148
|
-
id: string;
|
|
149
|
-
createdAt: string;
|
|
150
150
|
artifactComponentId: string;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -184,12 +184,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
184
184
|
scopes: SubAgentScopeConfig;
|
|
185
185
|
artifactComponentId: string;
|
|
186
186
|
}) => Promise<{
|
|
187
|
-
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: string;
|
|
188
189
|
projectId: string;
|
|
190
|
+
tenantId: string;
|
|
189
191
|
agentId: string;
|
|
190
192
|
subAgentId: string;
|
|
191
|
-
id: string;
|
|
192
|
-
createdAt: string;
|
|
193
193
|
artifactComponentId: string;
|
|
194
194
|
} | null>;
|
|
195
195
|
/**
|
|
@@ -9,24 +9,24 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
tenantId: string;
|
|
13
|
-
projectId: string;
|
|
14
|
-
agentId: string;
|
|
15
12
|
id: string;
|
|
16
13
|
createdAt: string;
|
|
17
14
|
updatedAt: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
agentId: string;
|
|
18
18
|
headersSchema: unknown;
|
|
19
19
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
22
|
scopes: AgentScopeConfig;
|
|
23
23
|
}) => Promise<{
|
|
24
|
-
tenantId: string;
|
|
25
|
-
projectId: string;
|
|
26
|
-
agentId: string;
|
|
27
24
|
id: string;
|
|
28
25
|
createdAt: string;
|
|
29
26
|
updatedAt: string;
|
|
27
|
+
projectId: string;
|
|
28
|
+
tenantId: string;
|
|
29
|
+
agentId: string;
|
|
30
30
|
headersSchema: unknown;
|
|
31
31
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
32
32
|
}[]>;
|
|
@@ -43,12 +43,12 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
45
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
46
|
-
tenantId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
agentId: string;
|
|
49
46
|
id: string;
|
|
50
47
|
createdAt: string;
|
|
51
48
|
updatedAt: string;
|
|
49
|
+
projectId: string;
|
|
50
|
+
tenantId: string;
|
|
51
|
+
agentId: string;
|
|
52
52
|
headersSchema: unknown;
|
|
53
53
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
54
54
|
}>;
|
|
@@ -83,12 +83,12 @@ declare const countContextConfigs: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
84
84
|
data: ContextConfigInsert;
|
|
85
85
|
}) => Promise<{
|
|
86
|
-
tenantId: string;
|
|
87
|
-
projectId: string;
|
|
88
|
-
agentId: string;
|
|
89
86
|
id: string;
|
|
90
87
|
createdAt: string;
|
|
91
88
|
updatedAt: string;
|
|
89
|
+
projectId: string;
|
|
90
|
+
tenantId: string;
|
|
91
|
+
agentId: string;
|
|
92
92
|
headersSchema: unknown;
|
|
93
93
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
94
94
|
}>;
|
|
@@ -65,12 +65,12 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
scopes: SubAgentScopeConfig;
|
|
66
66
|
dataComponentId: string;
|
|
67
67
|
}) => Promise<{
|
|
68
|
-
|
|
68
|
+
id: string;
|
|
69
|
+
createdAt: string;
|
|
69
70
|
projectId: string;
|
|
71
|
+
tenantId: string;
|
|
70
72
|
agentId: string;
|
|
71
73
|
subAgentId: string;
|
|
72
|
-
id: string;
|
|
73
|
-
createdAt: string;
|
|
74
74
|
dataComponentId: string;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -107,12 +107,12 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
107
107
|
scopes: SubAgentScopeConfig;
|
|
108
108
|
dataComponentId: string;
|
|
109
109
|
}) => Promise<{
|
|
110
|
-
|
|
110
|
+
id: string;
|
|
111
|
+
createdAt: string;
|
|
111
112
|
projectId: string;
|
|
113
|
+
tenantId: string;
|
|
112
114
|
agentId: string;
|
|
113
115
|
subAgentId: string;
|
|
114
|
-
id: string;
|
|
115
|
-
createdAt: string;
|
|
116
116
|
dataComponentId: string;
|
|
117
117
|
} | null>;
|
|
118
118
|
/**
|
|
@@ -53,14 +53,14 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
53
53
|
data: FunctionToolApiInsert;
|
|
54
54
|
scopes: AgentScopeConfig;
|
|
55
55
|
}) => Promise<{
|
|
56
|
-
|
|
57
|
-
projectId: string;
|
|
58
|
-
agentId: string;
|
|
56
|
+
description: string | null;
|
|
59
57
|
id: string;
|
|
60
|
-
createdAt: string;
|
|
61
58
|
name: string;
|
|
59
|
+
createdAt: string;
|
|
62
60
|
updatedAt: string;
|
|
63
|
-
|
|
61
|
+
projectId: string;
|
|
62
|
+
tenantId: string;
|
|
63
|
+
agentId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -95,14 +95,14 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
95
95
|
data: FunctionToolApiInsert;
|
|
96
96
|
scopes: AgentScopeConfig;
|
|
97
97
|
}) => Promise<{
|
|
98
|
-
|
|
99
|
-
projectId: string;
|
|
100
|
-
agentId: string;
|
|
98
|
+
description: string | null;
|
|
101
99
|
id: string;
|
|
102
|
-
createdAt: string;
|
|
103
100
|
name: string;
|
|
101
|
+
createdAt: string;
|
|
104
102
|
updatedAt: string;
|
|
105
|
-
|
|
103
|
+
projectId: string;
|
|
104
|
+
tenantId: string;
|
|
105
|
+
agentId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -157,17 +157,17 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
157
157
|
needsApproval?: boolean;
|
|
158
158
|
}> | null;
|
|
159
159
|
}) => Promise<{
|
|
160
|
-
tenantId: string;
|
|
161
|
-
projectId: string;
|
|
162
|
-
agentId: string;
|
|
163
|
-
subAgentId: string;
|
|
164
160
|
id: string;
|
|
165
161
|
createdAt: string;
|
|
166
162
|
updatedAt: string;
|
|
163
|
+
projectId: string;
|
|
164
|
+
tenantId: string;
|
|
165
|
+
agentId: string;
|
|
166
|
+
subAgentId: string;
|
|
167
|
+
functionToolId: string;
|
|
167
168
|
toolPolicies: Record<string, {
|
|
168
169
|
needsApproval?: boolean;
|
|
169
170
|
}> | null;
|
|
170
|
-
functionToolId: string;
|
|
171
171
|
}>;
|
|
172
172
|
/**
|
|
173
173
|
* Update an agent-function tool relation
|
|
@@ -222,17 +222,17 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
222
222
|
needsApproval?: boolean;
|
|
223
223
|
}> | null;
|
|
224
224
|
}) => Promise<{
|
|
225
|
-
tenantId: string;
|
|
226
|
-
projectId: string;
|
|
227
|
-
agentId: string;
|
|
228
|
-
subAgentId: string;
|
|
229
225
|
id: string;
|
|
230
226
|
createdAt: string;
|
|
231
227
|
updatedAt: string;
|
|
228
|
+
projectId: string;
|
|
229
|
+
tenantId: string;
|
|
230
|
+
agentId: string;
|
|
231
|
+
subAgentId: string;
|
|
232
|
+
functionToolId: string;
|
|
232
233
|
toolPolicies: Record<string, {
|
|
233
234
|
needsApproval?: boolean;
|
|
234
235
|
}> | null;
|
|
235
|
-
functionToolId: string;
|
|
236
236
|
}>;
|
|
237
237
|
//#endregion
|
|
238
238
|
export { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation };
|
|
@@ -15,15 +15,15 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
15
15
|
scopes: ProjectScopeConfig;
|
|
16
16
|
skillId: string;
|
|
17
17
|
}) => Promise<{
|
|
18
|
-
|
|
19
|
-
projectId: string;
|
|
18
|
+
description: string;
|
|
20
19
|
id: string;
|
|
20
|
+
name: string;
|
|
21
21
|
content: string;
|
|
22
|
+
metadata: Record<string, string> | null;
|
|
22
23
|
createdAt: string;
|
|
23
|
-
name: string;
|
|
24
24
|
updatedAt: string;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
projectId: string;
|
|
26
|
+
tenantId: string;
|
|
27
27
|
} | null>;
|
|
28
28
|
declare const getSkillByIdWithFiles: (db: AgentsManageDatabaseClient) => (params: {
|
|
29
29
|
scopes: ProjectScopeConfig;
|
|
@@ -110,15 +110,15 @@ interface WithTenantIdProjectId {
|
|
|
110
110
|
}
|
|
111
111
|
declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<SkillRecordWithFiles>;
|
|
112
112
|
declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<{
|
|
113
|
-
|
|
114
|
-
projectId: string;
|
|
113
|
+
description: string;
|
|
115
114
|
id: string;
|
|
115
|
+
name: string;
|
|
116
116
|
content: string;
|
|
117
|
+
metadata: Record<string, string> | null;
|
|
117
118
|
createdAt: string;
|
|
118
|
-
name: string;
|
|
119
119
|
updatedAt: string;
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
projectId: string;
|
|
121
|
+
tenantId: string;
|
|
122
122
|
}>;
|
|
123
123
|
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
124
124
|
scopes: ProjectScopeConfig;
|
|
@@ -139,16 +139,16 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
139
139
|
index: number;
|
|
140
140
|
alwaysLoaded?: boolean;
|
|
141
141
|
}) => Promise<{
|
|
142
|
-
tenantId: string;
|
|
143
|
-
projectId: string;
|
|
144
|
-
agentId: string;
|
|
145
|
-
subAgentId: string;
|
|
146
142
|
id: string;
|
|
147
|
-
skillId: string;
|
|
148
143
|
createdAt: string;
|
|
149
144
|
updatedAt: string;
|
|
145
|
+
projectId: string;
|
|
146
|
+
tenantId: string;
|
|
147
|
+
agentId: string;
|
|
148
|
+
subAgentId: string;
|
|
150
149
|
index: number;
|
|
151
150
|
alwaysLoaded: boolean;
|
|
151
|
+
skillId: string;
|
|
152
152
|
}>;
|
|
153
153
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
154
154
|
scopes: AgentScopeConfig;
|