@inkeep/agents-core 0.20.1 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4FMDWUE4.js → chunk-QEXLYPVZ.js} +1 -1
- package/dist/{chunk-B6F3RF4T.js → chunk-TNHJH73I.js} +14 -41
- package/dist/{chunk-LZJWVTQ2.js → chunk-TTIPV5QP.js} +11 -0
- package/dist/{chunk-VICWT3WO.js → chunk-XKJPMUGE.js} +1 -1
- package/dist/client-exports.cjs +10 -37
- package/dist/client-exports.js +2 -2
- package/dist/constants/models.cjs +11 -0
- package/dist/constants/models.d.cts +11 -0
- package/dist/constants/models.d.ts +11 -0
- package/dist/constants/models.js +1 -1
- package/dist/db/schema.cjs +13 -40
- package/dist/db/schema.d.cts +1 -1
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +143 -99
- package/dist/index.d.cts +27 -16
- package/dist/index.d.ts +27 -16
- package/dist/index.js +124 -64
- package/dist/{schema-CcSN2XcZ.d.cts → schema-BjQKqtdC.d.cts} +18 -18
- package/dist/{schema-D8h85qdU.d.ts → schema-DylNIx0j.d.ts} +18 -18
- package/dist/types/index.d.cts +8 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/validation/index.cjs +10 -37
- package/dist/validation/index.js +2 -2
- package/drizzle/0008_mysterious_crusher_hogan.sql +20 -0
- package/drizzle/meta/0008_snapshot.json +2753 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE } from './chunk-QFIITHNT.js';
|
|
2
|
-
export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-
|
|
2
|
+
export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-TTIPV5QP.js';
|
|
3
|
+
export { TaskState } from './chunk-H2F72PDA.js';
|
|
3
4
|
import { getLogger, convertZodToJsonSchema } from './chunk-YECQCT5N.js';
|
|
4
5
|
export { PinoLogger, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, getLogger, isZodSchema, loggerFactory, preview } from './chunk-YECQCT5N.js';
|
|
5
|
-
import { validateAndTypeAgentData, validateAgentStructure, isInternalAgent, isExternalAgent } from './chunk-
|
|
6
|
-
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences } from './chunk-
|
|
7
|
-
import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-
|
|
8
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SandboxConfigSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from './chunk-
|
|
9
|
-
import { schema_exports, contextConfigs, externalAgents, functions, functionTools,
|
|
10
|
-
export {
|
|
11
|
-
export { TaskState } from './chunk-H2F72PDA.js';
|
|
6
|
+
import { validateAndTypeAgentData, validateAgentStructure, isInternalAgent, isExternalAgent } from './chunk-QEXLYPVZ.js';
|
|
7
|
+
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences } from './chunk-QEXLYPVZ.js';
|
|
8
|
+
import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-XKJPMUGE.js';
|
|
9
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SandboxConfigSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from './chunk-XKJPMUGE.js';
|
|
10
|
+
import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentRelations, subAgents, subAgentToolRelations, tools, credentialReferences, agents, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-TNHJH73I.js';
|
|
11
|
+
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-TNHJH73I.js';
|
|
12
12
|
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
13
13
|
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-YFHT5M2R.js';
|
|
14
14
|
import { __commonJS, __require, __publicField } from './chunk-E6R6PML7.js';
|
|
@@ -213420,7 +213420,6 @@ var CredentialStuffer = class {
|
|
|
213420
213420
|
if (mcpType === MCPServerType.nango) {
|
|
213421
213421
|
return {
|
|
213422
213422
|
headers: {
|
|
213423
|
-
// For Nango MCP, authenticate with the Nango secret key
|
|
213424
213423
|
Authorization: `Bearer ${nangoCredentialData.secretKey}`,
|
|
213425
213424
|
"provider-config-key": nangoCredentialData.providerConfigKey,
|
|
213426
213425
|
"connection-id": nangoCredentialData.connectionId
|
|
@@ -214114,12 +214113,12 @@ var getFunctionToolsForSubAgent = (db) => {
|
|
|
214114
214113
|
scopes: { tenantId, projectId, agentId },
|
|
214115
214114
|
pagination: { page: 1, limit: 1e3 }
|
|
214116
214115
|
});
|
|
214117
|
-
const relations = await db.select().from(
|
|
214116
|
+
const relations = await db.select().from(subAgentFunctionToolRelations).where(
|
|
214118
214117
|
and(
|
|
214119
|
-
eq(
|
|
214120
|
-
eq(
|
|
214121
|
-
eq(
|
|
214122
|
-
eq(
|
|
214118
|
+
eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
214119
|
+
eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
214120
|
+
eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
214121
|
+
eq(subAgentFunctionToolRelations.subAgentId, subAgentId)
|
|
214123
214122
|
)
|
|
214124
214123
|
);
|
|
214125
214124
|
const relatedFunctionToolIds = new Set(relations.map((r) => r.functionToolId));
|
|
@@ -214140,17 +214139,43 @@ var getFunctionToolsForSubAgent = (db) => {
|
|
|
214140
214139
|
};
|
|
214141
214140
|
};
|
|
214142
214141
|
var upsertSubAgentFunctionToolRelation = (db) => async (params) => {
|
|
214143
|
-
|
|
214142
|
+
const { scopes, subAgentId, functionToolId, relationId } = params;
|
|
214143
|
+
const { tenantId, projectId, agentId } = scopes;
|
|
214144
|
+
if (relationId) {
|
|
214144
214145
|
return await updateSubAgentFunctionToolRelation(db)({
|
|
214145
|
-
scopes
|
|
214146
|
-
relationId
|
|
214146
|
+
scopes,
|
|
214147
|
+
relationId,
|
|
214147
214148
|
data: {
|
|
214148
|
-
subAgentId
|
|
214149
|
-
functionToolId
|
|
214149
|
+
subAgentId,
|
|
214150
|
+
functionToolId
|
|
214150
214151
|
}
|
|
214151
214152
|
});
|
|
214152
214153
|
}
|
|
214153
|
-
|
|
214154
|
+
try {
|
|
214155
|
+
const existingRelations = await db.select().from(subAgentFunctionToolRelations).where(
|
|
214156
|
+
and(
|
|
214157
|
+
eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
214158
|
+
eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
214159
|
+
eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
214160
|
+
eq(subAgentFunctionToolRelations.subAgentId, subAgentId),
|
|
214161
|
+
eq(subAgentFunctionToolRelations.functionToolId, functionToolId)
|
|
214162
|
+
)
|
|
214163
|
+
).limit(1);
|
|
214164
|
+
if (existingRelations.length > 0) {
|
|
214165
|
+
logger3.info(
|
|
214166
|
+
{ tenantId, projectId, agentId, subAgentId, functionToolId, relationId: existingRelations[0].id },
|
|
214167
|
+
"Sub_agent-function tool relation already exists, returning existing relation"
|
|
214168
|
+
);
|
|
214169
|
+
return { id: existingRelations[0].id };
|
|
214170
|
+
}
|
|
214171
|
+
return await addFunctionToolToSubAgent(db)(params);
|
|
214172
|
+
} catch (error) {
|
|
214173
|
+
logger3.error(
|
|
214174
|
+
{ tenantId, projectId, agentId, subAgentId, functionToolId, error },
|
|
214175
|
+
"Failed to upsert sub_agent-function tool relation"
|
|
214176
|
+
);
|
|
214177
|
+
throw error;
|
|
214178
|
+
}
|
|
214154
214179
|
};
|
|
214155
214180
|
var addFunctionToolToSubAgent = (db) => {
|
|
214156
214181
|
return async (params) => {
|
|
@@ -214158,7 +214183,7 @@ var addFunctionToolToSubAgent = (db) => {
|
|
|
214158
214183
|
const { tenantId, projectId, agentId } = scopes;
|
|
214159
214184
|
try {
|
|
214160
214185
|
const relationId = nanoid();
|
|
214161
|
-
await db.insert(
|
|
214186
|
+
await db.insert(subAgentFunctionToolRelations).values({
|
|
214162
214187
|
id: relationId,
|
|
214163
214188
|
tenantId,
|
|
214164
214189
|
projectId,
|
|
@@ -214168,7 +214193,7 @@ var addFunctionToolToSubAgent = (db) => {
|
|
|
214168
214193
|
});
|
|
214169
214194
|
logger3.info(
|
|
214170
214195
|
{ tenantId, projectId, agentId, subAgentId, functionToolId, relationId },
|
|
214171
|
-
"Function tool added to
|
|
214196
|
+
"Function tool added to sub_agent"
|
|
214172
214197
|
);
|
|
214173
214198
|
return { id: relationId };
|
|
214174
214199
|
} catch (error) {
|
|
@@ -214185,20 +214210,20 @@ var updateSubAgentFunctionToolRelation = (db) => {
|
|
|
214185
214210
|
const { scopes, relationId, data } = params;
|
|
214186
214211
|
const { tenantId, projectId, agentId } = scopes;
|
|
214187
214212
|
try {
|
|
214188
|
-
await db.update(
|
|
214213
|
+
await db.update(subAgentFunctionToolRelations).set({
|
|
214189
214214
|
subAgentId: data.subAgentId,
|
|
214190
214215
|
functionToolId: data.functionToolId
|
|
214191
214216
|
}).where(
|
|
214192
214217
|
and(
|
|
214193
|
-
eq(
|
|
214194
|
-
eq(
|
|
214195
|
-
eq(
|
|
214196
|
-
eq(
|
|
214218
|
+
eq(subAgentFunctionToolRelations.id, relationId),
|
|
214219
|
+
eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
214220
|
+
eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
214221
|
+
eq(subAgentFunctionToolRelations.agentId, agentId)
|
|
214197
214222
|
)
|
|
214198
214223
|
);
|
|
214199
214224
|
logger3.info(
|
|
214200
214225
|
{ tenantId, projectId, agentId, relationId, data },
|
|
214201
|
-
"
|
|
214226
|
+
"SubAgent-function tool relation updated"
|
|
214202
214227
|
);
|
|
214203
214228
|
return { id: relationId };
|
|
214204
214229
|
} catch (error) {
|
|
@@ -214277,7 +214302,7 @@ var getAgentRelationsBySource = (db) => async (params) => {
|
|
|
214277
214302
|
pagination: { page, limit, total, pages }
|
|
214278
214303
|
};
|
|
214279
214304
|
};
|
|
214280
|
-
var
|
|
214305
|
+
var getSubAgentRelationsByTarget = (db) => async (params) => {
|
|
214281
214306
|
const page = params.pagination?.page || 1;
|
|
214282
214307
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
214283
214308
|
const offset = (page - 1) * limit;
|
|
@@ -214405,7 +214430,7 @@ var getAgentRelationByParams = (db) => async (params) => {
|
|
|
214405
214430
|
where: and(...whereConditions)
|
|
214406
214431
|
});
|
|
214407
214432
|
};
|
|
214408
|
-
var
|
|
214433
|
+
var upsertSubAgentRelation = (db) => async (params) => {
|
|
214409
214434
|
const existing = await getAgentRelationByParams(db)({
|
|
214410
214435
|
scopes: { tenantId: params.tenantId, projectId: params.projectId, agentId: params.agentId },
|
|
214411
214436
|
sourceSubAgentId: params.sourceSubAgentId,
|
|
@@ -215131,7 +215156,6 @@ function createApiError({
|
|
|
215131
215156
|
const status = errorCodeToHttpStatus[code];
|
|
215132
215157
|
const title = getTitleFromCode(code);
|
|
215133
215158
|
const problemDetails = {
|
|
215134
|
-
// type,
|
|
215135
215159
|
title,
|
|
215136
215160
|
status,
|
|
215137
215161
|
detail: message,
|
|
@@ -216242,21 +216266,21 @@ var getFullAgentDefinition = (db) => async ({
|
|
|
216242
216266
|
tenantId: functionTools.tenantId,
|
|
216243
216267
|
projectId: functionTools.projectId,
|
|
216244
216268
|
agentId: functionTools.agentId,
|
|
216245
|
-
agentToolRelationId:
|
|
216246
|
-
}).from(
|
|
216269
|
+
agentToolRelationId: subAgentFunctionToolRelations.id
|
|
216270
|
+
}).from(subAgentFunctionToolRelations).innerJoin(
|
|
216247
216271
|
functionTools,
|
|
216248
216272
|
and(
|
|
216249
|
-
eq(
|
|
216250
|
-
eq(
|
|
216251
|
-
eq(
|
|
216252
|
-
eq(
|
|
216273
|
+
eq(subAgentFunctionToolRelations.functionToolId, functionTools.id),
|
|
216274
|
+
eq(subAgentFunctionToolRelations.tenantId, functionTools.tenantId),
|
|
216275
|
+
eq(subAgentFunctionToolRelations.projectId, functionTools.projectId),
|
|
216276
|
+
eq(subAgentFunctionToolRelations.agentId, functionTools.agentId)
|
|
216253
216277
|
)
|
|
216254
216278
|
).where(
|
|
216255
216279
|
and(
|
|
216256
|
-
eq(
|
|
216257
|
-
eq(
|
|
216258
|
-
eq(
|
|
216259
|
-
eq(
|
|
216280
|
+
eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
216281
|
+
eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
216282
|
+
eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
216283
|
+
eq(subAgentFunctionToolRelations.subAgentId, agent2.id)
|
|
216260
216284
|
)
|
|
216261
216285
|
);
|
|
216262
216286
|
const agentDataComponentRelations = await db.query.subAgentDataComponents.findMany({
|
|
@@ -217979,18 +218003,18 @@ var createFullAgentServerSide = (db, logger13 = defaultLogger) => async (scopes,
|
|
|
217979
218003
|
}
|
|
217980
218004
|
await Promise.all(agentArtifactComponentPromises);
|
|
217981
218005
|
logger13.info({}, "All agent-artifact component relations created");
|
|
217982
|
-
const
|
|
218006
|
+
const subAgentRelationPromises = [];
|
|
217983
218007
|
for (const [subAgentId, agentData2] of Object.entries(typed.subAgents)) {
|
|
217984
218008
|
if (isInternalAgent(agentData2) && agentData2.canTransferTo) {
|
|
217985
218009
|
for (const targetSubAgentId of agentData2.canTransferTo) {
|
|
217986
|
-
|
|
218010
|
+
subAgentRelationPromises.push(
|
|
217987
218011
|
(async () => {
|
|
217988
218012
|
try {
|
|
217989
218013
|
logger13.info(
|
|
217990
218014
|
{ subAgentId, targetSubAgentId, type: "transfer" },
|
|
217991
218015
|
"Processing agent transfer relation"
|
|
217992
218016
|
);
|
|
217993
|
-
await
|
|
218017
|
+
await upsertSubAgentRelation(db)({
|
|
217994
218018
|
id: nanoid(),
|
|
217995
218019
|
tenantId,
|
|
217996
218020
|
projectId,
|
|
@@ -218017,14 +218041,14 @@ var createFullAgentServerSide = (db, logger13 = defaultLogger) => async (scopes,
|
|
|
218017
218041
|
for (const targetSubAgentId of agentData2.canDelegateTo) {
|
|
218018
218042
|
const targetAgentData = typed.subAgents[targetSubAgentId];
|
|
218019
218043
|
const isTargetExternal = isExternalAgent(targetAgentData);
|
|
218020
|
-
|
|
218044
|
+
subAgentRelationPromises.push(
|
|
218021
218045
|
(async () => {
|
|
218022
218046
|
try {
|
|
218023
218047
|
logger13.info(
|
|
218024
218048
|
{ subAgentId, targetSubAgentId, type: "delegate" },
|
|
218025
218049
|
"Processing agent delegation relation"
|
|
218026
218050
|
);
|
|
218027
|
-
await
|
|
218051
|
+
await upsertSubAgentRelation(db)({
|
|
218028
218052
|
id: nanoid(),
|
|
218029
218053
|
tenantId,
|
|
218030
218054
|
projectId,
|
|
@@ -218049,10 +218073,10 @@ var createFullAgentServerSide = (db, logger13 = defaultLogger) => async (scopes,
|
|
|
218049
218073
|
}
|
|
218050
218074
|
}
|
|
218051
218075
|
}
|
|
218052
|
-
await Promise.all(
|
|
218076
|
+
await Promise.all(subAgentRelationPromises);
|
|
218053
218077
|
logger13.info(
|
|
218054
|
-
{
|
|
218055
|
-
"All agent relations created"
|
|
218078
|
+
{ subAgentRelationCount: subAgentRelationPromises.length },
|
|
218079
|
+
"All sub-agent relations created"
|
|
218056
218080
|
);
|
|
218057
218081
|
const createdAgent = await getFullAgentDefinition(db)({
|
|
218058
218082
|
scopes: { tenantId, projectId, agentId: finalAgentId }
|
|
@@ -218835,10 +218859,8 @@ function determineMimeTypes(artifact) {
|
|
|
218835
218859
|
function sanitizeArtifactForDatabase(artifact) {
|
|
218836
218860
|
return {
|
|
218837
218861
|
...artifact,
|
|
218838
|
-
// Ensure text fields don't exceed reasonable limits
|
|
218839
218862
|
name: artifact.name?.slice(0, 255) || void 0,
|
|
218840
218863
|
description: artifact.description?.slice(0, 1e3) || void 0,
|
|
218841
|
-
// Clean any undefined values from JSON fields
|
|
218842
218864
|
parts: artifact.parts ? JSON.parse(JSON.stringify(artifact.parts)) : null,
|
|
218843
218865
|
metadata: artifact.metadata ? JSON.parse(JSON.stringify(artifact.metadata)) : null
|
|
218844
218866
|
};
|
|
@@ -218945,7 +218967,6 @@ var addLedgerArtifacts = (db) => async (params) => {
|
|
|
218945
218967
|
description: sanitizedArt.description,
|
|
218946
218968
|
parts: sanitizedArt.parts,
|
|
218947
218969
|
metadata: sanitizedArt.metadata,
|
|
218948
|
-
// extra (optional) ledger fields
|
|
218949
218970
|
summary: sanitizedArt.description?.slice(0, 200) ?? null,
|
|
218950
218971
|
mime: determineMimeTypes(sanitizedArt),
|
|
218951
218972
|
// Simple string fallback until we debug the issue
|
|
@@ -220035,8 +220056,6 @@ var getFullProject = (db, logger13 = defaultLogger2) => async (params) => {
|
|
|
220035
220056
|
imageUrl: tool2.imageUrl || void 0,
|
|
220036
220057
|
capabilities: tool2.capabilities || void 0,
|
|
220037
220058
|
lastError: tool2.lastError || void 0
|
|
220038
|
-
// Don't include runtime fields in configuration
|
|
220039
|
-
// status, lastHealthCheck, availableTools, activeTools, lastToolsSync are all runtime
|
|
220040
220059
|
};
|
|
220041
220060
|
}
|
|
220042
220061
|
logger13.info(
|
|
@@ -221893,6 +221912,21 @@ var KeyChainStore = class {
|
|
|
221893
221912
|
const credential = await this.get(key);
|
|
221894
221913
|
return credential !== null;
|
|
221895
221914
|
}
|
|
221915
|
+
/**
|
|
221916
|
+
* Check if the credential store is available and functional
|
|
221917
|
+
*/
|
|
221918
|
+
async checkAvailability() {
|
|
221919
|
+
await this.initializationPromise;
|
|
221920
|
+
if (!this.keytarAvailable || !this.keytar) {
|
|
221921
|
+
return {
|
|
221922
|
+
available: false,
|
|
221923
|
+
reason: "Keytar not available - cannot store credentials in system keychain"
|
|
221924
|
+
};
|
|
221925
|
+
}
|
|
221926
|
+
return {
|
|
221927
|
+
available: true
|
|
221928
|
+
};
|
|
221929
|
+
}
|
|
221896
221930
|
/**
|
|
221897
221931
|
* Delete a credential from the keychain
|
|
221898
221932
|
*/
|
|
@@ -222034,6 +222068,14 @@ var InMemoryCredentialStore = class {
|
|
|
222034
222068
|
async delete(key) {
|
|
222035
222069
|
return this.credentials.delete(key);
|
|
222036
222070
|
}
|
|
222071
|
+
/**
|
|
222072
|
+
* Check if the credential store is available and functional
|
|
222073
|
+
*/
|
|
222074
|
+
async checkAvailability() {
|
|
222075
|
+
return {
|
|
222076
|
+
available: true
|
|
222077
|
+
};
|
|
222078
|
+
}
|
|
222037
222079
|
};
|
|
222038
222080
|
var logger12 = getLogger("nango-credential-store");
|
|
222039
222081
|
var CredentialKeySchema = z$1.object({
|
|
@@ -222448,6 +222490,26 @@ var NangoCredentialStore = class {
|
|
|
222448
222490
|
return false;
|
|
222449
222491
|
}
|
|
222450
222492
|
}
|
|
222493
|
+
/**
|
|
222494
|
+
* Check if the credential store is available and functional
|
|
222495
|
+
*/
|
|
222496
|
+
async checkAvailability() {
|
|
222497
|
+
if (!this.nangoConfig.secretKey) {
|
|
222498
|
+
return {
|
|
222499
|
+
available: false,
|
|
222500
|
+
reason: "Nango secret key not configured"
|
|
222501
|
+
};
|
|
222502
|
+
}
|
|
222503
|
+
if (this.nangoConfig.secretKey.includes("mock") || this.nangoConfig.secretKey === "your_nango_secret_key") {
|
|
222504
|
+
return {
|
|
222505
|
+
available: false,
|
|
222506
|
+
reason: "Nango secret key appears to be a placeholder or mock value"
|
|
222507
|
+
};
|
|
222508
|
+
}
|
|
222509
|
+
return {
|
|
222510
|
+
available: true
|
|
222511
|
+
};
|
|
222512
|
+
}
|
|
222451
222513
|
};
|
|
222452
222514
|
function createNangoCredentialStore(id, config) {
|
|
222453
222515
|
const nangoSecretKey = config?.secretKey || process.env.NANGO_SECRET_KEY;
|
|
@@ -222475,15 +222537,13 @@ function createDefaultCredentialStores() {
|
|
|
222475
222537
|
})
|
|
222476
222538
|
);
|
|
222477
222539
|
}
|
|
222478
|
-
|
|
222479
|
-
|
|
222480
|
-
|
|
222481
|
-
|
|
222482
|
-
|
|
222483
|
-
|
|
222484
|
-
|
|
222485
|
-
);
|
|
222486
|
-
}
|
|
222540
|
+
try {
|
|
222541
|
+
stores.push(createKeyChainStore("keychain-default"));
|
|
222542
|
+
} catch (error) {
|
|
222543
|
+
console.warn(
|
|
222544
|
+
"Failed to create keychain store:",
|
|
222545
|
+
error instanceof Error ? error.message : error
|
|
222546
|
+
);
|
|
222487
222547
|
}
|
|
222488
222548
|
return stores;
|
|
222489
222549
|
}
|
|
@@ -222554,4 +222614,4 @@ typescript/lib/typescript.js:
|
|
|
222554
222614
|
***************************************************************************** *)
|
|
222555
222615
|
*/
|
|
222556
222616
|
|
|
222557
|
-
export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, TemplateEngine, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentRelation, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource,
|
|
222617
|
+
export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, TemplateEngine, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentRelation, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getRequestExecutionContext, getSubAgentById, getSubAgentRelationsByTarget, getSubAgentsByIds, getTask, getToolById, getToolsForAgent, getTracer, getVisibleMessages, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentFunctionToolRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHeaders, validateHttpRequestHeaders, validateInternalSubAgent, validateProjectExists, validationHelper, withProjectValidation };
|
|
@@ -3371,13 +3371,13 @@ declare const subAgentToolRelations: drizzle_orm_sqlite_core.SQLiteTableWithColu
|
|
|
3371
3371
|
};
|
|
3372
3372
|
dialect: "sqlite";
|
|
3373
3373
|
}>;
|
|
3374
|
-
declare const
|
|
3375
|
-
name: "
|
|
3374
|
+
declare const subAgentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
3375
|
+
name: "sub_agent_function_tool_relations";
|
|
3376
3376
|
schema: undefined;
|
|
3377
3377
|
columns: {
|
|
3378
3378
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3379
3379
|
name: "created_at";
|
|
3380
|
-
tableName: "
|
|
3380
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3381
3381
|
dataType: "string";
|
|
3382
3382
|
columnType: "SQLiteText";
|
|
3383
3383
|
data: string;
|
|
@@ -3396,7 +3396,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3396
3396
|
}>;
|
|
3397
3397
|
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3398
3398
|
name: "updated_at";
|
|
3399
|
-
tableName: "
|
|
3399
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3400
3400
|
dataType: "string";
|
|
3401
3401
|
columnType: "SQLiteText";
|
|
3402
3402
|
data: string;
|
|
@@ -3415,7 +3415,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3415
3415
|
}>;
|
|
3416
3416
|
functionToolId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3417
3417
|
name: "function_tool_id";
|
|
3418
|
-
tableName: "
|
|
3418
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3419
3419
|
dataType: "string";
|
|
3420
3420
|
columnType: "SQLiteText";
|
|
3421
3421
|
data: string;
|
|
@@ -3434,7 +3434,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3434
3434
|
}>;
|
|
3435
3435
|
subAgentId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3436
3436
|
name: "sub_agent_id";
|
|
3437
|
-
tableName: "
|
|
3437
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3438
3438
|
dataType: "string";
|
|
3439
3439
|
columnType: "SQLiteText";
|
|
3440
3440
|
data: string;
|
|
@@ -3453,7 +3453,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3453
3453
|
}>;
|
|
3454
3454
|
agentId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3455
3455
|
name: "agent_id";
|
|
3456
|
-
tableName: "
|
|
3456
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3457
3457
|
dataType: "string";
|
|
3458
3458
|
columnType: "SQLiteText";
|
|
3459
3459
|
data: string;
|
|
@@ -3472,7 +3472,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3472
3472
|
}>;
|
|
3473
3473
|
projectId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3474
3474
|
name: "project_id";
|
|
3475
|
-
tableName: "
|
|
3475
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3476
3476
|
dataType: "string";
|
|
3477
3477
|
columnType: "SQLiteText";
|
|
3478
3478
|
data: string;
|
|
@@ -3491,7 +3491,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3491
3491
|
}>;
|
|
3492
3492
|
tenantId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3493
3493
|
name: "tenant_id";
|
|
3494
|
-
tableName: "
|
|
3494
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3495
3495
|
dataType: "string";
|
|
3496
3496
|
columnType: "SQLiteText";
|
|
3497
3497
|
data: string;
|
|
@@ -3510,7 +3510,7 @@ declare const agentFunctionToolRelations: drizzle_orm_sqlite_core.SQLiteTableWit
|
|
|
3510
3510
|
}>;
|
|
3511
3511
|
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
3512
3512
|
name: "id";
|
|
3513
|
-
tableName: "
|
|
3513
|
+
tableName: "sub_agent_function_tool_relations";
|
|
3514
3514
|
dataType: "string";
|
|
3515
3515
|
columnType: "SQLiteText";
|
|
3516
3516
|
data: string;
|
|
@@ -4881,7 +4881,7 @@ declare const subAgentsRelations: drizzle_orm.Relations<"sub_agents", {
|
|
|
4881
4881
|
sentMessages: drizzle_orm.Many<"messages">;
|
|
4882
4882
|
receivedMessages: drizzle_orm.Many<"messages">;
|
|
4883
4883
|
toolRelations: drizzle_orm.Many<"sub_agent_tool_relations">;
|
|
4884
|
-
functionToolRelations: drizzle_orm.Many<"
|
|
4884
|
+
functionToolRelations: drizzle_orm.Many<"sub_agent_function_tool_relations">;
|
|
4885
4885
|
dataComponentRelations: drizzle_orm.Many<"sub_agent_data_components">;
|
|
4886
4886
|
artifactComponentRelations: drizzle_orm.Many<"sub_agent_artifact_components">;
|
|
4887
4887
|
}>;
|
|
@@ -4963,15 +4963,13 @@ declare const functionToolsRelations: drizzle_orm.Relations<"function_tools", {
|
|
|
4963
4963
|
project: drizzle_orm.One<"projects", true>;
|
|
4964
4964
|
agent: drizzle_orm.One<"agent", true>;
|
|
4965
4965
|
function: drizzle_orm.One<"functions", true>;
|
|
4966
|
-
|
|
4966
|
+
subAgentRelations: drizzle_orm.Many<"sub_agent_function_tool_relations">;
|
|
4967
4967
|
}>;
|
|
4968
|
-
declare const
|
|
4969
|
-
|
|
4968
|
+
declare const subAgentFunctionToolRelationsRelations: drizzle_orm.Relations<"sub_agent_function_tool_relations", {
|
|
4969
|
+
subAgent: drizzle_orm.One<"sub_agents", true>;
|
|
4970
4970
|
functionTool: drizzle_orm.One<"function_tools", true>;
|
|
4971
4971
|
}>;
|
|
4972
4972
|
|
|
4973
|
-
declare const schema_agentFunctionToolRelations: typeof agentFunctionToolRelations;
|
|
4974
|
-
declare const schema_agentFunctionToolRelationsRelations: typeof agentFunctionToolRelationsRelations;
|
|
4975
4973
|
declare const schema_agentRelations: typeof agentRelations;
|
|
4976
4974
|
declare const schema_agentToolRelationsRelations: typeof agentToolRelationsRelations;
|
|
4977
4975
|
declare const schema_agents: typeof agents;
|
|
@@ -5005,6 +5003,8 @@ declare const schema_subAgentArtifactComponents: typeof subAgentArtifactComponen
|
|
|
5005
5003
|
declare const schema_subAgentArtifactComponentsRelations: typeof subAgentArtifactComponentsRelations;
|
|
5006
5004
|
declare const schema_subAgentDataComponents: typeof subAgentDataComponents;
|
|
5007
5005
|
declare const schema_subAgentDataComponentsRelations: typeof subAgentDataComponentsRelations;
|
|
5006
|
+
declare const schema_subAgentFunctionToolRelations: typeof subAgentFunctionToolRelations;
|
|
5007
|
+
declare const schema_subAgentFunctionToolRelationsRelations: typeof subAgentFunctionToolRelationsRelations;
|
|
5008
5008
|
declare const schema_subAgentRelations: typeof subAgentRelations;
|
|
5009
5009
|
declare const schema_subAgentRelationsRelations: typeof subAgentRelationsRelations;
|
|
5010
5010
|
declare const schema_subAgentToolRelations: typeof subAgentToolRelations;
|
|
@@ -5017,7 +5017,7 @@ declare const schema_tasksRelations: typeof tasksRelations;
|
|
|
5017
5017
|
declare const schema_tools: typeof tools;
|
|
5018
5018
|
declare const schema_toolsRelations: typeof toolsRelations;
|
|
5019
5019
|
declare namespace schema {
|
|
5020
|
-
export {
|
|
5020
|
+
export { schema_agentRelations as agentRelations, schema_agentToolRelationsRelations as agentToolRelationsRelations, schema_agents as agents, schema_apiKeys as apiKeys, schema_apiKeysRelations as apiKeysRelations, schema_artifactComponents as artifactComponents, schema_artifactComponentsRelations as artifactComponentsRelations, schema_contextCache as contextCache, schema_contextCacheRelations as contextCacheRelations, schema_contextConfigs as contextConfigs, schema_contextConfigsRelations as contextConfigsRelations, schema_conversations as conversations, schema_conversationsRelations as conversationsRelations, schema_credentialReferences as credentialReferences, schema_credentialReferencesRelations as credentialReferencesRelations, schema_dataComponents as dataComponents, schema_dataComponentsRelations as dataComponentsRelations, schema_externalAgents as externalAgents, schema_externalAgentsRelations as externalAgentsRelations, schema_functionTools as functionTools, schema_functionToolsRelations as functionToolsRelations, schema_functions as functions, schema_functionsRelations as functionsRelations, schema_ledgerArtifacts as ledgerArtifacts, schema_ledgerArtifactsRelations as ledgerArtifactsRelations, schema_messages as messages, schema_messagesRelations as messagesRelations, schema_projects as projects, schema_projectsRelations as projectsRelations, schema_subAgentArtifactComponents as subAgentArtifactComponents, schema_subAgentArtifactComponentsRelations as subAgentArtifactComponentsRelations, schema_subAgentDataComponents as subAgentDataComponents, schema_subAgentDataComponentsRelations as subAgentDataComponentsRelations, schema_subAgentFunctionToolRelations as subAgentFunctionToolRelations, schema_subAgentFunctionToolRelationsRelations as subAgentFunctionToolRelationsRelations, schema_subAgentRelations as subAgentRelations, schema_subAgentRelationsRelations as subAgentRelationsRelations, schema_subAgentToolRelations as subAgentToolRelations, schema_subAgents as subAgents, schema_subAgentsRelations as subAgentsRelations, schema_taskRelations as taskRelations, schema_taskRelationsRelations as taskRelationsRelations, schema_tasks as tasks, schema_tasksRelations as tasksRelations, schema_tools as tools, schema_toolsRelations as toolsRelations };
|
|
5021
5021
|
}
|
|
5022
5022
|
|
|
5023
|
-
export { taskRelationsRelations as A, contextConfigsRelations as B, contextCacheRelations as C, subAgentsRelations as D, agentRelations as E, externalAgentsRelations as F, apiKeysRelations as G, agentToolRelationsRelations as H, credentialReferencesRelations as I, toolsRelations as J, conversationsRelations as K, messagesRelations as L, artifactComponentsRelations as M, subAgentArtifactComponentsRelations as N, dataComponentsRelations as O, subAgentDataComponentsRelations as P, ledgerArtifactsRelations as Q, functionsRelations as R, subAgentRelationsRelations as S, functionToolsRelations as T,
|
|
5023
|
+
export { taskRelationsRelations as A, contextConfigsRelations as B, contextCacheRelations as C, subAgentsRelations as D, agentRelations as E, externalAgentsRelations as F, apiKeysRelations as G, agentToolRelationsRelations as H, credentialReferencesRelations as I, toolsRelations as J, conversationsRelations as K, messagesRelations as L, artifactComponentsRelations as M, subAgentArtifactComponentsRelations as N, dataComponentsRelations as O, subAgentDataComponentsRelations as P, ledgerArtifactsRelations as Q, functionsRelations as R, subAgentRelationsRelations as S, functionToolsRelations as T, subAgentFunctionToolRelationsRelations as U, agents as a, contextCache as b, contextConfigs as c, subAgents as d, subAgentRelations as e, externalAgents as f, taskRelations as g, dataComponents as h, subAgentDataComponents as i, artifactComponents as j, subAgentArtifactComponents as k, tools as l, functionTools as m, functions as n, subAgentToolRelations as o, projects as p, subAgentFunctionToolRelations as q, conversations as r, schema as s, tasks as t, messages as u, ledgerArtifacts as v, apiKeys as w, credentialReferences as x, tasksRelations as y, projectsRelations as z };
|