@inkeep/agents-core 0.0.0-dev-20260102022857 → 0.0.0-dev-20260105194521
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/constants/otel-attributes.d.ts +2 -0
- package/dist/constants/otel-attributes.js +4 -2
- package/dist/constants/signoz-queries.d.ts +1 -0
- package/dist/constants/signoz-queries.js +2 -1
- package/dist/data-access/agents.d.ts +31 -31
- package/dist/data-access/apiKeys.d.ts +8 -8
- package/dist/data-access/artifactComponents.d.ts +6 -6
- package/dist/data-access/contextConfigs.d.ts +12 -12
- package/dist/data-access/conversations.d.ts +4 -4
- package/dist/data-access/dataComponents.d.ts +4 -4
- package/dist/data-access/functionTools.d.ts +4 -4
- package/dist/data-access/ledgerArtifacts.d.ts +4 -2
- package/dist/data-access/ledgerArtifacts.js +10 -6
- package/dist/data-access/messages.d.ts +9 -9
- package/dist/data-access/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/subAgentRelations.d.ts +16 -16
- package/dist/data-access/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/subAgents.d.ts +9 -9
- package/dist/data-access/tasks.d.ts +2 -2
- package/dist/data-access/tools.d.ts +9 -9
- package/dist/types/a2a.d.ts +1 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +192 -192
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ declare const SPAN_NAMES: {
|
|
|
14
14
|
readonly TOOL_APPROVAL_REQUESTED: "tool.approval_requested";
|
|
15
15
|
readonly TOOL_APPROVAL_APPROVED: "tool.approval_approved";
|
|
16
16
|
readonly TOOL_APPROVAL_DENIED: "tool.approval_denied";
|
|
17
|
+
readonly COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress";
|
|
17
18
|
};
|
|
18
19
|
declare const AI_OPERATIONS: {
|
|
19
20
|
readonly GENERATE_TEXT: "ai.generateText.doGenerate";
|
|
@@ -113,6 +114,7 @@ declare const ACTIVITY_TYPES: {
|
|
|
113
114
|
readonly TOOL_APPROVAL_REQUESTED: "tool_approval_requested";
|
|
114
115
|
readonly TOOL_APPROVAL_APPROVED: "tool_approval_approved";
|
|
115
116
|
readonly TOOL_APPROVAL_DENIED: "tool_approval_denied";
|
|
117
|
+
readonly COMPRESSION: "compression";
|
|
116
118
|
};
|
|
117
119
|
/** Activity Status Values */
|
|
118
120
|
declare const ACTIVITY_STATUS: {
|
|
@@ -13,7 +13,8 @@ const SPAN_NAMES = {
|
|
|
13
13
|
ARTIFACT_PROCESSING: "agent_session.process_artifact",
|
|
14
14
|
TOOL_APPROVAL_REQUESTED: "tool.approval_requested",
|
|
15
15
|
TOOL_APPROVAL_APPROVED: "tool.approval_approved",
|
|
16
|
-
TOOL_APPROVAL_DENIED: "tool.approval_denied"
|
|
16
|
+
TOOL_APPROVAL_DENIED: "tool.approval_denied",
|
|
17
|
+
COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress"
|
|
17
18
|
};
|
|
18
19
|
const AI_OPERATIONS = {
|
|
19
20
|
GENERATE_TEXT: "ai.generateText.doGenerate",
|
|
@@ -112,7 +113,8 @@ const ACTIVITY_TYPES = {
|
|
|
112
113
|
AI_MODEL_STREAMED_OBJECT: "ai_model_streamed_object",
|
|
113
114
|
TOOL_APPROVAL_REQUESTED: "tool_approval_requested",
|
|
114
115
|
TOOL_APPROVAL_APPROVED: "tool_approval_approved",
|
|
115
|
-
TOOL_APPROVAL_DENIED: "tool_approval_denied"
|
|
116
|
+
TOOL_APPROVAL_DENIED: "tool_approval_denied",
|
|
117
|
+
COMPRESSION: "compression"
|
|
116
118
|
};
|
|
117
119
|
/** Activity Status Values */
|
|
118
120
|
const ACTIVITY_STATUS = {
|
|
@@ -103,6 +103,7 @@ declare const QUERY_EXPRESSIONS: {
|
|
|
103
103
|
readonly TOOL_APPROVAL_REQUESTED: "toolApprovalRequested";
|
|
104
104
|
readonly TOOL_APPROVAL_APPROVED: "toolApprovalApproved";
|
|
105
105
|
readonly TOOL_APPROVAL_DENIED: "toolApprovalDenied";
|
|
106
|
+
readonly COMPRESSION: "compression";
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
declare const REDUCE_OPERATIONS: {
|
|
@@ -102,7 +102,8 @@ const QUERY_EXPRESSIONS = {
|
|
|
102
102
|
ARTIFACT_PROCESSING: "artifactProcessing",
|
|
103
103
|
TOOL_APPROVAL_REQUESTED: "toolApprovalRequested",
|
|
104
104
|
TOOL_APPROVAL_APPROVED: "toolApprovalApproved",
|
|
105
|
-
TOOL_APPROVAL_DENIED: "toolApprovalDenied"
|
|
105
|
+
TOOL_APPROVAL_DENIED: "toolApprovalDenied",
|
|
106
|
+
COMPRESSION: "compression"
|
|
106
107
|
};
|
|
107
108
|
/** Query Reduce Operations */
|
|
108
109
|
const REDUCE_OPERATIONS = {
|
|
@@ -13,9 +13,10 @@ declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
description: string | null;
|
|
16
|
-
tenantId: string;
|
|
17
16
|
projectId: string;
|
|
18
|
-
|
|
17
|
+
tenantId: string;
|
|
18
|
+
defaultSubAgentId: string | null;
|
|
19
|
+
contextConfigId: string | null;
|
|
19
20
|
models: {
|
|
20
21
|
base?: {
|
|
21
22
|
model?: string | undefined;
|
|
@@ -30,11 +31,7 @@ declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
|
30
31
|
providerOptions?: Record<string, any> | undefined;
|
|
31
32
|
} | undefined;
|
|
32
33
|
} | null;
|
|
33
|
-
|
|
34
|
-
transferCountIs?: number | undefined;
|
|
35
|
-
} | null;
|
|
36
|
-
defaultSubAgentId: string | null;
|
|
37
|
-
contextConfigId: string | null;
|
|
34
|
+
prompt: string | null;
|
|
38
35
|
statusUpdates: {
|
|
39
36
|
enabled?: boolean | undefined;
|
|
40
37
|
numEvents?: number | undefined;
|
|
@@ -50,6 +47,9 @@ declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
|
50
47
|
} | undefined;
|
|
51
48
|
}[] | undefined;
|
|
52
49
|
} | null;
|
|
50
|
+
stopWhen: {
|
|
51
|
+
transferCountIs?: number | undefined;
|
|
52
|
+
} | null;
|
|
53
53
|
} | null>;
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -59,9 +59,10 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
59
59
|
createdAt: string;
|
|
60
60
|
updatedAt: string;
|
|
61
61
|
description: string | null;
|
|
62
|
-
tenantId: string;
|
|
63
62
|
projectId: string;
|
|
64
|
-
|
|
63
|
+
tenantId: string;
|
|
64
|
+
defaultSubAgentId: string | null;
|
|
65
|
+
contextConfigId: string | null;
|
|
65
66
|
models: {
|
|
66
67
|
base?: {
|
|
67
68
|
model?: string | undefined;
|
|
@@ -76,11 +77,7 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
76
77
|
providerOptions?: Record<string, any> | undefined;
|
|
77
78
|
} | undefined;
|
|
78
79
|
} | null;
|
|
79
|
-
|
|
80
|
-
transferCountIs?: number | undefined;
|
|
81
|
-
} | null;
|
|
82
|
-
defaultSubAgentId: string | null;
|
|
83
|
-
contextConfigId: string | null;
|
|
80
|
+
prompt: string | null;
|
|
84
81
|
statusUpdates: {
|
|
85
82
|
enabled?: boolean | undefined;
|
|
86
83
|
numEvents?: number | undefined;
|
|
@@ -96,16 +93,18 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
96
93
|
} | undefined;
|
|
97
94
|
}[] | undefined;
|
|
98
95
|
} | null;
|
|
96
|
+
stopWhen: {
|
|
97
|
+
transferCountIs?: number | undefined;
|
|
98
|
+
} | null;
|
|
99
99
|
defaultSubAgent: {
|
|
100
100
|
id: string;
|
|
101
101
|
name: string;
|
|
102
102
|
createdAt: string;
|
|
103
103
|
updatedAt: string;
|
|
104
104
|
description: string | null;
|
|
105
|
-
tenantId: string;
|
|
106
|
-
projectId: string;
|
|
107
|
-
prompt: string | null;
|
|
108
105
|
agentId: string;
|
|
106
|
+
projectId: string;
|
|
107
|
+
tenantId: string;
|
|
109
108
|
models: {
|
|
110
109
|
base?: {
|
|
111
110
|
model?: string | undefined;
|
|
@@ -120,6 +119,7 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
120
119
|
providerOptions?: Record<string, any> | undefined;
|
|
121
120
|
} | undefined;
|
|
122
121
|
} | null;
|
|
122
|
+
prompt: string | null;
|
|
123
123
|
stopWhen: {
|
|
124
124
|
stepCountIs?: number | undefined;
|
|
125
125
|
} | null;
|
|
@@ -134,9 +134,10 @@ declare const listAgents: (db: DatabaseClient) => (params: {
|
|
|
134
134
|
createdAt: string;
|
|
135
135
|
updatedAt: string;
|
|
136
136
|
description: string | null;
|
|
137
|
-
tenantId: string;
|
|
138
137
|
projectId: string;
|
|
139
|
-
|
|
138
|
+
tenantId: string;
|
|
139
|
+
defaultSubAgentId: string | null;
|
|
140
|
+
contextConfigId: string | null;
|
|
140
141
|
models: {
|
|
141
142
|
base?: {
|
|
142
143
|
model?: string | undefined;
|
|
@@ -151,11 +152,7 @@ declare const listAgents: (db: DatabaseClient) => (params: {
|
|
|
151
152
|
providerOptions?: Record<string, any> | undefined;
|
|
152
153
|
} | undefined;
|
|
153
154
|
} | null;
|
|
154
|
-
|
|
155
|
-
transferCountIs?: number | undefined;
|
|
156
|
-
} | null;
|
|
157
|
-
defaultSubAgentId: string | null;
|
|
158
|
-
contextConfigId: string | null;
|
|
155
|
+
prompt: string | null;
|
|
159
156
|
statusUpdates: {
|
|
160
157
|
enabled?: boolean | undefined;
|
|
161
158
|
numEvents?: number | undefined;
|
|
@@ -171,6 +168,9 @@ declare const listAgents: (db: DatabaseClient) => (params: {
|
|
|
171
168
|
} | undefined;
|
|
172
169
|
}[] | undefined;
|
|
173
170
|
} | null;
|
|
171
|
+
stopWhen: {
|
|
172
|
+
transferCountIs?: number | undefined;
|
|
173
|
+
} | null;
|
|
174
174
|
}[]>;
|
|
175
175
|
declare const listAgentsPaginated: (db: DatabaseClient) => (params: {
|
|
176
176
|
scopes: ProjectScopeConfig;
|
|
@@ -233,9 +233,10 @@ declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promis
|
|
|
233
233
|
createdAt: string;
|
|
234
234
|
updatedAt: string;
|
|
235
235
|
description: string | null;
|
|
236
|
-
tenantId: string;
|
|
237
236
|
projectId: string;
|
|
238
|
-
|
|
237
|
+
tenantId: string;
|
|
238
|
+
defaultSubAgentId: string | null;
|
|
239
|
+
contextConfigId: string | null;
|
|
239
240
|
models: {
|
|
240
241
|
base?: {
|
|
241
242
|
model?: string | undefined;
|
|
@@ -250,11 +251,7 @@ declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promis
|
|
|
250
251
|
providerOptions?: Record<string, any> | undefined;
|
|
251
252
|
} | undefined;
|
|
252
253
|
} | null;
|
|
253
|
-
|
|
254
|
-
transferCountIs?: number | undefined;
|
|
255
|
-
} | null;
|
|
256
|
-
defaultSubAgentId: string | null;
|
|
257
|
-
contextConfigId: string | null;
|
|
254
|
+
prompt: string | null;
|
|
258
255
|
statusUpdates: {
|
|
259
256
|
enabled?: boolean | undefined;
|
|
260
257
|
numEvents?: number | undefined;
|
|
@@ -270,6 +267,9 @@ declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promis
|
|
|
270
267
|
} | undefined;
|
|
271
268
|
}[] | undefined;
|
|
272
269
|
} | null;
|
|
270
|
+
stopWhen: {
|
|
271
|
+
transferCountIs?: number | undefined;
|
|
272
|
+
} | null;
|
|
273
273
|
}>;
|
|
274
274
|
declare const updateAgent: (db: DatabaseClient) => (params: {
|
|
275
275
|
scopes: AgentScopeConfig;
|
|
@@ -12,9 +12,9 @@ declare const getApiKeyById: (db: DatabaseClient) => (params: {
|
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
expiresAt: string | null;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
projectId: string;
|
|
17
15
|
agentId: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
tenantId: string;
|
|
18
18
|
publicId: string;
|
|
19
19
|
keyHash: string;
|
|
20
20
|
keyPrefix: string;
|
|
@@ -26,9 +26,9 @@ declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) =>
|
|
|
26
26
|
createdAt: string;
|
|
27
27
|
updatedAt: string;
|
|
28
28
|
expiresAt: string | null;
|
|
29
|
-
tenantId: string;
|
|
30
|
-
projectId: string;
|
|
31
29
|
agentId: string;
|
|
30
|
+
projectId: string;
|
|
31
|
+
tenantId: string;
|
|
32
32
|
publicId: string;
|
|
33
33
|
keyHash: string;
|
|
34
34
|
keyPrefix: string;
|
|
@@ -43,9 +43,9 @@ declare const listApiKeys: (db: DatabaseClient) => (params: {
|
|
|
43
43
|
createdAt: string;
|
|
44
44
|
updatedAt: string;
|
|
45
45
|
expiresAt: string | null;
|
|
46
|
-
tenantId: string;
|
|
47
|
-
projectId: string;
|
|
48
46
|
agentId: string;
|
|
47
|
+
projectId: string;
|
|
48
|
+
tenantId: string;
|
|
49
49
|
publicId: string;
|
|
50
50
|
keyHash: string;
|
|
51
51
|
keyPrefix: string;
|
|
@@ -70,9 +70,9 @@ declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Pr
|
|
|
70
70
|
createdAt: string;
|
|
71
71
|
updatedAt: string;
|
|
72
72
|
expiresAt: string | null;
|
|
73
|
-
tenantId: string;
|
|
74
|
-
projectId: string;
|
|
75
73
|
agentId: string;
|
|
74
|
+
projectId: string;
|
|
75
|
+
tenantId: string;
|
|
76
76
|
publicId: string;
|
|
77
77
|
keyHash: string;
|
|
78
78
|
keyPrefix: string;
|
|
@@ -12,8 +12,8 @@ declare const getArtifactComponentById: (db: DatabaseClient) => (params: {
|
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
description: string | null;
|
|
15
|
-
tenantId: string;
|
|
16
15
|
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
17
|
props: Record<string, unknown> | null;
|
|
18
18
|
} | undefined>;
|
|
19
19
|
declare const listArtifactComponents: (db: DatabaseClient) => (params: {
|
|
@@ -46,8 +46,8 @@ declare const createArtifactComponent: (db: DatabaseClient) => (params: Artifact
|
|
|
46
46
|
createdAt: string;
|
|
47
47
|
updatedAt: string;
|
|
48
48
|
description: string | null;
|
|
49
|
-
tenantId: string;
|
|
50
49
|
projectId: string;
|
|
50
|
+
tenantId: string;
|
|
51
51
|
props: Record<string, unknown> | null;
|
|
52
52
|
}>;
|
|
53
53
|
declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
|
|
@@ -86,9 +86,9 @@ declare const associateArtifactComponentWithAgent: (db: DatabaseClient) => (para
|
|
|
86
86
|
}) => Promise<{
|
|
87
87
|
id: string;
|
|
88
88
|
createdAt: string;
|
|
89
|
-
tenantId: string;
|
|
90
|
-
projectId: string;
|
|
91
89
|
agentId: string;
|
|
90
|
+
projectId: string;
|
|
91
|
+
tenantId: string;
|
|
92
92
|
subAgentId: string;
|
|
93
93
|
artifactComponentId: string;
|
|
94
94
|
}>;
|
|
@@ -129,9 +129,9 @@ declare const upsertAgentArtifactComponentRelation: (db: DatabaseClient) => (par
|
|
|
129
129
|
}) => Promise<{
|
|
130
130
|
id: string;
|
|
131
131
|
createdAt: string;
|
|
132
|
-
tenantId: string;
|
|
133
|
-
projectId: string;
|
|
134
132
|
agentId: string;
|
|
133
|
+
projectId: string;
|
|
134
|
+
tenantId: string;
|
|
135
135
|
subAgentId: string;
|
|
136
136
|
artifactComponentId: string;
|
|
137
137
|
} | null>;
|
|
@@ -11,11 +11,11 @@ declare const getContextConfigById: (db: DatabaseClient) => (params: {
|
|
|
11
11
|
id: string;
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
agentId: string;
|
|
17
14
|
headersSchema: unknown;
|
|
18
15
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
16
|
+
agentId: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: DatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
@@ -23,11 +23,11 @@ declare const listContextConfigs: (db: DatabaseClient) => (params: {
|
|
|
23
23
|
id: string;
|
|
24
24
|
createdAt: string;
|
|
25
25
|
updatedAt: string;
|
|
26
|
-
tenantId: string;
|
|
27
|
-
projectId: string;
|
|
28
|
-
agentId: string;
|
|
29
26
|
headersSchema: unknown;
|
|
30
27
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
28
|
+
agentId: string;
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
31
|
}[]>;
|
|
32
32
|
declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
|
|
33
33
|
scopes: AgentScopeConfig;
|
|
@@ -45,11 +45,11 @@ declare const createContextConfig: (db: DatabaseClient) => (params: ContextConfi
|
|
|
45
45
|
id: string;
|
|
46
46
|
createdAt: string;
|
|
47
47
|
updatedAt: string;
|
|
48
|
-
tenantId: string;
|
|
49
|
-
projectId: string;
|
|
50
|
-
agentId: string;
|
|
51
48
|
headersSchema: unknown;
|
|
52
49
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
50
|
+
agentId: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
tenantId: string;
|
|
53
53
|
}>;
|
|
54
54
|
declare const updateContextConfig: (db: DatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -85,11 +85,11 @@ declare const upsertContextConfig: (db: DatabaseClient) => (params: {
|
|
|
85
85
|
id: string;
|
|
86
86
|
createdAt: string;
|
|
87
87
|
updatedAt: string;
|
|
88
|
-
tenantId: string;
|
|
89
|
-
projectId: string;
|
|
90
|
-
agentId: string;
|
|
91
88
|
headersSchema: unknown;
|
|
92
89
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
90
|
+
agentId: string;
|
|
91
|
+
projectId: string;
|
|
92
|
+
tenantId: string;
|
|
93
93
|
}>;
|
|
94
94
|
//#endregion
|
|
95
95
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|
|
@@ -19,8 +19,8 @@ declare const createConversation: (db: DatabaseClient) => (params: ConversationI
|
|
|
19
19
|
updatedAt: string;
|
|
20
20
|
userId: string | null;
|
|
21
21
|
metadata: ConversationMetadata | null;
|
|
22
|
-
tenantId: string;
|
|
23
22
|
projectId: string;
|
|
23
|
+
tenantId: string;
|
|
24
24
|
title: string | null;
|
|
25
25
|
activeSubAgentId: string;
|
|
26
26
|
lastContextResolution: string | null;
|
|
@@ -70,8 +70,8 @@ declare const getConversation: (db: DatabaseClient) => (params: {
|
|
|
70
70
|
updatedAt: string;
|
|
71
71
|
userId: string | null;
|
|
72
72
|
metadata: ConversationMetadata | null;
|
|
73
|
-
tenantId: string;
|
|
74
73
|
projectId: string;
|
|
74
|
+
tenantId: string;
|
|
75
75
|
title: string | null;
|
|
76
76
|
activeSubAgentId: string;
|
|
77
77
|
lastContextResolution: string | null;
|
|
@@ -94,8 +94,8 @@ declare const createOrGetConversation: (db: DatabaseClient) => (input: Conversat
|
|
|
94
94
|
updatedAt: string;
|
|
95
95
|
userId: string | null;
|
|
96
96
|
metadata: ConversationMetadata | null;
|
|
97
|
-
tenantId: string;
|
|
98
97
|
projectId: string;
|
|
98
|
+
tenantId: string;
|
|
99
99
|
title: string | null;
|
|
100
100
|
activeSubAgentId: string;
|
|
101
101
|
lastContextResolution: string | null;
|
|
@@ -120,8 +120,8 @@ declare const getActiveAgentForConversation: (db: DatabaseClient) => (params: {
|
|
|
120
120
|
updatedAt: string;
|
|
121
121
|
userId: string | null;
|
|
122
122
|
metadata: ConversationMetadata | null;
|
|
123
|
-
tenantId: string;
|
|
124
123
|
projectId: string;
|
|
124
|
+
tenantId: string;
|
|
125
125
|
title: string | null;
|
|
126
126
|
activeSubAgentId: string;
|
|
127
127
|
lastContextResolution: string | null;
|
|
@@ -66,9 +66,9 @@ declare const associateDataComponentWithAgent: (db: DatabaseClient) => (params:
|
|
|
66
66
|
}) => Promise<{
|
|
67
67
|
id: string;
|
|
68
68
|
createdAt: string;
|
|
69
|
-
tenantId: string;
|
|
70
|
-
projectId: string;
|
|
71
69
|
agentId: string;
|
|
70
|
+
projectId: string;
|
|
71
|
+
tenantId: string;
|
|
72
72
|
subAgentId: string;
|
|
73
73
|
dataComponentId: string;
|
|
74
74
|
}>;
|
|
@@ -108,9 +108,9 @@ declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params:
|
|
|
108
108
|
}) => Promise<{
|
|
109
109
|
id: string;
|
|
110
110
|
createdAt: string;
|
|
111
|
-
tenantId: string;
|
|
112
|
-
projectId: string;
|
|
113
111
|
agentId: string;
|
|
112
|
+
projectId: string;
|
|
113
|
+
tenantId: string;
|
|
114
114
|
subAgentId: string;
|
|
115
115
|
dataComponentId: string;
|
|
116
116
|
} | null>;
|
|
@@ -58,9 +58,9 @@ declare const createFunctionTool: (db: DatabaseClient) => (params: {
|
|
|
58
58
|
createdAt: string;
|
|
59
59
|
updatedAt: string;
|
|
60
60
|
description: string | null;
|
|
61
|
-
tenantId: string;
|
|
62
|
-
projectId: string;
|
|
63
61
|
agentId: string;
|
|
62
|
+
projectId: string;
|
|
63
|
+
tenantId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -100,9 +100,9 @@ declare const upsertFunctionTool: (db: DatabaseClient) => (params: {
|
|
|
100
100
|
createdAt: string;
|
|
101
101
|
updatedAt: string;
|
|
102
102
|
description: string | null;
|
|
103
|
-
tenantId: string;
|
|
104
|
-
projectId: string;
|
|
105
103
|
agentId: string;
|
|
104
|
+
projectId: string;
|
|
105
|
+
tenantId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
|
|
@@ -29,13 +29,15 @@ declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
|
|
|
29
29
|
artifacts: Artifact[];
|
|
30
30
|
}) => Promise<void>;
|
|
31
31
|
/**
|
|
32
|
-
* Retrieve artifacts by taskId, toolCallId, and/or artifactId.
|
|
33
|
-
* At least one of taskId, toolCallId, or artifactId must be provided.
|
|
32
|
+
* Retrieve artifacts by taskId, toolCallId, toolCallIds, and/or artifactId.
|
|
33
|
+
* At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided.
|
|
34
|
+
* Use toolCallIds for batch queries to avoid N+1 query problems.
|
|
34
35
|
*/
|
|
35
36
|
declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
|
|
36
37
|
scopes: ProjectScopeConfig;
|
|
37
38
|
taskId?: string;
|
|
38
39
|
toolCallId?: string;
|
|
40
|
+
toolCallIds?: string[];
|
|
39
41
|
artifactId?: string;
|
|
40
42
|
}) => Promise<Artifact[]>;
|
|
41
43
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ledgerArtifacts } from "../db/schema.js";
|
|
2
2
|
import { generateId } from "../utils/conversations.js";
|
|
3
|
-
import { and, count, eq } from "drizzle-orm";
|
|
3
|
+
import { and, count, eq, inArray } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/data-access/ledgerArtifacts.ts
|
|
6
6
|
/**
|
|
@@ -195,16 +195,19 @@ const addLedgerArtifacts = (db) => async (params) => {
|
|
|
195
195
|
throw sanitizedError;
|
|
196
196
|
};
|
|
197
197
|
/**
|
|
198
|
-
* Retrieve artifacts by taskId, toolCallId, and/or artifactId.
|
|
199
|
-
* At least one of taskId, toolCallId, or artifactId must be provided.
|
|
198
|
+
* Retrieve artifacts by taskId, toolCallId, toolCallIds, and/or artifactId.
|
|
199
|
+
* At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided.
|
|
200
|
+
* Use toolCallIds for batch queries to avoid N+1 query problems.
|
|
200
201
|
*/
|
|
201
202
|
const getLedgerArtifacts = (db) => async (params) => {
|
|
202
|
-
const { scopes, taskId, toolCallId, artifactId } = params;
|
|
203
|
-
if (!taskId && !toolCallId && !artifactId) throw new Error("At least one of taskId, toolCallId, or artifactId must be provided");
|
|
203
|
+
const { scopes, taskId, toolCallId, toolCallIds, artifactId } = params;
|
|
204
|
+
if (!taskId && !toolCallId && !toolCallIds && !artifactId) throw new Error("At least one of taskId, toolCallId, toolCallIds, or artifactId must be provided");
|
|
205
|
+
if (toolCallId && toolCallIds) throw new Error("Cannot provide both toolCallId and toolCallIds. Use toolCallIds for batch queries.");
|
|
204
206
|
const conditions = [eq(ledgerArtifacts.tenantId, scopes.tenantId), eq(ledgerArtifacts.projectId, scopes.projectId)];
|
|
205
207
|
if (artifactId) conditions.push(eq(ledgerArtifacts.id, artifactId));
|
|
206
208
|
if (taskId) conditions.push(eq(ledgerArtifacts.taskId, taskId));
|
|
207
209
|
if (toolCallId) conditions.push(eq(ledgerArtifacts.toolCallId, toolCallId));
|
|
210
|
+
if (toolCallIds && toolCallIds.length > 0) conditions.push(inArray(ledgerArtifacts.toolCallId, toolCallIds));
|
|
208
211
|
return (await db.select().from(ledgerArtifacts).where(conditions.length > 1 ? and(...conditions) : conditions[0])).map((row) => ({
|
|
209
212
|
artifactId: row.id,
|
|
210
213
|
type: row.type ?? "source",
|
|
@@ -213,7 +216,8 @@ const getLedgerArtifacts = (db) => async (params) => {
|
|
|
213
216
|
name: row.name ?? void 0,
|
|
214
217
|
description: row.description ?? void 0,
|
|
215
218
|
parts: row.parts ?? [],
|
|
216
|
-
metadata: row.metadata || {}
|
|
219
|
+
metadata: row.metadata || {},
|
|
220
|
+
createdAt: row.createdAt
|
|
217
221
|
}));
|
|
218
222
|
};
|
|
219
223
|
/**
|
|
@@ -14,9 +14,11 @@ declare const getMessageById: (db: DatabaseClient) => (params: {
|
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
metadata: MessageMetadata | null;
|
|
16
16
|
role: string;
|
|
17
|
-
tenantId: string;
|
|
18
17
|
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
content: MessageContent;
|
|
20
|
+
taskId: string | null;
|
|
21
|
+
visibility: string;
|
|
20
22
|
conversationId: string;
|
|
21
23
|
fromSubAgentId: string | null;
|
|
22
24
|
toSubAgentId: string | null;
|
|
@@ -24,9 +26,7 @@ declare const getMessageById: (db: DatabaseClient) => (params: {
|
|
|
24
26
|
toExternalAgentId: string | null;
|
|
25
27
|
fromTeamAgentId: string | null;
|
|
26
28
|
toTeamAgentId: string | null;
|
|
27
|
-
visibility: string;
|
|
28
29
|
messageType: string;
|
|
29
|
-
taskId: string | null;
|
|
30
30
|
parentMessageId: string | null;
|
|
31
31
|
a2aTaskId: string | null;
|
|
32
32
|
a2aSessionId: string | null;
|
|
@@ -145,9 +145,11 @@ declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) =>
|
|
|
145
145
|
updatedAt: string;
|
|
146
146
|
metadata: MessageMetadata | null;
|
|
147
147
|
role: string;
|
|
148
|
-
tenantId: string;
|
|
149
148
|
projectId: string;
|
|
149
|
+
tenantId: string;
|
|
150
150
|
content: MessageContent;
|
|
151
|
+
taskId: string | null;
|
|
152
|
+
visibility: string;
|
|
151
153
|
conversationId: string;
|
|
152
154
|
fromSubAgentId: string | null;
|
|
153
155
|
toSubAgentId: string | null;
|
|
@@ -155,9 +157,7 @@ declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) =>
|
|
|
155
157
|
toExternalAgentId: string | null;
|
|
156
158
|
fromTeamAgentId: string | null;
|
|
157
159
|
toTeamAgentId: string | null;
|
|
158
|
-
visibility: string;
|
|
159
160
|
messageType: string;
|
|
160
|
-
taskId: string | null;
|
|
161
161
|
parentMessageId: string | null;
|
|
162
162
|
a2aTaskId: string | null;
|
|
163
163
|
a2aSessionId: string | null;
|
|
@@ -198,9 +198,11 @@ declare const deleteMessage: (db: DatabaseClient) => (params: {
|
|
|
198
198
|
updatedAt: string;
|
|
199
199
|
metadata: MessageMetadata | null;
|
|
200
200
|
role: string;
|
|
201
|
-
tenantId: string;
|
|
202
201
|
projectId: string;
|
|
202
|
+
tenantId: string;
|
|
203
203
|
content: MessageContent;
|
|
204
|
+
taskId: string | null;
|
|
205
|
+
visibility: string;
|
|
204
206
|
conversationId: string;
|
|
205
207
|
fromSubAgentId: string | null;
|
|
206
208
|
toSubAgentId: string | null;
|
|
@@ -208,9 +210,7 @@ declare const deleteMessage: (db: DatabaseClient) => (params: {
|
|
|
208
210
|
toExternalAgentId: string | null;
|
|
209
211
|
fromTeamAgentId: string | null;
|
|
210
212
|
toTeamAgentId: string | null;
|
|
211
|
-
visibility: string;
|
|
212
213
|
messageType: string;
|
|
213
|
-
taskId: string | null;
|
|
214
214
|
parentMessageId: string | null;
|
|
215
215
|
a2aTaskId: string | null;
|
|
216
216
|
a2aSessionId: string | null;
|
|
@@ -12,9 +12,9 @@ declare const getSubAgentExternalAgentRelationById: (db: DatabaseClient) => (par
|
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
headers: Record<string, string> | null;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
projectId: string;
|
|
17
15
|
agentId: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
tenantId: string;
|
|
18
18
|
externalAgentId: string;
|
|
19
19
|
subAgentId: string;
|
|
20
20
|
} | undefined>;
|
|
@@ -47,9 +47,9 @@ declare const getSubAgentExternalAgentRelations: (db: DatabaseClient) => (params
|
|
|
47
47
|
createdAt: string;
|
|
48
48
|
updatedAt: string;
|
|
49
49
|
headers: Record<string, string> | null;
|
|
50
|
-
tenantId: string;
|
|
51
|
-
projectId: string;
|
|
52
50
|
agentId: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
tenantId: string;
|
|
53
53
|
externalAgentId: string;
|
|
54
54
|
subAgentId: string;
|
|
55
55
|
}[]>;
|
|
@@ -60,9 +60,9 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: DatabaseClient) =>
|
|
|
60
60
|
createdAt: string;
|
|
61
61
|
updatedAt: string;
|
|
62
62
|
headers: Record<string, string> | null;
|
|
63
|
-
tenantId: string;
|
|
64
|
-
projectId: string;
|
|
65
63
|
agentId: string;
|
|
64
|
+
projectId: string;
|
|
65
|
+
tenantId: string;
|
|
66
66
|
externalAgentId: string;
|
|
67
67
|
subAgentId: string;
|
|
68
68
|
}[]>;
|
|
@@ -183,9 +183,9 @@ declare const createSubAgentExternalAgentRelation: (db: DatabaseClient) => (para
|
|
|
183
183
|
createdAt: string;
|
|
184
184
|
updatedAt: string;
|
|
185
185
|
headers: Record<string, string> | null;
|
|
186
|
-
tenantId: string;
|
|
187
|
-
projectId: string;
|
|
188
186
|
agentId: string;
|
|
187
|
+
projectId: string;
|
|
188
|
+
tenantId: string;
|
|
189
189
|
externalAgentId: string;
|
|
190
190
|
subAgentId: string;
|
|
191
191
|
}>;
|
|
@@ -200,9 +200,9 @@ declare const getSubAgentExternalAgentRelationByParams: (db: DatabaseClient) =>
|
|
|
200
200
|
createdAt: string;
|
|
201
201
|
updatedAt: string;
|
|
202
202
|
headers: Record<string, string> | null;
|
|
203
|
-
tenantId: string;
|
|
204
|
-
projectId: string;
|
|
205
203
|
agentId: string;
|
|
204
|
+
projectId: string;
|
|
205
|
+
tenantId: string;
|
|
206
206
|
externalAgentId: string;
|
|
207
207
|
subAgentId: string;
|
|
208
208
|
} | undefined>;
|
|
@@ -221,9 +221,9 @@ declare const upsertSubAgentExternalAgentRelation: (db: DatabaseClient) => (para
|
|
|
221
221
|
createdAt: string;
|
|
222
222
|
updatedAt: string;
|
|
223
223
|
headers: Record<string, string> | null;
|
|
224
|
-
tenantId: string;
|
|
225
|
-
projectId: string;
|
|
226
224
|
agentId: string;
|
|
225
|
+
projectId: string;
|
|
226
|
+
tenantId: string;
|
|
227
227
|
externalAgentId: string;
|
|
228
228
|
subAgentId: string;
|
|
229
229
|
}>;
|