@inkeep/agents-core 0.0.0-dev-20260120175022 → 0.0.0-dev-20260120193424
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 +82 -82
- package/dist/auth/auth-validation-schemas.d.ts +129 -129
- package/dist/auth/auth.d.ts +53 -53
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +6 -2
- package/dist/client-exports.js +2 -2
- package/dist/constants/otel-attributes.d.ts +3 -0
- package/dist/constants/otel-attributes.js +3 -0
- package/dist/data-access/index.d.ts +3 -1
- package/dist/data-access/index.js +3 -1
- package/dist/data-access/manage/agentFull.js +114 -0
- package/dist/data-access/manage/agents.d.ts +16 -16
- package/dist/data-access/manage/agents.js +27 -0
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- 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 +12 -12
- package/dist/data-access/manage/projectFull.d.ts +4 -0
- package/dist/data-access/manage/projectFull.js +31 -8
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +12 -12
- package/dist/data-access/manage/tools.d.ts +27 -27
- package/dist/data-access/manage/triggers.d.ts +84 -0
- package/dist/data-access/manage/triggers.js +95 -0
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +16 -16
- package/dist/data-access/runtime/evalRuns.d.ts +2 -2
- package/dist/data-access/runtime/evalRuns.js +11 -1
- package/dist/data-access/runtime/messages.d.ts +12 -12
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/data-access/runtime/triggerInvocations.d.ts +62 -0
- package/dist/data-access/runtime/triggerInvocations.js +54 -0
- package/dist/db/manage/manage-schema.d.ts +269 -4
- package/dist/db/manage/manage-schema.js +31 -2
- package/dist/db/runtime/runtime-schema.d.ts +364 -149
- package/dist/db/runtime/runtime-schema.js +33 -3
- package/dist/dolt/branch.d.ts +55 -1
- package/dist/dolt/branch.js +85 -1
- package/dist/dolt/index.d.ts +2 -2
- package/dist/dolt/index.js +2 -2
- package/dist/index.d.ts +10 -6
- package/dist/index.js +10 -6
- package/dist/types/entities.d.ts +14 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/template-interpolation.d.ts +22 -0
- package/dist/utils/template-interpolation.js +62 -0
- package/dist/utils/trigger-auth.d.ts +32 -0
- package/dist/utils/trigger-auth.js +130 -0
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas.d.ts +3465 -1227
- package/dist/validation/schemas.js +87 -4
- package/drizzle/manage/0001_broken_wendell_vaughn.sql +19 -0
- package/drizzle/manage/meta/0001_snapshot.json +3115 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0009_freezing_leo.sql +17 -0
- package/drizzle/runtime/meta/0009_snapshot.json +2397 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ import { createSubAgentRelation, deleteAgentRelationsByAgent, deleteAgentToolRel
|
|
|
9
9
|
import { deleteSubAgent, listSubAgents, upsertSubAgent } from "./subAgents.js";
|
|
10
10
|
import { deleteSubAgentTeamAgentRelation, getSubAgentTeamAgentRelationsByAgent, upsertSubAgentTeamAgentRelation } from "./subAgentTeamAgentRelations.js";
|
|
11
11
|
import { upsertSubAgentToolRelation } from "./tools.js";
|
|
12
|
+
import { deleteTrigger, listTriggers, upsertTrigger } from "./triggers.js";
|
|
12
13
|
import { deleteAgent, getAgentById, getFullAgentDefinition, getFullAgentDefinitionWithRelationIds, updateAgent, upsertAgent } from "./agents.js";
|
|
13
14
|
import { associateArtifactComponentWithAgent, deleteAgentArtifactComponentRelationByAgent, upsertAgentArtifactComponentRelation } from "./artifactComponents.js";
|
|
14
15
|
import { associateDataComponentWithAgent, deleteAgentDataComponentRelationByAgent, upsertAgentDataComponentRelation } from "./dataComponents.js";
|
|
@@ -246,6 +247,50 @@ const createFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
246
247
|
functionToolCount: Object.keys(typed.functionTools).length
|
|
247
248
|
}, "All function tools created successfully");
|
|
248
249
|
}
|
|
250
|
+
if (typed.triggers && Object.keys(typed.triggers).length > 0) {
|
|
251
|
+
logger.info({
|
|
252
|
+
agentId: finalAgentId,
|
|
253
|
+
triggerCount: Object.keys(typed.triggers).length
|
|
254
|
+
}, "Creating triggers for agent");
|
|
255
|
+
const triggerPromises = Object.entries(typed.triggers).map(async ([triggerId, triggerData]) => {
|
|
256
|
+
try {
|
|
257
|
+
logger.info({
|
|
258
|
+
agentId: finalAgentId,
|
|
259
|
+
triggerId
|
|
260
|
+
}, "Creating trigger in agent");
|
|
261
|
+
await upsertTrigger(db)({
|
|
262
|
+
scopes: {
|
|
263
|
+
tenantId,
|
|
264
|
+
projectId,
|
|
265
|
+
agentId: finalAgentId
|
|
266
|
+
},
|
|
267
|
+
data: {
|
|
268
|
+
...triggerData,
|
|
269
|
+
id: triggerId,
|
|
270
|
+
tenantId,
|
|
271
|
+
projectId,
|
|
272
|
+
agentId: finalAgentId
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
logger.info({
|
|
276
|
+
agentId: finalAgentId,
|
|
277
|
+
triggerId
|
|
278
|
+
}, "Trigger created successfully");
|
|
279
|
+
} catch (error) {
|
|
280
|
+
logger.error({
|
|
281
|
+
agentId: finalAgentId,
|
|
282
|
+
triggerId,
|
|
283
|
+
error
|
|
284
|
+
}, "Failed to create trigger in agent");
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
await Promise.all(triggerPromises);
|
|
289
|
+
logger.info({
|
|
290
|
+
agentId: finalAgentId,
|
|
291
|
+
triggerCount: Object.keys(typed.triggers).length
|
|
292
|
+
}, "All triggers created successfully");
|
|
293
|
+
}
|
|
249
294
|
const subAgentPromises = Object.entries(typed.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
250
295
|
const subAgent = agentData$1;
|
|
251
296
|
try {
|
|
@@ -766,6 +811,75 @@ const updateFullAgentServerSide = (db, logger = defaultLogger) => async (scopes,
|
|
|
766
811
|
}, "Failed to delete orphaned function tool");
|
|
767
812
|
}
|
|
768
813
|
if (deletedFunctionToolCount > 0) logger.info({ deletedFunctionToolCount }, "Deleted orphaned function tools from agent");
|
|
814
|
+
if (typedAgentDefinition.triggers && Object.keys(typedAgentDefinition.triggers).length > 0) {
|
|
815
|
+
logger.info({
|
|
816
|
+
agentId: finalAgentId,
|
|
817
|
+
triggerCount: Object.keys(typedAgentDefinition.triggers).length
|
|
818
|
+
}, "Updating triggers for agent");
|
|
819
|
+
const triggerPromises = Object.entries(typedAgentDefinition.triggers).map(async ([triggerId, triggerData]) => {
|
|
820
|
+
try {
|
|
821
|
+
logger.info({
|
|
822
|
+
agentId: finalAgentId,
|
|
823
|
+
triggerId
|
|
824
|
+
}, "Updating trigger in agent");
|
|
825
|
+
await upsertTrigger(db)({
|
|
826
|
+
scopes: {
|
|
827
|
+
tenantId,
|
|
828
|
+
projectId,
|
|
829
|
+
agentId: finalAgentId
|
|
830
|
+
},
|
|
831
|
+
data: {
|
|
832
|
+
...triggerData,
|
|
833
|
+
id: triggerId,
|
|
834
|
+
tenantId,
|
|
835
|
+
projectId,
|
|
836
|
+
agentId: finalAgentId
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
logger.info({
|
|
840
|
+
agentId: finalAgentId,
|
|
841
|
+
triggerId
|
|
842
|
+
}, "Trigger updated successfully");
|
|
843
|
+
} catch (error) {
|
|
844
|
+
logger.error({
|
|
845
|
+
agentId: finalAgentId,
|
|
846
|
+
triggerId,
|
|
847
|
+
error
|
|
848
|
+
}, "Failed to update trigger in agent");
|
|
849
|
+
throw error;
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
await Promise.all(triggerPromises);
|
|
853
|
+
logger.info({
|
|
854
|
+
agentId: finalAgentId,
|
|
855
|
+
triggerCount: Object.keys(typedAgentDefinition.triggers).length
|
|
856
|
+
}, "All triggers updated successfully");
|
|
857
|
+
}
|
|
858
|
+
const incomingTriggerIds = new Set(typedAgentDefinition.triggers ? Object.keys(typedAgentDefinition.triggers) : []);
|
|
859
|
+
const existingTriggers = await listTriggers(db)({ scopes: {
|
|
860
|
+
tenantId,
|
|
861
|
+
projectId,
|
|
862
|
+
agentId: finalAgentId
|
|
863
|
+
} });
|
|
864
|
+
let deletedTriggerCount = 0;
|
|
865
|
+
for (const trigger of existingTriggers) if (!incomingTriggerIds.has(trigger.id)) try {
|
|
866
|
+
await deleteTrigger(db)({
|
|
867
|
+
scopes: {
|
|
868
|
+
tenantId,
|
|
869
|
+
projectId,
|
|
870
|
+
agentId: finalAgentId
|
|
871
|
+
},
|
|
872
|
+
triggerId: trigger.id
|
|
873
|
+
});
|
|
874
|
+
deletedTriggerCount++;
|
|
875
|
+
logger.info({ triggerId: trigger.id }, "Deleted orphaned trigger");
|
|
876
|
+
} catch (error) {
|
|
877
|
+
logger.error({
|
|
878
|
+
triggerId: trigger.id,
|
|
879
|
+
error
|
|
880
|
+
}, "Failed to delete orphaned trigger");
|
|
881
|
+
}
|
|
882
|
+
if (deletedTriggerCount > 0) logger.info({ deletedTriggerCount }, "Deleted orphaned triggers from agent");
|
|
769
883
|
const subAgentPromises = Object.entries(typedAgentDefinition.subAgents).map(async ([subAgentId, agentData$1]) => {
|
|
770
884
|
const subAgent = agentData$1;
|
|
771
885
|
let existingSubAgent = null;
|
|
@@ -8,13 +8,14 @@ import { PgTable } from "drizzle-orm/pg-core";
|
|
|
8
8
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
}) => Promise<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
11
13
|
id: string;
|
|
12
14
|
name: string;
|
|
13
15
|
description: string | null;
|
|
16
|
+
prompt: string | null;
|
|
14
17
|
createdAt: string;
|
|
15
18
|
updatedAt: string;
|
|
16
|
-
projectId: string;
|
|
17
|
-
tenantId: string;
|
|
18
19
|
models: {
|
|
19
20
|
base?: {
|
|
20
21
|
model?: string | undefined;
|
|
@@ -32,7 +33,6 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
32
33
|
stopWhen: {
|
|
33
34
|
transferCountIs?: number | undefined;
|
|
34
35
|
} | null;
|
|
35
|
-
prompt: string | null;
|
|
36
36
|
defaultSubAgentId: string | null;
|
|
37
37
|
contextConfigId: string | null;
|
|
38
38
|
statusUpdates: {
|
|
@@ -54,13 +54,14 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
56
56
|
}) => Promise<{
|
|
57
|
+
tenantId: string;
|
|
58
|
+
projectId: string;
|
|
57
59
|
id: string;
|
|
58
60
|
name: string;
|
|
59
61
|
description: string | null;
|
|
62
|
+
prompt: string | null;
|
|
60
63
|
createdAt: string;
|
|
61
64
|
updatedAt: string;
|
|
62
|
-
projectId: string;
|
|
63
|
-
tenantId: string;
|
|
64
65
|
models: {
|
|
65
66
|
base?: {
|
|
66
67
|
model?: string | undefined;
|
|
@@ -78,7 +79,6 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
78
79
|
stopWhen: {
|
|
79
80
|
transferCountIs?: number | undefined;
|
|
80
81
|
} | null;
|
|
81
|
-
prompt: string | null;
|
|
82
82
|
defaultSubAgentId: string | null;
|
|
83
83
|
contextConfigId: string | null;
|
|
84
84
|
statusUpdates: {
|
|
@@ -97,13 +97,15 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
97
97
|
}[] | undefined;
|
|
98
98
|
} | null;
|
|
99
99
|
defaultSubAgent: {
|
|
100
|
+
tenantId: string;
|
|
101
|
+
projectId: string;
|
|
100
102
|
id: string;
|
|
101
103
|
name: string;
|
|
102
104
|
description: string | null;
|
|
105
|
+
prompt: string | null;
|
|
106
|
+
agentId: string;
|
|
103
107
|
createdAt: string;
|
|
104
108
|
updatedAt: string;
|
|
105
|
-
projectId: string;
|
|
106
|
-
tenantId: string;
|
|
107
109
|
models: {
|
|
108
110
|
base?: {
|
|
109
111
|
model?: string | undefined;
|
|
@@ -121,21 +123,20 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
121
123
|
stopWhen: {
|
|
122
124
|
stepCountIs?: number | undefined;
|
|
123
125
|
} | null;
|
|
124
|
-
prompt: string | null;
|
|
125
|
-
agentId: string;
|
|
126
126
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
127
127
|
} | null;
|
|
128
128
|
} | null>;
|
|
129
129
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
130
130
|
scopes: ProjectScopeConfig;
|
|
131
131
|
}) => Promise<{
|
|
132
|
+
tenantId: string;
|
|
133
|
+
projectId: string;
|
|
132
134
|
id: string;
|
|
133
135
|
name: string;
|
|
134
136
|
description: string | null;
|
|
137
|
+
prompt: string | null;
|
|
135
138
|
createdAt: string;
|
|
136
139
|
updatedAt: string;
|
|
137
|
-
projectId: string;
|
|
138
|
-
tenantId: string;
|
|
139
140
|
models: {
|
|
140
141
|
base?: {
|
|
141
142
|
model?: string | undefined;
|
|
@@ -153,7 +154,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
153
154
|
stopWhen: {
|
|
154
155
|
transferCountIs?: number | undefined;
|
|
155
156
|
} | null;
|
|
156
|
-
prompt: string | null;
|
|
157
157
|
defaultSubAgentId: string | null;
|
|
158
158
|
contextConfigId: string | null;
|
|
159
159
|
statusUpdates: {
|
|
@@ -228,13 +228,14 @@ declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params:
|
|
|
228
228
|
};
|
|
229
229
|
}>;
|
|
230
230
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
231
|
+
tenantId: string;
|
|
232
|
+
projectId: string;
|
|
231
233
|
id: string;
|
|
232
234
|
name: string;
|
|
233
235
|
description: string | null;
|
|
236
|
+
prompt: string | null;
|
|
234
237
|
createdAt: string;
|
|
235
238
|
updatedAt: string;
|
|
236
|
-
projectId: string;
|
|
237
|
-
tenantId: string;
|
|
238
239
|
models: {
|
|
239
240
|
base?: {
|
|
240
241
|
model?: string | undefined;
|
|
@@ -252,7 +253,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
252
253
|
stopWhen: {
|
|
253
254
|
transferCountIs?: number | undefined;
|
|
254
255
|
} | null;
|
|
255
|
-
prompt: string | null;
|
|
256
256
|
defaultSubAgentId: string | null;
|
|
257
257
|
contextConfigId: string | null;
|
|
258
258
|
statusUpdates: {
|
|
@@ -9,6 +9,7 @@ import { getAgentRelations, getAgentRelationsByAgent } from "./subAgentRelations
|
|
|
9
9
|
import { getSubAgentById } from "./subAgents.js";
|
|
10
10
|
import { getSubAgentTeamAgentRelationsByAgent } from "./subAgentTeamAgentRelations.js";
|
|
11
11
|
import { listTools } from "./tools.js";
|
|
12
|
+
import { listTriggers } from "./triggers.js";
|
|
12
13
|
import { and, count, desc, eq, inArray } from "drizzle-orm";
|
|
13
14
|
|
|
14
15
|
//#region src/data-access/manage/agents.ts
|
|
@@ -450,6 +451,32 @@ const getFullAgentDefinitionInternal = (db) => async ({ scopes: { tenantId, proj
|
|
|
450
451
|
} catch (error) {
|
|
451
452
|
console.warn("Failed to load tools/functions lookups:", error);
|
|
452
453
|
}
|
|
454
|
+
try {
|
|
455
|
+
const triggersList = await listTriggers(db)({ scopes: {
|
|
456
|
+
tenantId,
|
|
457
|
+
projectId,
|
|
458
|
+
agentId
|
|
459
|
+
} });
|
|
460
|
+
console.log(`[getFullAgentDefinitionInternal] Fetched ${triggersList.length} triggers for agent ${agentId}`);
|
|
461
|
+
if (triggersList.length > 0) {
|
|
462
|
+
const triggersObject = {};
|
|
463
|
+
for (const trigger of triggersList) triggersObject[trigger.id] = {
|
|
464
|
+
id: trigger.id,
|
|
465
|
+
name: trigger.name,
|
|
466
|
+
description: trigger.description,
|
|
467
|
+
enabled: trigger.enabled,
|
|
468
|
+
inputSchema: trigger.inputSchema,
|
|
469
|
+
outputTransform: trigger.outputTransform,
|
|
470
|
+
messageTemplate: trigger.messageTemplate,
|
|
471
|
+
authentication: trigger.authentication,
|
|
472
|
+
signingSecret: trigger.signingSecret
|
|
473
|
+
};
|
|
474
|
+
result.triggers = triggersObject;
|
|
475
|
+
console.log(`[getFullAgentDefinitionInternal] Added triggers to result:`, Object.keys(triggersObject));
|
|
476
|
+
}
|
|
477
|
+
} catch (error) {
|
|
478
|
+
console.warn("Failed to load triggers:", error);
|
|
479
|
+
}
|
|
453
480
|
return result;
|
|
454
481
|
};
|
|
455
482
|
const getFullAgentDefinition = (db) => async ({ scopes }) => {
|
|
@@ -7,13 +7,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
7
7
|
scopes: ProjectScopeConfig;
|
|
8
8
|
id: string;
|
|
9
9
|
}) => Promise<{
|
|
10
|
+
tenantId: string;
|
|
11
|
+
projectId: string;
|
|
10
12
|
id: string;
|
|
11
13
|
name: string;
|
|
12
14
|
description: string | null;
|
|
13
15
|
createdAt: string;
|
|
14
16
|
updatedAt: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
17
17
|
props: Record<string, unknown> | null;
|
|
18
18
|
render: {
|
|
19
19
|
component: string;
|
|
@@ -49,13 +49,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
49
49
|
};
|
|
50
50
|
}>;
|
|
51
51
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
52
|
+
tenantId: string;
|
|
53
|
+
projectId: string;
|
|
52
54
|
id: string;
|
|
53
55
|
name: string;
|
|
54
56
|
description: string | null;
|
|
55
57
|
createdAt: string;
|
|
56
58
|
updatedAt: string;
|
|
57
|
-
projectId: string;
|
|
58
|
-
tenantId: string;
|
|
59
59
|
props: Record<string, unknown> | null;
|
|
60
60
|
render: {
|
|
61
61
|
component: string;
|
|
@@ -104,11 +104,11 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
104
104
|
scopes: SubAgentScopeConfig;
|
|
105
105
|
artifactComponentId: string;
|
|
106
106
|
}) => Promise<{
|
|
107
|
-
id: string;
|
|
108
|
-
createdAt: string;
|
|
109
|
-
projectId: string;
|
|
110
107
|
tenantId: string;
|
|
108
|
+
projectId: string;
|
|
109
|
+
id: string;
|
|
111
110
|
agentId: string;
|
|
111
|
+
createdAt: string;
|
|
112
112
|
subAgentId: string;
|
|
113
113
|
artifactComponentId: string;
|
|
114
114
|
}>;
|
|
@@ -147,11 +147,11 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
147
147
|
scopes: SubAgentScopeConfig;
|
|
148
148
|
artifactComponentId: string;
|
|
149
149
|
}) => Promise<{
|
|
150
|
-
id: string;
|
|
151
|
-
createdAt: string;
|
|
152
|
-
projectId: string;
|
|
153
150
|
tenantId: string;
|
|
151
|
+
projectId: string;
|
|
152
|
+
id: string;
|
|
154
153
|
agentId: string;
|
|
154
|
+
createdAt: string;
|
|
155
155
|
subAgentId: string;
|
|
156
156
|
artifactComponentId: string;
|
|
157
157
|
} | null>;
|
|
@@ -8,24 +8,24 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
8
8
|
scopes: AgentScopeConfig;
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
11
13
|
id: string;
|
|
14
|
+
agentId: string;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
agentId: string;
|
|
17
17
|
headersSchema: unknown;
|
|
18
18
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
22
22
|
}) => Promise<{
|
|
23
|
+
tenantId: string;
|
|
24
|
+
projectId: string;
|
|
23
25
|
id: string;
|
|
26
|
+
agentId: string;
|
|
24
27
|
createdAt: string;
|
|
25
28
|
updatedAt: string;
|
|
26
|
-
projectId: string;
|
|
27
|
-
tenantId: string;
|
|
28
|
-
agentId: string;
|
|
29
29
|
headersSchema: unknown;
|
|
30
30
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
31
31
|
}[]>;
|
|
@@ -42,12 +42,12 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
42
42
|
};
|
|
43
43
|
}>;
|
|
44
44
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
45
|
+
tenantId: string;
|
|
46
|
+
projectId: string;
|
|
45
47
|
id: string;
|
|
48
|
+
agentId: string;
|
|
46
49
|
createdAt: string;
|
|
47
50
|
updatedAt: string;
|
|
48
|
-
projectId: string;
|
|
49
|
-
tenantId: string;
|
|
50
|
-
agentId: string;
|
|
51
51
|
headersSchema: unknown;
|
|
52
52
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
53
53
|
}>;
|
|
@@ -82,12 +82,12 @@ declare const countContextConfigs: (db: AgentsManageDatabaseClient) => (params:
|
|
|
82
82
|
declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
83
83
|
data: ContextConfigInsert;
|
|
84
84
|
}) => Promise<{
|
|
85
|
+
tenantId: string;
|
|
86
|
+
projectId: string;
|
|
85
87
|
id: string;
|
|
88
|
+
agentId: string;
|
|
86
89
|
createdAt: string;
|
|
87
90
|
updatedAt: string;
|
|
88
|
-
projectId: string;
|
|
89
|
-
tenantId: string;
|
|
90
|
-
agentId: string;
|
|
91
91
|
headersSchema: unknown;
|
|
92
92
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
93
93
|
}>;
|
|
@@ -64,11 +64,11 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
64
64
|
scopes: SubAgentScopeConfig;
|
|
65
65
|
dataComponentId: string;
|
|
66
66
|
}) => Promise<{
|
|
67
|
-
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
|
-
projectId: string;
|
|
70
67
|
tenantId: string;
|
|
68
|
+
projectId: string;
|
|
69
|
+
id: string;
|
|
71
70
|
agentId: string;
|
|
71
|
+
createdAt: string;
|
|
72
72
|
subAgentId: string;
|
|
73
73
|
dataComponentId: string;
|
|
74
74
|
}>;
|
|
@@ -106,11 +106,11 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
106
106
|
scopes: SubAgentScopeConfig;
|
|
107
107
|
dataComponentId: string;
|
|
108
108
|
}) => Promise<{
|
|
109
|
-
id: string;
|
|
110
|
-
createdAt: string;
|
|
111
|
-
projectId: string;
|
|
112
109
|
tenantId: string;
|
|
110
|
+
projectId: string;
|
|
111
|
+
id: string;
|
|
113
112
|
agentId: string;
|
|
113
|
+
createdAt: string;
|
|
114
114
|
subAgentId: string;
|
|
115
115
|
dataComponentId: string;
|
|
116
116
|
} | null>;
|
|
@@ -53,14 +53,14 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
53
53
|
data: FunctionToolApiInsert;
|
|
54
54
|
scopes: AgentScopeConfig;
|
|
55
55
|
}) => Promise<{
|
|
56
|
+
tenantId: string;
|
|
57
|
+
projectId: string;
|
|
56
58
|
id: string;
|
|
57
59
|
name: string;
|
|
58
60
|
description: string | null;
|
|
61
|
+
agentId: string;
|
|
59
62
|
createdAt: string;
|
|
60
63
|
updatedAt: string;
|
|
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
|
+
tenantId: string;
|
|
99
|
+
projectId: string;
|
|
98
100
|
id: string;
|
|
99
101
|
name: string;
|
|
100
102
|
description: string | null;
|
|
103
|
+
agentId: string;
|
|
101
104
|
createdAt: string;
|
|
102
105
|
updatedAt: string;
|
|
103
|
-
projectId: string;
|
|
104
|
-
tenantId: string;
|
|
105
|
-
agentId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -150,12 +150,12 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
150
150
|
subAgentId: string;
|
|
151
151
|
functionToolId: string;
|
|
152
152
|
}) => Promise<{
|
|
153
|
+
tenantId: string;
|
|
154
|
+
projectId: string;
|
|
153
155
|
id: string;
|
|
156
|
+
agentId: string;
|
|
154
157
|
createdAt: string;
|
|
155
158
|
updatedAt: string;
|
|
156
|
-
projectId: string;
|
|
157
|
-
tenantId: string;
|
|
158
|
-
agentId: string;
|
|
159
159
|
subAgentId: string;
|
|
160
160
|
functionToolId: string;
|
|
161
161
|
}>;
|
|
@@ -206,12 +206,12 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
206
206
|
subAgentId: string;
|
|
207
207
|
functionToolId: string;
|
|
208
208
|
}) => Promise<{
|
|
209
|
+
tenantId: string;
|
|
210
|
+
projectId: string;
|
|
209
211
|
id: string;
|
|
212
|
+
agentId: string;
|
|
210
213
|
createdAt: string;
|
|
211
214
|
updatedAt: string;
|
|
212
|
-
projectId: string;
|
|
213
|
-
tenantId: string;
|
|
214
|
-
agentId: string;
|
|
215
215
|
subAgentId: string;
|
|
216
216
|
functionToolId: string;
|
|
217
217
|
}>;
|
|
@@ -24,9 +24,13 @@ declare const updateFullProjectServerSide: (db: AgentsManageDatabaseClient, logg
|
|
|
24
24
|
}) => Promise<FullProjectSelect>;
|
|
25
25
|
declare const getFullProject: (db: AgentsManageDatabaseClient, logger?: ProjectLogger) => (params: {
|
|
26
26
|
scopes: ProjectScopeConfig;
|
|
27
|
+
/** Optional branch name to query from. If not provided, uses the project's main branch. */
|
|
28
|
+
branchName?: string;
|
|
27
29
|
}) => Promise<FullProjectSelect | null>;
|
|
28
30
|
declare const getFullProjectWithRelationIds: (db: AgentsManageDatabaseClient, logger?: ProjectLogger) => (params: {
|
|
29
31
|
scopes: ProjectScopeConfig;
|
|
32
|
+
/** Optional branch name to query from. If not provided, uses the project's main branch. */
|
|
33
|
+
branchName?: string;
|
|
30
34
|
}) => Promise<FullProjectSelectWithRelationIds | null>;
|
|
31
35
|
/**
|
|
32
36
|
* Delete a complete project and cascade to all related entities
|
|
@@ -3,6 +3,7 @@ import { deleteExternalAgent, listExternalAgents, upsertExternalAgent } from "./
|
|
|
3
3
|
import { deleteFunction, listFunctions, upsertFunction } from "./functions.js";
|
|
4
4
|
import { deleteCredentialReference, listCredentialReferences, upsertCredentialReference } from "./credentialReferences.js";
|
|
5
5
|
import { deleteTool, listTools, upsertTool } from "./tools.js";
|
|
6
|
+
import { getProjectBranchName, withBranch } from "../../dolt/branch.js";
|
|
6
7
|
import { listAgents } from "./agents.js";
|
|
7
8
|
import { deleteArtifactComponent, listArtifactComponents, upsertArtifactComponent } from "./artifactComponents.js";
|
|
8
9
|
import { deleteDataComponent, listDataComponents, upsertDataComponent } from "./dataComponents.js";
|
|
@@ -1047,12 +1048,20 @@ const getFullProjectInternal = (db, logger = defaultLogger) => async (params) =>
|
|
|
1047
1048
|
});
|
|
1048
1049
|
await Promise.all(agentPromises);
|
|
1049
1050
|
}
|
|
1050
|
-
|
|
1051
|
+
const projectModels = project.models ?? {
|
|
1052
|
+
base: { model: "claude-sonnet-4-5" },
|
|
1053
|
+
structuredOutput: { model: "claude-sonnet-4-5" },
|
|
1054
|
+
summarizer: { model: "claude-sonnet-4-5" }
|
|
1055
|
+
};
|
|
1056
|
+
if (!projectModels.base) logger.warn({
|
|
1057
|
+
tenantId,
|
|
1058
|
+
projectId
|
|
1059
|
+
}, `Project ${project.id} is missing base model configuration. Using default: claude-sonnet-4-5`);
|
|
1051
1060
|
const fullProjectDefinition = {
|
|
1052
1061
|
id: project.id,
|
|
1053
1062
|
name: project.name,
|
|
1054
1063
|
description: project.description,
|
|
1055
|
-
models:
|
|
1064
|
+
models: projectModels,
|
|
1056
1065
|
stopWhen: project.stopWhen ?? null,
|
|
1057
1066
|
agents,
|
|
1058
1067
|
tools: projectTools,
|
|
@@ -1082,15 +1091,29 @@ const getFullProjectInternal = (db, logger = defaultLogger) => async (params) =>
|
|
|
1082
1091
|
}
|
|
1083
1092
|
};
|
|
1084
1093
|
const getFullProject = (db, logger = defaultLogger) => async (params) => {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1094
|
+
const { scopes, branchName } = params;
|
|
1095
|
+
const targetBranch = branchName ?? getProjectBranchName(scopes.tenantId, scopes.projectId);
|
|
1096
|
+
return withBranch(db)({
|
|
1097
|
+
branchName: targetBranch,
|
|
1098
|
+
callback: async (txDb) => {
|
|
1099
|
+
return getFullProjectInternal(txDb, logger)({
|
|
1100
|
+
scopes,
|
|
1101
|
+
includeRelationIds: false
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1088
1104
|
});
|
|
1089
1105
|
};
|
|
1090
1106
|
const getFullProjectWithRelationIds = (db, logger = defaultLogger) => async (params) => {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1107
|
+
const { scopes, branchName } = params;
|
|
1108
|
+
const targetBranch = branchName ?? getProjectBranchName(scopes.tenantId, scopes.projectId);
|
|
1109
|
+
return withBranch(db)({
|
|
1110
|
+
branchName: targetBranch,
|
|
1111
|
+
callback: async (txDb) => {
|
|
1112
|
+
return getFullProjectInternal(txDb, logger)({
|
|
1113
|
+
scopes,
|
|
1114
|
+
includeRelationIds: true
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1094
1117
|
});
|
|
1095
1118
|
};
|
|
1096
1119
|
/**
|
|
@@ -8,12 +8,12 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
8
8
|
scopes: SubAgentScopeConfig;
|
|
9
9
|
relationId: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
11
13
|
id: string;
|
|
14
|
+
agentId: string;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
agentId: string;
|
|
17
17
|
headers: Record<string, string> | null;
|
|
18
18
|
externalAgentId: string;
|
|
19
19
|
subAgentId: string;
|
|
@@ -43,12 +43,12 @@ declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClien
|
|
|
43
43
|
declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
44
44
|
scopes: SubAgentScopeConfig;
|
|
45
45
|
}) => Promise<{
|
|
46
|
+
tenantId: string;
|
|
47
|
+
projectId: string;
|
|
46
48
|
id: string;
|
|
49
|
+
agentId: string;
|
|
47
50
|
createdAt: string;
|
|
48
51
|
updatedAt: string;
|
|
49
|
-
projectId: string;
|
|
50
|
-
tenantId: string;
|
|
51
|
-
agentId: string;
|
|
52
52
|
headers: Record<string, string> | null;
|
|
53
53
|
externalAgentId: string;
|
|
54
54
|
subAgentId: string;
|
|
@@ -56,12 +56,12 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
56
56
|
declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
57
57
|
scopes: AgentScopeConfig;
|
|
58
58
|
}) => Promise<{
|
|
59
|
+
tenantId: string;
|
|
60
|
+
projectId: string;
|
|
59
61
|
id: string;
|
|
62
|
+
agentId: string;
|
|
60
63
|
createdAt: string;
|
|
61
64
|
updatedAt: string;
|
|
62
|
-
projectId: string;
|
|
63
|
-
tenantId: string;
|
|
64
|
-
agentId: string;
|
|
65
65
|
headers: Record<string, string> | null;
|
|
66
66
|
externalAgentId: string;
|
|
67
67
|
subAgentId: string;
|
|
@@ -179,12 +179,12 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
179
179
|
headers?: Record<string, string> | null;
|
|
180
180
|
};
|
|
181
181
|
}) => Promise<{
|
|
182
|
+
tenantId: string;
|
|
183
|
+
projectId: string;
|
|
182
184
|
id: string;
|
|
185
|
+
agentId: string;
|
|
183
186
|
createdAt: string;
|
|
184
187
|
updatedAt: string;
|
|
185
|
-
projectId: string;
|
|
186
|
-
tenantId: string;
|
|
187
|
-
agentId: string;
|
|
188
188
|
headers: Record<string, string> | null;
|
|
189
189
|
externalAgentId: string;
|
|
190
190
|
subAgentId: string;
|
|
@@ -196,12 +196,12 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
196
196
|
scopes: SubAgentScopeConfig;
|
|
197
197
|
externalAgentId: string;
|
|
198
198
|
}) => Promise<{
|
|
199
|
+
tenantId: string;
|
|
200
|
+
projectId: string;
|
|
199
201
|
id: string;
|
|
202
|
+
agentId: string;
|
|
200
203
|
createdAt: string;
|
|
201
204
|
updatedAt: string;
|
|
202
|
-
projectId: string;
|
|
203
|
-
tenantId: string;
|
|
204
|
-
agentId: string;
|
|
205
205
|
headers: Record<string, string> | null;
|
|
206
206
|
externalAgentId: string;
|
|
207
207
|
subAgentId: string;
|
|
@@ -217,12 +217,12 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
217
217
|
headers?: Record<string, string> | null;
|
|
218
218
|
};
|
|
219
219
|
}) => Promise<{
|
|
220
|
+
tenantId: string;
|
|
221
|
+
projectId: string;
|
|
220
222
|
id: string;
|
|
223
|
+
agentId: string;
|
|
221
224
|
createdAt: string;
|
|
222
225
|
updatedAt: string;
|
|
223
|
-
projectId: string;
|
|
224
|
-
tenantId: string;
|
|
225
|
-
agentId: string;
|
|
226
226
|
headers: Record<string, string> | null;
|
|
227
227
|
externalAgentId: string;
|
|
228
228
|
subAgentId: string;
|