@inkeep/agents-core 0.68.4 → 0.70.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 (68) hide show
  1. package/dist/auth/auth-schema.d.ts +163 -163
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.d.ts +9 -9
  4. package/dist/auth/authz/config.d.ts +33 -7
  5. package/dist/auth/authz/config.js +18 -8
  6. package/dist/auth/authz/credential-gateway.d.ts +57 -0
  7. package/dist/auth/authz/credential-gateway.js +118 -0
  8. package/dist/auth/authz/index.d.ts +4 -3
  9. package/dist/auth/authz/index.js +4 -3
  10. package/dist/auth/authz/types.d.ts +8 -1
  11. package/dist/auth/authz/types.js +7 -3
  12. package/dist/auth/entitlement-lock.js +2 -4
  13. package/dist/auth/entitlements.js +1 -1
  14. package/dist/auth/permissions.d.ts +13 -13
  15. package/dist/auth/support-copilot-platforms.d.ts +147 -0
  16. package/dist/auth/support-copilot-platforms.js +120 -0
  17. package/dist/client-exports.d.ts +3 -2
  18. package/dist/client-exports.js +3 -2
  19. package/dist/constants/allowed-file-formats.d.ts +6 -1
  20. package/dist/constants/allowed-file-formats.js +256 -24
  21. package/dist/constants/index.d.ts +2 -2
  22. package/dist/constants/index.js +2 -2
  23. package/dist/constants/signoz-queries.d.ts +1 -0
  24. package/dist/constants/signoz-queries.js +2 -1
  25. package/dist/context/TemplateEngine.d.ts +17 -1
  26. package/dist/context/TemplateEngine.js +37 -3
  27. package/dist/data-access/index.d.ts +2 -2
  28. package/dist/data-access/index.js +2 -2
  29. package/dist/data-access/manage/agents.d.ts +21 -21
  30. package/dist/data-access/manage/artifactComponents.d.ts +8 -8
  31. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  32. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  33. package/dist/data-access/manage/functionTools.d.ts +10 -10
  34. package/dist/data-access/manage/skills.d.ts +10 -10
  35. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
  36. package/dist/data-access/manage/subAgentRelations.d.ts +16 -16
  37. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
  38. package/dist/data-access/manage/subAgents.d.ts +15 -15
  39. package/dist/data-access/manage/tools.d.ts +15 -15
  40. package/dist/data-access/manage/triggers.d.ts +1 -1
  41. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  42. package/dist/data-access/runtime/apps.d.ts +35 -11
  43. package/dist/data-access/runtime/conversations.d.ts +12 -12
  44. package/dist/data-access/runtime/entitlements.d.ts +2 -1
  45. package/dist/data-access/runtime/entitlements.js +5 -1
  46. package/dist/data-access/runtime/feedback.d.ts +6 -6
  47. package/dist/data-access/runtime/messages.d.ts +6 -6
  48. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
  49. package/dist/data-access/runtime/tasks.d.ts +3 -3
  50. package/dist/db/runtime/runtime-schema.d.ts +395 -379
  51. package/dist/index.d.ts +7 -5
  52. package/dist/index.js +7 -5
  53. package/dist/middleware/no-auth.d.ts +2 -2
  54. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +1 -1
  55. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +1 -1
  56. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +1 -1
  57. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +1 -1
  58. package/dist/test-utils/mocks/logger.js +1 -1
  59. package/dist/utils/apiKeys.js +1 -1
  60. package/dist/utils/error.d.ts +51 -51
  61. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  62. package/dist/validation/index.d.ts +2 -2
  63. package/dist/validation/index.js +2 -2
  64. package/dist/validation/schemas/skills.d.ts +46 -46
  65. package/dist/validation/schemas.d.ts +2080 -1892
  66. package/dist/validation/schemas.js +16 -2
  67. package/package.json +1 -1
  68. package/spicedb/schema.zed +27 -0
@@ -10,12 +10,12 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
10
10
  relationId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- createdAt: string;
14
- updatedAt: string;
15
13
  tenantId: string;
14
+ createdAt: string;
16
15
  projectId: string;
17
16
  agentId: string;
18
17
  subAgentId: string;
18
+ updatedAt: string;
19
19
  headers: Record<string, string> | null;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
@@ -45,12 +45,12 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
47
  id: string;
48
- createdAt: string;
49
- updatedAt: string;
50
48
  tenantId: string;
49
+ createdAt: string;
51
50
  projectId: string;
52
51
  agentId: string;
53
52
  subAgentId: string;
53
+ updatedAt: string;
54
54
  headers: Record<string, string> | null;
55
55
  targetAgentId: string;
56
56
  }[]>;
@@ -58,12 +58,12 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
60
  id: string;
61
- createdAt: string;
62
- updatedAt: string;
63
61
  tenantId: string;
62
+ createdAt: string;
64
63
  projectId: string;
65
64
  agentId: string;
66
65
  subAgentId: string;
66
+ updatedAt: string;
67
67
  headers: Record<string, string> | null;
68
68
  targetAgentId: string;
69
69
  }[]>;
@@ -223,12 +223,12 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
223
223
  };
224
224
  }) => Promise<{
225
225
  id: string;
226
- createdAt: string;
227
- updatedAt: string;
228
226
  tenantId: string;
227
+ createdAt: string;
229
228
  projectId: string;
230
229
  agentId: string;
231
230
  subAgentId: string;
231
+ updatedAt: string;
232
232
  headers: Record<string, string> | null;
233
233
  targetAgentId: string;
234
234
  }>;
@@ -240,12 +240,12 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
240
240
  targetAgentId: string;
241
241
  }) => Promise<{
242
242
  id: string;
243
- createdAt: string;
244
- updatedAt: string;
245
243
  tenantId: string;
244
+ createdAt: string;
246
245
  projectId: string;
247
246
  agentId: string;
248
247
  subAgentId: string;
248
+ updatedAt: string;
249
249
  headers: Record<string, string> | null;
250
250
  targetAgentId: string;
251
251
  } | undefined>;
@@ -261,12 +261,12 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
261
261
  };
262
262
  }) => Promise<{
263
263
  id: string;
264
- createdAt: string;
265
- updatedAt: string;
266
264
  tenantId: string;
265
+ createdAt: string;
267
266
  projectId: string;
268
267
  agentId: string;
269
268
  subAgentId: string;
269
+ updatedAt: string;
270
270
  headers: Record<string, string> | null;
271
271
  targetAgentId: string;
272
272
  }>;
@@ -10,8 +10,13 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
+ tenantId: string;
14
+ createdAt: string;
13
15
  name: string;
14
16
  description: string | null;
17
+ projectId: string;
18
+ agentId: string;
19
+ updatedAt: string;
15
20
  models: {
16
21
  base?: {
17
22
  model?: string | undefined;
@@ -35,11 +40,6 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
35
40
  stopWhen: {
36
41
  stepCountIs?: number | undefined;
37
42
  } | null;
38
- createdAt: string;
39
- updatedAt: string;
40
- tenantId: string;
41
- projectId: string;
42
- agentId: string;
43
43
  prompt: string | null;
44
44
  conversationHistoryConfig: ConversationHistoryConfig | null;
45
45
  } | undefined>;
@@ -47,8 +47,13 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
47
47
  scopes: AgentScopeConfig;
48
48
  }) => Promise<{
49
49
  id: string;
50
+ tenantId: string;
51
+ createdAt: string;
50
52
  name: string;
51
53
  description: string | null;
54
+ projectId: string;
55
+ agentId: string;
56
+ updatedAt: string;
52
57
  models: {
53
58
  base?: {
54
59
  model?: string | undefined;
@@ -72,11 +77,6 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
72
77
  stopWhen: {
73
78
  stepCountIs?: number | undefined;
74
79
  } | null;
75
- createdAt: string;
76
- updatedAt: string;
77
- tenantId: string;
78
- projectId: string;
79
- agentId: string;
80
80
  prompt: string | null;
81
81
  conversationHistoryConfig: ConversationHistoryConfig | null;
82
82
  }[]>;
@@ -128,8 +128,13 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
128
128
  }>;
129
129
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
130
130
  id: string;
131
+ tenantId: string;
132
+ createdAt: string;
131
133
  name: string;
132
134
  description: string | null;
135
+ projectId: string;
136
+ agentId: string;
137
+ updatedAt: string;
133
138
  models: {
134
139
  base?: {
135
140
  model?: string | undefined;
@@ -153,11 +158,6 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
153
158
  stopWhen: {
154
159
  stepCountIs?: number | undefined;
155
160
  } | null;
156
- createdAt: string;
157
- updatedAt: string;
158
- tenantId: string;
159
- projectId: string;
160
- agentId: string;
161
161
  prompt: string | null;
162
162
  conversationHistoryConfig: ConversationHistoryConfig | null;
163
163
  }>;
@@ -21,12 +21,12 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
21
21
  toolId: string;
22
22
  }) => Promise<{
23
23
  id: string;
24
+ tenantId: string;
25
+ createdAt: string;
24
26
  name: string;
25
27
  description: string | null;
26
- createdAt: string;
27
- updatedAt: string;
28
- tenantId: string;
29
28
  projectId: string;
29
+ updatedAt: string;
30
30
  credentialReferenceId: string | null;
31
31
  config: {
32
32
  type: "mcp";
@@ -79,12 +79,12 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
79
79
  }>;
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
81
  id: string;
82
+ tenantId: string;
83
+ createdAt: string;
82
84
  name: string;
83
85
  description: string | null;
84
- createdAt: string;
85
- updatedAt: string;
86
- tenantId: string;
87
86
  projectId: string;
87
+ updatedAt: string;
88
88
  credentialReferenceId: string | null;
89
89
  config: {
90
90
  type: "mcp";
@@ -136,13 +136,13 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
136
136
  }> | null;
137
137
  }) => Promise<{
138
138
  id: string;
139
- createdAt: string;
140
- updatedAt: string;
141
139
  tenantId: string;
140
+ createdAt: string;
142
141
  projectId: string;
143
142
  agentId: string;
144
143
  subAgentId: string;
145
144
  toolId: string;
145
+ updatedAt: string;
146
146
  headers: Record<string, string> | null;
147
147
  selectedTools: string[] | null;
148
148
  toolPolicies: Record<string, {
@@ -155,13 +155,13 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
155
155
  toolId: string;
156
156
  }) => Promise<{
157
157
  id: string;
158
- createdAt: string;
159
- updatedAt: string;
160
158
  tenantId: string;
159
+ createdAt: string;
161
160
  projectId: string;
162
161
  agentId: string;
163
162
  subAgentId: string;
164
163
  toolId: string;
164
+ updatedAt: string;
165
165
  headers: Record<string, string> | null;
166
166
  selectedTools: string[] | null;
167
167
  toolPolicies: Record<string, {
@@ -183,13 +183,13 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
183
183
  relationId?: string;
184
184
  }) => Promise<{
185
185
  id: string;
186
- createdAt: string;
187
- updatedAt: string;
188
186
  tenantId: string;
187
+ createdAt: string;
189
188
  projectId: string;
190
189
  agentId: string;
191
190
  subAgentId: string;
192
191
  toolId: string;
192
+ updatedAt: string;
193
193
  headers: Record<string, string> | null;
194
194
  selectedTools: string[] | null;
195
195
  toolPolicies: Record<string, {
@@ -203,12 +203,12 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
203
203
  data: ToolInsert;
204
204
  }) => Promise<{
205
205
  id: string;
206
+ tenantId: string;
207
+ createdAt: string;
206
208
  name: string;
207
209
  description: string | null;
208
- createdAt: string;
209
- updatedAt: string;
210
- tenantId: string;
211
210
  projectId: string;
211
+ updatedAt: string;
212
212
  credentialReferenceId: string | null;
213
213
  config: {
214
214
  type: "mcp";
@@ -131,8 +131,8 @@ declare const createTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
131
131
  triggerId: string;
132
132
  userId: string;
133
133
  }) => Promise<{
134
- createdAt: string;
135
134
  tenantId: string;
135
+ createdAt: string;
136
136
  projectId: string;
137
137
  agentId: string;
138
138
  userId: string;
@@ -9,12 +9,12 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  id: string;
10
10
  }) => Promise<{
11
11
  id: string;
12
- name: string | null;
13
- createdAt: string;
14
- updatedAt: string;
15
12
  tenantId: string;
13
+ createdAt: string;
14
+ name: string | null;
16
15
  projectId: string;
17
16
  agentId: string;
17
+ updatedAt: string;
18
18
  expiresAt: string | null;
19
19
  publicId: string;
20
20
  keyHash: string;
@@ -23,12 +23,12 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
25
  id: string;
26
- name: string | null;
27
- createdAt: string;
28
- updatedAt: string;
29
26
  tenantId: string;
27
+ createdAt: string;
28
+ name: string | null;
30
29
  projectId: string;
31
30
  agentId: string;
31
+ updatedAt: string;
32
32
  expiresAt: string | null;
33
33
  publicId: string;
34
34
  keyHash: string;
@@ -40,12 +40,12 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
42
  id: string;
43
- name: string | null;
44
- createdAt: string;
45
- updatedAt: string;
46
43
  tenantId: string;
44
+ createdAt: string;
45
+ name: string | null;
47
46
  projectId: string;
48
47
  agentId: string;
48
+ updatedAt: string;
49
49
  expiresAt: string | null;
50
50
  publicId: string;
51
51
  keyHash: string;
@@ -67,12 +67,12 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
69
  id: string;
70
- name: string | null;
71
- createdAt: string;
72
- updatedAt: string;
73
70
  tenantId: string;
71
+ createdAt: string;
72
+ name: string | null;
74
73
  projectId: string;
75
74
  agentId: string;
75
+ updatedAt: string;
76
76
  expiresAt: string | null;
77
77
  publicId: string;
78
78
  keyHash: string;
@@ -5,14 +5,14 @@ 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
+ type: AppType;
8
9
  id: string;
10
+ tenantId: string | null;
11
+ createdAt: string;
9
12
  name: string;
10
13
  description: string | null;
11
- type: AppType;
12
- createdAt: string;
13
- updatedAt: string;
14
- tenantId: string | null;
15
14
  projectId: string | null;
15
+ updatedAt: string;
16
16
  enabled: boolean;
17
17
  prompt: string | null;
18
18
  config: {
@@ -34,7 +34,15 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
34
34
  } | {
35
35
  type: "support_copilot";
36
36
  supportCopilot: {
37
- credentialReferenceIds: string[];
37
+ platform: string;
38
+ credentialReferenceId?: string | undefined;
39
+ quickActions?: {
40
+ group: string;
41
+ actions: {
42
+ label: string;
43
+ prompt: string;
44
+ }[];
45
+ }[] | undefined;
38
46
  };
39
47
  };
40
48
  lastUsedAt: string | null;
@@ -66,14 +74,14 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
74
  };
67
75
  }>;
68
76
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
77
+ type: AppType;
69
78
  id: string;
79
+ tenantId: string | null;
80
+ createdAt: string;
70
81
  name: string;
71
82
  description: string | null;
72
- type: AppType;
73
- createdAt: string;
74
- updatedAt: string;
75
- tenantId: string | null;
76
83
  projectId: string | null;
84
+ updatedAt: string;
77
85
  enabled: boolean;
78
86
  prompt: string | null;
79
87
  config: {
@@ -95,7 +103,15 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
95
103
  } | {
96
104
  type: "support_copilot";
97
105
  supportCopilot: {
98
- credentialReferenceIds: string[];
106
+ platform: string;
107
+ credentialReferenceId?: string | undefined;
108
+ quickActions?: {
109
+ group: string;
110
+ actions: {
111
+ label: string;
112
+ prompt: string;
113
+ }[];
114
+ }[] | undefined;
99
115
  };
100
116
  };
101
117
  lastUsedAt: string | null;
@@ -170,7 +186,15 @@ declare const updateApp: (db: AgentsRunDatabaseClient) => (params: {
170
186
  } | {
171
187
  type: "support_copilot";
172
188
  supportCopilot: {
173
- credentialReferenceIds: string[];
189
+ platform: string;
190
+ credentialReferenceId?: string | undefined;
191
+ quickActions?: {
192
+ group: string;
193
+ actions: {
194
+ label: string;
195
+ prompt: string;
196
+ }[];
197
+ }[] | undefined;
174
198
  };
175
199
  };
176
200
  lastUsedAt: string | null;
@@ -16,13 +16,13 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
18
  id: string;
19
- title: string | null;
20
- createdAt: string;
21
- updatedAt: string;
22
19
  tenantId: string;
20
+ createdAt: string;
23
21
  metadata: ConversationMetadata | null;
22
+ title: string | null;
24
23
  projectId: string;
25
24
  agentId: string | null;
25
+ updatedAt: string;
26
26
  userId: string | null;
27
27
  ref: {
28
28
  type: "commit" | "tag" | "branch";
@@ -85,13 +85,13 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
87
  id: string;
88
- title: string | null;
89
- createdAt: string;
90
- updatedAt: string;
91
88
  tenantId: string;
89
+ createdAt: string;
92
90
  metadata: ConversationMetadata | null;
91
+ title: string | null;
93
92
  projectId: string;
94
93
  agentId: string | null;
94
+ updatedAt: string;
95
95
  userId: string | null;
96
96
  ref: {
97
97
  type: "commit" | "tag" | "branch";
@@ -121,13 +121,13 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
123
  id: string;
124
- title: string | null;
125
- createdAt: string;
126
- updatedAt: string;
127
124
  tenantId: string;
125
+ createdAt: string;
128
126
  metadata: ConversationMetadata | null;
127
+ title: string | null;
129
128
  projectId: string;
130
129
  agentId: string | null;
130
+ updatedAt: string;
131
131
  userId: string | null;
132
132
  ref: {
133
133
  type: "commit" | "tag" | "branch";
@@ -153,13 +153,13 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
155
  id: string;
156
- title: string | null;
157
- createdAt: string;
158
- updatedAt: string;
159
156
  tenantId: string;
157
+ createdAt: string;
160
158
  metadata: ConversationMetadata | null;
159
+ title: string | null;
161
160
  projectId: string;
162
161
  agentId: string | null;
162
+ updatedAt: string;
163
163
  userId: string | null;
164
164
  ref: {
165
165
  type: "commit" | "tag" | "branch";
@@ -6,8 +6,9 @@ declare const listOrgEntitlements: (db: AgentsRunDatabaseClient) => (orgId: stri
6
6
  maxValue: number;
7
7
  }>>;
8
8
  declare function dalResolveEntitlement(db: AgentsRunDatabaseClient, orgId: string, resourceType: string): Promise<number | null>;
9
+ declare function dalSelectEntitlementForUpdate(tx: AgentsRunDatabaseClient, orgId: string, resourceType: string): Promise<number | null>;
9
10
  declare function dalGetServiceAccountUserId(db: AgentsRunDatabaseClient, orgId: string): Promise<string | null>;
10
11
  declare function dalCountMembersByRoleBucket(db: AgentsRunDatabaseClient, orgId: string, isAdminBucket: boolean, serviceAccountUserId: string | null): Promise<number>;
11
12
  declare function dalSumSeatEntitlements(db: AgentsRunDatabaseClient, orgId: string): Promise<number | null>;
12
13
  //#endregion
13
- export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, listOrgEntitlements };
14
+ export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSelectEntitlementForUpdate, dalSumSeatEntitlements, listOrgEntitlements };
@@ -14,6 +14,10 @@ async function dalResolveEntitlement(db, orgId, resourceType) {
14
14
  if (rows.length === 0) return null;
15
15
  return rows[0].maxValue;
16
16
  }
17
+ async function dalSelectEntitlementForUpdate(tx, orgId, resourceType) {
18
+ const rows = await tx.select({ maxValue: orgEntitlement.maxValue }).from(orgEntitlement).where(and(eq(orgEntitlement.organizationId, orgId), eq(orgEntitlement.resourceType, resourceType))).for("update");
19
+ return rows.length === 0 ? null : rows[0].maxValue;
20
+ }
17
21
  async function dalGetServiceAccountUserId(db, orgId) {
18
22
  return (await db.select({ serviceAccountUserId: organization.serviceAccountUserId }).from(organization).where(eq(organization.id, orgId)))[0]?.serviceAccountUserId ?? null;
19
23
  }
@@ -30,4 +34,4 @@ async function dalSumSeatEntitlements(db, orgId) {
30
34
  }
31
35
 
32
36
  //#endregion
33
- export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, listOrgEntitlements };
37
+ export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSelectEntitlementForUpdate, dalSumSeatEntitlements, listOrgEntitlements };
@@ -58,12 +58,12 @@ declare const listFeedback: (db: AgentsRunDatabaseClient) => (params: {
58
58
  total: number;
59
59
  }>;
60
60
  declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
61
- id: string;
62
61
  type: "positive" | "negative";
63
- createdAt: string;
64
- updatedAt: string;
62
+ id: string;
65
63
  tenantId: string;
64
+ createdAt: string;
66
65
  projectId: string;
66
+ updatedAt: string;
67
67
  conversationId: string;
68
68
  messageId: string | null;
69
69
  details: string | null;
@@ -87,12 +87,12 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
87
87
  scopes: ProjectScopeConfig;
88
88
  feedbackId: string;
89
89
  }) => Promise<{
90
- id: string;
91
90
  type: "positive" | "negative";
92
- createdAt: string;
93
- updatedAt: string;
91
+ id: string;
94
92
  tenantId: string;
93
+ createdAt: string;
95
94
  projectId: string;
95
+ updatedAt: string;
96
96
  conversationId: string;
97
97
  messageId: string | null;
98
98
  details: string | null;
@@ -11,12 +11,12 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
11
11
  messageId: string;
12
12
  }) => Promise<{
13
13
  id: string;
14
- createdAt: string;
15
- updatedAt: string;
16
14
  tenantId: string;
15
+ createdAt: string;
17
16
  metadata: MessageMetadata | null;
18
17
  content: MessageContent;
19
18
  projectId: string;
19
+ updatedAt: string;
20
20
  role: string;
21
21
  conversationId: string;
22
22
  fromSubAgentId: string | null;
@@ -145,12 +145,12 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
145
145
  data: Omit<MessageInsert, "tenantId" | "projectId">;
146
146
  }) => Promise<{
147
147
  id: string;
148
- createdAt: string;
149
- updatedAt: string;
150
148
  tenantId: string;
149
+ createdAt: string;
151
150
  metadata: MessageMetadata | null;
152
151
  content: MessageContent;
153
152
  projectId: string;
153
+ updatedAt: string;
154
154
  role: string;
155
155
  conversationId: string;
156
156
  fromSubAgentId: string | null;
@@ -198,12 +198,12 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
198
198
  messageId: string;
199
199
  }) => Promise<{
200
200
  id: string;
201
- createdAt: string;
202
- updatedAt: string;
203
201
  tenantId: string;
202
+ createdAt: string;
204
203
  metadata: MessageMetadata | null;
205
204
  content: MessageContent;
206
205
  projectId: string;
206
+ updatedAt: string;
207
207
  role: string;
208
208
  conversationId: string;
209
209
  fromSubAgentId: string | null;
@@ -15,8 +15,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
15
15
  scheduledTriggerId: string;
16
16
  userId: string;
17
17
  }) => Promise<{
18
- createdAt: string;
19
18
  tenantId: string;
19
+ createdAt: string;
20
20
  userId: string;
21
21
  scheduledTriggerId: string;
22
22
  }>;
@@ -8,19 +8,19 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
8
8
  //#region src/data-access/runtime/tasks.d.ts
9
9
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
10
10
  id: string;
11
- createdAt: string;
12
- updatedAt: string;
13
11
  tenantId: string;
12
+ createdAt: string;
14
13
  metadata: TaskMetadataConfig | null;
15
14
  projectId: string;
16
15
  agentId: string;
17
16
  subAgentId: string;
17
+ updatedAt: string;
18
+ status: string;
18
19
  ref: {
19
20
  type: "commit" | "tag" | "branch";
20
21
  name: string;
21
22
  hash: string;
22
23
  } | null;
23
- status: string;
24
24
  contextId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {