@inkeep/agents-core 0.0.0-dev-20260120222159 → 0.0.0-dev-20260121022749

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.
Files changed (64) hide show
  1. package/dist/auth/auth.d.ts +53 -53
  2. package/dist/auth/auth.js +1 -1
  3. package/dist/auth/permissions.d.ts +13 -13
  4. package/dist/context/ContextConfig.js +3 -3
  5. package/dist/data-access/index.d.ts +5 -5
  6. package/dist/data-access/index.js +5 -5
  7. package/dist/data-access/manage/agents.d.ts +37 -37
  8. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  9. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  10. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  11. package/dist/data-access/manage/evalConfig.d.ts +12 -2
  12. package/dist/data-access/manage/evalConfig.js +25 -1
  13. package/dist/data-access/manage/functionTools.d.ts +14 -14
  14. package/dist/data-access/manage/projectFull.d.ts +0 -4
  15. package/dist/data-access/manage/projectFull.js +8 -21
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  17. package/dist/data-access/manage/subAgentRelations.d.ts +36 -36
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  19. package/dist/data-access/manage/subAgents.d.ts +27 -27
  20. package/dist/data-access/manage/tools.d.ts +41 -34
  21. package/dist/data-access/manage/tools.js +9 -1
  22. package/dist/data-access/manage/triggers.d.ts +0 -4
  23. package/dist/data-access/manage/triggers.js +1 -15
  24. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  25. package/dist/data-access/runtime/conversations.d.ts +31 -31
  26. package/dist/data-access/runtime/messages.d.ts +18 -18
  27. package/dist/data-access/runtime/organizations.d.ts +10 -1
  28. package/dist/data-access/runtime/organizations.js +13 -1
  29. package/dist/data-access/runtime/tasks.d.ts +7 -7
  30. package/dist/db/manage/manage-client.d.ts +3 -1
  31. package/dist/db/manage/manage-client.js +13 -1
  32. package/dist/db/manage/manage-schema.d.ts +375 -375
  33. package/dist/db/migrations/cleanup-old-trigger-auth.d.ts +1 -0
  34. package/dist/db/migrations/cleanup-old-trigger-auth.js +68 -0
  35. package/dist/db/runtime/runtime-schema.d.ts +181 -181
  36. package/dist/dolt/branch.d.ts +4 -53
  37. package/dist/dolt/branch.js +23 -81
  38. package/dist/dolt/branches-api.js +1 -1
  39. package/dist/dolt/index.d.ts +5 -3
  40. package/dist/dolt/index.js +5 -3
  41. package/dist/dolt/migrate-all-branches.js +1 -1
  42. package/dist/dolt/{ref.d.ts → ref-helpers.d.ts} +5 -2
  43. package/dist/dolt/{ref.js → ref-helpers.js} +15 -3
  44. package/dist/dolt/ref-middleware.d.ts +82 -0
  45. package/dist/dolt/ref-middleware.js +217 -0
  46. package/dist/dolt/ref-scope.d.ts +101 -0
  47. package/dist/dolt/ref-scope.js +231 -0
  48. package/dist/env.d.ts +2 -2
  49. package/dist/env.js +1 -1
  50. package/dist/index.d.ts +12 -10
  51. package/dist/index.js +15 -13
  52. package/dist/types/entities.d.ts +3 -2
  53. package/dist/types/index.d.ts +2 -2
  54. package/dist/utils/index.d.ts +2 -2
  55. package/dist/utils/index.js +2 -2
  56. package/dist/utils/third-party-mcp-servers/composio-client.js +23 -23
  57. package/dist/utils/trigger-auth.d.ts +37 -7
  58. package/dist/utils/trigger-auth.js +72 -77
  59. package/dist/validation/dolt-schemas.d.ts +1 -1
  60. package/dist/validation/index.d.ts +2 -2
  61. package/dist/validation/index.js +2 -2
  62. package/dist/validation/schemas.d.ts +473 -486
  63. package/dist/validation/schemas.js +23 -28
  64. package/package.json +2 -1
@@ -8,15 +8,15 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
8
8
  scopes: AgentScopeConfig;
9
9
  relationId: string;
10
10
  }) => Promise<{
11
- tenantId: string;
12
- projectId: string;
13
11
  id: string;
14
- agentId: string;
15
12
  createdAt: string;
16
13
  updatedAt: string;
17
- relationType: string | null;
14
+ agentId: string;
15
+ projectId: string;
16
+ tenantId: string;
18
17
  sourceSubAgentId: string;
19
18
  targetSubAgentId: string | null;
19
+ relationType: string | null;
20
20
  } | undefined>;
21
21
  declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
22
22
  scopes: AgentScopeConfig;
@@ -43,28 +43,28 @@ declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
43
43
  declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  scopes: SubAgentScopeConfig;
45
45
  }) => Promise<{
46
- tenantId: string;
47
- projectId: string;
48
46
  id: string;
49
- agentId: string;
50
47
  createdAt: string;
51
48
  updatedAt: string;
52
- relationType: string | null;
49
+ agentId: string;
50
+ projectId: string;
51
+ tenantId: string;
53
52
  sourceSubAgentId: string;
54
53
  targetSubAgentId: string | null;
54
+ relationType: string | null;
55
55
  }[]>;
56
56
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
58
58
  }) => Promise<{
59
- tenantId: string;
60
- projectId: string;
61
59
  id: string;
62
- agentId: string;
63
60
  createdAt: string;
64
61
  updatedAt: string;
65
- relationType: string | null;
62
+ agentId: string;
63
+ projectId: string;
64
+ tenantId: string;
66
65
  sourceSubAgentId: string;
67
66
  targetSubAgentId: string | null;
67
+ relationType: string | null;
68
68
  }[]>;
69
69
  declare const getAgentRelationsBySource: (db: AgentsManageDatabaseClient) => (params: {
70
70
  scopes: AgentScopeConfig;
@@ -125,15 +125,15 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
125
125
  }[];
126
126
  }>;
127
127
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
128
- tenantId: string;
129
- projectId: string;
130
128
  id: string;
131
- agentId: string;
132
129
  createdAt: string;
133
130
  updatedAt: string;
134
- relationType: string | null;
131
+ agentId: string;
132
+ projectId: string;
133
+ tenantId: string;
135
134
  sourceSubAgentId: string;
136
135
  targetSubAgentId: string | null;
136
+ relationType: string | null;
137
137
  }>;
138
138
  /**
139
139
  * Check if sub-agent relation exists by agent, source, target, and relation type
@@ -144,29 +144,29 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
144
144
  targetSubAgentId?: string;
145
145
  relationType: string;
146
146
  }) => Promise<{
147
- tenantId: string;
148
- projectId: string;
149
147
  id: string;
150
- agentId: string;
151
148
  createdAt: string;
152
149
  updatedAt: string;
153
- relationType: string | null;
150
+ agentId: string;
151
+ projectId: string;
152
+ tenantId: string;
154
153
  sourceSubAgentId: string;
155
154
  targetSubAgentId: string | null;
155
+ relationType: string | null;
156
156
  } | undefined>;
157
157
  /**
158
158
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
159
159
  */
160
160
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
161
- tenantId: string;
162
- projectId: string;
163
161
  id: string;
164
- agentId: string;
165
162
  createdAt: string;
166
163
  updatedAt: string;
167
- relationType: string | null;
164
+ agentId: string;
165
+ projectId: string;
166
+ tenantId: string;
168
167
  sourceSubAgentId: string;
169
168
  targetSubAgentId: string | null;
169
+ relationType: string | null;
170
170
  }>;
171
171
  declare const updateAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
172
172
  scopes: AgentScopeConfig;
@@ -203,19 +203,19 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
203
203
  }> | null;
204
204
  };
205
205
  }) => Promise<{
206
- tenantId: string;
207
- projectId: string;
208
206
  id: string;
209
- agentId: string;
210
207
  createdAt: string;
211
208
  updatedAt: string;
212
- toolId: string;
213
209
  headers: Record<string, string> | null;
210
+ subAgentId: string;
211
+ agentId: string;
212
+ projectId: string;
213
+ tenantId: string;
214
+ toolId: string;
215
+ selectedTools: string[] | null;
214
216
  toolPolicies: Record<string, {
215
217
  needsApproval?: boolean;
216
218
  }> | null;
217
- subAgentId: string;
218
- selectedTools: string[] | null;
219
219
  }>;
220
220
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
221
221
  scopes: AgentScopeConfig;
@@ -247,19 +247,19 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
247
247
  scopes: SubAgentScopeConfig;
248
248
  relationId: string;
249
249
  }) => Promise<{
250
- tenantId: string;
251
- projectId: string;
252
250
  id: string;
253
- agentId: string;
254
251
  createdAt: string;
255
252
  updatedAt: string;
256
- toolId: string;
257
253
  headers: Record<string, string> | null;
254
+ subAgentId: string;
255
+ agentId: string;
256
+ projectId: string;
257
+ tenantId: string;
258
+ toolId: string;
259
+ selectedTools: string[] | null;
258
260
  toolPolicies: Record<string, {
259
261
  needsApproval?: boolean;
260
262
  }> | null;
261
- subAgentId: string;
262
- selectedTools: string[] | null;
263
263
  } | undefined>;
264
264
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
265
265
  scopes: SubAgentScopeConfig;
@@ -8,14 +8,14 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
8
8
  scopes: SubAgentScopeConfig;
9
9
  relationId: string;
10
10
  }) => Promise<{
11
- tenantId: string;
12
- projectId: string;
13
11
  id: string;
14
- agentId: string;
15
12
  createdAt: string;
16
13
  updatedAt: string;
17
14
  headers: Record<string, string> | null;
18
15
  subAgentId: string;
16
+ agentId: string;
17
+ projectId: string;
18
+ tenantId: string;
19
19
  targetAgentId: string;
20
20
  } | undefined>;
21
21
  declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
@@ -43,27 +43,27 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
43
43
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  scopes: SubAgentScopeConfig;
45
45
  }) => Promise<{
46
- tenantId: string;
47
- projectId: string;
48
46
  id: string;
49
- agentId: string;
50
47
  createdAt: string;
51
48
  updatedAt: string;
52
49
  headers: Record<string, string> | null;
53
50
  subAgentId: string;
51
+ agentId: string;
52
+ projectId: string;
53
+ tenantId: string;
54
54
  targetAgentId: string;
55
55
  }[]>;
56
56
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
58
58
  }) => Promise<{
59
- tenantId: string;
60
- projectId: string;
61
59
  id: string;
62
- agentId: string;
63
60
  createdAt: string;
64
61
  updatedAt: string;
65
62
  headers: Record<string, string> | null;
66
63
  subAgentId: string;
64
+ agentId: string;
65
+ projectId: string;
66
+ tenantId: string;
67
67
  targetAgentId: string;
68
68
  }[]>;
69
69
  declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -209,14 +209,14 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
209
209
  headers?: Record<string, string> | null;
210
210
  };
211
211
  }) => Promise<{
212
- tenantId: string;
213
- projectId: string;
214
212
  id: string;
215
- agentId: string;
216
213
  createdAt: string;
217
214
  updatedAt: string;
218
215
  headers: Record<string, string> | null;
219
216
  subAgentId: string;
217
+ agentId: string;
218
+ projectId: string;
219
+ tenantId: string;
220
220
  targetAgentId: string;
221
221
  }>;
222
222
  /**
@@ -226,14 +226,14 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
226
226
  scopes: SubAgentScopeConfig;
227
227
  targetAgentId: string;
228
228
  }) => Promise<{
229
- tenantId: string;
230
- projectId: string;
231
229
  id: string;
232
- agentId: string;
233
230
  createdAt: string;
234
231
  updatedAt: string;
235
232
  headers: Record<string, string> | null;
236
233
  subAgentId: string;
234
+ agentId: string;
235
+ projectId: string;
236
+ tenantId: string;
237
237
  targetAgentId: string;
238
238
  } | undefined>;
239
239
  /**
@@ -247,14 +247,14 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
247
247
  headers?: Record<string, string> | null;
248
248
  };
249
249
  }) => Promise<{
250
- tenantId: string;
251
- projectId: string;
252
250
  id: string;
253
- agentId: string;
254
251
  createdAt: string;
255
252
  updatedAt: string;
256
253
  headers: Record<string, string> | null;
257
254
  subAgentId: string;
255
+ agentId: string;
256
+ projectId: string;
257
+ tenantId: string;
258
258
  targetAgentId: string;
259
259
  }>;
260
260
  declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -8,15 +8,16 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
8
8
  scopes: AgentScopeConfig;
9
9
  subAgentId: string;
10
10
  }) => Promise<{
11
- tenantId: string;
12
- projectId: string;
13
11
  id: string;
14
12
  name: string;
15
- description: string | null;
16
- prompt: string | null;
17
- agentId: string;
18
13
  createdAt: string;
19
14
  updatedAt: string;
15
+ description: string | null;
16
+ stopWhen: {
17
+ stepCountIs?: number | undefined;
18
+ } | null;
19
+ prompt: string | null;
20
+ conversationHistoryConfig: ConversationHistoryConfig | null;
20
21
  models: {
21
22
  base?: {
22
23
  model?: string | undefined;
@@ -31,23 +32,23 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
31
32
  providerOptions?: Record<string, any> | undefined;
32
33
  } | undefined;
33
34
  } | null;
34
- stopWhen: {
35
- stepCountIs?: number | undefined;
36
- } | null;
37
- conversationHistoryConfig: ConversationHistoryConfig | null;
35
+ agentId: string;
36
+ projectId: string;
37
+ tenantId: string;
38
38
  } | undefined>;
39
39
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
40
40
  scopes: AgentScopeConfig;
41
41
  }) => Promise<{
42
- tenantId: string;
43
- projectId: string;
44
42
  id: string;
45
43
  name: string;
46
- description: string | null;
47
- prompt: string | null;
48
- agentId: string;
49
44
  createdAt: string;
50
45
  updatedAt: string;
46
+ description: string | null;
47
+ stopWhen: {
48
+ stepCountIs?: number | undefined;
49
+ } | null;
50
+ prompt: string | null;
51
+ conversationHistoryConfig: ConversationHistoryConfig | null;
51
52
  models: {
52
53
  base?: {
53
54
  model?: string | undefined;
@@ -62,10 +63,9 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
62
63
  providerOptions?: Record<string, any> | undefined;
63
64
  } | undefined;
64
65
  } | null;
65
- stopWhen: {
66
- stepCountIs?: number | undefined;
67
- } | null;
68
- conversationHistoryConfig: ConversationHistoryConfig | null;
66
+ agentId: string;
67
+ projectId: string;
68
+ tenantId: string;
69
69
  }[]>;
70
70
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
71
71
  scopes: AgentScopeConfig;
@@ -108,15 +108,16 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
108
108
  };
109
109
  }>;
110
110
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
111
- tenantId: string;
112
- projectId: string;
113
111
  id: string;
114
112
  name: string;
115
- description: string | null;
116
- prompt: string | null;
117
- agentId: string;
118
113
  createdAt: string;
119
114
  updatedAt: string;
115
+ description: string | null;
116
+ stopWhen: {
117
+ stepCountIs?: number | undefined;
118
+ } | null;
119
+ prompt: string | null;
120
+ conversationHistoryConfig: ConversationHistoryConfig | null;
120
121
  models: {
121
122
  base?: {
122
123
  model?: string | undefined;
@@ -131,10 +132,9 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
131
132
  providerOptions?: Record<string, any> | undefined;
132
133
  } | undefined;
133
134
  } | null;
134
- stopWhen: {
135
- stepCountIs?: number | undefined;
136
- } | null;
137
- conversationHistoryConfig: ConversationHistoryConfig | null;
135
+ agentId: string;
136
+ projectId: string;
137
+ tenantId: string;
138
138
  }>;
139
139
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
140
140
  scopes: AgentScopeConfig;
@@ -12,24 +12,31 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
12
12
  scopes: ProjectScopeConfig;
13
13
  toolId: string;
14
14
  }) => Promise<{
15
- tenantId: string;
16
- projectId: string;
17
15
  id: string;
18
16
  name: string;
17
+ createdAt: string;
18
+ updatedAt: string;
19
19
  description: string | null;
20
+ headers: Record<string, string> | null;
21
+ projectId: string;
22
+ tenantId: string;
20
23
  config: {
21
24
  type: "mcp";
22
25
  mcp: ToolMcpConfig;
23
26
  };
24
27
  credentialReferenceId: string | null;
25
- createdAt: string;
26
- updatedAt: string;
27
- headers: Record<string, string> | null;
28
28
  credentialScope: string;
29
29
  imageUrl: string | null;
30
30
  capabilities: ToolServerCapabilities | null;
31
31
  lastError: string | null;
32
32
  } | null>;
33
+ declare const getMcpToolById: (db: AgentsManageDatabaseClient) => (params: {
34
+ scopes: ProjectScopeConfig;
35
+ toolId: string;
36
+ relationshipId?: string;
37
+ credentialStoreRegistry?: CredentialStoreRegistry;
38
+ userId?: string;
39
+ }) => Promise<McpTool | null>;
33
40
  declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
34
41
  scopes: ProjectScopeConfig;
35
42
  pagination?: PaginationConfig;
@@ -61,19 +68,19 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
61
68
  };
62
69
  }>;
63
70
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
64
- tenantId: string;
65
- projectId: string;
66
71
  id: string;
67
72
  name: string;
73
+ createdAt: string;
74
+ updatedAt: string;
68
75
  description: string | null;
76
+ headers: Record<string, string> | null;
77
+ projectId: string;
78
+ tenantId: string;
69
79
  config: {
70
80
  type: "mcp";
71
81
  mcp: ToolMcpConfig;
72
82
  };
73
83
  credentialReferenceId: string | null;
74
- createdAt: string;
75
- updatedAt: string;
76
- headers: Record<string, string> | null;
77
84
  credentialScope: string;
78
85
  imageUrl: string | null;
79
86
  capabilities: ToolServerCapabilities | null;
@@ -116,38 +123,38 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
116
123
  needsApproval?: boolean;
117
124
  }> | null;
118
125
  }) => Promise<{
119
- tenantId: string;
120
- projectId: string;
121
126
  id: string;
122
- agentId: string;
123
127
  createdAt: string;
124
128
  updatedAt: string;
125
- toolId: string;
126
129
  headers: Record<string, string> | null;
130
+ subAgentId: string;
131
+ agentId: string;
132
+ projectId: string;
133
+ tenantId: string;
134
+ toolId: string;
135
+ selectedTools: string[] | null;
127
136
  toolPolicies: Record<string, {
128
137
  needsApproval?: boolean;
129
138
  }> | null;
130
- subAgentId: string;
131
- selectedTools: string[] | null;
132
139
  }>;
133
140
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
134
141
  scopes: AgentScopeConfig;
135
142
  subAgentId: string;
136
143
  toolId: string;
137
144
  }) => Promise<{
138
- tenantId: string;
139
- projectId: string;
140
145
  id: string;
141
- agentId: string;
142
146
  createdAt: string;
143
147
  updatedAt: string;
144
- toolId: string;
145
148
  headers: Record<string, string> | null;
149
+ subAgentId: string;
150
+ agentId: string;
151
+ projectId: string;
152
+ tenantId: string;
153
+ toolId: string;
154
+ selectedTools: string[] | null;
146
155
  toolPolicies: Record<string, {
147
156
  needsApproval?: boolean;
148
157
  }> | null;
149
- subAgentId: string;
150
- selectedTools: string[] | null;
151
158
  }>;
152
159
  /**
153
160
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -163,19 +170,19 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
163
170
  }> | null;
164
171
  relationId?: string;
165
172
  }) => Promise<{
166
- tenantId: string;
167
- projectId: string;
168
173
  id: string;
169
- agentId: string;
170
174
  createdAt: string;
171
175
  updatedAt: string;
172
- toolId: string;
173
176
  headers: Record<string, string> | null;
177
+ subAgentId: string;
178
+ agentId: string;
179
+ projectId: string;
180
+ tenantId: string;
181
+ toolId: string;
182
+ selectedTools: string[] | null;
174
183
  toolPolicies: Record<string, {
175
184
  needsApproval?: boolean;
176
185
  }> | null;
177
- subAgentId: string;
178
- selectedTools: string[] | null;
179
186
  }>;
180
187
  /**
181
188
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -183,23 +190,23 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
183
190
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
184
191
  data: ToolInsert;
185
192
  }) => Promise<{
186
- tenantId: string;
187
- projectId: string;
188
193
  id: string;
189
194
  name: string;
195
+ createdAt: string;
196
+ updatedAt: string;
190
197
  description: string | null;
198
+ headers: Record<string, string> | null;
199
+ projectId: string;
200
+ tenantId: string;
191
201
  config: {
192
202
  type: "mcp";
193
203
  mcp: ToolMcpConfig;
194
204
  };
195
205
  credentialReferenceId: string | null;
196
- createdAt: string;
197
- updatedAt: string;
198
- headers: Record<string, string> | null;
199
206
  credentialScope: string;
200
207
  imageUrl: string | null;
201
208
  capabilities: ToolServerCapabilities | null;
202
209
  lastError: string | null;
203
210
  }>;
204
211
  //#endregion
205
- export { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool };
212
+ export { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool };
@@ -240,6 +240,14 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
240
240
  const getToolById = (db) => async (params) => {
241
241
  return await db.query.tools.findFirst({ where: and(eq(tools.tenantId, params.scopes.tenantId), eq(tools.projectId, params.scopes.projectId), eq(tools.id, params.toolId)) }) ?? null;
242
242
  };
243
+ const getMcpToolById = (db) => async (params) => {
244
+ const tool = await getToolById(db)({
245
+ scopes: params.scopes,
246
+ toolId: params.toolId
247
+ });
248
+ if (!tool) return null;
249
+ return await dbResultToMcpTool(tool, db, params.credentialStoreRegistry, params.relationshipId, params.userId);
250
+ };
243
251
  const listTools = (db) => async (params) => {
244
252
  const page = params.pagination?.page || 1;
245
253
  const limit = Math.min(params.pagination?.limit || 10, 100);
@@ -343,4 +351,4 @@ const upsertTool = (db) => async (params) => {
343
351
  };
344
352
 
345
353
  //#endregion
346
- export { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool };
354
+ export { addToolToAgent, createTool, dbResultToMcpTool, deleteTool, getMcpToolById, getToolById, listTools, removeToolFromAgent, updateTool, upsertSubAgentToolRelation, upsertTool };
@@ -6,14 +6,10 @@ import { TriggerInsert, TriggerSelect, TriggerUpdate } from "../../types/entitie
6
6
 
7
7
  /**
8
8
  * Get a trigger by ID (agent-scoped)
9
- * Uses withBranch to checkout the project's main branch and query using Drizzle ORM,
10
- * which handles column name mapping automatically.
11
9
  */
12
10
  declare const getTriggerById: (db: AgentsManageDatabaseClient) => (params: {
13
11
  scopes: AgentScopeConfig;
14
12
  triggerId: string;
15
- /** If true, uses withBranch to read from the project branch. Default: true for non-branch-scoped clients */
16
- useBranchScope?: boolean;
17
13
  }) => Promise<TriggerSelect | undefined>;
18
14
  /**
19
15
  * List all triggers for an agent
@@ -1,26 +1,12 @@
1
1
  import { triggers } from "../../db/manage/manage-schema.js";
2
- import { getProjectBranchName, withBranch } from "../../dolt/branch.js";
3
2
  import { and, count, desc, eq } from "drizzle-orm";
4
3
 
5
4
  //#region src/data-access/manage/triggers.ts
6
5
  /**
7
6
  * Get a trigger by ID (agent-scoped)
8
- * Uses withBranch to checkout the project's main branch and query using Drizzle ORM,
9
- * which handles column name mapping automatically.
10
7
  */
11
8
  const getTriggerById = (db) => async (params) => {
12
- const { scopes, triggerId, useBranchScope = true } = params;
13
- if (useBranchScope) {
14
- const branchName = getProjectBranchName(scopes.tenantId, scopes.projectId);
15
- try {
16
- return await withBranch(db)({
17
- branchName,
18
- callback: async (txDb) => {
19
- return await txDb.query.triggers.findFirst({ where: and(eq(triggers.tenantId, scopes.tenantId), eq(triggers.projectId, scopes.projectId), eq(triggers.agentId, scopes.agentId), eq(triggers.id, triggerId)) });
20
- }
21
- });
22
- } catch {}
23
- }
9
+ const { scopes, triggerId } = params;
24
10
  return await db.query.triggers.findFirst({ where: and(eq(triggers.tenantId, scopes.tenantId), eq(triggers.projectId, scopes.projectId), eq(triggers.agentId, scopes.agentId), eq(triggers.id, triggerId)) });
25
11
  };
26
12
  /**
@@ -7,49 +7,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
7
7
  scopes: ProjectScopeConfig;
8
8
  id: string;
9
9
  }) => Promise<{
10
- tenantId: string;
11
- projectId: string;
12
10
  id: string;
13
11
  name: string | null;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ expiresAt: string | null;
14
15
  agentId: string;
16
+ projectId: string;
17
+ tenantId: string;
15
18
  publicId: string;
16
19
  keyHash: string;
17
20
  keyPrefix: string;
18
21
  lastUsedAt: string | null;
19
- expiresAt: string | null;
20
- createdAt: string;
21
- updatedAt: string;
22
22
  } | undefined>;
23
23
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
24
- tenantId: string;
25
- projectId: string;
26
24
  id: string;
27
25
  name: string | null;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ expiresAt: string | null;
28
29
  agentId: string;
30
+ projectId: string;
31
+ tenantId: string;
29
32
  publicId: string;
30
33
  keyHash: string;
31
34
  keyPrefix: string;
32
35
  lastUsedAt: string | null;
33
- expiresAt: string | null;
34
- createdAt: string;
35
- updatedAt: string;
36
36
  } | undefined>;
37
37
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
38
38
  scopes: ProjectScopeConfig;
39
39
  agentId?: string;
40
40
  }) => Promise<{
41
- tenantId: string;
42
- projectId: string;
43
41
  id: string;
44
42
  name: string | null;
43
+ createdAt: string;
44
+ updatedAt: string;
45
+ expiresAt: string | null;
45
46
  agentId: string;
47
+ projectId: string;
48
+ tenantId: string;
46
49
  publicId: string;
47
50
  keyHash: string;
48
51
  keyPrefix: string;
49
52
  lastUsedAt: string | null;
50
- expiresAt: string | null;
51
- createdAt: string;
52
- updatedAt: string;
53
53
  }[]>;
54
54
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
55
55
  scopes: ProjectScopeConfig;
@@ -65,18 +65,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
65
65
  };
66
66
  }>;
67
67
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
68
- tenantId: string;
69
- projectId: string;
70
68
  id: string;
71
69
  name: string | null;
70
+ createdAt: string;
71
+ updatedAt: string;
72
+ expiresAt: string | null;
72
73
  agentId: string;
74
+ projectId: string;
75
+ tenantId: string;
73
76
  publicId: string;
74
77
  keyHash: string;
75
78
  keyPrefix: string;
76
79
  lastUsedAt: string | null;
77
- expiresAt: string | null;
78
- createdAt: string;
79
- updatedAt: string;
80
80
  }>;
81
81
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
82
82
  scopes: ProjectScopeConfig;