@inkeep/agents-core 0.46.0 → 0.46.1

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 (52) hide show
  1. package/dist/auth/auth-schema.d.ts +17 -0
  2. package/dist/auth/auth-schema.js +4 -3
  3. package/dist/auth/auth-validation-schemas.d.ts +180 -146
  4. package/dist/auth/auth.d.ts +52 -18
  5. package/dist/auth/auth.js +15 -1
  6. package/dist/auth/authz/config.d.ts +5 -1
  7. package/dist/auth/authz/config.js +8 -3
  8. package/dist/auth/init.js +13 -3
  9. package/dist/auth/password-reset-link-store.d.ts +26 -0
  10. package/dist/auth/password-reset-link-store.js +40 -0
  11. package/dist/auth/permissions.d.ts +9 -9
  12. package/dist/auth/spicedb-schema.d.ts +9 -0
  13. package/dist/auth/spicedb-schema.js +24 -0
  14. package/dist/client-exports.d.ts +5 -193
  15. package/dist/client-exports.js +2 -97
  16. package/dist/constants/models.d.ts +2 -0
  17. package/dist/constants/models.js +2 -0
  18. package/dist/data-access/index.d.ts +3 -3
  19. package/dist/data-access/index.js +3 -3
  20. package/dist/data-access/manage/agents.d.ts +25 -25
  21. package/dist/data-access/manage/agents.js +4 -4
  22. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  23. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  24. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  25. package/dist/data-access/manage/functionTools.d.ts +14 -14
  26. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  27. package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
  28. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  29. package/dist/data-access/manage/subAgents.d.ts +15 -15
  30. package/dist/data-access/manage/tools.d.ts +27 -27
  31. package/dist/data-access/manage/tools.js +1 -1
  32. package/dist/data-access/manage/triggers.d.ts +2 -2
  33. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  34. package/dist/data-access/runtime/conversations.d.ts +24 -24
  35. package/dist/data-access/runtime/messages.d.ts +18 -18
  36. package/dist/data-access/runtime/organizations.d.ts +10 -1
  37. package/dist/data-access/runtime/organizations.js +24 -3
  38. package/dist/data-access/runtime/tasks.d.ts +4 -4
  39. package/dist/db/manage/manage-schema.d.ts +306 -306
  40. package/dist/db/runtime/runtime-schema.d.ts +204 -204
  41. package/dist/index.d.ts +5 -4
  42. package/dist/index.js +8 -7
  43. package/dist/types/index.js +1 -1
  44. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  45. package/dist/validation/index.d.ts +2 -2
  46. package/dist/validation/index.js +2 -2
  47. package/dist/validation/schemas.d.ts +1602 -1601
  48. package/dist/validation/schemas.js +3 -2
  49. package/drizzle/runtime/0011_colorful_vivisector.sql +50 -0
  50. package/drizzle/runtime/meta/0011_snapshot.json +3088 -0
  51. package/drizzle/runtime/meta/_journal.json +7 -0
  52. package/package.json +9 -2
@@ -8,13 +8,13 @@ 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;
15
+ tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
18
18
  subAgentId: string;
19
19
  targetAgentId: string;
20
20
  } | undefined>;
@@ -43,26 +43,26 @@ 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;
50
+ tenantId: string;
51
+ projectId: string;
52
+ agentId: string;
53
53
  subAgentId: 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;
63
+ tenantId: string;
64
+ projectId: string;
65
+ agentId: string;
66
66
  subAgentId: string;
67
67
  targetAgentId: string;
68
68
  }[]>;
@@ -209,13 +209,13 @@ 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;
216
+ tenantId: string;
217
+ projectId: string;
218
+ agentId: string;
219
219
  subAgentId: string;
220
220
  targetAgentId: string;
221
221
  }>;
@@ -226,13 +226,13 @@ 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;
233
+ tenantId: string;
234
+ projectId: string;
235
+ agentId: string;
236
236
  subAgentId: string;
237
237
  targetAgentId: string;
238
238
  } | undefined>;
@@ -247,13 +247,13 @@ 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;
254
+ tenantId: string;
255
+ projectId: string;
256
+ agentId: string;
257
257
  subAgentId: string;
258
258
  targetAgentId: string;
259
259
  }>;
@@ -8,15 +8,11 @@ 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;
20
16
  models: {
21
17
  base?: {
22
18
  model?: string | undefined;
@@ -34,20 +30,20 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
34
30
  stopWhen: {
35
31
  stepCountIs?: number | undefined;
36
32
  } | null;
33
+ tenantId: string;
34
+ projectId: string;
35
+ prompt: string | null;
36
+ agentId: string;
37
37
  conversationHistoryConfig: ConversationHistoryConfig | null;
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;
51
47
  models: {
52
48
  base?: {
53
49
  model?: string | undefined;
@@ -65,6 +61,10 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
65
61
  stopWhen: {
66
62
  stepCountIs?: number | undefined;
67
63
  } | null;
64
+ tenantId: string;
65
+ projectId: string;
66
+ prompt: string | null;
67
+ agentId: string;
68
68
  conversationHistoryConfig: ConversationHistoryConfig | null;
69
69
  }[]>;
70
70
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
@@ -108,15 +108,11 @@ 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;
120
116
  models: {
121
117
  base?: {
122
118
  model?: string | undefined;
@@ -134,6 +130,10 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
134
130
  stopWhen: {
135
131
  stepCountIs?: number | undefined;
136
132
  } | null;
133
+ tenantId: string;
134
+ projectId: string;
135
+ prompt: string | null;
136
+ agentId: string;
137
137
  conversationHistoryConfig: ConversationHistoryConfig | null;
138
138
  }>;
139
139
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -18,19 +18,19 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
18
18
  scopes: ProjectScopeConfig;
19
19
  toolId: string;
20
20
  }) => Promise<{
21
- tenantId: string;
22
- projectId: string;
23
21
  id: string;
24
22
  name: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
25
  description: string | null;
26
+ headers: Record<string, string> | null;
27
+ tenantId: string;
28
+ projectId: string;
26
29
  config: {
27
30
  type: "mcp";
28
31
  mcp: ToolMcpConfig;
29
32
  };
30
33
  credentialReferenceId: string | null;
31
- createdAt: string;
32
- updatedAt: string;
33
- headers: Record<string, string> | null;
34
34
  credentialScope: string;
35
35
  imageUrl: string | null;
36
36
  capabilities: ToolServerCapabilities | null;
@@ -76,19 +76,19 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
76
76
  };
77
77
  }>;
78
78
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
79
- tenantId: string;
80
- projectId: string;
81
79
  id: string;
82
80
  name: string;
81
+ createdAt: string;
82
+ updatedAt: string;
83
83
  description: string | null;
84
+ headers: Record<string, string> | null;
85
+ tenantId: string;
86
+ projectId: string;
84
87
  config: {
85
88
  type: "mcp";
86
89
  mcp: ToolMcpConfig;
87
90
  };
88
91
  credentialReferenceId: string | null;
89
- createdAt: string;
90
- updatedAt: string;
91
- headers: Record<string, string> | null;
92
92
  credentialScope: string;
93
93
  imageUrl: string | null;
94
94
  capabilities: ToolServerCapabilities | null;
@@ -133,14 +133,14 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
133
133
  needsApproval?: boolean;
134
134
  }> | null;
135
135
  }) => Promise<{
136
- tenantId: string;
137
- projectId: string;
138
136
  id: string;
139
- agentId: string;
140
137
  createdAt: string;
141
138
  updatedAt: string;
142
- toolId: string;
143
139
  headers: Record<string, string> | null;
140
+ tenantId: string;
141
+ projectId: string;
142
+ agentId: string;
143
+ toolId: string;
144
144
  toolPolicies: Record<string, {
145
145
  needsApproval?: boolean;
146
146
  }> | null;
@@ -152,14 +152,14 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
152
152
  subAgentId: string;
153
153
  toolId: string;
154
154
  }) => Promise<{
155
- tenantId: string;
156
- projectId: string;
157
155
  id: string;
158
- agentId: string;
159
156
  createdAt: string;
160
157
  updatedAt: string;
161
- toolId: string;
162
158
  headers: Record<string, string> | null;
159
+ tenantId: string;
160
+ projectId: string;
161
+ agentId: string;
162
+ toolId: string;
163
163
  toolPolicies: Record<string, {
164
164
  needsApproval?: boolean;
165
165
  }> | null;
@@ -180,14 +180,14 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
180
180
  }> | null;
181
181
  relationId?: string;
182
182
  }) => Promise<{
183
- tenantId: string;
184
- projectId: string;
185
183
  id: string;
186
- agentId: string;
187
184
  createdAt: string;
188
185
  updatedAt: string;
189
- toolId: string;
190
186
  headers: Record<string, string> | null;
187
+ tenantId: string;
188
+ projectId: string;
189
+ agentId: string;
190
+ toolId: string;
191
191
  toolPolicies: Record<string, {
192
192
  needsApproval?: boolean;
193
193
  }> | null;
@@ -200,19 +200,19 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
200
200
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
201
201
  data: ToolInsert;
202
202
  }) => Promise<{
203
- tenantId: string;
204
- projectId: string;
205
203
  id: string;
206
204
  name: string;
205
+ createdAt: string;
206
+ updatedAt: string;
207
207
  description: string | null;
208
+ headers: Record<string, string> | null;
209
+ tenantId: string;
210
+ projectId: string;
208
211
  config: {
209
212
  type: "mcp";
210
213
  mcp: ToolMcpConfig;
211
214
  };
212
215
  credentialReferenceId: string | null;
213
- createdAt: string;
214
- updatedAt: string;
215
- headers: Record<string, string> | null;
216
216
  credentialScope: string;
217
217
  imageUrl: string | null;
218
218
  capabilities: ToolServerCapabilities | null;
@@ -1,5 +1,5 @@
1
- import { CredentialStoreType, MCPServerType, MCPTransportType } from "../../types/utility.js";
2
1
  import { subAgentToolRelations, tools } from "../../db/manage/manage-schema.js";
2
+ import { CredentialStoreType, MCPServerType, MCPTransportType } from "../../types/utility.js";
3
3
  import { detectAuthenticationRequired } from "../../utils/auth-detection.js";
4
4
  import { env } from "../../env.js";
5
5
  import { getLogger } from "../../utils/logger.js";
@@ -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" | "header" | "body";
43
+ source: "query" | "body" | "header";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
47
47
  };
48
48
  signedComponents: {
49
- source: "literal" | "header" | "body";
49
+ source: "literal" | "body" | "header";
50
50
  required: boolean;
51
51
  key?: string | undefined;
52
52
  value?: string | undefined;
@@ -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;
15
+ tenantId: string;
16
+ projectId: string;
14
17
  agentId: 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;
29
+ tenantId: string;
30
+ projectId: string;
28
31
  agentId: 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;
46
+ tenantId: string;
47
+ projectId: string;
45
48
  agentId: 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;
73
+ tenantId: string;
74
+ projectId: string;
72
75
  agentId: 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;
@@ -15,20 +15,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
15
15
  total: number;
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
- tenantId: string;
19
- projectId: string;
20
18
  id: string;
21
- title: string | null;
22
- agentId: string | null;
23
19
  createdAt: string;
24
20
  updatedAt: string;
25
- userId: string | null;
26
- metadata: ConversationMetadata | null;
27
21
  ref: {
28
22
  type: "commit" | "tag" | "branch";
29
23
  name: string;
30
24
  hash: string;
31
25
  } | null;
26
+ userId: string | null;
27
+ metadata: ConversationMetadata | null;
28
+ title: string | null;
29
+ tenantId: string;
30
+ projectId: string;
31
+ agentId: string | null;
32
32
  activeSubAgentId: string;
33
33
  lastContextResolution: string | null;
34
34
  }>;
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
84
84
  scopes: ProjectScopeConfig;
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
- tenantId: string;
88
- projectId: string;
89
87
  id: string;
90
- title: string | null;
91
- agentId: string | null;
92
88
  createdAt: string;
93
89
  updatedAt: string;
94
- userId: string | null;
95
- metadata: ConversationMetadata | null;
96
90
  ref: {
97
91
  type: "commit" | "tag" | "branch";
98
92
  name: string;
99
93
  hash: string;
100
94
  } | null;
95
+ userId: string | null;
96
+ metadata: ConversationMetadata | null;
97
+ title: string | null;
98
+ tenantId: string;
99
+ projectId: string;
100
+ agentId: string | null;
101
101
  activeSubAgentId: string;
102
102
  lastContextResolution: string | null;
103
103
  } | undefined>;
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
120
120
  metadata?: ConversationMetadata | null | undefined;
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
- tenantId: string;
124
- projectId: string;
125
123
  id: string;
126
- title: string | null;
127
- agentId: string | null;
128
124
  createdAt: string;
129
125
  updatedAt: string;
130
- userId: string | null;
131
- metadata: ConversationMetadata | null;
132
126
  ref: {
133
127
  type: "commit" | "tag" | "branch";
134
128
  name: string;
135
129
  hash: string;
136
130
  } | null;
131
+ userId: string | null;
132
+ metadata: ConversationMetadata | null;
133
+ title: string | null;
134
+ tenantId: string;
135
+ projectId: string;
136
+ agentId: string | null;
137
137
  activeSubAgentId: string;
138
138
  lastContextResolution: string | null;
139
139
  }>;
@@ -152,20 +152,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
152
152
  scopes: ProjectScopeConfig;
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
- tenantId: string;
156
- projectId: string;
157
155
  id: string;
158
- title: string | null;
159
- agentId: string | null;
160
156
  createdAt: string;
161
157
  updatedAt: string;
162
- userId: string | null;
163
- metadata: ConversationMetadata | null;
164
158
  ref: {
165
159
  type: "commit" | "tag" | "branch";
166
160
  name: string;
167
161
  hash: string;
168
162
  } | null;
163
+ userId: string | null;
164
+ metadata: ConversationMetadata | null;
165
+ title: string | null;
166
+ tenantId: string;
167
+ projectId: string;
168
+ agentId: string | null;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -9,26 +9,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  scopes: ProjectScopeConfig;
10
10
  messageId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
12
  id: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
17
15
  metadata: MessageMetadata | null;
18
- content: MessageContent;
19
16
  role: string;
17
+ tenantId: string;
18
+ projectId: string;
19
+ content: MessageContent;
20
+ conversationId: string;
20
21
  fromSubAgentId: string | null;
21
22
  toSubAgentId: string | null;
22
23
  fromExternalAgentId: string | null;
23
24
  toExternalAgentId: string | null;
24
- taskId: string | null;
25
- a2aTaskId: string | null;
26
- conversationId: string;
27
25
  fromTeamAgentId: string | null;
28
26
  toTeamAgentId: string | null;
29
27
  visibility: string;
30
28
  messageType: string;
29
+ taskId: string | null;
31
30
  parentMessageId: string | null;
31
+ a2aTaskId: string | null;
32
32
  a2aSessionId: string | null;
33
33
  } | undefined>;
34
34
  declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
@@ -140,26 +140,26 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  id: string;
141
141
  }[]>;
142
142
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
- tenantId: string;
144
- projectId: string;
145
143
  id: string;
146
144
  createdAt: string;
147
145
  updatedAt: string;
148
146
  metadata: MessageMetadata | null;
149
- content: MessageContent;
150
147
  role: string;
148
+ tenantId: string;
149
+ projectId: string;
150
+ content: MessageContent;
151
+ conversationId: string;
151
152
  fromSubAgentId: string | null;
152
153
  toSubAgentId: string | null;
153
154
  fromExternalAgentId: string | null;
154
155
  toExternalAgentId: string | null;
155
- taskId: string | null;
156
- a2aTaskId: string | null;
157
- conversationId: string;
158
156
  fromTeamAgentId: string | null;
159
157
  toTeamAgentId: string | null;
160
158
  visibility: string;
161
159
  messageType: string;
160
+ taskId: string | null;
162
161
  parentMessageId: string | null;
162
+ a2aTaskId: string | null;
163
163
  a2aSessionId: string | null;
164
164
  }>;
165
165
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -193,26 +193,26 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
193
193
  scopes: ProjectScopeConfig;
194
194
  messageId: string;
195
195
  }) => Promise<{
196
- tenantId: string;
197
- projectId: string;
198
196
  id: string;
199
197
  createdAt: string;
200
198
  updatedAt: string;
201
199
  metadata: MessageMetadata | null;
202
- content: MessageContent;
203
200
  role: string;
201
+ tenantId: string;
202
+ projectId: string;
203
+ content: MessageContent;
204
+ conversationId: string;
204
205
  fromSubAgentId: string | null;
205
206
  toSubAgentId: string | null;
206
207
  fromExternalAgentId: string | null;
207
208
  toExternalAgentId: string | null;
208
- taskId: string | null;
209
- a2aTaskId: string | null;
210
- conversationId: string;
211
209
  fromTeamAgentId: string | null;
212
210
  toTeamAgentId: string | null;
213
211
  visibility: string;
214
212
  messageType: string;
213
+ taskId: string | null;
215
214
  parentMessageId: string | null;
215
+ a2aTaskId: string | null;
216
216
  a2aSessionId: string | null;
217
217
  }>;
218
218
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -48,5 +48,14 @@ declare const upsertOrganization: (db: AgentsRunDatabaseClient) => (data: {
48
48
  }) => Promise<{
49
49
  created: boolean;
50
50
  }>;
51
+ interface UserProviderInfo {
52
+ userId: string;
53
+ providers: string[];
54
+ }
55
+ /**
56
+ * Get authentication providers for a list of users.
57
+ * Returns which providers each user has linked (e.g., 'credential', 'google', 'auth0').
58
+ */
59
+ declare const getUserProvidersFromDb: (db: AgentsRunDatabaseClient) => (userIds: string[]) => Promise<UserProviderInfo[]>;
51
60
  //#endregion
52
- export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, upsertOrganization };
61
+ export { UserProviderInfo, addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };
@@ -1,5 +1,5 @@
1
- import { invitation, member, organization } from "../../auth/auth-schema.js";
2
- import { and, desc, eq, or } from "drizzle-orm";
1
+ import { account, invitation, member, organization } from "../../auth/auth-schema.js";
2
+ import { and, desc, eq, inArray, or } from "drizzle-orm";
3
3
 
4
4
  //#region src/data-access/runtime/organizations.ts
5
5
  /**
@@ -70,6 +70,27 @@ const upsertOrganization = (db) => async (data) => {
70
70
  });
71
71
  return { created: true };
72
72
  };
73
+ /**
74
+ * Get authentication providers for a list of users.
75
+ * Returns which providers each user has linked (e.g., 'credential', 'google', 'auth0').
76
+ */
77
+ const getUserProvidersFromDb = (db) => async (userIds) => {
78
+ if (userIds.length === 0) return [];
79
+ const accounts = await db.select({
80
+ userId: account.userId,
81
+ providerId: account.providerId
82
+ }).from(account).where(inArray(account.userId, userIds));
83
+ const providerMap = /* @__PURE__ */ new Map();
84
+ for (const acc of accounts) {
85
+ const existing = providerMap.get(acc.userId) || [];
86
+ if (!existing.includes(acc.providerId)) existing.push(acc.providerId);
87
+ providerMap.set(acc.userId, existing);
88
+ }
89
+ return userIds.map((userId) => ({
90
+ userId,
91
+ providers: providerMap.get(userId) || []
92
+ }));
93
+ };
73
94
 
74
95
  //#endregion
75
- export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, upsertOrganization };
96
+ export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };