@inkeep/agents-core 0.64.10 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/auth/auth-schema.d.ts +108 -108
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/client-exports.d.ts +2 -2
  4. package/dist/client-exports.js +2 -2
  5. package/dist/data-access/index.d.ts +4 -3
  6. package/dist/data-access/index.js +3 -2
  7. package/dist/data-access/manage/agents.d.ts +25 -25
  8. package/dist/data-access/manage/artifactComponents.d.ts +8 -8
  9. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  10. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  11. package/dist/data-access/manage/functionTools.d.ts +10 -10
  12. package/dist/data-access/manage/projectLifecycle.d.ts +6 -6
  13. package/dist/data-access/manage/projectLifecycle.js +42 -21
  14. package/dist/data-access/manage/skills.d.ts +12 -12
  15. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
  16. package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
  17. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
  18. package/dist/data-access/manage/subAgents.d.ts +15 -15
  19. package/dist/data-access/manage/tools.d.ts +24 -24
  20. package/dist/data-access/manage/triggers.d.ts +3 -3
  21. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  22. package/dist/data-access/runtime/apps.d.ts +12 -12
  23. package/dist/data-access/runtime/cascade-delete.d.ts +2 -3
  24. package/dist/data-access/runtime/cascade-delete.js +10 -10
  25. package/dist/data-access/runtime/conversations.d.ts +20 -20
  26. package/dist/data-access/runtime/messages.d.ts +12 -12
  27. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +22 -14
  28. package/dist/data-access/runtime/scheduledTriggerInvocations.js +67 -9
  29. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +54 -0
  30. package/dist/data-access/runtime/scheduledTriggerUsers.js +62 -0
  31. package/dist/data-access/runtime/scheduledTriggers.d.ts +1 -0
  32. package/dist/data-access/runtime/tasks.d.ts +3 -3
  33. package/dist/db/manage/manage-schema.d.ts +6 -6
  34. package/dist/db/runtime/runtime-schema.d.ts +505 -388
  35. package/dist/db/runtime/runtime-schema.js +36 -2
  36. package/dist/index.d.ts +7 -6
  37. package/dist/index.js +5 -4
  38. package/dist/types/entities.d.ts +6 -2
  39. package/dist/types/index.d.ts +2 -2
  40. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  41. package/dist/validation/index.d.ts +2 -2
  42. package/dist/validation/index.js +2 -2
  43. package/dist/validation/schemas/skills.d.ts +49 -49
  44. package/dist/validation/schemas.d.ts +1931 -1837
  45. package/dist/validation/schemas.js +26 -5
  46. package/drizzle/runtime/0032_sloppy_starfox.sql +17 -0
  47. package/drizzle/runtime/0033_backfill-scheduled-trigger-users.sql +7 -0
  48. package/drizzle/runtime/meta/0032_snapshot.json +5120 -0
  49. package/drizzle/runtime/meta/_journal.json +14 -0
  50. package/package.json +1 -1
@@ -9,11 +9,11 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
9
9
  scopes: AgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
12
  id: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
15
+ tenantId: string;
16
+ projectId: string;
17
17
  agentId: string;
18
18
  sourceSubAgentId: string;
19
19
  targetSubAgentId: string | null;
@@ -44,11 +44,11 @@ declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- projectId: string;
49
47
  id: string;
50
48
  createdAt: string;
51
49
  updatedAt: string;
50
+ tenantId: string;
51
+ projectId: string;
52
52
  agentId: string;
53
53
  sourceSubAgentId: string;
54
54
  targetSubAgentId: string | null;
@@ -57,11 +57,11 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
57
57
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- projectId: string;
62
60
  id: string;
63
61
  createdAt: string;
64
62
  updatedAt: string;
63
+ tenantId: string;
64
+ projectId: string;
65
65
  agentId: string;
66
66
  sourceSubAgentId: string;
67
67
  targetSubAgentId: string | null;
@@ -126,11 +126,11 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
126
126
  }[];
127
127
  }>;
128
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
129
- tenantId: string;
130
- projectId: string;
131
129
  id: string;
132
130
  createdAt: string;
133
131
  updatedAt: string;
132
+ tenantId: string;
133
+ projectId: string;
134
134
  agentId: string;
135
135
  sourceSubAgentId: string;
136
136
  targetSubAgentId: string | null;
@@ -145,11 +145,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
145
145
  targetSubAgentId?: string;
146
146
  relationType: string;
147
147
  }) => Promise<{
148
- tenantId: string;
149
- projectId: string;
150
148
  id: string;
151
149
  createdAt: string;
152
150
  updatedAt: string;
151
+ tenantId: string;
152
+ projectId: string;
153
153
  agentId: string;
154
154
  sourceSubAgentId: string;
155
155
  targetSubAgentId: string | null;
@@ -159,11 +159,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
159
159
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
160
160
  */
161
161
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
162
- tenantId: string;
163
- projectId: string;
164
162
  id: string;
165
163
  createdAt: string;
166
164
  updatedAt: string;
165
+ tenantId: string;
166
+ projectId: string;
167
167
  agentId: string;
168
168
  sourceSubAgentId: string;
169
169
  targetSubAgentId: string | null;
@@ -204,19 +204,19 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
204
204
  }> | null;
205
205
  };
206
206
  }) => Promise<{
207
- tenantId: string;
208
- projectId: string;
209
207
  id: string;
210
- toolId: string;
211
208
  createdAt: string;
212
209
  updatedAt: string;
210
+ tenantId: string;
211
+ projectId: string;
213
212
  agentId: string;
213
+ toolId: string;
214
214
  subAgentId: string;
215
+ headers: Record<string, string> | null;
216
+ selectedTools: string[] | null;
215
217
  toolPolicies: Record<string, {
216
218
  needsApproval?: boolean;
217
219
  }> | null;
218
- headers: Record<string, string> | null;
219
- selectedTools: string[] | null;
220
220
  }>;
221
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
222
222
  scopes: AgentScopeConfig;
@@ -248,19 +248,19 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
248
248
  scopes: SubAgentScopeConfig;
249
249
  relationId: string;
250
250
  }) => Promise<{
251
- tenantId: string;
252
- projectId: string;
253
251
  id: string;
254
- toolId: string;
255
252
  createdAt: string;
256
253
  updatedAt: string;
254
+ tenantId: string;
255
+ projectId: string;
257
256
  agentId: string;
257
+ toolId: string;
258
258
  subAgentId: string;
259
+ headers: Record<string, string> | null;
260
+ selectedTools: string[] | null;
259
261
  toolPolicies: Record<string, {
260
262
  needsApproval?: boolean;
261
263
  }> | null;
262
- headers: Record<string, string> | null;
263
- selectedTools: string[] | null;
264
264
  } | undefined>;
265
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
266
266
  scopes: SubAgentScopeConfig;
@@ -9,11 +9,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
12
  id: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
15
+ tenantId: string;
16
+ projectId: string;
17
17
  agentId: string;
18
18
  subAgentId: string;
19
19
  headers: Record<string, string> | null;
@@ -44,11 +44,11 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
44
44
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- projectId: string;
49
47
  id: string;
50
48
  createdAt: string;
51
49
  updatedAt: string;
50
+ tenantId: string;
51
+ projectId: string;
52
52
  agentId: string;
53
53
  subAgentId: string;
54
54
  headers: Record<string, string> | null;
@@ -57,11 +57,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
57
57
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- projectId: string;
62
60
  id: string;
63
61
  createdAt: string;
64
62
  updatedAt: string;
63
+ tenantId: string;
64
+ projectId: string;
65
65
  agentId: string;
66
66
  subAgentId: string;
67
67
  headers: Record<string, string> | null;
@@ -222,11 +222,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
222
222
  headers?: Record<string, string> | null;
223
223
  };
224
224
  }) => Promise<{
225
- tenantId: string;
226
- projectId: string;
227
225
  id: string;
228
226
  createdAt: string;
229
227
  updatedAt: string;
228
+ tenantId: string;
229
+ projectId: string;
230
230
  agentId: string;
231
231
  subAgentId: string;
232
232
  headers: Record<string, string> | null;
@@ -239,11 +239,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
239
239
  scopes: SubAgentScopeConfig;
240
240
  targetAgentId: string;
241
241
  }) => Promise<{
242
- tenantId: string;
243
- projectId: string;
244
242
  id: string;
245
243
  createdAt: string;
246
244
  updatedAt: string;
245
+ tenantId: string;
246
+ projectId: string;
247
247
  agentId: string;
248
248
  subAgentId: string;
249
249
  headers: Record<string, string> | null;
@@ -260,11 +260,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
260
260
  headers?: Record<string, string> | null;
261
261
  };
262
262
  }) => Promise<{
263
- tenantId: string;
264
- projectId: string;
265
263
  id: string;
266
264
  createdAt: string;
267
265
  updatedAt: string;
266
+ tenantId: string;
267
+ projectId: string;
268
268
  agentId: string;
269
269
  subAgentId: string;
270
270
  headers: Record<string, string> | null;
@@ -9,13 +9,9 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
9
9
  scopes: AgentScopeConfig;
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
12
  id: string;
15
13
  name: string;
16
14
  description: string | null;
17
- createdAt: string;
18
- updatedAt: string;
19
15
  models: {
20
16
  base?: {
21
17
  model?: string | undefined;
@@ -39,20 +35,20 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
39
35
  stopWhen: {
40
36
  stepCountIs?: number | undefined;
41
37
  } | null;
42
- agentId: string;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ tenantId: string;
43
41
  prompt: string | null;
42
+ projectId: string;
43
+ agentId: string;
44
44
  conversationHistoryConfig: ConversationHistoryConfig | null;
45
45
  } | undefined>;
46
46
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
47
47
  scopes: AgentScopeConfig;
48
48
  }) => Promise<{
49
- tenantId: string;
50
- projectId: string;
51
49
  id: string;
52
50
  name: string;
53
51
  description: string | null;
54
- createdAt: string;
55
- updatedAt: string;
56
52
  models: {
57
53
  base?: {
58
54
  model?: string | undefined;
@@ -76,8 +72,12 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
76
72
  stopWhen: {
77
73
  stepCountIs?: number | undefined;
78
74
  } | null;
79
- agentId: string;
75
+ createdAt: string;
76
+ updatedAt: string;
77
+ tenantId: string;
80
78
  prompt: string | null;
79
+ projectId: string;
80
+ agentId: string;
81
81
  conversationHistoryConfig: ConversationHistoryConfig | null;
82
82
  }[]>;
83
83
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
@@ -127,13 +127,9 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
127
127
  };
128
128
  }>;
129
129
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
130
- tenantId: string;
131
- projectId: string;
132
130
  id: string;
133
131
  name: string;
134
132
  description: string | null;
135
- createdAt: string;
136
- updatedAt: string;
137
133
  models: {
138
134
  base?: {
139
135
  model?: string | undefined;
@@ -157,8 +153,12 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
157
153
  stopWhen: {
158
154
  stepCountIs?: number | undefined;
159
155
  } | null;
160
- agentId: string;
156
+ createdAt: string;
157
+ updatedAt: string;
158
+ tenantId: string;
161
159
  prompt: string | null;
160
+ projectId: string;
161
+ agentId: string;
162
162
  conversationHistoryConfig: ConversationHistoryConfig | null;
163
163
  }>;
164
164
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -20,20 +20,20 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
20
20
  scopes: ProjectScopeConfig;
21
21
  toolId: string;
22
22
  }) => Promise<{
23
- tenantId: string;
24
- projectId: string;
25
23
  id: string;
26
24
  name: string;
27
25
  description: string | null;
28
26
  createdAt: string;
29
27
  updatedAt: string;
28
+ tenantId: string;
29
+ projectId: string;
30
30
  credentialReferenceId: string | null;
31
- headers: Record<string, string> | null;
32
31
  config: {
33
32
  type: "mcp";
34
33
  mcp: ToolMcpConfig;
35
34
  };
36
35
  credentialScope: string;
36
+ headers: Record<string, string> | null;
37
37
  imageUrl: string | null;
38
38
  capabilities: ToolServerCapabilities | null;
39
39
  lastError: string | null;
@@ -78,20 +78,20 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
78
78
  };
79
79
  }>;
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
- tenantId: string;
82
- projectId: string;
83
81
  id: string;
84
82
  name: string;
85
83
  description: string | null;
86
84
  createdAt: string;
87
85
  updatedAt: string;
86
+ tenantId: string;
87
+ projectId: string;
88
88
  credentialReferenceId: string | null;
89
- headers: Record<string, string> | null;
90
89
  config: {
91
90
  type: "mcp";
92
91
  mcp: ToolMcpConfig;
93
92
  };
94
93
  credentialScope: string;
94
+ headers: Record<string, string> | null;
95
95
  imageUrl: string | null;
96
96
  capabilities: ToolServerCapabilities | null;
97
97
  lastError: string | null;
@@ -135,38 +135,38 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
135
135
  needsApproval?: boolean;
136
136
  }> | null;
137
137
  }) => Promise<{
138
- tenantId: string;
139
- projectId: string;
140
138
  id: string;
141
- toolId: string;
142
139
  createdAt: string;
143
140
  updatedAt: string;
141
+ tenantId: string;
142
+ projectId: string;
144
143
  agentId: string;
144
+ toolId: string;
145
145
  subAgentId: string;
146
+ headers: Record<string, string> | null;
147
+ selectedTools: string[] | null;
146
148
  toolPolicies: Record<string, {
147
149
  needsApproval?: boolean;
148
150
  }> | null;
149
- headers: Record<string, string> | null;
150
- selectedTools: string[] | null;
151
151
  }>;
152
152
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
153
153
  scopes: AgentScopeConfig;
154
154
  subAgentId: string;
155
155
  toolId: string;
156
156
  }) => Promise<{
157
- tenantId: string;
158
- projectId: string;
159
157
  id: string;
160
- toolId: string;
161
158
  createdAt: string;
162
159
  updatedAt: string;
160
+ tenantId: string;
161
+ projectId: string;
163
162
  agentId: string;
163
+ toolId: string;
164
164
  subAgentId: string;
165
+ headers: Record<string, string> | null;
166
+ selectedTools: string[] | null;
165
167
  toolPolicies: Record<string, {
166
168
  needsApproval?: boolean;
167
169
  }> | null;
168
- headers: Record<string, string> | null;
169
- selectedTools: string[] | null;
170
170
  }>;
171
171
  /**
172
172
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -182,19 +182,19 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
182
182
  }> | null;
183
183
  relationId?: string;
184
184
  }) => Promise<{
185
- tenantId: string;
186
- projectId: string;
187
185
  id: string;
188
- toolId: string;
189
186
  createdAt: string;
190
187
  updatedAt: string;
188
+ tenantId: string;
189
+ projectId: string;
191
190
  agentId: string;
191
+ toolId: string;
192
192
  subAgentId: string;
193
+ headers: Record<string, string> | null;
194
+ selectedTools: string[] | null;
193
195
  toolPolicies: Record<string, {
194
196
  needsApproval?: boolean;
195
197
  }> | null;
196
- headers: Record<string, string> | null;
197
- selectedTools: string[] | null;
198
198
  }>;
199
199
  /**
200
200
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -202,20 +202,20 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
202
202
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
203
203
  data: ToolInsert;
204
204
  }) => Promise<{
205
- tenantId: string;
206
- projectId: string;
207
205
  id: string;
208
206
  name: string;
209
207
  description: string | null;
210
208
  createdAt: string;
211
209
  updatedAt: string;
210
+ tenantId: string;
211
+ projectId: string;
212
212
  credentialReferenceId: string | null;
213
- headers: Record<string, string> | null;
214
213
  config: {
215
214
  type: "mcp";
216
215
  mcp: ToolMcpConfig;
217
216
  };
218
217
  credentialScope: string;
218
+ headers: Record<string, string> | null;
219
219
  imageUrl: string | null;
220
220
  capabilities: ToolServerCapabilities | null;
221
221
  lastError: string | null;
@@ -37,10 +37,10 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
37
37
  authentication: unknown;
38
38
  signingSecretCredentialReferenceId: string | null;
39
39
  signatureVerification: {
40
- algorithm: "md5" | "sha256" | "sha512" | "sha384" | "sha1";
41
- encoding: "base64" | "hex";
40
+ algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
41
+ encoding: "hex" | "base64";
42
42
  signature: {
43
- source: "query" | "header" | "body";
43
+ source: "header" | "query" | "body";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- tenantId: string;
12
- projectId: string;
13
11
  id: string;
14
12
  name: string | null;
15
13
  createdAt: string;
16
14
  updatedAt: string;
15
+ tenantId: string;
16
+ projectId: string;
17
17
  agentId: string;
18
+ lastUsedAt: string | null;
18
19
  expiresAt: string | null;
19
20
  publicId: string;
20
21
  keyHash: string;
21
22
  keyPrefix: string;
22
- lastUsedAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- tenantId: string;
26
- projectId: string;
27
25
  id: string;
28
26
  name: string | null;
29
27
  createdAt: string;
30
28
  updatedAt: string;
29
+ tenantId: string;
30
+ projectId: string;
31
31
  agentId: string;
32
+ lastUsedAt: string | null;
32
33
  expiresAt: string | null;
33
34
  publicId: string;
34
35
  keyHash: string;
35
36
  keyPrefix: string;
36
- lastUsedAt: string | null;
37
37
  } | undefined>;
38
38
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
- tenantId: string;
43
- projectId: string;
44
42
  id: string;
45
43
  name: string | null;
46
44
  createdAt: string;
47
45
  updatedAt: string;
46
+ tenantId: string;
47
+ projectId: string;
48
48
  agentId: string;
49
+ lastUsedAt: string | null;
49
50
  expiresAt: string | null;
50
51
  publicId: string;
51
52
  keyHash: string;
52
53
  keyPrefix: string;
53
- lastUsedAt: string | null;
54
54
  }[]>;
55
55
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
56
56
  scopes: ProjectScopeConfig;
@@ -66,18 +66,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  };
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
- tenantId: string;
70
- projectId: string;
71
69
  id: string;
72
70
  name: string | null;
73
71
  createdAt: string;
74
72
  updatedAt: string;
73
+ tenantId: string;
74
+ projectId: string;
75
75
  agentId: string;
76
+ lastUsedAt: string | null;
76
77
  expiresAt: string | null;
77
78
  publicId: string;
78
79
  keyHash: string;
79
80
  keyPrefix: string;
80
- lastUsedAt: string | null;
81
81
  }>;
82
82
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
83
83
  scopes: ProjectScopeConfig;
@@ -5,16 +5,16 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
5
5
 
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
- tenantId: string | null;
9
- projectId: string | null;
8
+ type: AppType;
10
9
  id: string;
11
10
  name: string;
12
11
  description: string | null;
13
- type: AppType;
14
12
  createdAt: string;
15
13
  updatedAt: string;
16
- prompt: string | null;
14
+ tenantId: string | null;
17
15
  enabled: boolean;
16
+ prompt: string | null;
17
+ projectId: string | null;
18
18
  config: {
19
19
  type: "web_client";
20
20
  webClient: {
@@ -32,9 +32,9 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
32
32
  type: "api";
33
33
  api: Record<string, never>;
34
34
  };
35
- lastUsedAt: string | null;
36
- defaultProjectId: string | null;
37
35
  defaultAgentId: string | null;
36
+ defaultProjectId: string | null;
37
+ lastUsedAt: string | null;
38
38
  } | undefined>;
39
39
  declare const updateAppLastUsed: (db: AgentsRunDatabaseClient) => (id: string) => Promise<void>;
40
40
  declare const getAppByIdForTenant: (db: AgentsRunDatabaseClient) => (params: {
@@ -61,16 +61,16 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
61
61
  };
62
62
  }>;
63
63
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
64
- tenantId: string | null;
65
- projectId: string | null;
64
+ type: AppType;
66
65
  id: string;
67
66
  name: string;
68
67
  description: string | null;
69
- type: AppType;
70
68
  createdAt: string;
71
69
  updatedAt: string;
72
- prompt: string | null;
70
+ tenantId: string | null;
73
71
  enabled: boolean;
72
+ prompt: string | null;
73
+ projectId: string | null;
74
74
  config: {
75
75
  type: "web_client";
76
76
  webClient: {
@@ -88,9 +88,9 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
88
88
  type: "api";
89
89
  api: Record<string, never>;
90
90
  };
91
- lastUsedAt: string | null;
92
- defaultProjectId: string | null;
93
91
  defaultAgentId: string | null;
92
+ defaultProjectId: string | null;
93
+ lastUsedAt: string | null;
94
94
  }>;
95
95
  declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
96
96
  scopes: TenantScopeConfig;
@@ -34,8 +34,8 @@ declare const cascadeDeleteByBranch: (db: AgentsRunDatabaseClient) => (params: {
34
34
  ref: string;
35
35
  }) => Promise<CascadeDeleteResult>;
36
36
  /**
37
- * Delete all runtime entities for a project on a specific branch.
38
- * Used when deleting a project from a branch.
37
+ * Delete all runtime entities for a project across all branches.
38
+ * Used when deleting a project entirely.
39
39
  * PostgreSQL cascades handle: messages, taskRelations, ledgerArtifacts
40
40
  *
41
41
  * @param db - Runtime database client
@@ -43,7 +43,6 @@ declare const cascadeDeleteByBranch: (db: AgentsRunDatabaseClient) => (params: {
43
43
  */
44
44
  declare const cascadeDeleteByProject: (db: AgentsRunDatabaseClient) => (params: {
45
45
  scopes: ProjectScopeConfig;
46
- fullBranchName: string;
47
46
  }) => Promise<CascadeDeleteResult>;
48
47
  /**
49
48
  * Delete all runtime entities for a specific agent on a specific branch.
@@ -40,22 +40,22 @@ const cascadeDeleteByBranch = (db) => async (params) => {
40
40
  };
41
41
  };
42
42
  /**
43
- * Delete all runtime entities for a project on a specific branch.
44
- * Used when deleting a project from a branch.
43
+ * Delete all runtime entities for a project across all branches.
44
+ * Used when deleting a project entirely.
45
45
  * PostgreSQL cascades handle: messages, taskRelations, ledgerArtifacts
46
46
  *
47
47
  * @param db - Runtime database client
48
48
  * @returns Function that performs the cascade delete
49
49
  */
50
50
  const cascadeDeleteByProject = (db) => async (params) => {
51
- const { scopes, fullBranchName } = params;
52
- const contextCacheResult = await db.delete(contextCache).where(and(projectScopedWhere(contextCache, scopes), sql`${contextCache.ref}->>'name' = ${fullBranchName}`)).returning();
53
- const conversationsResult = await db.delete(conversations).where(and(projectScopedWhere(conversations, scopes), sql`${conversations.ref}->>'name' = ${fullBranchName}`)).returning();
54
- const tasksResult = await db.delete(tasks).where(and(projectScopedWhere(tasks, scopes), sql`${tasks.ref}->>'name' = ${fullBranchName}`)).returning();
55
- const triggerInvocationsResult = await db.delete(triggerInvocations).where(and(eq(triggerInvocations.tenantId, scopes.tenantId), eq(triggerInvocations.projectId, scopes.projectId), sql`${triggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
56
- const scheduledTriggerInvocationsResult = await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, scopes.tenantId), eq(scheduledTriggerInvocations.projectId, scopes.projectId), sql`${scheduledTriggerInvocations.ref}->>'name' = ${fullBranchName}`)).returning();
57
- const datasetRunsResult = await db.delete(datasetRun).where(and(eq(datasetRun.tenantId, scopes.tenantId), eq(datasetRun.projectId, scopes.projectId), sql`${datasetRun.ref}->>'name' = ${fullBranchName}`)).returning();
58
- const evaluationRunsResult = await db.delete(evaluationRun).where(and(eq(evaluationRun.tenantId, scopes.tenantId), eq(evaluationRun.projectId, scopes.projectId), sql`${evaluationRun.ref}->>'name' = ${fullBranchName}`)).returning();
51
+ const { scopes } = params;
52
+ const contextCacheResult = await db.delete(contextCache).where(projectScopedWhere(contextCache, scopes)).returning();
53
+ const conversationsResult = await db.delete(conversations).where(projectScopedWhere(conversations, scopes)).returning();
54
+ const tasksResult = await db.delete(tasks).where(projectScopedWhere(tasks, scopes)).returning();
55
+ const triggerInvocationsResult = await db.delete(triggerInvocations).where(and(eq(triggerInvocations.tenantId, scopes.tenantId), eq(triggerInvocations.projectId, scopes.projectId))).returning();
56
+ const scheduledTriggerInvocationsResult = await db.delete(scheduledTriggerInvocations).where(and(eq(scheduledTriggerInvocations.tenantId, scopes.tenantId), eq(scheduledTriggerInvocations.projectId, scopes.projectId))).returning();
57
+ const datasetRunsResult = await db.delete(datasetRun).where(and(eq(datasetRun.tenantId, scopes.tenantId), eq(datasetRun.projectId, scopes.projectId))).returning();
58
+ const evaluationRunsResult = await db.delete(evaluationRun).where(and(eq(evaluationRun.tenantId, scopes.tenantId), eq(evaluationRun.projectId, scopes.projectId))).returning();
59
59
  const apiKeysResult = await db.delete(apiKeys).where(projectScopedWhere(apiKeys, scopes)).returning();
60
60
  await cascadeDeleteGitHubAccessByProject(db)({
61
61
  tenantId: scopes.tenantId,