@inkeep/agents-core 0.0.0-dev-20260106155500 → 0.0.0-dev-20260106221934
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/_virtual/rolldown_runtime.js +2 -2
- package/dist/auth/auth-validation-schemas.d.ts +17 -17
- package/dist/auth/auth.d.ts +67 -58
- package/dist/auth/permissions.d.ts +15 -14
- package/dist/auth/permissions.js +2 -1
- package/dist/client-exports.d.ts +13 -0
- package/dist/data-access/agents.d.ts +26 -26
- package/dist/data-access/apiKeys.d.ts +20 -20
- package/dist/data-access/artifactComponents.d.ts +34 -14
- package/dist/data-access/artifactComponents.js +22 -1
- package/dist/data-access/contextConfigs.d.ts +12 -12
- package/dist/data-access/conversations.d.ts +12 -12
- package/dist/data-access/dataComponents.d.ts +6 -6
- package/dist/data-access/functionTools.d.ts +10 -10
- package/dist/data-access/messages.d.ts +24 -24
- package/dist/data-access/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/subAgentRelations.d.ts +30 -30
- package/dist/data-access/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/subAgents.d.ts +18 -18
- package/dist/data-access/tasks.d.ts +4 -4
- package/dist/data-access/tools.d.ts +39 -39
- package/dist/db/schema.d.ts +25 -0
- package/dist/db/schema.js +3 -2
- package/dist/index.js +1 -1
- package/dist/utils/schema-conversion.d.ts +1 -1
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1189 -1009
- package/drizzle/0007_slim_karma.sql +1 -0
- package/drizzle/meta/0007_snapshot.json +3772 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +9 -9
package/dist/client-exports.d.ts
CHANGED
|
@@ -145,6 +145,19 @@ declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
|
|
|
145
145
|
name: z.ZodString;
|
|
146
146
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
147
|
props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
|
|
148
|
+
render: z.ZodOptional<z.ZodNullable<z.ZodType<{
|
|
149
|
+
component: string;
|
|
150
|
+
mockData: Record<string, unknown>;
|
|
151
|
+
}, {
|
|
152
|
+
component: string;
|
|
153
|
+
mockData: Record<string, unknown>;
|
|
154
|
+
}, z.core.$ZodTypeInternals<{
|
|
155
|
+
component: string;
|
|
156
|
+
mockData: Record<string, unknown>;
|
|
157
|
+
}, {
|
|
158
|
+
component: string;
|
|
159
|
+
mockData: Record<string, unknown>;
|
|
160
|
+
}>>>>;
|
|
148
161
|
}, {
|
|
149
162
|
out: {};
|
|
150
163
|
in: {};
|
|
@@ -8,9 +8,12 @@ import { PgTable } from "drizzle-orm/pg-core";
|
|
|
8
8
|
declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
}) => Promise<{
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
13
13
|
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
prompt: string | null;
|
|
14
17
|
createdAt: string;
|
|
15
18
|
updatedAt: string;
|
|
16
19
|
models: {
|
|
@@ -30,10 +33,8 @@ declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
|
30
33
|
stopWhen: {
|
|
31
34
|
transferCountIs?: number | undefined;
|
|
32
35
|
} | null;
|
|
33
|
-
tenantId: string;
|
|
34
36
|
defaultSubAgentId: string | null;
|
|
35
37
|
contextConfigId: string | null;
|
|
36
|
-
prompt: string | null;
|
|
37
38
|
statusUpdates: {
|
|
38
39
|
enabled?: boolean | undefined;
|
|
39
40
|
numEvents?: number | undefined;
|
|
@@ -49,14 +50,16 @@ declare const getAgentById: (db: DatabaseClient) => (params: {
|
|
|
49
50
|
} | undefined;
|
|
50
51
|
}[] | undefined;
|
|
51
52
|
} | null;
|
|
52
|
-
projectId: string;
|
|
53
53
|
} | null>;
|
|
54
54
|
declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
56
56
|
}) => Promise<{
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
tenantId: string;
|
|
58
|
+
projectId: string;
|
|
59
59
|
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
description: string | null;
|
|
62
|
+
prompt: string | null;
|
|
60
63
|
createdAt: string;
|
|
61
64
|
updatedAt: string;
|
|
62
65
|
models: {
|
|
@@ -76,10 +79,8 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
76
79
|
stopWhen: {
|
|
77
80
|
transferCountIs?: number | undefined;
|
|
78
81
|
} | null;
|
|
79
|
-
tenantId: string;
|
|
80
82
|
defaultSubAgentId: string | null;
|
|
81
83
|
contextConfigId: string | null;
|
|
82
|
-
prompt: string | null;
|
|
83
84
|
statusUpdates: {
|
|
84
85
|
enabled?: boolean | undefined;
|
|
85
86
|
numEvents?: number | undefined;
|
|
@@ -95,11 +96,14 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
95
96
|
} | undefined;
|
|
96
97
|
}[] | undefined;
|
|
97
98
|
} | null;
|
|
98
|
-
projectId: string;
|
|
99
99
|
defaultSubAgent: {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
tenantId: string;
|
|
101
|
+
projectId: string;
|
|
102
102
|
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
description: string | null;
|
|
105
|
+
prompt: string | null;
|
|
106
|
+
agentId: string;
|
|
103
107
|
createdAt: string;
|
|
104
108
|
updatedAt: string;
|
|
105
109
|
models: {
|
|
@@ -119,19 +123,18 @@ declare const getAgentWithDefaultSubAgent: (db: DatabaseClient) => (params: {
|
|
|
119
123
|
stopWhen: {
|
|
120
124
|
stepCountIs?: number | undefined;
|
|
121
125
|
} | null;
|
|
122
|
-
tenantId: string;
|
|
123
|
-
prompt: string | null;
|
|
124
|
-
projectId: string;
|
|
125
|
-
agentId: string;
|
|
126
126
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
127
127
|
} | null;
|
|
128
128
|
} | null>;
|
|
129
129
|
declare const listAgents: (db: DatabaseClient) => (params: {
|
|
130
130
|
scopes: ProjectScopeConfig;
|
|
131
131
|
}) => Promise<{
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
tenantId: string;
|
|
133
|
+
projectId: string;
|
|
134
134
|
id: string;
|
|
135
|
+
name: string;
|
|
136
|
+
description: string | null;
|
|
137
|
+
prompt: string | null;
|
|
135
138
|
createdAt: string;
|
|
136
139
|
updatedAt: string;
|
|
137
140
|
models: {
|
|
@@ -151,10 +154,8 @@ declare const listAgents: (db: DatabaseClient) => (params: {
|
|
|
151
154
|
stopWhen: {
|
|
152
155
|
transferCountIs?: number | undefined;
|
|
153
156
|
} | null;
|
|
154
|
-
tenantId: string;
|
|
155
157
|
defaultSubAgentId: string | null;
|
|
156
158
|
contextConfigId: string | null;
|
|
157
|
-
prompt: string | null;
|
|
158
159
|
statusUpdates: {
|
|
159
160
|
enabled?: boolean | undefined;
|
|
160
161
|
numEvents?: number | undefined;
|
|
@@ -170,7 +171,6 @@ declare const listAgents: (db: DatabaseClient) => (params: {
|
|
|
170
171
|
} | undefined;
|
|
171
172
|
}[] | undefined;
|
|
172
173
|
} | null;
|
|
173
|
-
projectId: string;
|
|
174
174
|
}[]>;
|
|
175
175
|
declare const listAgentsPaginated: (db: DatabaseClient) => (params: {
|
|
176
176
|
scopes: ProjectScopeConfig;
|
|
@@ -228,9 +228,12 @@ declare const listAgentsPaginated: (db: DatabaseClient) => (params: {
|
|
|
228
228
|
};
|
|
229
229
|
}>;
|
|
230
230
|
declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promise<{
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
tenantId: string;
|
|
232
|
+
projectId: string;
|
|
233
233
|
id: string;
|
|
234
|
+
name: string;
|
|
235
|
+
description: string | null;
|
|
236
|
+
prompt: string | null;
|
|
234
237
|
createdAt: string;
|
|
235
238
|
updatedAt: string;
|
|
236
239
|
models: {
|
|
@@ -250,10 +253,8 @@ declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promis
|
|
|
250
253
|
stopWhen: {
|
|
251
254
|
transferCountIs?: number | undefined;
|
|
252
255
|
} | null;
|
|
253
|
-
tenantId: string;
|
|
254
256
|
defaultSubAgentId: string | null;
|
|
255
257
|
contextConfigId: string | null;
|
|
256
|
-
prompt: string | null;
|
|
257
258
|
statusUpdates: {
|
|
258
259
|
enabled?: boolean | undefined;
|
|
259
260
|
numEvents?: number | undefined;
|
|
@@ -269,7 +270,6 @@ declare const createAgent: (db: DatabaseClient) => (data: AgentInsert) => Promis
|
|
|
269
270
|
} | undefined;
|
|
270
271
|
}[] | undefined;
|
|
271
272
|
} | null;
|
|
272
|
-
projectId: string;
|
|
273
273
|
}>;
|
|
274
274
|
declare const updateAgent: (db: DatabaseClient) => (params: {
|
|
275
275
|
scopes: AgentScopeConfig;
|
|
@@ -7,49 +7,49 @@ declare const getApiKeyById: (db: DatabaseClient) => (params: {
|
|
|
7
7
|
scopes: ProjectScopeConfig;
|
|
8
8
|
id: string;
|
|
9
9
|
}) => Promise<{
|
|
10
|
-
name: string | null;
|
|
11
|
-
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
|
-
updatedAt: string;
|
|
14
|
-
expiresAt: string | null;
|
|
15
10
|
tenantId: string;
|
|
16
11
|
projectId: string;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string | null;
|
|
17
14
|
agentId: string;
|
|
18
15
|
publicId: string;
|
|
19
16
|
keyHash: string;
|
|
20
17
|
keyPrefix: string;
|
|
21
18
|
lastUsedAt: string | null;
|
|
22
|
-
|
|
23
|
-
declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) => Promise<{
|
|
24
|
-
name: string | null;
|
|
25
|
-
id: string;
|
|
19
|
+
expiresAt: string | null;
|
|
26
20
|
createdAt: string;
|
|
27
21
|
updatedAt: string;
|
|
28
|
-
|
|
22
|
+
} | undefined>;
|
|
23
|
+
declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) => Promise<{
|
|
29
24
|
tenantId: string;
|
|
30
25
|
projectId: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string | null;
|
|
31
28
|
agentId: string;
|
|
32
29
|
publicId: string;
|
|
33
30
|
keyHash: string;
|
|
34
31
|
keyPrefix: string;
|
|
35
32
|
lastUsedAt: string | null;
|
|
33
|
+
expiresAt: string | null;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
36
|
} | undefined>;
|
|
37
37
|
declare const listApiKeys: (db: DatabaseClient) => (params: {
|
|
38
38
|
scopes: ProjectScopeConfig;
|
|
39
39
|
agentId?: string;
|
|
40
40
|
}) => Promise<{
|
|
41
|
-
name: string | null;
|
|
42
|
-
id: string;
|
|
43
|
-
createdAt: string;
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
expiresAt: string | null;
|
|
46
41
|
tenantId: string;
|
|
47
42
|
projectId: string;
|
|
43
|
+
id: string;
|
|
44
|
+
name: string | null;
|
|
48
45
|
agentId: string;
|
|
49
46
|
publicId: string;
|
|
50
47
|
keyHash: string;
|
|
51
48
|
keyPrefix: string;
|
|
52
49
|
lastUsedAt: string | null;
|
|
50
|
+
expiresAt: string | null;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
53
|
}[]>;
|
|
54
54
|
declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
|
|
55
55
|
scopes: ProjectScopeConfig;
|
|
@@ -65,18 +65,18 @@ declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Promise<{
|
|
68
|
-
name: string | null;
|
|
69
|
-
id: string;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
updatedAt: string;
|
|
72
|
-
expiresAt: string | null;
|
|
73
68
|
tenantId: string;
|
|
74
69
|
projectId: string;
|
|
70
|
+
id: string;
|
|
71
|
+
name: string | null;
|
|
75
72
|
agentId: string;
|
|
76
73
|
publicId: string;
|
|
77
74
|
keyHash: string;
|
|
78
75
|
keyPrefix: string;
|
|
79
76
|
lastUsedAt: string | null;
|
|
77
|
+
expiresAt: string | null;
|
|
78
|
+
createdAt: string;
|
|
79
|
+
updatedAt: string;
|
|
80
80
|
}>;
|
|
81
81
|
declare const updateApiKey: (db: DatabaseClient) => (params: {
|
|
82
82
|
scopes: ProjectScopeConfig;
|
|
@@ -7,14 +7,18 @@ declare const getArtifactComponentById: (db: DatabaseClient) => (params: {
|
|
|
7
7
|
scopes: ProjectScopeConfig;
|
|
8
8
|
id: string;
|
|
9
9
|
}) => Promise<{
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
tenantId: string;
|
|
11
|
+
projectId: string;
|
|
12
12
|
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string | null;
|
|
13
15
|
createdAt: string;
|
|
14
16
|
updatedAt: string;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
projectId: string;
|
|
17
17
|
props: Record<string, unknown> | null;
|
|
18
|
+
render: {
|
|
19
|
+
component: string;
|
|
20
|
+
mockData: Record<string, unknown>;
|
|
21
|
+
} | null;
|
|
18
22
|
} | undefined>;
|
|
19
23
|
declare const listArtifactComponents: (db: DatabaseClient) => (params: {
|
|
20
24
|
scopes: ProjectScopeConfig;
|
|
@@ -22,6 +26,10 @@ declare const listArtifactComponents: (db: DatabaseClient) => (params: {
|
|
|
22
26
|
createdAt: string;
|
|
23
27
|
updatedAt: string;
|
|
24
28
|
props: Record<string, unknown> | null;
|
|
29
|
+
render: {
|
|
30
|
+
component: string;
|
|
31
|
+
mockData: Record<string, unknown>;
|
|
32
|
+
} | null;
|
|
25
33
|
name: string;
|
|
26
34
|
description: string | null;
|
|
27
35
|
projectId: string;
|
|
@@ -41,14 +49,18 @@ declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params:
|
|
|
41
49
|
};
|
|
42
50
|
}>;
|
|
43
51
|
declare const createArtifactComponent: (db: DatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
tenantId: string;
|
|
53
|
+
projectId: string;
|
|
46
54
|
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string | null;
|
|
47
57
|
createdAt: string;
|
|
48
58
|
updatedAt: string;
|
|
49
|
-
tenantId: string;
|
|
50
|
-
projectId: string;
|
|
51
59
|
props: Record<string, unknown> | null;
|
|
60
|
+
render: {
|
|
61
|
+
component: string;
|
|
62
|
+
mockData: Record<string, unknown>;
|
|
63
|
+
} | null;
|
|
52
64
|
}>;
|
|
53
65
|
declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
|
|
54
66
|
scopes: ProjectScopeConfig;
|
|
@@ -58,6 +70,10 @@ declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
|
|
|
58
70
|
createdAt: string;
|
|
59
71
|
updatedAt: string;
|
|
60
72
|
props: Record<string, unknown> | null;
|
|
73
|
+
render: {
|
|
74
|
+
component: string;
|
|
75
|
+
mockData: Record<string, unknown>;
|
|
76
|
+
} | null;
|
|
61
77
|
name: string;
|
|
62
78
|
description: string | null;
|
|
63
79
|
projectId: string;
|
|
@@ -77,6 +93,10 @@ declare const getArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
|
|
|
77
93
|
name: string;
|
|
78
94
|
description: string | null;
|
|
79
95
|
props: Record<string, unknown> | null;
|
|
96
|
+
render: {
|
|
97
|
+
component: string;
|
|
98
|
+
mockData: Record<string, unknown>;
|
|
99
|
+
} | null;
|
|
80
100
|
createdAt: string;
|
|
81
101
|
updatedAt: string;
|
|
82
102
|
}[]>;
|
|
@@ -84,12 +104,12 @@ declare const associateArtifactComponentWithAgent: (db: DatabaseClient) => (para
|
|
|
84
104
|
scopes: SubAgentScopeConfig;
|
|
85
105
|
artifactComponentId: string;
|
|
86
106
|
}) => Promise<{
|
|
87
|
-
subAgentId: string;
|
|
88
|
-
id: string;
|
|
89
|
-
createdAt: string;
|
|
90
107
|
tenantId: string;
|
|
91
108
|
projectId: string;
|
|
109
|
+
id: string;
|
|
92
110
|
agentId: string;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
subAgentId: string;
|
|
93
113
|
artifactComponentId: string;
|
|
94
114
|
}>;
|
|
95
115
|
declare const removeArtifactComponentFromAgent: (db: DatabaseClient) => (params: {
|
|
@@ -127,12 +147,12 @@ declare const upsertAgentArtifactComponentRelation: (db: DatabaseClient) => (par
|
|
|
127
147
|
scopes: SubAgentScopeConfig;
|
|
128
148
|
artifactComponentId: string;
|
|
129
149
|
}) => Promise<{
|
|
130
|
-
subAgentId: string;
|
|
131
|
-
id: string;
|
|
132
|
-
createdAt: string;
|
|
133
150
|
tenantId: string;
|
|
134
151
|
projectId: string;
|
|
152
|
+
id: string;
|
|
135
153
|
agentId: string;
|
|
154
|
+
createdAt: string;
|
|
155
|
+
subAgentId: string;
|
|
136
156
|
artifactComponentId: string;
|
|
137
157
|
} | null>;
|
|
138
158
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { artifactComponents, subAgentArtifactComponents, subAgentRelations, subAgents } from "../db/schema.js";
|
|
2
2
|
import { validatePropsAsJsonSchema } from "../validation/props-validation.js";
|
|
3
3
|
import { generateId } from "../utils/conversations.js";
|
|
4
|
+
import { validateRender } from "../validation/render-validation.js";
|
|
4
5
|
import { and, count, desc, eq } from "drizzle-orm";
|
|
5
6
|
|
|
6
7
|
//#region src/data-access/artifactComponents.ts
|
|
@@ -36,6 +37,15 @@ const createArtifactComponent = (db) => async (params) => {
|
|
|
36
37
|
throw new Error(`Invalid props schema: ${errorMessages}`);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
if (params.render !== void 0 && params.render !== null) {
|
|
41
|
+
if (typeof params.render === "object" && params.render !== null && "component" in params.render && "mockData" in params.render) {
|
|
42
|
+
const renderValidation = validateRender(params.render);
|
|
43
|
+
if (!renderValidation.isValid) {
|
|
44
|
+
const errorMessages = renderValidation.errors.map((e) => `${e.field}: ${e.message}`).join(", ");
|
|
45
|
+
throw new Error(`Invalid render: ${errorMessages}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
39
49
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
40
50
|
const [artifactComponent] = await db.insert(artifactComponents).values({
|
|
41
51
|
...params,
|
|
@@ -52,6 +62,15 @@ const updateArtifactComponent = (db) => async (params) => {
|
|
|
52
62
|
throw new Error(`Invalid props schema: ${errorMessages}`);
|
|
53
63
|
}
|
|
54
64
|
}
|
|
65
|
+
if (params.data.render !== void 0 && params.data.render !== null) {
|
|
66
|
+
if (typeof params.data.render === "object" && params.data.render !== null && "component" in params.data.render && "mockData" in params.data.render) {
|
|
67
|
+
const renderValidation = validateRender(params.data.render);
|
|
68
|
+
if (!renderValidation.isValid) {
|
|
69
|
+
const errorMessages = renderValidation.errors.map((e) => `${e.field}: ${e.message}`).join(", ");
|
|
70
|
+
throw new Error(`Invalid render: ${errorMessages}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
55
74
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
56
75
|
const [updated] = await db.update(artifactComponents).set({
|
|
57
76
|
...params.data,
|
|
@@ -75,6 +94,7 @@ const getArtifactComponentsForAgent = (db) => async (params) => {
|
|
|
75
94
|
name: artifactComponents.name,
|
|
76
95
|
description: artifactComponents.description,
|
|
77
96
|
props: artifactComponents.props,
|
|
97
|
+
render: artifactComponents.render,
|
|
78
98
|
createdAt: artifactComponents.createdAt,
|
|
79
99
|
updatedAt: artifactComponents.updatedAt
|
|
80
100
|
}).from(artifactComponents).innerJoin(subAgentArtifactComponents, eq(artifactComponents.id, subAgentArtifactComponents.artifactComponentId)).where(and(eq(artifactComponents.tenantId, params.scopes.tenantId), eq(artifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(artifactComponents.createdAt));
|
|
@@ -148,7 +168,8 @@ const upsertArtifactComponent = (db) => async (params) => {
|
|
|
148
168
|
data: {
|
|
149
169
|
name: params.data.name,
|
|
150
170
|
description: params.data.description,
|
|
151
|
-
props: params.data.props
|
|
171
|
+
props: params.data.props,
|
|
172
|
+
render: params.data.render
|
|
152
173
|
}
|
|
153
174
|
});
|
|
154
175
|
return await createArtifactComponent(db)(params.data);
|
|
@@ -8,26 +8,26 @@ declare const getContextConfigById: (db: DatabaseClient) => (params: {
|
|
|
8
8
|
scopes: AgentScopeConfig;
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
+
tenantId: string;
|
|
12
|
+
projectId: string;
|
|
11
13
|
id: string;
|
|
14
|
+
agentId: string;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
17
|
headersSchema: unknown;
|
|
17
18
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
18
|
-
agentId: string;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: DatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
22
22
|
}) => Promise<{
|
|
23
|
+
tenantId: string;
|
|
24
|
+
projectId: string;
|
|
23
25
|
id: string;
|
|
26
|
+
agentId: string;
|
|
24
27
|
createdAt: string;
|
|
25
28
|
updatedAt: string;
|
|
26
|
-
tenantId: string;
|
|
27
|
-
projectId: string;
|
|
28
29
|
headersSchema: unknown;
|
|
29
30
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
30
|
-
agentId: string;
|
|
31
31
|
}[]>;
|
|
32
32
|
declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
|
|
33
33
|
scopes: AgentScopeConfig;
|
|
@@ -42,14 +42,14 @@ declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
|
|
|
42
42
|
};
|
|
43
43
|
}>;
|
|
44
44
|
declare const createContextConfig: (db: DatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
45
|
+
tenantId: string;
|
|
46
|
+
projectId: string;
|
|
45
47
|
id: string;
|
|
48
|
+
agentId: string;
|
|
46
49
|
createdAt: string;
|
|
47
50
|
updatedAt: string;
|
|
48
|
-
tenantId: string;
|
|
49
|
-
projectId: string;
|
|
50
51
|
headersSchema: unknown;
|
|
51
52
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
52
|
-
agentId: string;
|
|
53
53
|
}>;
|
|
54
54
|
declare const updateContextConfig: (db: DatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -82,14 +82,14 @@ declare const countContextConfigs: (db: DatabaseClient) => (params: {
|
|
|
82
82
|
declare const upsertContextConfig: (db: DatabaseClient) => (params: {
|
|
83
83
|
data: ContextConfigInsert;
|
|
84
84
|
}) => Promise<{
|
|
85
|
+
tenantId: string;
|
|
86
|
+
projectId: string;
|
|
85
87
|
id: string;
|
|
88
|
+
agentId: string;
|
|
86
89
|
createdAt: string;
|
|
87
90
|
updatedAt: string;
|
|
88
|
-
tenantId: string;
|
|
89
|
-
projectId: string;
|
|
90
91
|
headersSchema: unknown;
|
|
91
92
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
92
|
-
agentId: string;
|
|
93
93
|
}>;
|
|
94
94
|
//#endregion
|
|
95
95
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|
|
@@ -14,14 +14,14 @@ declare const listConversations: (db: DatabaseClient) => (params: {
|
|
|
14
14
|
total: number;
|
|
15
15
|
}>;
|
|
16
16
|
declare const createConversation: (db: DatabaseClient) => (params: ConversationInsert) => Promise<{
|
|
17
|
-
|
|
17
|
+
tenantId: string;
|
|
18
|
+
projectId: string;
|
|
18
19
|
id: string;
|
|
20
|
+
title: string | null;
|
|
19
21
|
createdAt: string;
|
|
20
22
|
updatedAt: string;
|
|
21
23
|
userId: string | null;
|
|
22
24
|
metadata: ConversationMetadata | null;
|
|
23
|
-
tenantId: string;
|
|
24
|
-
projectId: string;
|
|
25
25
|
activeSubAgentId: string;
|
|
26
26
|
lastContextResolution: string | null;
|
|
27
27
|
}>;
|
|
@@ -65,14 +65,14 @@ declare const getConversation: (db: DatabaseClient) => (params: {
|
|
|
65
65
|
scopes: ProjectScopeConfig;
|
|
66
66
|
conversationId: string;
|
|
67
67
|
}) => Promise<{
|
|
68
|
-
|
|
68
|
+
tenantId: string;
|
|
69
|
+
projectId: string;
|
|
69
70
|
id: string;
|
|
71
|
+
title: string | null;
|
|
70
72
|
createdAt: string;
|
|
71
73
|
updatedAt: string;
|
|
72
74
|
userId: string | null;
|
|
73
75
|
metadata: ConversationMetadata | null;
|
|
74
|
-
tenantId: string;
|
|
75
|
-
projectId: string;
|
|
76
76
|
activeSubAgentId: string;
|
|
77
77
|
lastContextResolution: string | null;
|
|
78
78
|
} | undefined>;
|
|
@@ -89,14 +89,14 @@ declare const createOrGetConversation: (db: DatabaseClient) => (input: Conversat
|
|
|
89
89
|
metadata?: ConversationMetadata | null | undefined;
|
|
90
90
|
contextConfigId?: string | undefined;
|
|
91
91
|
} | {
|
|
92
|
-
|
|
92
|
+
tenantId: string;
|
|
93
|
+
projectId: string;
|
|
93
94
|
id: string;
|
|
95
|
+
title: string | null;
|
|
94
96
|
createdAt: string;
|
|
95
97
|
updatedAt: string;
|
|
96
98
|
userId: string | null;
|
|
97
99
|
metadata: ConversationMetadata | null;
|
|
98
|
-
tenantId: string;
|
|
99
|
-
projectId: string;
|
|
100
100
|
activeSubAgentId: string;
|
|
101
101
|
lastContextResolution: string | null;
|
|
102
102
|
}>;
|
|
@@ -115,14 +115,14 @@ declare const getActiveAgentForConversation: (db: DatabaseClient) => (params: {
|
|
|
115
115
|
scopes: ProjectScopeConfig;
|
|
116
116
|
conversationId: string;
|
|
117
117
|
}) => Promise<{
|
|
118
|
-
|
|
118
|
+
tenantId: string;
|
|
119
|
+
projectId: string;
|
|
119
120
|
id: string;
|
|
121
|
+
title: string | null;
|
|
120
122
|
createdAt: string;
|
|
121
123
|
updatedAt: string;
|
|
122
124
|
userId: string | null;
|
|
123
125
|
metadata: ConversationMetadata | null;
|
|
124
|
-
tenantId: string;
|
|
125
|
-
projectId: string;
|
|
126
126
|
activeSubAgentId: string;
|
|
127
127
|
lastContextResolution: string | null;
|
|
128
128
|
} | undefined>;
|
|
@@ -64,12 +64,12 @@ declare const associateDataComponentWithAgent: (db: DatabaseClient) => (params:
|
|
|
64
64
|
scopes: SubAgentScopeConfig;
|
|
65
65
|
dataComponentId: string;
|
|
66
66
|
}) => Promise<{
|
|
67
|
-
subAgentId: string;
|
|
68
|
-
id: string;
|
|
69
|
-
createdAt: string;
|
|
70
67
|
tenantId: string;
|
|
71
68
|
projectId: string;
|
|
69
|
+
id: string;
|
|
72
70
|
agentId: string;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
subAgentId: string;
|
|
73
73
|
dataComponentId: string;
|
|
74
74
|
}>;
|
|
75
75
|
/**
|
|
@@ -106,12 +106,12 @@ declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params:
|
|
|
106
106
|
scopes: SubAgentScopeConfig;
|
|
107
107
|
dataComponentId: string;
|
|
108
108
|
}) => Promise<{
|
|
109
|
-
subAgentId: string;
|
|
110
|
-
id: string;
|
|
111
|
-
createdAt: string;
|
|
112
109
|
tenantId: string;
|
|
113
110
|
projectId: string;
|
|
111
|
+
id: string;
|
|
114
112
|
agentId: string;
|
|
113
|
+
createdAt: string;
|
|
114
|
+
subAgentId: string;
|
|
115
115
|
dataComponentId: string;
|
|
116
116
|
} | null>;
|
|
117
117
|
/**
|
|
@@ -53,14 +53,14 @@ declare const createFunctionTool: (db: DatabaseClient) => (params: {
|
|
|
53
53
|
data: FunctionToolApiInsert;
|
|
54
54
|
scopes: AgentScopeConfig;
|
|
55
55
|
}) => Promise<{
|
|
56
|
-
description: string | null;
|
|
57
|
-
name: string;
|
|
58
|
-
id: string;
|
|
59
|
-
createdAt: string;
|
|
60
|
-
updatedAt: string;
|
|
61
56
|
tenantId: string;
|
|
62
57
|
projectId: string;
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string | null;
|
|
63
61
|
agentId: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -95,14 +95,14 @@ declare const upsertFunctionTool: (db: DatabaseClient) => (params: {
|
|
|
95
95
|
data: FunctionToolApiInsert;
|
|
96
96
|
scopes: AgentScopeConfig;
|
|
97
97
|
}) => Promise<{
|
|
98
|
-
description: string | null;
|
|
99
|
-
name: string;
|
|
100
|
-
id: string;
|
|
101
|
-
createdAt: string;
|
|
102
|
-
updatedAt: string;
|
|
103
98
|
tenantId: string;
|
|
104
99
|
projectId: string;
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
description: string | null;
|
|
105
103
|
agentId: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
|