@inkeep/agents-core 0.0.0-dev-20260220231539 → 0.0.0-dev-20260221002805
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.
- package/dist/auth/auth-schema.d.ts +117 -83
- package/dist/auth/auth-schema.js +3 -1
- package/dist/auth/auth-validation-schemas.d.ts +199 -131
- package/dist/auth/auth.d.ts +55 -23
- package/dist/auth/auth.js +22 -8
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/data-access/index.d.ts +3 -3
- package/dist/data-access/index.js +3 -3
- package/dist/data-access/manage/agents.d.ts +5 -5
- package/dist/data-access/manage/artifactComponents.d.ts +2 -2
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/functionTools.d.ts +4 -4
- package/dist/data-access/manage/skills.d.ts +4 -4
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgentRelations.d.ts +8 -8
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgents.d.ts +3 -3
- package/dist/data-access/manage/tools.d.ts +9 -9
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/conversations.d.ts +11 -11
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/organizations.d.ts +11 -1
- package/dist/data-access/runtime/organizations.js +27 -1
- package/dist/data-access/runtime/tasks.d.ts +3 -3
- package/dist/data-access/runtime/users.d.ts +9 -1
- package/dist/data-access/runtime/users.js +20 -3
- package/dist/data-access/runtime/workAppSlack.d.ts +1 -1
- package/dist/db/manage/manage-schema.d.ts +357 -357
- package/dist/db/runtime/runtime-schema.d.ts +286 -269
- package/dist/db/runtime/runtime-schema.js +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/middleware/no-auth.d.ts +2 -2
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1652 -1652
- package/drizzle/runtime/0015_soft_payback.sql +3 -0
- package/drizzle/runtime/meta/0015_snapshot.json +3772 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -12,9 +12,9 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
14
|
metadata: Record<string, string> | null;
|
|
15
|
-
description: string;
|
|
16
15
|
projectId: string;
|
|
17
16
|
tenantId: string;
|
|
17
|
+
description: string;
|
|
18
18
|
content: string;
|
|
19
19
|
} | null>;
|
|
20
20
|
declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -45,9 +45,9 @@ declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillInser
|
|
|
45
45
|
createdAt: string;
|
|
46
46
|
updatedAt: string;
|
|
47
47
|
metadata: Record<string, string> | null;
|
|
48
|
-
description: string;
|
|
49
48
|
projectId: string;
|
|
50
49
|
tenantId: string;
|
|
50
|
+
description: string;
|
|
51
51
|
content: string;
|
|
52
52
|
}>;
|
|
53
53
|
declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
|
|
@@ -56,9 +56,9 @@ declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillInser
|
|
|
56
56
|
createdAt: string;
|
|
57
57
|
updatedAt: string;
|
|
58
58
|
metadata: Record<string, string> | null;
|
|
59
|
-
description: string;
|
|
60
59
|
projectId: string;
|
|
61
60
|
tenantId: string;
|
|
61
|
+
description: string;
|
|
62
62
|
content: string;
|
|
63
63
|
}>;
|
|
64
64
|
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -97,9 +97,9 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
97
97
|
projectId: string;
|
|
98
98
|
tenantId: string;
|
|
99
99
|
subAgentId: string;
|
|
100
|
-
skillId: string;
|
|
101
100
|
index: number;
|
|
102
101
|
alwaysLoaded: boolean;
|
|
102
|
+
skillId: string;
|
|
103
103
|
}>;
|
|
104
104
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
105
105
|
scopes: AgentScopeConfig;
|
|
@@ -11,11 +11,11 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
11
11
|
id: string;
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
|
-
headers: Record<string, string> | null;
|
|
15
14
|
agentId: string;
|
|
16
15
|
projectId: string;
|
|
17
16
|
tenantId: string;
|
|
18
17
|
subAgentId: string;
|
|
18
|
+
headers: Record<string, string> | null;
|
|
19
19
|
externalAgentId: string;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -46,11 +46,11 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
46
46
|
id: string;
|
|
47
47
|
createdAt: string;
|
|
48
48
|
updatedAt: string;
|
|
49
|
-
headers: Record<string, string> | null;
|
|
50
49
|
agentId: string;
|
|
51
50
|
projectId: string;
|
|
52
51
|
tenantId: string;
|
|
53
52
|
subAgentId: string;
|
|
53
|
+
headers: Record<string, string> | null;
|
|
54
54
|
externalAgentId: string;
|
|
55
55
|
}[]>;
|
|
56
56
|
declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -59,11 +59,11 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
|
|
|
59
59
|
id: string;
|
|
60
60
|
createdAt: string;
|
|
61
61
|
updatedAt: string;
|
|
62
|
-
headers: Record<string, string> | null;
|
|
63
62
|
agentId: string;
|
|
64
63
|
projectId: string;
|
|
65
64
|
tenantId: string;
|
|
66
65
|
subAgentId: string;
|
|
66
|
+
headers: Record<string, string> | null;
|
|
67
67
|
externalAgentId: string;
|
|
68
68
|
}[]>;
|
|
69
69
|
declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -182,11 +182,11 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
182
182
|
id: string;
|
|
183
183
|
createdAt: string;
|
|
184
184
|
updatedAt: string;
|
|
185
|
-
headers: Record<string, string> | null;
|
|
186
185
|
agentId: string;
|
|
187
186
|
projectId: string;
|
|
188
187
|
tenantId: string;
|
|
189
188
|
subAgentId: string;
|
|
189
|
+
headers: Record<string, string> | null;
|
|
190
190
|
externalAgentId: string;
|
|
191
191
|
}>;
|
|
192
192
|
/**
|
|
@@ -199,11 +199,11 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
199
199
|
id: string;
|
|
200
200
|
createdAt: string;
|
|
201
201
|
updatedAt: string;
|
|
202
|
-
headers: Record<string, string> | null;
|
|
203
202
|
agentId: string;
|
|
204
203
|
projectId: string;
|
|
205
204
|
tenantId: string;
|
|
206
205
|
subAgentId: string;
|
|
206
|
+
headers: Record<string, string> | null;
|
|
207
207
|
externalAgentId: string;
|
|
208
208
|
} | undefined>;
|
|
209
209
|
/**
|
|
@@ -220,11 +220,11 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
220
220
|
id: string;
|
|
221
221
|
createdAt: string;
|
|
222
222
|
updatedAt: string;
|
|
223
|
-
headers: Record<string, string> | null;
|
|
224
223
|
agentId: string;
|
|
225
224
|
projectId: string;
|
|
226
225
|
tenantId: string;
|
|
227
226
|
subAgentId: string;
|
|
227
|
+
headers: Record<string, string> | null;
|
|
228
228
|
externalAgentId: string;
|
|
229
229
|
}>;
|
|
230
230
|
declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -14,9 +14,9 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
14
14
|
agentId: string;
|
|
15
15
|
projectId: string;
|
|
16
16
|
tenantId: string;
|
|
17
|
+
relationType: string | null;
|
|
17
18
|
sourceSubAgentId: string;
|
|
18
19
|
targetSubAgentId: string | null;
|
|
19
|
-
relationType: string | null;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
22
|
scopes: AgentScopeConfig;
|
|
@@ -49,9 +49,9 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
49
49
|
agentId: string;
|
|
50
50
|
projectId: string;
|
|
51
51
|
tenantId: string;
|
|
52
|
+
relationType: string | null;
|
|
52
53
|
sourceSubAgentId: string;
|
|
53
54
|
targetSubAgentId: string | null;
|
|
54
|
-
relationType: string | null;
|
|
55
55
|
}[]>;
|
|
56
56
|
declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
57
57
|
scopes: AgentScopeConfig;
|
|
@@ -62,9 +62,9 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
|
|
|
62
62
|
agentId: string;
|
|
63
63
|
projectId: string;
|
|
64
64
|
tenantId: string;
|
|
65
|
+
relationType: string | null;
|
|
65
66
|
sourceSubAgentId: string;
|
|
66
67
|
targetSubAgentId: string | null;
|
|
67
|
-
relationType: string | null;
|
|
68
68
|
}[]>;
|
|
69
69
|
declare const getAgentRelationsBySource: (db: AgentsManageDatabaseClient) => (params: {
|
|
70
70
|
scopes: AgentScopeConfig;
|
|
@@ -131,9 +131,9 @@ declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
131
131
|
agentId: string;
|
|
132
132
|
projectId: string;
|
|
133
133
|
tenantId: string;
|
|
134
|
+
relationType: string | null;
|
|
134
135
|
sourceSubAgentId: string;
|
|
135
136
|
targetSubAgentId: string | null;
|
|
136
|
-
relationType: string | null;
|
|
137
137
|
}>;
|
|
138
138
|
/**
|
|
139
139
|
* Check if sub-agent relation exists by agent, source, target, and relation type
|
|
@@ -150,9 +150,9 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
|
|
|
150
150
|
agentId: string;
|
|
151
151
|
projectId: string;
|
|
152
152
|
tenantId: string;
|
|
153
|
+
relationType: string | null;
|
|
153
154
|
sourceSubAgentId: string;
|
|
154
155
|
targetSubAgentId: string | null;
|
|
155
|
-
relationType: string | null;
|
|
156
156
|
} | undefined>;
|
|
157
157
|
/**
|
|
158
158
|
* Upsert agent relation (create if it doesn't exist, no-op if it does)
|
|
@@ -164,9 +164,9 @@ declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
164
164
|
agentId: string;
|
|
165
165
|
projectId: string;
|
|
166
166
|
tenantId: string;
|
|
167
|
+
relationType: string | null;
|
|
167
168
|
sourceSubAgentId: string;
|
|
168
169
|
targetSubAgentId: string | null;
|
|
169
|
-
relationType: string | null;
|
|
170
170
|
}>;
|
|
171
171
|
declare const updateAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
172
172
|
scopes: AgentScopeConfig;
|
|
@@ -206,12 +206,12 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
206
206
|
id: string;
|
|
207
207
|
createdAt: string;
|
|
208
208
|
updatedAt: string;
|
|
209
|
-
headers: Record<string, string> | null;
|
|
210
209
|
agentId: string;
|
|
211
210
|
projectId: string;
|
|
212
211
|
tenantId: string;
|
|
213
212
|
subAgentId: string;
|
|
214
213
|
toolId: string;
|
|
214
|
+
headers: Record<string, string> | null;
|
|
215
215
|
toolPolicies: Record<string, {
|
|
216
216
|
needsApproval?: boolean;
|
|
217
217
|
}> | null;
|
|
@@ -250,12 +250,12 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
250
250
|
id: string;
|
|
251
251
|
createdAt: string;
|
|
252
252
|
updatedAt: string;
|
|
253
|
-
headers: Record<string, string> | null;
|
|
254
253
|
agentId: string;
|
|
255
254
|
projectId: string;
|
|
256
255
|
tenantId: string;
|
|
257
256
|
subAgentId: string;
|
|
258
257
|
toolId: string;
|
|
258
|
+
headers: Record<string, string> | null;
|
|
259
259
|
toolPolicies: Record<string, {
|
|
260
260
|
needsApproval?: boolean;
|
|
261
261
|
}> | null;
|
|
@@ -11,11 +11,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
|
|
|
11
11
|
id: string;
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
|
-
headers: Record<string, string> | null;
|
|
15
14
|
agentId: string;
|
|
16
15
|
projectId: string;
|
|
17
16
|
tenantId: string;
|
|
18
17
|
subAgentId: string;
|
|
18
|
+
headers: Record<string, string> | null;
|
|
19
19
|
targetAgentId: string;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -46,11 +46,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
|
|
|
46
46
|
id: string;
|
|
47
47
|
createdAt: string;
|
|
48
48
|
updatedAt: string;
|
|
49
|
-
headers: Record<string, string> | null;
|
|
50
49
|
agentId: string;
|
|
51
50
|
projectId: string;
|
|
52
51
|
tenantId: string;
|
|
53
52
|
subAgentId: string;
|
|
53
|
+
headers: Record<string, string> | null;
|
|
54
54
|
targetAgentId: string;
|
|
55
55
|
}[]>;
|
|
56
56
|
declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -59,11 +59,11 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
|
|
|
59
59
|
id: string;
|
|
60
60
|
createdAt: string;
|
|
61
61
|
updatedAt: string;
|
|
62
|
-
headers: Record<string, string> | null;
|
|
63
62
|
agentId: string;
|
|
64
63
|
projectId: string;
|
|
65
64
|
tenantId: string;
|
|
66
65
|
subAgentId: string;
|
|
66
|
+
headers: Record<string, string> | null;
|
|
67
67
|
targetAgentId: string;
|
|
68
68
|
}[]>;
|
|
69
69
|
declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -212,11 +212,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
212
212
|
id: string;
|
|
213
213
|
createdAt: string;
|
|
214
214
|
updatedAt: string;
|
|
215
|
-
headers: Record<string, string> | null;
|
|
216
215
|
agentId: string;
|
|
217
216
|
projectId: string;
|
|
218
217
|
tenantId: string;
|
|
219
218
|
subAgentId: string;
|
|
219
|
+
headers: Record<string, string> | null;
|
|
220
220
|
targetAgentId: string;
|
|
221
221
|
}>;
|
|
222
222
|
/**
|
|
@@ -229,11 +229,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
|
|
|
229
229
|
id: string;
|
|
230
230
|
createdAt: string;
|
|
231
231
|
updatedAt: string;
|
|
232
|
-
headers: Record<string, string> | null;
|
|
233
232
|
agentId: string;
|
|
234
233
|
projectId: string;
|
|
235
234
|
tenantId: string;
|
|
236
235
|
subAgentId: string;
|
|
236
|
+
headers: Record<string, string> | null;
|
|
237
237
|
targetAgentId: string;
|
|
238
238
|
} | undefined>;
|
|
239
239
|
/**
|
|
@@ -250,11 +250,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
250
250
|
id: string;
|
|
251
251
|
createdAt: string;
|
|
252
252
|
updatedAt: string;
|
|
253
|
-
headers: Record<string, string> | null;
|
|
254
253
|
agentId: string;
|
|
255
254
|
projectId: string;
|
|
256
255
|
tenantId: string;
|
|
257
256
|
subAgentId: string;
|
|
257
|
+
headers: Record<string, string> | null;
|
|
258
258
|
targetAgentId: string;
|
|
259
259
|
}>;
|
|
260
260
|
declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -12,10 +12,10 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
12
12
|
name: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
description: string | null;
|
|
16
15
|
agentId: string;
|
|
17
16
|
projectId: string;
|
|
18
17
|
tenantId: string;
|
|
18
|
+
description: string | null;
|
|
19
19
|
models: {
|
|
20
20
|
base?: {
|
|
21
21
|
model?: string | undefined;
|
|
@@ -43,10 +43,10 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
43
43
|
name: string;
|
|
44
44
|
createdAt: string;
|
|
45
45
|
updatedAt: string;
|
|
46
|
-
description: string | null;
|
|
47
46
|
agentId: string;
|
|
48
47
|
projectId: string;
|
|
49
48
|
tenantId: string;
|
|
49
|
+
description: string | null;
|
|
50
50
|
models: {
|
|
51
51
|
base?: {
|
|
52
52
|
model?: string | undefined;
|
|
@@ -112,10 +112,10 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
112
112
|
name: string;
|
|
113
113
|
createdAt: string;
|
|
114
114
|
updatedAt: string;
|
|
115
|
-
description: string | null;
|
|
116
115
|
agentId: string;
|
|
117
116
|
projectId: string;
|
|
118
117
|
tenantId: string;
|
|
118
|
+
description: string | null;
|
|
119
119
|
models: {
|
|
120
120
|
base?: {
|
|
121
121
|
model?: string | undefined;
|
|
@@ -22,10 +22,10 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
22
22
|
name: string;
|
|
23
23
|
createdAt: string;
|
|
24
24
|
updatedAt: string;
|
|
25
|
-
description: string | null;
|
|
26
|
-
headers: Record<string, string> | null;
|
|
27
25
|
projectId: string;
|
|
28
26
|
tenantId: string;
|
|
27
|
+
description: string | null;
|
|
28
|
+
headers: Record<string, string> | null;
|
|
29
29
|
config: {
|
|
30
30
|
type: "mcp";
|
|
31
31
|
mcp: ToolMcpConfig;
|
|
@@ -80,10 +80,10 @@ declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInser
|
|
|
80
80
|
name: string;
|
|
81
81
|
createdAt: string;
|
|
82
82
|
updatedAt: string;
|
|
83
|
-
description: string | null;
|
|
84
|
-
headers: Record<string, string> | null;
|
|
85
83
|
projectId: string;
|
|
86
84
|
tenantId: string;
|
|
85
|
+
description: string | null;
|
|
86
|
+
headers: Record<string, string> | null;
|
|
87
87
|
config: {
|
|
88
88
|
type: "mcp";
|
|
89
89
|
mcp: ToolMcpConfig;
|
|
@@ -136,12 +136,12 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
136
136
|
id: string;
|
|
137
137
|
createdAt: string;
|
|
138
138
|
updatedAt: string;
|
|
139
|
-
headers: Record<string, string> | null;
|
|
140
139
|
agentId: string;
|
|
141
140
|
projectId: string;
|
|
142
141
|
tenantId: string;
|
|
143
142
|
subAgentId: string;
|
|
144
143
|
toolId: string;
|
|
144
|
+
headers: Record<string, string> | null;
|
|
145
145
|
toolPolicies: Record<string, {
|
|
146
146
|
needsApproval?: boolean;
|
|
147
147
|
}> | null;
|
|
@@ -155,12 +155,12 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
|
|
|
155
155
|
id: string;
|
|
156
156
|
createdAt: string;
|
|
157
157
|
updatedAt: string;
|
|
158
|
-
headers: Record<string, string> | null;
|
|
159
158
|
agentId: string;
|
|
160
159
|
projectId: string;
|
|
161
160
|
tenantId: string;
|
|
162
161
|
subAgentId: string;
|
|
163
162
|
toolId: string;
|
|
163
|
+
headers: Record<string, string> | null;
|
|
164
164
|
toolPolicies: Record<string, {
|
|
165
165
|
needsApproval?: boolean;
|
|
166
166
|
}> | null;
|
|
@@ -183,12 +183,12 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
183
183
|
id: string;
|
|
184
184
|
createdAt: string;
|
|
185
185
|
updatedAt: string;
|
|
186
|
-
headers: Record<string, string> | null;
|
|
187
186
|
agentId: string;
|
|
188
187
|
projectId: string;
|
|
189
188
|
tenantId: string;
|
|
190
189
|
subAgentId: string;
|
|
191
190
|
toolId: string;
|
|
191
|
+
headers: Record<string, string> | null;
|
|
192
192
|
toolPolicies: Record<string, {
|
|
193
193
|
needsApproval?: boolean;
|
|
194
194
|
}> | null;
|
|
@@ -204,10 +204,10 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
204
204
|
name: string;
|
|
205
205
|
createdAt: string;
|
|
206
206
|
updatedAt: string;
|
|
207
|
-
description: string | null;
|
|
208
|
-
headers: Record<string, string> | null;
|
|
209
207
|
projectId: string;
|
|
210
208
|
tenantId: string;
|
|
209
|
+
description: string | null;
|
|
210
|
+
headers: Record<string, string> | null;
|
|
211
211
|
config: {
|
|
212
212
|
type: "mcp";
|
|
213
213
|
mcp: ToolMcpConfig;
|
|
@@ -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" | "
|
|
43
|
+
source: "query" | "header" | "body";
|
|
44
44
|
key: string;
|
|
45
45
|
prefix?: string | undefined;
|
|
46
46
|
regex?: string | undefined;
|
|
47
47
|
};
|
|
48
48
|
signedComponents: {
|
|
49
|
-
source: "literal" | "
|
|
49
|
+
source: "literal" | "header" | "body";
|
|
50
50
|
required: boolean;
|
|
51
51
|
key?: string | undefined;
|
|
52
52
|
value?: string | undefined;
|
|
@@ -19,16 +19,16 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
|
|
|
19
19
|
createdAt: string;
|
|
20
20
|
updatedAt: string;
|
|
21
21
|
ref: {
|
|
22
|
-
type: "
|
|
22
|
+
type: "tag" | "commit" | "branch";
|
|
23
23
|
name: string;
|
|
24
24
|
hash: string;
|
|
25
25
|
} | null;
|
|
26
26
|
userId: string | null;
|
|
27
27
|
metadata: ConversationMetadata | null;
|
|
28
|
-
title: string | null;
|
|
29
28
|
agentId: string | null;
|
|
30
29
|
projectId: string;
|
|
31
30
|
tenantId: string;
|
|
31
|
+
title: string | null;
|
|
32
32
|
activeSubAgentId: string;
|
|
33
33
|
lastContextResolution: string | null;
|
|
34
34
|
}>;
|
|
@@ -43,7 +43,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
43
43
|
agentId: string | null;
|
|
44
44
|
activeSubAgentId: string;
|
|
45
45
|
ref: {
|
|
46
|
-
type: "
|
|
46
|
+
type: "tag" | "commit" | "branch";
|
|
47
47
|
name: string;
|
|
48
48
|
hash: string;
|
|
49
49
|
} | null;
|
|
@@ -69,7 +69,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
|
|
|
69
69
|
agentId: string | null;
|
|
70
70
|
activeSubAgentId: string;
|
|
71
71
|
ref: {
|
|
72
|
-
type: "
|
|
72
|
+
type: "tag" | "commit" | "branch";
|
|
73
73
|
name: string;
|
|
74
74
|
hash: string;
|
|
75
75
|
} | null;
|
|
@@ -88,16 +88,16 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
88
88
|
createdAt: string;
|
|
89
89
|
updatedAt: string;
|
|
90
90
|
ref: {
|
|
91
|
-
type: "
|
|
91
|
+
type: "tag" | "commit" | "branch";
|
|
92
92
|
name: string;
|
|
93
93
|
hash: string;
|
|
94
94
|
} | null;
|
|
95
95
|
userId: string | null;
|
|
96
96
|
metadata: ConversationMetadata | null;
|
|
97
|
-
title: string | null;
|
|
98
97
|
agentId: string | null;
|
|
99
98
|
projectId: string;
|
|
100
99
|
tenantId: string;
|
|
100
|
+
title: string | null;
|
|
101
101
|
activeSubAgentId: string;
|
|
102
102
|
lastContextResolution: string | null;
|
|
103
103
|
} | undefined>;
|
|
@@ -107,7 +107,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
107
107
|
tenantId: string;
|
|
108
108
|
id: string;
|
|
109
109
|
ref: {
|
|
110
|
-
type: "
|
|
110
|
+
type: "tag" | "commit" | "branch";
|
|
111
111
|
name: string;
|
|
112
112
|
hash: string;
|
|
113
113
|
};
|
|
@@ -124,16 +124,16 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
124
124
|
createdAt: string;
|
|
125
125
|
updatedAt: string;
|
|
126
126
|
ref: {
|
|
127
|
-
type: "
|
|
127
|
+
type: "tag" | "commit" | "branch";
|
|
128
128
|
name: string;
|
|
129
129
|
hash: string;
|
|
130
130
|
} | null;
|
|
131
131
|
userId: string | null;
|
|
132
132
|
metadata: ConversationMetadata | null;
|
|
133
|
-
title: string | null;
|
|
134
133
|
agentId: string | null;
|
|
135
134
|
projectId: string;
|
|
136
135
|
tenantId: string;
|
|
136
|
+
title: string | null;
|
|
137
137
|
activeSubAgentId: string;
|
|
138
138
|
lastContextResolution: string | null;
|
|
139
139
|
}>;
|
|
@@ -156,16 +156,16 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
156
156
|
createdAt: string;
|
|
157
157
|
updatedAt: string;
|
|
158
158
|
ref: {
|
|
159
|
-
type: "
|
|
159
|
+
type: "tag" | "commit" | "branch";
|
|
160
160
|
name: string;
|
|
161
161
|
hash: string;
|
|
162
162
|
} | null;
|
|
163
163
|
userId: string | null;
|
|
164
164
|
metadata: ConversationMetadata | null;
|
|
165
|
-
title: string | null;
|
|
166
165
|
agentId: string | null;
|
|
167
166
|
projectId: string;
|
|
168
167
|
tenantId: string;
|
|
168
|
+
title: string | null;
|
|
169
169
|
activeSubAgentId: string;
|
|
170
170
|
lastContextResolution: string | null;
|
|
171
171
|
} | undefined>;
|
|
@@ -17,18 +17,18 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
17
17
|
projectId: string;
|
|
18
18
|
tenantId: string;
|
|
19
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: {
|
|
@@ -148,18 +148,18 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageIn
|
|
|
148
148
|
projectId: string;
|
|
149
149
|
tenantId: string;
|
|
150
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: {
|
|
@@ -201,18 +201,18 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
201
201
|
projectId: string;
|
|
202
202
|
tenantId: string;
|
|
203
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: {
|
|
@@ -57,5 +57,15 @@ interface UserProviderInfo {
|
|
|
57
57
|
* Returns which providers each user has linked (e.g., 'credential', 'google', 'auth0').
|
|
58
58
|
*/
|
|
59
59
|
declare const getUserProvidersFromDb: (db: AgentsRunDatabaseClient) => (userIds: string[]) => Promise<UserProviderInfo[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Create an invitation directly in db
|
|
62
|
+
* Used when shouldAllowJoinFromWorkspace is enabled for a work_app_slack_workspaces
|
|
63
|
+
*/
|
|
64
|
+
declare const createInvitationInDb: (db: AgentsRunDatabaseClient) => (data: {
|
|
65
|
+
organizationId: string;
|
|
66
|
+
email: string;
|
|
67
|
+
}) => Promise<{
|
|
68
|
+
id: string;
|
|
69
|
+
}>;
|
|
60
70
|
//#endregion
|
|
61
|
-
export { UserProviderInfo, addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };
|
|
71
|
+
export { UserProviderInfo, addUserToOrganization, createInvitationInDb, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { account, invitation, member, organization } from "../../auth/auth-schema.js";
|
|
2
2
|
import { and, desc, eq, inArray, or } from "drizzle-orm";
|
|
3
|
+
import { generateId } from "better-auth";
|
|
3
4
|
|
|
4
5
|
//#region src/data-access/runtime/organizations.ts
|
|
5
6
|
/**
|
|
@@ -91,6 +92,31 @@ const getUserProvidersFromDb = (db) => async (userIds) => {
|
|
|
91
92
|
providers: providerMap.get(userId) || []
|
|
92
93
|
}));
|
|
93
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Create an invitation directly in db
|
|
97
|
+
* Used when shouldAllowJoinFromWorkspace is enabled for a work_app_slack_workspaces
|
|
98
|
+
*/
|
|
99
|
+
const createInvitationInDb = (db) => async (data) => {
|
|
100
|
+
const orgSettings = (await db.select({
|
|
101
|
+
serviceAccountUserId: organization.serviceAccountUserId,
|
|
102
|
+
preferredAuthMethod: organization.preferredAuthMethod
|
|
103
|
+
}).from(organization).where(eq(organization.id, data.organizationId)).limit(1))[0];
|
|
104
|
+
if (!orgSettings?.serviceAccountUserId) throw new Error(`Organization ${data.organizationId} does not have a serviceAccountUserId configured`);
|
|
105
|
+
if (!orgSettings?.preferredAuthMethod) throw new Error(`Organization ${data.organizationId} does not have a preferredAuthMethod configured`);
|
|
106
|
+
const inviteId = generateId();
|
|
107
|
+
const expiresAt = new Date(Date.now() + 3600 * 1e3);
|
|
108
|
+
await db.insert(invitation).values({
|
|
109
|
+
id: inviteId,
|
|
110
|
+
organizationId: data.organizationId,
|
|
111
|
+
email: data.email,
|
|
112
|
+
role: "member",
|
|
113
|
+
status: "pending",
|
|
114
|
+
expiresAt,
|
|
115
|
+
inviterId: orgSettings.serviceAccountUserId,
|
|
116
|
+
authMethod: orgSettings.preferredAuthMethod
|
|
117
|
+
});
|
|
118
|
+
return { id: inviteId };
|
|
119
|
+
};
|
|
94
120
|
|
|
95
121
|
//#endregion
|
|
96
|
-
export { addUserToOrganization, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };
|
|
122
|
+
export { addUserToOrganization, createInvitationInDb, getPendingInvitationsByEmail, getUserOrganizationsFromDb, getUserProvidersFromDb, upsertOrganization };
|
|
@@ -10,7 +10,7 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
|
|
|
10
10
|
createdAt: string;
|
|
11
11
|
updatedAt: string;
|
|
12
12
|
ref: {
|
|
13
|
-
type: "
|
|
13
|
+
type: "tag" | "commit" | "branch";
|
|
14
14
|
name: string;
|
|
15
15
|
hash: string;
|
|
16
16
|
} | null;
|
|
@@ -19,8 +19,8 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
|
|
|
19
19
|
agentId: string;
|
|
20
20
|
projectId: string;
|
|
21
21
|
tenantId: string;
|
|
22
|
-
subAgentId: string;
|
|
23
22
|
contextId: string;
|
|
23
|
+
subAgentId: string;
|
|
24
24
|
}>;
|
|
25
25
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|
|
26
26
|
id: string;
|
|
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
36
36
|
updatedAt: string;
|
|
37
37
|
contextId: string;
|
|
38
38
|
ref: {
|
|
39
|
-
type: "
|
|
39
|
+
type: "tag" | "commit" | "branch";
|
|
40
40
|
name: string;
|
|
41
41
|
hash: string;
|
|
42
42
|
} | null;
|
|
@@ -15,5 +15,13 @@ declare const getUserById: (db: AgentsRunDatabaseClient) => (userId: string) =>
|
|
|
15
15
|
* Get user by email
|
|
16
16
|
*/
|
|
17
17
|
declare const getUserByEmail: (db: AgentsRunDatabaseClient) => (email: string) => Promise<User | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Get organization member by email
|
|
20
|
+
* Returns the user if they are a member of the specified organization
|
|
21
|
+
*/
|
|
22
|
+
declare const getOrganizationMemberByEmail: (db: AgentsRunDatabaseClient) => (organizationId: string, email: string) => Promise<(User & {
|
|
23
|
+
role: string;
|
|
24
|
+
memberId: string;
|
|
25
|
+
}) | null>;
|
|
18
26
|
//#endregion
|
|
19
|
-
export { getUserByEmail, getUserById };
|
|
27
|
+
export { getOrganizationMemberByEmail, getUserByEmail, getUserById };
|