weave-typescript 0.42.8 → 0.44.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.
- package/dist/weaveapi/agent/v1/agent.pb.d.ts +225 -0
- package/dist/weaveapi/agent/v1/agent.pb.js +2389 -0
- package/dist/weaveapi/agent/v1/service.pb.d.ts +374 -0
- package/dist/weaveapi/agent/v1/service.pb.js +2939 -0
- package/dist/weaveapi/auth/v1/auth.pb.d.ts +34 -0
- package/dist/weaveapi/auth/v1/auth.pb.js +486 -1
- package/dist/weaveapi/auth/v1/service.pb.d.ts +31 -1
- package/dist/weaveapi/auth/v1/service.pb.js +351 -1
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +369 -0
- package/dist/weaveapi/workflow/v1/service.pb.js +2933 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +297 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.js +3226 -0
- package/dist/weavesql/weavedb/agent_sql.d.ts +541 -0
- package/dist/weavesql/weavedb/agent_sql.js +844 -0
- package/dist/weavesql/weavedb/auth_identity_sql.d.ts +81 -0
- package/dist/weavesql/weavedb/auth_identity_sql.js +181 -2
- package/dist/weavesql/weavedb/workflow_sql.d.ts +567 -86
- package/dist/weavesql/weavedb/workflow_sql.js +906 -178
- package/package.json +1 -1
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const createAgentTemplateQuery = "-- name: CreateAgentTemplate :one\nINSERT INTO weave.agent_templates (\n id,\n organization_id,\n slug,\n name,\n description,\n status,\n created_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7\n)\nRETURNING id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at";
|
|
6
|
+
export interface CreateAgentTemplateArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
organizationId: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
status: string;
|
|
13
|
+
createdByUserId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateAgentTemplateRow {
|
|
16
|
+
id: string;
|
|
17
|
+
organizationId: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
status: string;
|
|
22
|
+
createdByUserId: string;
|
|
23
|
+
draftRevision: number;
|
|
24
|
+
latestVersionId: string | null;
|
|
25
|
+
latestVersion: number;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
}
|
|
29
|
+
export declare function createAgentTemplate(client: Client, args: CreateAgentTemplateArgs): Promise<CreateAgentTemplateRow | null>;
|
|
30
|
+
export declare const createAgentTemplateDraftQuery = "-- name: CreateAgentTemplateDraft :one\nINSERT INTO weave.agent_template_drafts (\n id,\n template_id,\n organization_id,\n base_version_id,\n revision,\n name,\n description,\n instructions,\n model_id,\n provider_configuration_id,\n tool_descriptors,\n input_schema,\n output_schema,\n metadata,\n updated_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4::uuid,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10::uuid,\n $11,\n $12,\n $13,\n $14,\n $15\n)\nRETURNING id, template_id, organization_id, base_version_id, revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at";
|
|
31
|
+
export interface CreateAgentTemplateDraftArgs {
|
|
32
|
+
id: string;
|
|
33
|
+
templateId: string;
|
|
34
|
+
organizationId: string;
|
|
35
|
+
baseVersionId: string | null;
|
|
36
|
+
revision: number;
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
instructions: string;
|
|
40
|
+
modelId: string;
|
|
41
|
+
providerConfigurationId: string | null;
|
|
42
|
+
toolDescriptors: any;
|
|
43
|
+
inputSchema: any;
|
|
44
|
+
outputSchema: any;
|
|
45
|
+
metadata: any;
|
|
46
|
+
updatedByUserId: string;
|
|
47
|
+
}
|
|
48
|
+
export interface CreateAgentTemplateDraftRow {
|
|
49
|
+
id: string;
|
|
50
|
+
templateId: string;
|
|
51
|
+
organizationId: string;
|
|
52
|
+
baseVersionId: string | null;
|
|
53
|
+
revision: number;
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
instructions: string;
|
|
57
|
+
modelId: string;
|
|
58
|
+
providerConfigurationId: string | null;
|
|
59
|
+
toolDescriptors: any;
|
|
60
|
+
inputSchema: any;
|
|
61
|
+
outputSchema: any;
|
|
62
|
+
metadata: any;
|
|
63
|
+
updatedByUserId: string;
|
|
64
|
+
createdAt: Date;
|
|
65
|
+
updatedAt: Date;
|
|
66
|
+
}
|
|
67
|
+
export declare function createAgentTemplateDraft(client: Client, args: CreateAgentTemplateDraftArgs): Promise<CreateAgentTemplateDraftRow | null>;
|
|
68
|
+
export declare const getAgentTemplateByIDQuery = "-- name: GetAgentTemplateByID :one\nSELECT id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at FROM weave.agent_templates\nWHERE organization_id = $1\n AND id = $2";
|
|
69
|
+
export interface GetAgentTemplateByIDArgs {
|
|
70
|
+
organizationId: string;
|
|
71
|
+
templateId: string;
|
|
72
|
+
}
|
|
73
|
+
export interface GetAgentTemplateByIDRow {
|
|
74
|
+
id: string;
|
|
75
|
+
organizationId: string;
|
|
76
|
+
slug: string;
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
status: string;
|
|
80
|
+
createdByUserId: string;
|
|
81
|
+
draftRevision: number;
|
|
82
|
+
latestVersionId: string | null;
|
|
83
|
+
latestVersion: number;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
}
|
|
87
|
+
export declare function getAgentTemplateByID(client: Client, args: GetAgentTemplateByIDArgs): Promise<GetAgentTemplateByIDRow | null>;
|
|
88
|
+
export declare const getAgentTemplateBySlugQuery = "-- name: GetAgentTemplateBySlug :one\nSELECT id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at FROM weave.agent_templates\nWHERE organization_id = $1\n AND slug = $2";
|
|
89
|
+
export interface GetAgentTemplateBySlugArgs {
|
|
90
|
+
organizationId: string;
|
|
91
|
+
slug: string;
|
|
92
|
+
}
|
|
93
|
+
export interface GetAgentTemplateBySlugRow {
|
|
94
|
+
id: string;
|
|
95
|
+
organizationId: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
name: string;
|
|
98
|
+
description: string;
|
|
99
|
+
status: string;
|
|
100
|
+
createdByUserId: string;
|
|
101
|
+
draftRevision: number;
|
|
102
|
+
latestVersionId: string | null;
|
|
103
|
+
latestVersion: number;
|
|
104
|
+
createdAt: Date;
|
|
105
|
+
updatedAt: Date;
|
|
106
|
+
}
|
|
107
|
+
export declare function getAgentTemplateBySlug(client: Client, args: GetAgentTemplateBySlugArgs): Promise<GetAgentTemplateBySlugRow | null>;
|
|
108
|
+
export declare const getAgentTemplateDraftQuery = "-- name: GetAgentTemplateDraft :one\nSELECT id, template_id, organization_id, base_version_id, revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at FROM weave.agent_template_drafts\nWHERE organization_id = $1\n AND template_id = $2";
|
|
109
|
+
export interface GetAgentTemplateDraftArgs {
|
|
110
|
+
organizationId: string;
|
|
111
|
+
templateId: string;
|
|
112
|
+
}
|
|
113
|
+
export interface GetAgentTemplateDraftRow {
|
|
114
|
+
id: string;
|
|
115
|
+
templateId: string;
|
|
116
|
+
organizationId: string;
|
|
117
|
+
baseVersionId: string | null;
|
|
118
|
+
revision: number;
|
|
119
|
+
name: string;
|
|
120
|
+
description: string;
|
|
121
|
+
instructions: string;
|
|
122
|
+
modelId: string;
|
|
123
|
+
providerConfigurationId: string | null;
|
|
124
|
+
toolDescriptors: any;
|
|
125
|
+
inputSchema: any;
|
|
126
|
+
outputSchema: any;
|
|
127
|
+
metadata: any;
|
|
128
|
+
updatedByUserId: string;
|
|
129
|
+
createdAt: Date;
|
|
130
|
+
updatedAt: Date;
|
|
131
|
+
}
|
|
132
|
+
export declare function getAgentTemplateDraft(client: Client, args: GetAgentTemplateDraftArgs): Promise<GetAgentTemplateDraftRow | null>;
|
|
133
|
+
export declare const listAgentTemplatesQuery = "-- name: ListAgentTemplates :many\nSELECT id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at FROM weave.agent_templates\nWHERE organization_id = $1\n AND (\n $2::text IS NULL\n OR status = $2::text\n )\nORDER BY updated_at DESC, created_at DESC\nLIMIT $4 OFFSET $3";
|
|
134
|
+
export interface ListAgentTemplatesArgs {
|
|
135
|
+
organizationId: string;
|
|
136
|
+
status: string | null;
|
|
137
|
+
pageOffset: string;
|
|
138
|
+
pageSize: string;
|
|
139
|
+
}
|
|
140
|
+
export interface ListAgentTemplatesRow {
|
|
141
|
+
id: string;
|
|
142
|
+
organizationId: string;
|
|
143
|
+
slug: string;
|
|
144
|
+
name: string;
|
|
145
|
+
description: string;
|
|
146
|
+
status: string;
|
|
147
|
+
createdByUserId: string;
|
|
148
|
+
draftRevision: number;
|
|
149
|
+
latestVersionId: string | null;
|
|
150
|
+
latestVersion: number;
|
|
151
|
+
createdAt: Date;
|
|
152
|
+
updatedAt: Date;
|
|
153
|
+
}
|
|
154
|
+
export declare function listAgentTemplates(client: Client, args: ListAgentTemplatesArgs): Promise<ListAgentTemplatesRow[]>;
|
|
155
|
+
export declare const updateAgentTemplateDraftMetadataQuery = "-- name: UpdateAgentTemplateDraftMetadata :one\nUPDATE weave.agent_templates\nSET\n name = $1,\n description = $2,\n draft_revision = $3,\n updated_at = now()\nWHERE organization_id = $4\n AND id = $5\nRETURNING id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at";
|
|
156
|
+
export interface UpdateAgentTemplateDraftMetadataArgs {
|
|
157
|
+
name: string;
|
|
158
|
+
description: string;
|
|
159
|
+
draftRevision: number;
|
|
160
|
+
organizationId: string;
|
|
161
|
+
templateId: string;
|
|
162
|
+
}
|
|
163
|
+
export interface UpdateAgentTemplateDraftMetadataRow {
|
|
164
|
+
id: string;
|
|
165
|
+
organizationId: string;
|
|
166
|
+
slug: string;
|
|
167
|
+
name: string;
|
|
168
|
+
description: string;
|
|
169
|
+
status: string;
|
|
170
|
+
createdByUserId: string;
|
|
171
|
+
draftRevision: number;
|
|
172
|
+
latestVersionId: string | null;
|
|
173
|
+
latestVersion: number;
|
|
174
|
+
createdAt: Date;
|
|
175
|
+
updatedAt: Date;
|
|
176
|
+
}
|
|
177
|
+
export declare function updateAgentTemplateDraftMetadata(client: Client, args: UpdateAgentTemplateDraftMetadataArgs): Promise<UpdateAgentTemplateDraftMetadataRow | null>;
|
|
178
|
+
export declare const updateAgentTemplateStatusQuery = "-- name: UpdateAgentTemplateStatus :one\nUPDATE weave.agent_templates\nSET\n status = $1,\n updated_at = now()\nWHERE organization_id = $2\n AND id = $3\nRETURNING id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at";
|
|
179
|
+
export interface UpdateAgentTemplateStatusArgs {
|
|
180
|
+
status: string;
|
|
181
|
+
organizationId: string;
|
|
182
|
+
templateId: string;
|
|
183
|
+
}
|
|
184
|
+
export interface UpdateAgentTemplateStatusRow {
|
|
185
|
+
id: string;
|
|
186
|
+
organizationId: string;
|
|
187
|
+
slug: string;
|
|
188
|
+
name: string;
|
|
189
|
+
description: string;
|
|
190
|
+
status: string;
|
|
191
|
+
createdByUserId: string;
|
|
192
|
+
draftRevision: number;
|
|
193
|
+
latestVersionId: string | null;
|
|
194
|
+
latestVersion: number;
|
|
195
|
+
createdAt: Date;
|
|
196
|
+
updatedAt: Date;
|
|
197
|
+
}
|
|
198
|
+
export declare function updateAgentTemplateStatus(client: Client, args: UpdateAgentTemplateStatusArgs): Promise<UpdateAgentTemplateStatusRow | null>;
|
|
199
|
+
export declare const updateAgentDraftQuery = "-- name: UpdateAgentDraft :one\nUPDATE weave.agent_template_drafts\nSET\n base_version_id = $1::uuid,\n revision = revision + 1,\n name = $2,\n description = $3,\n instructions = $4,\n model_id = $5,\n provider_configuration_id = $6::uuid,\n tool_descriptors = $7,\n input_schema = $8,\n output_schema = $9,\n metadata = $10,\n updated_by_user_id = $11,\n updated_at = now()\nWHERE organization_id = $12\n AND template_id = $13\n AND revision = $14\nRETURNING id, template_id, organization_id, base_version_id, revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at";
|
|
200
|
+
export interface UpdateAgentDraftArgs {
|
|
201
|
+
baseVersionId: string | null;
|
|
202
|
+
name: string;
|
|
203
|
+
description: string;
|
|
204
|
+
instructions: string;
|
|
205
|
+
modelId: string;
|
|
206
|
+
providerConfigurationId: string | null;
|
|
207
|
+
toolDescriptors: any;
|
|
208
|
+
inputSchema: any;
|
|
209
|
+
outputSchema: any;
|
|
210
|
+
metadata: any;
|
|
211
|
+
updatedByUserId: string;
|
|
212
|
+
organizationId: string;
|
|
213
|
+
templateId: string;
|
|
214
|
+
expectedRevision: number;
|
|
215
|
+
}
|
|
216
|
+
export interface UpdateAgentDraftRow {
|
|
217
|
+
id: string;
|
|
218
|
+
templateId: string;
|
|
219
|
+
organizationId: string;
|
|
220
|
+
baseVersionId: string | null;
|
|
221
|
+
revision: number;
|
|
222
|
+
name: string;
|
|
223
|
+
description: string;
|
|
224
|
+
instructions: string;
|
|
225
|
+
modelId: string;
|
|
226
|
+
providerConfigurationId: string | null;
|
|
227
|
+
toolDescriptors: any;
|
|
228
|
+
inputSchema: any;
|
|
229
|
+
outputSchema: any;
|
|
230
|
+
metadata: any;
|
|
231
|
+
updatedByUserId: string;
|
|
232
|
+
createdAt: Date;
|
|
233
|
+
updatedAt: Date;
|
|
234
|
+
}
|
|
235
|
+
export declare function updateAgentDraft(client: Client, args: UpdateAgentDraftArgs): Promise<UpdateAgentDraftRow | null>;
|
|
236
|
+
export declare const insertAgentDraftPatchQuery = "-- name: InsertAgentDraftPatch :one\nINSERT INTO weave.agent_template_draft_patches (\n id,\n template_id,\n organization_id,\n revision,\n patch,\n created_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6\n)\nRETURNING id, template_id, organization_id, revision, patch, created_by_user_id, created_at";
|
|
237
|
+
export interface InsertAgentDraftPatchArgs {
|
|
238
|
+
id: string;
|
|
239
|
+
templateId: string;
|
|
240
|
+
organizationId: string;
|
|
241
|
+
revision: number;
|
|
242
|
+
patch: any;
|
|
243
|
+
createdByUserId: string;
|
|
244
|
+
}
|
|
245
|
+
export interface InsertAgentDraftPatchRow {
|
|
246
|
+
id: string;
|
|
247
|
+
templateId: string;
|
|
248
|
+
organizationId: string;
|
|
249
|
+
revision: number;
|
|
250
|
+
patch: any;
|
|
251
|
+
createdByUserId: string;
|
|
252
|
+
createdAt: Date;
|
|
253
|
+
}
|
|
254
|
+
export declare function insertAgentDraftPatch(client: Client, args: InsertAgentDraftPatchArgs): Promise<InsertAgentDraftPatchRow | null>;
|
|
255
|
+
export declare const insertAgentTemplateVersionQuery = "-- name: InsertAgentTemplateVersion :one\nINSERT INTO weave.agent_template_versions (\n id,\n template_id,\n organization_id,\n version,\n source_draft_revision,\n name,\n description,\n instructions,\n model_id,\n provider_configuration_id,\n tool_descriptors,\n input_schema,\n output_schema,\n metadata,\n published_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10::uuid,\n $11,\n $12,\n $13,\n $14,\n $15\n)\nRETURNING id, template_id, organization_id, version, source_draft_revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, published_by_user_id, published_at";
|
|
256
|
+
export interface InsertAgentTemplateVersionArgs {
|
|
257
|
+
id: string;
|
|
258
|
+
templateId: string;
|
|
259
|
+
organizationId: string;
|
|
260
|
+
version: number;
|
|
261
|
+
sourceDraftRevision: number;
|
|
262
|
+
name: string;
|
|
263
|
+
description: string;
|
|
264
|
+
instructions: string;
|
|
265
|
+
modelId: string;
|
|
266
|
+
providerConfigurationId: string | null;
|
|
267
|
+
toolDescriptors: any;
|
|
268
|
+
inputSchema: any;
|
|
269
|
+
outputSchema: any;
|
|
270
|
+
metadata: any;
|
|
271
|
+
publishedByUserId: string;
|
|
272
|
+
}
|
|
273
|
+
export interface InsertAgentTemplateVersionRow {
|
|
274
|
+
id: string;
|
|
275
|
+
templateId: string;
|
|
276
|
+
organizationId: string;
|
|
277
|
+
version: number;
|
|
278
|
+
sourceDraftRevision: number;
|
|
279
|
+
name: string;
|
|
280
|
+
description: string;
|
|
281
|
+
instructions: string;
|
|
282
|
+
modelId: string;
|
|
283
|
+
providerConfigurationId: string | null;
|
|
284
|
+
toolDescriptors: any;
|
|
285
|
+
inputSchema: any;
|
|
286
|
+
outputSchema: any;
|
|
287
|
+
metadata: any;
|
|
288
|
+
publishedByUserId: string;
|
|
289
|
+
publishedAt: Date;
|
|
290
|
+
}
|
|
291
|
+
export declare function insertAgentTemplateVersion(client: Client, args: InsertAgentTemplateVersionArgs): Promise<InsertAgentTemplateVersionRow | null>;
|
|
292
|
+
export declare const setAgentTemplateLatestVersionQuery = "-- name: SetAgentTemplateLatestVersion :one\nUPDATE weave.agent_templates\nSET\n latest_version_id = $1,\n latest_version = $2,\n updated_at = now()\nWHERE organization_id = $3\n AND id = $4\nRETURNING id, organization_id, slug, name, description, status, created_by_user_id, draft_revision, latest_version_id, latest_version, created_at, updated_at";
|
|
293
|
+
export interface SetAgentTemplateLatestVersionArgs {
|
|
294
|
+
versionId: string | null;
|
|
295
|
+
version: number;
|
|
296
|
+
organizationId: string;
|
|
297
|
+
templateId: string;
|
|
298
|
+
}
|
|
299
|
+
export interface SetAgentTemplateLatestVersionRow {
|
|
300
|
+
id: string;
|
|
301
|
+
organizationId: string;
|
|
302
|
+
slug: string;
|
|
303
|
+
name: string;
|
|
304
|
+
description: string;
|
|
305
|
+
status: string;
|
|
306
|
+
createdByUserId: string;
|
|
307
|
+
draftRevision: number;
|
|
308
|
+
latestVersionId: string | null;
|
|
309
|
+
latestVersion: number;
|
|
310
|
+
createdAt: Date;
|
|
311
|
+
updatedAt: Date;
|
|
312
|
+
}
|
|
313
|
+
export declare function setAgentTemplateLatestVersion(client: Client, args: SetAgentTemplateLatestVersionArgs): Promise<SetAgentTemplateLatestVersionRow | null>;
|
|
314
|
+
export declare const getAgentTemplateVersionByNumberQuery = "-- name: GetAgentTemplateVersionByNumber :one\nSELECT id, template_id, organization_id, version, source_draft_revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, published_by_user_id, published_at FROM weave.agent_template_versions\nWHERE organization_id = $1\n AND template_id = $2\n AND version = $3";
|
|
315
|
+
export interface GetAgentTemplateVersionByNumberArgs {
|
|
316
|
+
organizationId: string;
|
|
317
|
+
templateId: string;
|
|
318
|
+
version: number;
|
|
319
|
+
}
|
|
320
|
+
export interface GetAgentTemplateVersionByNumberRow {
|
|
321
|
+
id: string;
|
|
322
|
+
templateId: string;
|
|
323
|
+
organizationId: string;
|
|
324
|
+
version: number;
|
|
325
|
+
sourceDraftRevision: number;
|
|
326
|
+
name: string;
|
|
327
|
+
description: string;
|
|
328
|
+
instructions: string;
|
|
329
|
+
modelId: string;
|
|
330
|
+
providerConfigurationId: string | null;
|
|
331
|
+
toolDescriptors: any;
|
|
332
|
+
inputSchema: any;
|
|
333
|
+
outputSchema: any;
|
|
334
|
+
metadata: any;
|
|
335
|
+
publishedByUserId: string;
|
|
336
|
+
publishedAt: Date;
|
|
337
|
+
}
|
|
338
|
+
export declare function getAgentTemplateVersionByNumber(client: Client, args: GetAgentTemplateVersionByNumberArgs): Promise<GetAgentTemplateVersionByNumberRow | null>;
|
|
339
|
+
export declare const getAgentTemplateVersionByIDQuery = "-- name: GetAgentTemplateVersionByID :one\nSELECT id, template_id, organization_id, version, source_draft_revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, published_by_user_id, published_at FROM weave.agent_template_versions\nWHERE organization_id = $1\n AND id = $2";
|
|
340
|
+
export interface GetAgentTemplateVersionByIDArgs {
|
|
341
|
+
organizationId: string;
|
|
342
|
+
versionId: string;
|
|
343
|
+
}
|
|
344
|
+
export interface GetAgentTemplateVersionByIDRow {
|
|
345
|
+
id: string;
|
|
346
|
+
templateId: string;
|
|
347
|
+
organizationId: string;
|
|
348
|
+
version: number;
|
|
349
|
+
sourceDraftRevision: number;
|
|
350
|
+
name: string;
|
|
351
|
+
description: string;
|
|
352
|
+
instructions: string;
|
|
353
|
+
modelId: string;
|
|
354
|
+
providerConfigurationId: string | null;
|
|
355
|
+
toolDescriptors: any;
|
|
356
|
+
inputSchema: any;
|
|
357
|
+
outputSchema: any;
|
|
358
|
+
metadata: any;
|
|
359
|
+
publishedByUserId: string;
|
|
360
|
+
publishedAt: Date;
|
|
361
|
+
}
|
|
362
|
+
export declare function getAgentTemplateVersionByID(client: Client, args: GetAgentTemplateVersionByIDArgs): Promise<GetAgentTemplateVersionByIDRow | null>;
|
|
363
|
+
export declare const listAgentTemplateVersionsQuery = "-- name: ListAgentTemplateVersions :many\nSELECT id, template_id, organization_id, version, source_draft_revision, name, description, instructions, model_id, provider_configuration_id, tool_descriptors, input_schema, output_schema, metadata, published_by_user_id, published_at FROM weave.agent_template_versions\nWHERE organization_id = $1\n AND template_id = $2\nORDER BY version DESC\nLIMIT $4 OFFSET $3";
|
|
364
|
+
export interface ListAgentTemplateVersionsArgs {
|
|
365
|
+
organizationId: string;
|
|
366
|
+
templateId: string;
|
|
367
|
+
pageOffset: string;
|
|
368
|
+
pageSize: string;
|
|
369
|
+
}
|
|
370
|
+
export interface ListAgentTemplateVersionsRow {
|
|
371
|
+
id: string;
|
|
372
|
+
templateId: string;
|
|
373
|
+
organizationId: string;
|
|
374
|
+
version: number;
|
|
375
|
+
sourceDraftRevision: number;
|
|
376
|
+
name: string;
|
|
377
|
+
description: string;
|
|
378
|
+
instructions: string;
|
|
379
|
+
modelId: string;
|
|
380
|
+
providerConfigurationId: string | null;
|
|
381
|
+
toolDescriptors: any;
|
|
382
|
+
inputSchema: any;
|
|
383
|
+
outputSchema: any;
|
|
384
|
+
metadata: any;
|
|
385
|
+
publishedByUserId: string;
|
|
386
|
+
publishedAt: Date;
|
|
387
|
+
}
|
|
388
|
+
export declare function listAgentTemplateVersions(client: Client, args: ListAgentTemplateVersionsArgs): Promise<ListAgentTemplateVersionsRow[]>;
|
|
389
|
+
export declare const createAgentRunQuery = "-- name: CreateAgentRun :one\nINSERT INTO weave.agent_runs (\n id,\n organization_id,\n agent_template_id,\n agent_version_id,\n status,\n created_by_user_id,\n chat_session_id,\n workflow_run_id,\n workflow_step_run_id,\n input\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7::uuid,\n $8::uuid,\n $9::uuid,\n $10\n)\nRETURNING id, organization_id, agent_template_id, agent_version_id, status, created_by_user_id, chat_session_id, workflow_run_id, workflow_step_run_id, input, output, error_code, safe_error_message, created_at, started_at, finished_at";
|
|
390
|
+
export interface CreateAgentRunArgs {
|
|
391
|
+
id: string;
|
|
392
|
+
organizationId: string;
|
|
393
|
+
agentTemplateId: string;
|
|
394
|
+
agentVersionId: string;
|
|
395
|
+
status: string;
|
|
396
|
+
createdByUserId: string;
|
|
397
|
+
chatSessionId: string | null;
|
|
398
|
+
workflowRunId: string | null;
|
|
399
|
+
workflowStepRunId: string | null;
|
|
400
|
+
input: any;
|
|
401
|
+
}
|
|
402
|
+
export interface CreateAgentRunRow {
|
|
403
|
+
id: string;
|
|
404
|
+
organizationId: string;
|
|
405
|
+
agentTemplateId: string;
|
|
406
|
+
agentVersionId: string;
|
|
407
|
+
status: string;
|
|
408
|
+
createdByUserId: string;
|
|
409
|
+
chatSessionId: string | null;
|
|
410
|
+
workflowRunId: string | null;
|
|
411
|
+
workflowStepRunId: string | null;
|
|
412
|
+
input: any;
|
|
413
|
+
output: any;
|
|
414
|
+
errorCode: string;
|
|
415
|
+
safeErrorMessage: string;
|
|
416
|
+
createdAt: Date;
|
|
417
|
+
startedAt: Date | null;
|
|
418
|
+
finishedAt: Date | null;
|
|
419
|
+
}
|
|
420
|
+
export declare function createAgentRun(client: Client, args: CreateAgentRunArgs): Promise<CreateAgentRunRow | null>;
|
|
421
|
+
export declare const getAgentRunQuery = "-- name: GetAgentRun :one\nSELECT id, organization_id, agent_template_id, agent_version_id, status, created_by_user_id, chat_session_id, workflow_run_id, workflow_step_run_id, input, output, error_code, safe_error_message, created_at, started_at, finished_at FROM weave.agent_runs\nWHERE organization_id = $1\n AND id = $2";
|
|
422
|
+
export interface GetAgentRunArgs {
|
|
423
|
+
organizationId: string;
|
|
424
|
+
agentRunId: string;
|
|
425
|
+
}
|
|
426
|
+
export interface GetAgentRunRow {
|
|
427
|
+
id: string;
|
|
428
|
+
organizationId: string;
|
|
429
|
+
agentTemplateId: string;
|
|
430
|
+
agentVersionId: string;
|
|
431
|
+
status: string;
|
|
432
|
+
createdByUserId: string;
|
|
433
|
+
chatSessionId: string | null;
|
|
434
|
+
workflowRunId: string | null;
|
|
435
|
+
workflowStepRunId: string | null;
|
|
436
|
+
input: any;
|
|
437
|
+
output: any;
|
|
438
|
+
errorCode: string;
|
|
439
|
+
safeErrorMessage: string;
|
|
440
|
+
createdAt: Date;
|
|
441
|
+
startedAt: Date | null;
|
|
442
|
+
finishedAt: Date | null;
|
|
443
|
+
}
|
|
444
|
+
export declare function getAgentRun(client: Client, args: GetAgentRunArgs): Promise<GetAgentRunRow | null>;
|
|
445
|
+
export declare const listAgentRunsQuery = "-- name: ListAgentRuns :many\nSELECT id, organization_id, agent_template_id, agent_version_id, status, created_by_user_id, chat_session_id, workflow_run_id, workflow_step_run_id, input, output, error_code, safe_error_message, created_at, started_at, finished_at FROM weave.agent_runs\nWHERE organization_id = $1\n AND (\n $2::uuid IS NULL\n OR agent_template_id = $2::uuid\n )\n AND (\n $3::text IS NULL\n OR status = $3::text\n )\nORDER BY created_at DESC\nLIMIT $5 OFFSET $4";
|
|
446
|
+
export interface ListAgentRunsArgs {
|
|
447
|
+
organizationId: string;
|
|
448
|
+
agentTemplateId: string | null;
|
|
449
|
+
status: string | null;
|
|
450
|
+
pageOffset: string;
|
|
451
|
+
pageSize: string;
|
|
452
|
+
}
|
|
453
|
+
export interface ListAgentRunsRow {
|
|
454
|
+
id: string;
|
|
455
|
+
organizationId: string;
|
|
456
|
+
agentTemplateId: string;
|
|
457
|
+
agentVersionId: string;
|
|
458
|
+
status: string;
|
|
459
|
+
createdByUserId: string;
|
|
460
|
+
chatSessionId: string | null;
|
|
461
|
+
workflowRunId: string | null;
|
|
462
|
+
workflowStepRunId: string | null;
|
|
463
|
+
input: any;
|
|
464
|
+
output: any;
|
|
465
|
+
errorCode: string;
|
|
466
|
+
safeErrorMessage: string;
|
|
467
|
+
createdAt: Date;
|
|
468
|
+
startedAt: Date | null;
|
|
469
|
+
finishedAt: Date | null;
|
|
470
|
+
}
|
|
471
|
+
export declare function listAgentRuns(client: Client, args: ListAgentRunsArgs): Promise<ListAgentRunsRow[]>;
|
|
472
|
+
export declare const updateAgentRunStatusQuery = "-- name: UpdateAgentRunStatus :one\nUPDATE weave.agent_runs\nSET\n status = $1,\n output = $2,\n error_code = $3,\n safe_error_message = $4,\n started_at = COALESCE(started_at, $5::timestamptz),\n finished_at = $6::timestamptz\nWHERE organization_id = $7\n AND id = $8\nRETURNING id, organization_id, agent_template_id, agent_version_id, status, created_by_user_id, chat_session_id, workflow_run_id, workflow_step_run_id, input, output, error_code, safe_error_message, created_at, started_at, finished_at";
|
|
473
|
+
export interface UpdateAgentRunStatusArgs {
|
|
474
|
+
status: string;
|
|
475
|
+
output: any;
|
|
476
|
+
errorCode: string;
|
|
477
|
+
safeErrorMessage: string;
|
|
478
|
+
startedAt: Date | null;
|
|
479
|
+
finishedAt: Date | null;
|
|
480
|
+
organizationId: string;
|
|
481
|
+
agentRunId: string;
|
|
482
|
+
}
|
|
483
|
+
export interface UpdateAgentRunStatusRow {
|
|
484
|
+
id: string;
|
|
485
|
+
organizationId: string;
|
|
486
|
+
agentTemplateId: string;
|
|
487
|
+
agentVersionId: string;
|
|
488
|
+
status: string;
|
|
489
|
+
createdByUserId: string;
|
|
490
|
+
chatSessionId: string | null;
|
|
491
|
+
workflowRunId: string | null;
|
|
492
|
+
workflowStepRunId: string | null;
|
|
493
|
+
input: any;
|
|
494
|
+
output: any;
|
|
495
|
+
errorCode: string;
|
|
496
|
+
safeErrorMessage: string;
|
|
497
|
+
createdAt: Date;
|
|
498
|
+
startedAt: Date | null;
|
|
499
|
+
finishedAt: Date | null;
|
|
500
|
+
}
|
|
501
|
+
export declare function updateAgentRunStatus(client: Client, args: UpdateAgentRunStatusArgs): Promise<UpdateAgentRunStatusRow | null>;
|
|
502
|
+
export declare const insertAgentRunEventQuery = "-- name: InsertAgentRunEvent :one\nINSERT INTO weave.agent_run_events (\n id,\n organization_id,\n agent_run_id,\n sequence,\n kind,\n message,\n payload\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7\n)\nRETURNING id, organization_id, agent_run_id, sequence, kind, message, payload, created_at";
|
|
503
|
+
export interface InsertAgentRunEventArgs {
|
|
504
|
+
id: string;
|
|
505
|
+
organizationId: string;
|
|
506
|
+
agentRunId: string;
|
|
507
|
+
sequence: string;
|
|
508
|
+
kind: string;
|
|
509
|
+
message: string;
|
|
510
|
+
payload: any;
|
|
511
|
+
}
|
|
512
|
+
export interface InsertAgentRunEventRow {
|
|
513
|
+
id: string;
|
|
514
|
+
organizationId: string;
|
|
515
|
+
agentRunId: string;
|
|
516
|
+
sequence: string;
|
|
517
|
+
kind: string;
|
|
518
|
+
message: string;
|
|
519
|
+
payload: any;
|
|
520
|
+
createdAt: Date;
|
|
521
|
+
}
|
|
522
|
+
export declare function insertAgentRunEvent(client: Client, args: InsertAgentRunEventArgs): Promise<InsertAgentRunEventRow | null>;
|
|
523
|
+
export declare const listAgentRunEventsQuery = "-- name: ListAgentRunEvents :many\nSELECT id, organization_id, agent_run_id, sequence, kind, message, payload, created_at FROM weave.agent_run_events\nWHERE organization_id = $1\n AND agent_run_id = $2\n AND sequence > $3\nORDER BY sequence\nLIMIT $4";
|
|
524
|
+
export interface ListAgentRunEventsArgs {
|
|
525
|
+
organizationId: string;
|
|
526
|
+
agentRunId: string;
|
|
527
|
+
afterSequence: string;
|
|
528
|
+
pageSize: string;
|
|
529
|
+
}
|
|
530
|
+
export interface ListAgentRunEventsRow {
|
|
531
|
+
id: string;
|
|
532
|
+
organizationId: string;
|
|
533
|
+
agentRunId: string;
|
|
534
|
+
sequence: string;
|
|
535
|
+
kind: string;
|
|
536
|
+
message: string;
|
|
537
|
+
payload: any;
|
|
538
|
+
createdAt: Date;
|
|
539
|
+
}
|
|
540
|
+
export declare function listAgentRunEvents(client: Client, args: ListAgentRunEventsArgs): Promise<ListAgentRunEventsRow[]>;
|
|
541
|
+
export {};
|