@inkeep/agents-core 0.64.8 → 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 (53) 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/auth/permissions.d.ts +9 -9
  4. package/dist/client-exports.d.ts +2 -2
  5. package/dist/client-exports.js +2 -2
  6. package/dist/data-access/index.d.ts +4 -3
  7. package/dist/data-access/index.js +3 -2
  8. package/dist/data-access/manage/agents.d.ts +42 -42
  9. package/dist/data-access/manage/artifactComponents.d.ts +8 -8
  10. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  11. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  12. package/dist/data-access/manage/functionTools.d.ts +10 -10
  13. package/dist/data-access/manage/projectLifecycle.d.ts +6 -6
  14. package/dist/data-access/manage/projectLifecycle.js +42 -21
  15. package/dist/data-access/manage/skills.d.ts +9 -9
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  17. package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  19. package/dist/data-access/manage/subAgents.d.ts +18 -18
  20. package/dist/data-access/manage/tools.d.ts +24 -24
  21. package/dist/data-access/manage/triggers.d.ts +2 -2
  22. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  23. package/dist/data-access/runtime/apps.d.ts +12 -12
  24. package/dist/data-access/runtime/cascade-delete.d.ts +2 -3
  25. package/dist/data-access/runtime/cascade-delete.js +10 -10
  26. package/dist/data-access/runtime/conversations.d.ts +24 -24
  27. package/dist/data-access/runtime/messages.d.ts +21 -21
  28. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +22 -14
  29. package/dist/data-access/runtime/scheduledTriggerInvocations.js +67 -9
  30. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +54 -0
  31. package/dist/data-access/runtime/scheduledTriggerUsers.js +62 -0
  32. package/dist/data-access/runtime/scheduledTriggers.d.ts +1 -0
  33. package/dist/data-access/runtime/tasks.d.ts +6 -6
  34. package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
  35. package/dist/db/manage/manage-schema.d.ts +449 -449
  36. package/dist/db/runtime/runtime-schema.d.ts +477 -360
  37. package/dist/db/runtime/runtime-schema.js +36 -2
  38. package/dist/index.d.ts +7 -6
  39. package/dist/index.js +5 -4
  40. package/dist/middleware/no-auth.d.ts +2 -2
  41. package/dist/types/entities.d.ts +6 -2
  42. package/dist/types/index.d.ts +2 -2
  43. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  44. package/dist/validation/index.d.ts +2 -2
  45. package/dist/validation/index.js +2 -2
  46. package/dist/validation/schemas/skills.d.ts +37 -37
  47. package/dist/validation/schemas.d.ts +2418 -2324
  48. package/dist/validation/schemas.js +26 -5
  49. package/drizzle/runtime/0032_sloppy_starfox.sql +17 -0
  50. package/drizzle/runtime/0033_backfill-scheduled-trigger-users.sql +7 -0
  51. package/drizzle/runtime/meta/0032_snapshot.json +5120 -0
  52. package/drizzle/runtime/meta/_journal.json +14 -0
  53. package/package.json +1 -1
@@ -12,12 +12,12 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- agentId: string;
16
- projectId: string;
17
15
  tenantId: string;
18
- relationType: string | null;
16
+ projectId: string;
17
+ agentId: string;
19
18
  sourceSubAgentId: string;
20
19
  targetSubAgentId: string | null;
20
+ relationType: string | null;
21
21
  } | undefined>;
22
22
  declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
23
23
  scopes: AgentScopeConfig;
@@ -47,12 +47,12 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
47
47
  id: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
- agentId: string;
51
- projectId: string;
52
50
  tenantId: string;
53
- relationType: string | null;
51
+ projectId: string;
52
+ agentId: string;
54
53
  sourceSubAgentId: string;
55
54
  targetSubAgentId: string | null;
55
+ relationType: string | null;
56
56
  }[]>;
57
57
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
@@ -60,12 +60,12 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
60
60
  id: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
- agentId: string;
64
- projectId: string;
65
63
  tenantId: string;
66
- relationType: string | null;
64
+ projectId: string;
65
+ agentId: string;
67
66
  sourceSubAgentId: string;
68
67
  targetSubAgentId: string | null;
68
+ relationType: string | null;
69
69
  }[]>;
70
70
  declare const getAgentRelationsBySource: (db: AgentsManageDatabaseClient) => (params: {
71
71
  scopes: AgentScopeConfig;
@@ -129,12 +129,12 @@ declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
129
129
  id: string;
130
130
  createdAt: string;
131
131
  updatedAt: string;
132
- agentId: string;
133
- projectId: string;
134
132
  tenantId: string;
135
- relationType: string | null;
133
+ projectId: string;
134
+ agentId: string;
136
135
  sourceSubAgentId: string;
137
136
  targetSubAgentId: string | null;
137
+ relationType: string | null;
138
138
  }>;
139
139
  /**
140
140
  * Check if sub-agent relation exists by agent, source, target, and relation type
@@ -148,12 +148,12 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
148
148
  id: string;
149
149
  createdAt: string;
150
150
  updatedAt: string;
151
- agentId: string;
152
- projectId: string;
153
151
  tenantId: string;
154
- relationType: string | null;
152
+ projectId: string;
153
+ agentId: string;
155
154
  sourceSubAgentId: string;
156
155
  targetSubAgentId: string | null;
156
+ relationType: string | null;
157
157
  } | undefined>;
158
158
  /**
159
159
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
@@ -162,12 +162,12 @@ declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
162
162
  id: string;
163
163
  createdAt: string;
164
164
  updatedAt: string;
165
- agentId: string;
166
- projectId: string;
167
165
  tenantId: string;
168
- relationType: string | null;
166
+ projectId: string;
167
+ agentId: string;
169
168
  sourceSubAgentId: string;
170
169
  targetSubAgentId: string | null;
170
+ relationType: string | null;
171
171
  }>;
172
172
  declare const updateAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
173
173
  scopes: AgentScopeConfig;
@@ -207,12 +207,12 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
207
207
  id: string;
208
208
  createdAt: string;
209
209
  updatedAt: string;
210
- headers: Record<string, string> | null;
211
- agentId: string;
212
- projectId: string;
213
210
  tenantId: string;
214
- subAgentId: string;
211
+ projectId: string;
212
+ agentId: string;
215
213
  toolId: string;
214
+ subAgentId: string;
215
+ headers: Record<string, string> | null;
216
216
  selectedTools: string[] | null;
217
217
  toolPolicies: Record<string, {
218
218
  needsApproval?: boolean;
@@ -251,12 +251,12 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
251
251
  id: string;
252
252
  createdAt: string;
253
253
  updatedAt: string;
254
- headers: Record<string, string> | null;
255
- agentId: string;
256
- projectId: string;
257
254
  tenantId: string;
258
- subAgentId: string;
255
+ projectId: string;
256
+ agentId: string;
259
257
  toolId: string;
258
+ subAgentId: string;
259
+ headers: Record<string, string> | null;
260
260
  selectedTools: string[] | null;
261
261
  toolPolicies: Record<string, {
262
262
  needsApproval?: boolean;
@@ -12,11 +12,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
12
12
  id: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- headers: Record<string, string> | null;
16
- agentId: string;
17
- projectId: string;
18
15
  tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
19
18
  subAgentId: string;
19
+ headers: Record<string, string> | null;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
22
22
  declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
@@ -47,11 +47,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
47
47
  id: string;
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
- headers: Record<string, string> | null;
51
- agentId: string;
52
- projectId: string;
53
50
  tenantId: string;
51
+ projectId: string;
52
+ agentId: string;
54
53
  subAgentId: string;
54
+ headers: Record<string, string> | null;
55
55
  targetAgentId: string;
56
56
  }[]>;
57
57
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -60,11 +60,11 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
60
60
  id: string;
61
61
  createdAt: string;
62
62
  updatedAt: string;
63
- headers: Record<string, string> | null;
64
- agentId: string;
65
- projectId: string;
66
63
  tenantId: string;
64
+ projectId: string;
65
+ agentId: string;
67
66
  subAgentId: string;
67
+ headers: Record<string, string> | null;
68
68
  targetAgentId: string;
69
69
  }[]>;
70
70
  declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -225,11 +225,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
225
225
  id: string;
226
226
  createdAt: string;
227
227
  updatedAt: string;
228
- headers: Record<string, string> | null;
229
- agentId: string;
230
- projectId: string;
231
228
  tenantId: string;
229
+ projectId: string;
230
+ agentId: string;
232
231
  subAgentId: string;
232
+ headers: Record<string, string> | null;
233
233
  targetAgentId: string;
234
234
  }>;
235
235
  /**
@@ -242,11 +242,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
242
242
  id: string;
243
243
  createdAt: string;
244
244
  updatedAt: string;
245
- headers: Record<string, string> | null;
246
- agentId: string;
247
- projectId: string;
248
245
  tenantId: string;
246
+ projectId: string;
247
+ agentId: string;
249
248
  subAgentId: string;
249
+ headers: Record<string, string> | null;
250
250
  targetAgentId: string;
251
251
  } | undefined>;
252
252
  /**
@@ -263,11 +263,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
263
263
  id: string;
264
264
  createdAt: string;
265
265
  updatedAt: string;
266
- headers: Record<string, string> | null;
267
- agentId: string;
268
- projectId: string;
269
266
  tenantId: string;
267
+ projectId: string;
268
+ agentId: string;
270
269
  subAgentId: string;
270
+ headers: Record<string, string> | null;
271
271
  targetAgentId: string;
272
272
  }>;
273
273
  declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -11,12 +11,7 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
11
11
  }) => Promise<{
12
12
  id: string;
13
13
  name: string;
14
- createdAt: string;
15
- updatedAt: string;
16
14
  description: string | null;
17
- agentId: string;
18
- projectId: string;
19
- tenantId: string;
20
15
  models: {
21
16
  base?: {
22
17
  model?: string | undefined;
@@ -37,10 +32,15 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
37
32
  allowedProviders?: string[] | undefined;
38
33
  } | undefined;
39
34
  } | null;
40
- prompt: string | null;
41
35
  stopWhen: {
42
36
  stepCountIs?: number | undefined;
43
37
  } | null;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ tenantId: string;
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: {
@@ -48,12 +48,7 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
48
48
  }) => Promise<{
49
49
  id: string;
50
50
  name: string;
51
- createdAt: string;
52
- updatedAt: string;
53
51
  description: string | null;
54
- agentId: string;
55
- projectId: string;
56
- tenantId: string;
57
52
  models: {
58
53
  base?: {
59
54
  model?: string | undefined;
@@ -74,10 +69,15 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
74
69
  allowedProviders?: string[] | undefined;
75
70
  } | undefined;
76
71
  } | null;
77
- prompt: string | null;
78
72
  stopWhen: {
79
73
  stepCountIs?: number | undefined;
80
74
  } | null;
75
+ createdAt: string;
76
+ updatedAt: string;
77
+ tenantId: string;
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: {
@@ -129,12 +129,7 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
129
129
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
130
130
  id: string;
131
131
  name: string;
132
- createdAt: string;
133
- updatedAt: string;
134
132
  description: string | null;
135
- agentId: string;
136
- projectId: string;
137
- tenantId: string;
138
133
  models: {
139
134
  base?: {
140
135
  model?: string | undefined;
@@ -155,10 +150,15 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
155
150
  allowedProviders?: string[] | undefined;
156
151
  } | undefined;
157
152
  } | null;
158
- prompt: string | null;
159
153
  stopWhen: {
160
154
  stepCountIs?: number | undefined;
161
155
  } | null;
156
+ createdAt: string;
157
+ updatedAt: string;
158
+ tenantId: string;
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: {
@@ -22,18 +22,18 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
22
22
  }) => Promise<{
23
23
  id: string;
24
24
  name: string;
25
+ description: string | null;
25
26
  createdAt: string;
26
27
  updatedAt: string;
27
- description: string | null;
28
- headers: Record<string, string> | null;
29
- projectId: string;
30
28
  tenantId: string;
29
+ projectId: string;
30
+ credentialReferenceId: string | null;
31
31
  config: {
32
32
  type: "mcp";
33
33
  mcp: ToolMcpConfig;
34
34
  };
35
- credentialReferenceId: string | null;
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;
@@ -80,18 +80,18 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
81
  id: string;
82
82
  name: string;
83
+ description: string | null;
83
84
  createdAt: string;
84
85
  updatedAt: string;
85
- description: string | null;
86
- headers: Record<string, string> | null;
87
- projectId: string;
88
86
  tenantId: string;
87
+ projectId: string;
88
+ credentialReferenceId: string | null;
89
89
  config: {
90
90
  type: "mcp";
91
91
  mcp: ToolMcpConfig;
92
92
  };
93
- credentialReferenceId: string | null;
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;
@@ -138,12 +138,12 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
138
138
  id: string;
139
139
  createdAt: string;
140
140
  updatedAt: string;
141
- headers: Record<string, string> | null;
142
- agentId: string;
143
- projectId: string;
144
141
  tenantId: string;
145
- subAgentId: string;
142
+ projectId: string;
143
+ agentId: string;
146
144
  toolId: string;
145
+ subAgentId: string;
146
+ headers: Record<string, string> | null;
147
147
  selectedTools: string[] | null;
148
148
  toolPolicies: Record<string, {
149
149
  needsApproval?: boolean;
@@ -157,12 +157,12 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
157
157
  id: string;
158
158
  createdAt: string;
159
159
  updatedAt: string;
160
- headers: Record<string, string> | null;
161
- agentId: string;
162
- projectId: string;
163
160
  tenantId: string;
164
- subAgentId: string;
161
+ projectId: string;
162
+ agentId: string;
165
163
  toolId: string;
164
+ subAgentId: string;
165
+ headers: Record<string, string> | null;
166
166
  selectedTools: string[] | null;
167
167
  toolPolicies: Record<string, {
168
168
  needsApproval?: boolean;
@@ -185,12 +185,12 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
185
185
  id: string;
186
186
  createdAt: string;
187
187
  updatedAt: string;
188
- headers: Record<string, string> | null;
189
- agentId: string;
190
- projectId: string;
191
188
  tenantId: string;
192
- subAgentId: string;
189
+ projectId: string;
190
+ agentId: string;
193
191
  toolId: string;
192
+ subAgentId: string;
193
+ headers: Record<string, string> | null;
194
194
  selectedTools: string[] | null;
195
195
  toolPolicies: Record<string, {
196
196
  needsApproval?: boolean;
@@ -204,18 +204,18 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
204
204
  }) => Promise<{
205
205
  id: string;
206
206
  name: string;
207
+ description: string | null;
207
208
  createdAt: string;
208
209
  updatedAt: string;
209
- description: string | null;
210
- headers: Record<string, string> | null;
211
- projectId: string;
212
210
  tenantId: string;
211
+ projectId: string;
212
+ credentialReferenceId: string | null;
213
213
  config: {
214
214
  type: "mcp";
215
215
  mcp: ToolMcpConfig;
216
216
  };
217
- credentialReferenceId: string | null;
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;
@@ -40,13 +40,13 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
40
40
  algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
41
41
  encoding: "hex" | "base64";
42
42
  signature: {
43
- source: "query" | "body" | "header";
43
+ source: "header" | "query" | "body";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
47
47
  };
48
48
  signedComponents: {
49
- source: "literal" | "body" | "header";
49
+ source: "literal" | "header" | "body";
50
50
  required: boolean;
51
51
  key?: string | undefined;
52
52
  value?: string | undefined;
@@ -12,28 +12,28 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
12
12
  name: string | null;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
- expiresAt: string | null;
16
- agentId: string;
17
- projectId: string;
18
15
  tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
18
+ lastUsedAt: string | null;
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
25
  id: string;
26
26
  name: string | null;
27
27
  createdAt: string;
28
28
  updatedAt: string;
29
- expiresAt: string | null;
30
- agentId: string;
31
- projectId: string;
32
29
  tenantId: string;
30
+ projectId: string;
31
+ agentId: string;
32
+ lastUsedAt: string | null;
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;
@@ -43,14 +43,14 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
43
43
  name: string | null;
44
44
  createdAt: string;
45
45
  updatedAt: string;
46
- expiresAt: string | null;
47
- agentId: string;
48
- projectId: string;
49
46
  tenantId: string;
47
+ projectId: string;
48
+ agentId: string;
49
+ lastUsedAt: string | null;
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;
@@ -70,14 +70,14 @@ declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInse
70
70
  name: string | null;
71
71
  createdAt: string;
72
72
  updatedAt: string;
73
- expiresAt: string | null;
74
- agentId: string;
75
- projectId: string;
76
73
  tenantId: string;
74
+ projectId: string;
75
+ agentId: string;
76
+ lastUsedAt: string | null;
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;
@@ -6,18 +6,15 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
8
  type: AppType;
9
- enabled: boolean;
10
9
  id: string;
11
10
  name: string;
11
+ description: string | null;
12
12
  createdAt: string;
13
13
  updatedAt: string;
14
- description: string | null;
15
- projectId: string | null;
16
14
  tenantId: string | null;
15
+ enabled: boolean;
17
16
  prompt: string | null;
18
- lastUsedAt: string | null;
19
- defaultProjectId: string | null;
20
- defaultAgentId: string | null;
17
+ projectId: string | null;
21
18
  config: {
22
19
  type: "web_client";
23
20
  webClient: {
@@ -35,6 +32,9 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
35
32
  type: "api";
36
33
  api: Record<string, never>;
37
34
  };
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: {
@@ -62,18 +62,15 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
62
62
  }>;
63
63
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
64
64
  type: AppType;
65
- enabled: boolean;
66
65
  id: string;
67
66
  name: string;
67
+ description: string | null;
68
68
  createdAt: string;
69
69
  updatedAt: string;
70
- description: string | null;
71
- projectId: string | null;
72
70
  tenantId: string | null;
71
+ enabled: boolean;
73
72
  prompt: string | null;
74
- lastUsedAt: string | null;
75
- defaultProjectId: string | null;
76
- defaultAgentId: string | null;
73
+ projectId: string | null;
77
74
  config: {
78
75
  type: "web_client";
79
76
  webClient: {
@@ -91,6 +88,9 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
91
88
  type: "api";
92
89
  api: Record<string, never>;
93
90
  };
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,