@inkeep/agents-core 0.46.0 → 0.47.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 (60) 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 +163 -129
  4. package/dist/auth/auth.d.ts +91 -57
  5. package/dist/auth/auth.js +16 -2
  6. package/dist/auth/authz/config.d.ts +5 -86
  7. package/dist/auth/authz/config.js +12 -73
  8. package/dist/auth/authz/index.d.ts +2 -1
  9. package/dist/auth/authz/index.js +2 -1
  10. package/dist/auth/authz/permissions.d.ts +1 -1
  11. package/dist/auth/authz/permissions.js +1 -1
  12. package/dist/auth/authz/sync.d.ts +1 -1
  13. package/dist/auth/authz/sync.js +1 -1
  14. package/dist/auth/authz/types.d.ts +92 -0
  15. package/dist/auth/authz/types.js +76 -0
  16. package/dist/auth/init.js +14 -4
  17. package/dist/auth/password-reset-link-store.d.ts +26 -0
  18. package/dist/auth/password-reset-link-store.js +40 -0
  19. package/dist/auth/permissions.d.ts +13 -13
  20. package/dist/auth/spicedb-schema.d.ts +9 -0
  21. package/dist/auth/spicedb-schema.js +24 -0
  22. package/dist/client-exports.d.ts +6 -194
  23. package/dist/client-exports.js +3 -98
  24. package/dist/constants/models.d.ts +2 -0
  25. package/dist/constants/models.js +2 -0
  26. package/dist/data-access/index.d.ts +3 -3
  27. package/dist/data-access/index.js +3 -3
  28. package/dist/data-access/manage/agents.d.ts +30 -30
  29. package/dist/data-access/manage/agents.js +4 -4
  30. package/dist/data-access/manage/artifactComponents.d.ts +6 -6
  31. package/dist/data-access/manage/contextConfigs.d.ts +4 -4
  32. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  33. package/dist/data-access/manage/functionTools.d.ts +6 -6
  34. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
  35. package/dist/data-access/manage/subAgentRelations.d.ts +8 -8
  36. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
  37. package/dist/data-access/manage/subAgents.d.ts +18 -18
  38. package/dist/data-access/manage/tools.d.ts +18 -18
  39. package/dist/data-access/manage/tools.js +1 -1
  40. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  41. package/dist/data-access/runtime/conversations.d.ts +12 -12
  42. package/dist/data-access/runtime/messages.d.ts +3 -3
  43. package/dist/data-access/runtime/organizations.d.ts +10 -1
  44. package/dist/data-access/runtime/organizations.js +24 -3
  45. package/dist/data-access/runtime/tasks.d.ts +1 -1
  46. package/dist/db/manage/manage-schema.d.ts +302 -302
  47. package/dist/db/runtime/runtime-schema.d.ts +206 -206
  48. package/dist/env.d.ts +6 -0
  49. package/dist/env.js +4 -1
  50. package/dist/index.d.ts +7 -5
  51. package/dist/index.js +10 -8
  52. package/dist/types/index.js +1 -1
  53. package/dist/validation/index.d.ts +2 -2
  54. package/dist/validation/index.js +2 -2
  55. package/dist/validation/schemas.d.ts +1344 -1343
  56. package/dist/validation/schemas.js +3 -2
  57. package/drizzle/runtime/0011_colorful_vivisector.sql +50 -0
  58. package/drizzle/runtime/meta/0011_snapshot.json +3088 -0
  59. package/drizzle/runtime/meta/_journal.json +7 -0
  60. package/package.json +9 -2
@@ -8,9 +8,9 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
8
8
  scopes: SubAgentScopeConfig;
9
9
  relationId: string;
10
10
  }) => Promise<{
11
+ id: string;
11
12
  tenantId: string;
12
13
  projectId: string;
13
- id: string;
14
14
  agentId: string;
15
15
  createdAt: string;
16
16
  updatedAt: string;
@@ -43,9 +43,9 @@ declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClien
43
43
  declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  scopes: SubAgentScopeConfig;
45
45
  }) => Promise<{
46
+ id: string;
46
47
  tenantId: string;
47
48
  projectId: string;
48
- id: string;
49
49
  agentId: string;
50
50
  createdAt: string;
51
51
  updatedAt: string;
@@ -56,9 +56,9 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
56
56
  declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
58
58
  }) => Promise<{
59
+ id: string;
59
60
  tenantId: string;
60
61
  projectId: string;
61
- id: string;
62
62
  agentId: string;
63
63
  createdAt: string;
64
64
  updatedAt: string;
@@ -179,9 +179,9 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
179
179
  headers?: Record<string, string> | null;
180
180
  };
181
181
  }) => Promise<{
182
+ id: string;
182
183
  tenantId: string;
183
184
  projectId: string;
184
- id: string;
185
185
  agentId: string;
186
186
  createdAt: string;
187
187
  updatedAt: string;
@@ -196,9 +196,9 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
196
196
  scopes: SubAgentScopeConfig;
197
197
  externalAgentId: string;
198
198
  }) => Promise<{
199
+ id: string;
199
200
  tenantId: string;
200
201
  projectId: string;
201
- id: string;
202
202
  agentId: string;
203
203
  createdAt: string;
204
204
  updatedAt: string;
@@ -217,9 +217,9 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
217
217
  headers?: Record<string, string> | null;
218
218
  };
219
219
  }) => Promise<{
220
+ id: string;
220
221
  tenantId: string;
221
222
  projectId: string;
222
- id: string;
223
223
  agentId: string;
224
224
  createdAt: string;
225
225
  updatedAt: string;
@@ -8,9 +8,9 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
8
8
  scopes: AgentScopeConfig;
9
9
  relationId: string;
10
10
  }) => Promise<{
11
+ id: string;
11
12
  tenantId: string;
12
13
  projectId: string;
13
- id: string;
14
14
  agentId: string;
15
15
  createdAt: string;
16
16
  updatedAt: string;
@@ -43,9 +43,9 @@ declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
43
43
  declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  scopes: SubAgentScopeConfig;
45
45
  }) => Promise<{
46
+ id: string;
46
47
  tenantId: string;
47
48
  projectId: string;
48
- id: string;
49
49
  agentId: string;
50
50
  createdAt: string;
51
51
  updatedAt: string;
@@ -56,9 +56,9 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
56
56
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
58
58
  }) => Promise<{
59
+ id: string;
59
60
  tenantId: string;
60
61
  projectId: string;
61
- id: string;
62
62
  agentId: string;
63
63
  createdAt: string;
64
64
  updatedAt: string;
@@ -125,9 +125,9 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
125
125
  }[];
126
126
  }>;
127
127
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
128
+ id: string;
128
129
  tenantId: string;
129
130
  projectId: string;
130
- id: string;
131
131
  agentId: string;
132
132
  createdAt: string;
133
133
  updatedAt: string;
@@ -144,9 +144,9 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
144
144
  targetSubAgentId?: string;
145
145
  relationType: string;
146
146
  }) => Promise<{
147
+ id: string;
147
148
  tenantId: string;
148
149
  projectId: string;
149
- id: string;
150
150
  agentId: string;
151
151
  createdAt: string;
152
152
  updatedAt: string;
@@ -158,9 +158,9 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
158
158
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
159
159
  */
160
160
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
161
+ id: string;
161
162
  tenantId: string;
162
163
  projectId: string;
163
- id: string;
164
164
  agentId: string;
165
165
  createdAt: string;
166
166
  updatedAt: string;
@@ -203,9 +203,9 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
203
203
  }> | null;
204
204
  };
205
205
  }) => Promise<{
206
+ id: string;
206
207
  tenantId: string;
207
208
  projectId: string;
208
- id: string;
209
209
  agentId: string;
210
210
  createdAt: string;
211
211
  updatedAt: string;
@@ -247,9 +247,9 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
247
247
  scopes: SubAgentScopeConfig;
248
248
  relationId: string;
249
249
  }) => Promise<{
250
+ id: string;
250
251
  tenantId: string;
251
252
  projectId: string;
252
- id: string;
253
253
  agentId: string;
254
254
  createdAt: string;
255
255
  updatedAt: string;
@@ -8,9 +8,9 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
8
8
  scopes: SubAgentScopeConfig;
9
9
  relationId: string;
10
10
  }) => Promise<{
11
+ id: string;
11
12
  tenantId: string;
12
13
  projectId: string;
13
- id: string;
14
14
  agentId: string;
15
15
  createdAt: string;
16
16
  updatedAt: string;
@@ -43,9 +43,9 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
43
43
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  scopes: SubAgentScopeConfig;
45
45
  }) => Promise<{
46
+ id: string;
46
47
  tenantId: string;
47
48
  projectId: string;
48
- id: string;
49
49
  agentId: string;
50
50
  createdAt: string;
51
51
  updatedAt: string;
@@ -56,9 +56,9 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
56
56
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
57
  scopes: AgentScopeConfig;
58
58
  }) => Promise<{
59
+ id: string;
59
60
  tenantId: string;
60
61
  projectId: string;
61
- id: string;
62
62
  agentId: string;
63
63
  createdAt: string;
64
64
  updatedAt: string;
@@ -209,9 +209,9 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
209
209
  headers?: Record<string, string> | null;
210
210
  };
211
211
  }) => Promise<{
212
+ id: string;
212
213
  tenantId: string;
213
214
  projectId: string;
214
- id: string;
215
215
  agentId: string;
216
216
  createdAt: string;
217
217
  updatedAt: string;
@@ -226,9 +226,9 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
226
226
  scopes: SubAgentScopeConfig;
227
227
  targetAgentId: string;
228
228
  }) => Promise<{
229
+ id: string;
229
230
  tenantId: string;
230
231
  projectId: string;
231
- id: string;
232
232
  agentId: string;
233
233
  createdAt: string;
234
234
  updatedAt: string;
@@ -247,9 +247,9 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
247
247
  headers?: Record<string, string> | null;
248
248
  };
249
249
  }) => Promise<{
250
+ id: string;
250
251
  tenantId: string;
251
252
  projectId: string;
252
- id: string;
253
253
  agentId: string;
254
254
  createdAt: string;
255
255
  updatedAt: string;
@@ -8,15 +8,14 @@ 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
13
  description: string | null;
16
- prompt: string | null;
14
+ tenantId: string;
15
+ projectId: string;
17
16
  agentId: string;
18
- createdAt: string;
19
- updatedAt: string;
17
+ prompt: string | null;
18
+ conversationHistoryConfig: ConversationHistoryConfig | null;
20
19
  models: {
21
20
  base?: {
22
21
  model?: string | undefined;
@@ -34,20 +33,20 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
34
33
  stopWhen: {
35
34
  stepCountIs?: number | undefined;
36
35
  } | null;
37
- conversationHistoryConfig: ConversationHistoryConfig | null;
36
+ createdAt: string;
37
+ updatedAt: string;
38
38
  } | undefined>;
39
39
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
40
40
  scopes: AgentScopeConfig;
41
41
  }) => Promise<{
42
- tenantId: string;
43
- projectId: string;
44
42
  id: string;
45
43
  name: string;
46
44
  description: string | null;
47
- prompt: string | null;
45
+ tenantId: string;
46
+ projectId: string;
48
47
  agentId: string;
49
- createdAt: string;
50
- updatedAt: string;
48
+ prompt: string | null;
49
+ conversationHistoryConfig: ConversationHistoryConfig | null;
51
50
  models: {
52
51
  base?: {
53
52
  model?: string | undefined;
@@ -65,7 +64,8 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
65
64
  stopWhen: {
66
65
  stepCountIs?: number | undefined;
67
66
  } | null;
68
- conversationHistoryConfig: ConversationHistoryConfig | null;
67
+ createdAt: string;
68
+ updatedAt: string;
69
69
  }[]>;
70
70
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
71
71
  scopes: AgentScopeConfig;
@@ -108,15 +108,14 @@ 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
113
  description: string | null;
116
- prompt: string | null;
114
+ tenantId: string;
115
+ projectId: string;
117
116
  agentId: string;
118
- createdAt: string;
119
- updatedAt: string;
117
+ prompt: string | null;
118
+ conversationHistoryConfig: ConversationHistoryConfig | null;
120
119
  models: {
121
120
  base?: {
122
121
  model?: string | undefined;
@@ -134,7 +133,8 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
134
133
  stopWhen: {
135
134
  stepCountIs?: number | undefined;
136
135
  } | null;
137
- conversationHistoryConfig: ConversationHistoryConfig | null;
136
+ createdAt: string;
137
+ updatedAt: string;
138
138
  }>;
139
139
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
140
140
  scopes: AgentScopeConfig;
@@ -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;
25
23
  description: string | null;
24
+ tenantId: string;
25
+ projectId: string;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ headers: Record<string, string> | null;
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;
83
81
  description: string | null;
82
+ tenantId: string;
83
+ projectId: string;
84
+ createdAt: string;
85
+ updatedAt: string;
86
+ headers: Record<string, string> | null;
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,9 +133,9 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
133
133
  needsApproval?: boolean;
134
134
  }> | null;
135
135
  }) => Promise<{
136
+ id: string;
136
137
  tenantId: string;
137
138
  projectId: string;
138
- id: string;
139
139
  agentId: string;
140
140
  createdAt: string;
141
141
  updatedAt: string;
@@ -152,9 +152,9 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
152
152
  subAgentId: string;
153
153
  toolId: string;
154
154
  }) => Promise<{
155
+ id: string;
155
156
  tenantId: string;
156
157
  projectId: string;
157
- id: string;
158
158
  agentId: string;
159
159
  createdAt: string;
160
160
  updatedAt: string;
@@ -180,9 +180,9 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
180
180
  }> | null;
181
181
  relationId?: string;
182
182
  }) => Promise<{
183
+ id: string;
183
184
  tenantId: string;
184
185
  projectId: string;
185
- id: string;
186
186
  agentId: string;
187
187
  createdAt: string;
188
188
  updatedAt: string;
@@ -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;
207
205
  description: string | null;
206
+ tenantId: string;
207
+ projectId: string;
208
+ createdAt: string;
209
+ updatedAt: string;
210
+ headers: Record<string, string> | null;
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";
@@ -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
+ tenantId: string;
13
+ projectId: string;
14
14
  agentId: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ expiresAt: string | null;
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
+ tenantId: string;
27
+ projectId: string;
28
28
  agentId: string;
29
+ createdAt: string;
30
+ updatedAt: string;
31
+ expiresAt: string | null;
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
+ tenantId: string;
44
+ projectId: string;
45
45
  agentId: string;
46
+ createdAt: string;
47
+ updatedAt: string;
48
+ expiresAt: string | null;
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
+ tenantId: string;
71
+ projectId: string;
72
72
  agentId: string;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ expiresAt: string | null;
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
+ id: string;
18
19
  tenantId: string;
19
20
  projectId: string;
20
- id: string;
21
- title: string | null;
22
21
  agentId: string | null;
22
+ title: string | null;
23
23
  createdAt: string;
24
24
  updatedAt: string;
25
- userId: string | null;
26
25
  metadata: ConversationMetadata | null;
27
26
  ref: {
28
27
  type: "commit" | "tag" | "branch";
29
28
  name: string;
30
29
  hash: string;
31
30
  } | null;
31
+ userId: 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
+ id: string;
87
88
  tenantId: string;
88
89
  projectId: string;
89
- id: string;
90
- title: string | null;
91
90
  agentId: string | null;
91
+ title: string | null;
92
92
  createdAt: string;
93
93
  updatedAt: string;
94
- userId: string | null;
95
94
  metadata: ConversationMetadata | null;
96
95
  ref: {
97
96
  type: "commit" | "tag" | "branch";
98
97
  name: string;
99
98
  hash: string;
100
99
  } | null;
100
+ userId: 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
+ id: string;
123
124
  tenantId: string;
124
125
  projectId: string;
125
- id: string;
126
- title: string | null;
127
126
  agentId: string | null;
127
+ title: string | null;
128
128
  createdAt: string;
129
129
  updatedAt: string;
130
- userId: string | null;
131
130
  metadata: ConversationMetadata | null;
132
131
  ref: {
133
132
  type: "commit" | "tag" | "branch";
134
133
  name: string;
135
134
  hash: string;
136
135
  } | null;
136
+ userId: 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
+ id: string;
155
156
  tenantId: string;
156
157
  projectId: string;
157
- id: string;
158
- title: string | null;
159
158
  agentId: string | null;
159
+ title: string | null;
160
160
  createdAt: string;
161
161
  updatedAt: string;
162
- userId: string | null;
163
162
  metadata: ConversationMetadata | null;
164
163
  ref: {
165
164
  type: "commit" | "tag" | "branch";
166
165
  name: string;
167
166
  hash: string;
168
167
  } | null;
168
+ userId: string | null;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -9,9 +9,9 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  scopes: ProjectScopeConfig;
10
10
  messageId: string;
11
11
  }) => Promise<{
12
+ id: string;
12
13
  tenantId: string;
13
14
  projectId: string;
14
- id: string;
15
15
  createdAt: string;
16
16
  updatedAt: string;
17
17
  metadata: MessageMetadata | null;
@@ -140,9 +140,9 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  id: string;
141
141
  }[]>;
142
142
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
+ id: string;
143
144
  tenantId: string;
144
145
  projectId: string;
145
- id: string;
146
146
  createdAt: string;
147
147
  updatedAt: string;
148
148
  metadata: MessageMetadata | null;
@@ -193,9 +193,9 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
193
193
  scopes: ProjectScopeConfig;
194
194
  messageId: string;
195
195
  }) => Promise<{
196
+ id: string;
196
197
  tenantId: string;
197
198
  projectId: string;
198
- id: string;
199
199
  createdAt: string;
200
200
  updatedAt: string;
201
201
  metadata: MessageMetadata | null;
@@ -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 };
@@ -6,9 +6,9 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
6
6
 
7
7
  //#region src/data-access/runtime/tasks.d.ts
8
8
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
9
+ id: string;
9
10
  tenantId: string;
10
11
  projectId: string;
11
- id: string;
12
12
  agentId: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;