weave-typescript 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.
- package/dist/weaveapi/agent/v1/agent.pb.d.ts +14 -14
- package/dist/weaveapi/agent/v1/agent.pb.js +88 -88
- package/dist/weaveapi/agent/v1/service.pb.d.ts +53 -53
- package/dist/weaveapi/agent/v1/service.pb.js +264 -250
- package/dist/weaveapi/chat/v1/chat.pb.d.ts +3 -3
- package/dist/weaveapi/chat/v1/chat.pb.js +33 -33
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +55 -55
- package/dist/weaveapi/workflow/v1/service.pb.js +282 -268
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +18 -18
- package/dist/weaveapi/workflow/v1/workflow.pb.js +111 -111
- package/dist/weavesql/weavedb/agent_sql.d.ts +83 -83
- package/dist/weavesql/weavedb/agent_sql.js +110 -110
- package/dist/weavesql/weavedb/workflow_sql.d.ts +93 -93
- package/dist/weavesql/weavedb/workflow_sql.js +120 -120
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
|
2
2
|
interface Client {
|
|
3
3
|
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
4
|
}
|
|
5
|
-
export declare const
|
|
6
|
-
export interface
|
|
5
|
+
export declare const createAgentDefinitionQuery = "-- name: CreateAgentDefinition :one\nINSERT INTO weave.agent_definitions (\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 CreateAgentDefinitionArgs {
|
|
7
7
|
id: string;
|
|
8
8
|
organizationId: string;
|
|
9
9
|
slug: string;
|
|
@@ -12,7 +12,7 @@ export interface CreateAgentTemplateArgs {
|
|
|
12
12
|
status: string;
|
|
13
13
|
createdByUserId: string;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface CreateAgentDefinitionRow {
|
|
16
16
|
id: string;
|
|
17
17
|
organizationId: string;
|
|
18
18
|
slug: string;
|
|
@@ -26,11 +26,11 @@ export interface CreateAgentTemplateRow {
|
|
|
26
26
|
createdAt: Date;
|
|
27
27
|
updatedAt: Date;
|
|
28
28
|
}
|
|
29
|
-
export declare function
|
|
30
|
-
export declare const
|
|
31
|
-
export interface
|
|
29
|
+
export declare function createAgentDefinition(client: Client, args: CreateAgentDefinitionArgs): Promise<CreateAgentDefinitionRow | null>;
|
|
30
|
+
export declare const createAgentDefinitionDraftQuery = "-- name: CreateAgentDefinitionDraft :one\nINSERT INTO weave.agent_definition_drafts (\n id,\n definition_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, definition_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 CreateAgentDefinitionDraftArgs {
|
|
32
32
|
id: string;
|
|
33
|
-
|
|
33
|
+
definitionId: string;
|
|
34
34
|
organizationId: string;
|
|
35
35
|
baseVersionId: string | null;
|
|
36
36
|
revision: number;
|
|
@@ -45,9 +45,9 @@ export interface CreateAgentTemplateDraftArgs {
|
|
|
45
45
|
metadata: any;
|
|
46
46
|
updatedByUserId: string;
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface CreateAgentDefinitionDraftRow {
|
|
49
49
|
id: string;
|
|
50
|
-
|
|
50
|
+
definitionId: string;
|
|
51
51
|
organizationId: string;
|
|
52
52
|
baseVersionId: string | null;
|
|
53
53
|
revision: number;
|
|
@@ -64,13 +64,13 @@ export interface CreateAgentTemplateDraftRow {
|
|
|
64
64
|
createdAt: Date;
|
|
65
65
|
updatedAt: Date;
|
|
66
66
|
}
|
|
67
|
-
export declare function
|
|
68
|
-
export declare const
|
|
69
|
-
export interface
|
|
67
|
+
export declare function createAgentDefinitionDraft(client: Client, args: CreateAgentDefinitionDraftArgs): Promise<CreateAgentDefinitionDraftRow | null>;
|
|
68
|
+
export declare const getAgentDefinitionByIDQuery = "-- name: GetAgentDefinitionByID :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_definitions\nWHERE organization_id = $1\n AND id = $2";
|
|
69
|
+
export interface GetAgentDefinitionByIDArgs {
|
|
70
70
|
organizationId: string;
|
|
71
|
-
|
|
71
|
+
definitionId: string;
|
|
72
72
|
}
|
|
73
|
-
export interface
|
|
73
|
+
export interface GetAgentDefinitionByIDRow {
|
|
74
74
|
id: string;
|
|
75
75
|
organizationId: string;
|
|
76
76
|
slug: string;
|
|
@@ -84,13 +84,13 @@ export interface GetAgentTemplateByIDRow {
|
|
|
84
84
|
createdAt: Date;
|
|
85
85
|
updatedAt: Date;
|
|
86
86
|
}
|
|
87
|
-
export declare function
|
|
88
|
-
export declare const
|
|
89
|
-
export interface
|
|
87
|
+
export declare function getAgentDefinitionByID(client: Client, args: GetAgentDefinitionByIDArgs): Promise<GetAgentDefinitionByIDRow | null>;
|
|
88
|
+
export declare const getAgentDefinitionBySlugQuery = "-- name: GetAgentDefinitionBySlug :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_definitions\nWHERE organization_id = $1\n AND slug = $2";
|
|
89
|
+
export interface GetAgentDefinitionBySlugArgs {
|
|
90
90
|
organizationId: string;
|
|
91
91
|
slug: string;
|
|
92
92
|
}
|
|
93
|
-
export interface
|
|
93
|
+
export interface GetAgentDefinitionBySlugRow {
|
|
94
94
|
id: string;
|
|
95
95
|
organizationId: string;
|
|
96
96
|
slug: string;
|
|
@@ -104,15 +104,15 @@ export interface GetAgentTemplateBySlugRow {
|
|
|
104
104
|
createdAt: Date;
|
|
105
105
|
updatedAt: Date;
|
|
106
106
|
}
|
|
107
|
-
export declare function
|
|
108
|
-
export declare const
|
|
109
|
-
export interface
|
|
107
|
+
export declare function getAgentDefinitionBySlug(client: Client, args: GetAgentDefinitionBySlugArgs): Promise<GetAgentDefinitionBySlugRow | null>;
|
|
108
|
+
export declare const getAgentDefinitionDraftQuery = "-- name: GetAgentDefinitionDraft :one\nSELECT id, definition_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_definition_drafts\nWHERE organization_id = $1\n AND definition_id = $2";
|
|
109
|
+
export interface GetAgentDefinitionDraftArgs {
|
|
110
110
|
organizationId: string;
|
|
111
|
-
|
|
111
|
+
definitionId: string;
|
|
112
112
|
}
|
|
113
|
-
export interface
|
|
113
|
+
export interface GetAgentDefinitionDraftRow {
|
|
114
114
|
id: string;
|
|
115
|
-
|
|
115
|
+
definitionId: string;
|
|
116
116
|
organizationId: string;
|
|
117
117
|
baseVersionId: string | null;
|
|
118
118
|
revision: number;
|
|
@@ -129,15 +129,15 @@ export interface GetAgentTemplateDraftRow {
|
|
|
129
129
|
createdAt: Date;
|
|
130
130
|
updatedAt: Date;
|
|
131
131
|
}
|
|
132
|
-
export declare function
|
|
133
|
-
export declare const
|
|
134
|
-
export interface
|
|
132
|
+
export declare function getAgentDefinitionDraft(client: Client, args: GetAgentDefinitionDraftArgs): Promise<GetAgentDefinitionDraftRow | null>;
|
|
133
|
+
export declare const listAgentDefinitionsQuery = "-- name: ListAgentDefinitions :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_definitions\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 ListAgentDefinitionsArgs {
|
|
135
135
|
organizationId: string;
|
|
136
136
|
status: string | null;
|
|
137
137
|
pageOffset: string;
|
|
138
138
|
pageSize: string;
|
|
139
139
|
}
|
|
140
|
-
export interface
|
|
140
|
+
export interface ListAgentDefinitionsRow {
|
|
141
141
|
id: string;
|
|
142
142
|
organizationId: string;
|
|
143
143
|
slug: string;
|
|
@@ -151,16 +151,16 @@ export interface ListAgentTemplatesRow {
|
|
|
151
151
|
createdAt: Date;
|
|
152
152
|
updatedAt: Date;
|
|
153
153
|
}
|
|
154
|
-
export declare function
|
|
155
|
-
export declare const
|
|
156
|
-
export interface
|
|
154
|
+
export declare function listAgentDefinitions(client: Client, args: ListAgentDefinitionsArgs): Promise<ListAgentDefinitionsRow[]>;
|
|
155
|
+
export declare const updateAgentDefinitionDraftMetadataQuery = "-- name: UpdateAgentDefinitionDraftMetadata :one\nUPDATE weave.agent_definitions\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 UpdateAgentDefinitionDraftMetadataArgs {
|
|
157
157
|
name: string;
|
|
158
158
|
description: string;
|
|
159
159
|
draftRevision: number;
|
|
160
160
|
organizationId: string;
|
|
161
|
-
|
|
161
|
+
definitionId: string;
|
|
162
162
|
}
|
|
163
|
-
export interface
|
|
163
|
+
export interface UpdateAgentDefinitionDraftMetadataRow {
|
|
164
164
|
id: string;
|
|
165
165
|
organizationId: string;
|
|
166
166
|
slug: string;
|
|
@@ -174,14 +174,14 @@ export interface UpdateAgentTemplateDraftMetadataRow {
|
|
|
174
174
|
createdAt: Date;
|
|
175
175
|
updatedAt: Date;
|
|
176
176
|
}
|
|
177
|
-
export declare function
|
|
178
|
-
export declare const
|
|
179
|
-
export interface
|
|
177
|
+
export declare function updateAgentDefinitionDraftMetadata(client: Client, args: UpdateAgentDefinitionDraftMetadataArgs): Promise<UpdateAgentDefinitionDraftMetadataRow | null>;
|
|
178
|
+
export declare const updateAgentDefinitionStatusQuery = "-- name: UpdateAgentDefinitionStatus :one\nUPDATE weave.agent_definitions\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 UpdateAgentDefinitionStatusArgs {
|
|
180
180
|
status: string;
|
|
181
181
|
organizationId: string;
|
|
182
|
-
|
|
182
|
+
definitionId: string;
|
|
183
183
|
}
|
|
184
|
-
export interface
|
|
184
|
+
export interface UpdateAgentDefinitionStatusRow {
|
|
185
185
|
id: string;
|
|
186
186
|
organizationId: string;
|
|
187
187
|
slug: string;
|
|
@@ -195,8 +195,8 @@ export interface UpdateAgentTemplateStatusRow {
|
|
|
195
195
|
createdAt: Date;
|
|
196
196
|
updatedAt: Date;
|
|
197
197
|
}
|
|
198
|
-
export declare function
|
|
199
|
-
export declare const updateAgentDraftQuery = "-- name: UpdateAgentDraft :one\nUPDATE weave.
|
|
198
|
+
export declare function updateAgentDefinitionStatus(client: Client, args: UpdateAgentDefinitionStatusArgs): Promise<UpdateAgentDefinitionStatusRow | null>;
|
|
199
|
+
export declare const updateAgentDraftQuery = "-- name: UpdateAgentDraft :one\nUPDATE weave.agent_definition_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 definition_id = $13\n AND revision = $14\nRETURNING id, definition_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
200
|
export interface UpdateAgentDraftArgs {
|
|
201
201
|
baseVersionId: string | null;
|
|
202
202
|
name: string;
|
|
@@ -210,12 +210,12 @@ export interface UpdateAgentDraftArgs {
|
|
|
210
210
|
metadata: any;
|
|
211
211
|
updatedByUserId: string;
|
|
212
212
|
organizationId: string;
|
|
213
|
-
|
|
213
|
+
definitionId: string;
|
|
214
214
|
expectedRevision: number;
|
|
215
215
|
}
|
|
216
216
|
export interface UpdateAgentDraftRow {
|
|
217
217
|
id: string;
|
|
218
|
-
|
|
218
|
+
definitionId: string;
|
|
219
219
|
organizationId: string;
|
|
220
220
|
baseVersionId: string | null;
|
|
221
221
|
revision: number;
|
|
@@ -233,10 +233,10 @@ export interface UpdateAgentDraftRow {
|
|
|
233
233
|
updatedAt: Date;
|
|
234
234
|
}
|
|
235
235
|
export declare function updateAgentDraft(client: Client, args: UpdateAgentDraftArgs): Promise<UpdateAgentDraftRow | null>;
|
|
236
|
-
export declare const insertAgentDraftPatchQuery = "-- name: InsertAgentDraftPatch :one\nINSERT INTO weave.
|
|
236
|
+
export declare const insertAgentDraftPatchQuery = "-- name: InsertAgentDraftPatch :one\nINSERT INTO weave.agent_definition_draft_patches (\n id,\n definition_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, definition_id, organization_id, revision, patch, created_by_user_id, created_at";
|
|
237
237
|
export interface InsertAgentDraftPatchArgs {
|
|
238
238
|
id: string;
|
|
239
|
-
|
|
239
|
+
definitionId: string;
|
|
240
240
|
organizationId: string;
|
|
241
241
|
revision: number;
|
|
242
242
|
patch: any;
|
|
@@ -244,7 +244,7 @@ export interface InsertAgentDraftPatchArgs {
|
|
|
244
244
|
}
|
|
245
245
|
export interface InsertAgentDraftPatchRow {
|
|
246
246
|
id: string;
|
|
247
|
-
|
|
247
|
+
definitionId: string;
|
|
248
248
|
organizationId: string;
|
|
249
249
|
revision: number;
|
|
250
250
|
patch: any;
|
|
@@ -252,10 +252,10 @@ export interface InsertAgentDraftPatchRow {
|
|
|
252
252
|
createdAt: Date;
|
|
253
253
|
}
|
|
254
254
|
export declare function insertAgentDraftPatch(client: Client, args: InsertAgentDraftPatchArgs): Promise<InsertAgentDraftPatchRow | null>;
|
|
255
|
-
export declare const
|
|
256
|
-
export interface
|
|
255
|
+
export declare const insertAgentDefinitionVersionQuery = "-- name: InsertAgentDefinitionVersion :one\nINSERT INTO weave.agent_definition_versions (\n id,\n definition_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, definition_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 InsertAgentDefinitionVersionArgs {
|
|
257
257
|
id: string;
|
|
258
|
-
|
|
258
|
+
definitionId: string;
|
|
259
259
|
organizationId: string;
|
|
260
260
|
version: number;
|
|
261
261
|
sourceDraftRevision: number;
|
|
@@ -270,9 +270,9 @@ export interface InsertAgentTemplateVersionArgs {
|
|
|
270
270
|
metadata: any;
|
|
271
271
|
publishedByUserId: string;
|
|
272
272
|
}
|
|
273
|
-
export interface
|
|
273
|
+
export interface InsertAgentDefinitionVersionRow {
|
|
274
274
|
id: string;
|
|
275
|
-
|
|
275
|
+
definitionId: string;
|
|
276
276
|
organizationId: string;
|
|
277
277
|
version: number;
|
|
278
278
|
sourceDraftRevision: number;
|
|
@@ -288,15 +288,15 @@ export interface InsertAgentTemplateVersionRow {
|
|
|
288
288
|
publishedByUserId: string;
|
|
289
289
|
publishedAt: Date;
|
|
290
290
|
}
|
|
291
|
-
export declare function
|
|
292
|
-
export declare const
|
|
293
|
-
export interface
|
|
291
|
+
export declare function insertAgentDefinitionVersion(client: Client, args: InsertAgentDefinitionVersionArgs): Promise<InsertAgentDefinitionVersionRow | null>;
|
|
292
|
+
export declare const setAgentDefinitionLatestVersionQuery = "-- name: SetAgentDefinitionLatestVersion :one\nUPDATE weave.agent_definitions\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 SetAgentDefinitionLatestVersionArgs {
|
|
294
294
|
versionId: string | null;
|
|
295
295
|
version: number;
|
|
296
296
|
organizationId: string;
|
|
297
|
-
|
|
297
|
+
definitionId: string;
|
|
298
298
|
}
|
|
299
|
-
export interface
|
|
299
|
+
export interface SetAgentDefinitionLatestVersionRow {
|
|
300
300
|
id: string;
|
|
301
301
|
organizationId: string;
|
|
302
302
|
slug: string;
|
|
@@ -310,16 +310,16 @@ export interface SetAgentTemplateLatestVersionRow {
|
|
|
310
310
|
createdAt: Date;
|
|
311
311
|
updatedAt: Date;
|
|
312
312
|
}
|
|
313
|
-
export declare function
|
|
314
|
-
export declare const
|
|
315
|
-
export interface
|
|
313
|
+
export declare function setAgentDefinitionLatestVersion(client: Client, args: SetAgentDefinitionLatestVersionArgs): Promise<SetAgentDefinitionLatestVersionRow | null>;
|
|
314
|
+
export declare const getAgentDefinitionVersionByNumberQuery = "-- name: GetAgentDefinitionVersionByNumber :one\nSELECT id, definition_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_definition_versions\nWHERE organization_id = $1\n AND definition_id = $2\n AND version = $3";
|
|
315
|
+
export interface GetAgentDefinitionVersionByNumberArgs {
|
|
316
316
|
organizationId: string;
|
|
317
|
-
|
|
317
|
+
definitionId: string;
|
|
318
318
|
version: number;
|
|
319
319
|
}
|
|
320
|
-
export interface
|
|
320
|
+
export interface GetAgentDefinitionVersionByNumberRow {
|
|
321
321
|
id: string;
|
|
322
|
-
|
|
322
|
+
definitionId: string;
|
|
323
323
|
organizationId: string;
|
|
324
324
|
version: number;
|
|
325
325
|
sourceDraftRevision: number;
|
|
@@ -335,15 +335,15 @@ export interface GetAgentTemplateVersionByNumberRow {
|
|
|
335
335
|
publishedByUserId: string;
|
|
336
336
|
publishedAt: Date;
|
|
337
337
|
}
|
|
338
|
-
export declare function
|
|
339
|
-
export declare const
|
|
340
|
-
export interface
|
|
338
|
+
export declare function getAgentDefinitionVersionByNumber(client: Client, args: GetAgentDefinitionVersionByNumberArgs): Promise<GetAgentDefinitionVersionByNumberRow | null>;
|
|
339
|
+
export declare const getAgentDefinitionVersionByIDQuery = "-- name: GetAgentDefinitionVersionByID :one\nSELECT id, definition_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_definition_versions\nWHERE organization_id = $1\n AND id = $2";
|
|
340
|
+
export interface GetAgentDefinitionVersionByIDArgs {
|
|
341
341
|
organizationId: string;
|
|
342
342
|
versionId: string;
|
|
343
343
|
}
|
|
344
|
-
export interface
|
|
344
|
+
export interface GetAgentDefinitionVersionByIDRow {
|
|
345
345
|
id: string;
|
|
346
|
-
|
|
346
|
+
definitionId: string;
|
|
347
347
|
organizationId: string;
|
|
348
348
|
version: number;
|
|
349
349
|
sourceDraftRevision: number;
|
|
@@ -359,17 +359,17 @@ export interface GetAgentTemplateVersionByIDRow {
|
|
|
359
359
|
publishedByUserId: string;
|
|
360
360
|
publishedAt: Date;
|
|
361
361
|
}
|
|
362
|
-
export declare function
|
|
363
|
-
export declare const
|
|
364
|
-
export interface
|
|
362
|
+
export declare function getAgentDefinitionVersionByID(client: Client, args: GetAgentDefinitionVersionByIDArgs): Promise<GetAgentDefinitionVersionByIDRow | null>;
|
|
363
|
+
export declare const listAgentDefinitionVersionsQuery = "-- name: ListAgentDefinitionVersions :many\nSELECT id, definition_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_definition_versions\nWHERE organization_id = $1\n AND definition_id = $2\nORDER BY version DESC\nLIMIT $4 OFFSET $3";
|
|
364
|
+
export interface ListAgentDefinitionVersionsArgs {
|
|
365
365
|
organizationId: string;
|
|
366
|
-
|
|
366
|
+
definitionId: string;
|
|
367
367
|
pageOffset: string;
|
|
368
368
|
pageSize: string;
|
|
369
369
|
}
|
|
370
|
-
export interface
|
|
370
|
+
export interface ListAgentDefinitionVersionsRow {
|
|
371
371
|
id: string;
|
|
372
|
-
|
|
372
|
+
definitionId: string;
|
|
373
373
|
organizationId: string;
|
|
374
374
|
version: number;
|
|
375
375
|
sourceDraftRevision: number;
|
|
@@ -385,12 +385,12 @@ export interface ListAgentTemplateVersionsRow {
|
|
|
385
385
|
publishedByUserId: string;
|
|
386
386
|
publishedAt: Date;
|
|
387
387
|
}
|
|
388
|
-
export declare function
|
|
389
|
-
export declare const createAgentRunQuery = "-- name: CreateAgentRun :one\nINSERT INTO weave.agent_runs (\n id,\n organization_id,\n
|
|
388
|
+
export declare function listAgentDefinitionVersions(client: Client, args: ListAgentDefinitionVersionsArgs): Promise<ListAgentDefinitionVersionsRow[]>;
|
|
389
|
+
export declare const createAgentRunQuery = "-- name: CreateAgentRun :one\nINSERT INTO weave.agent_runs (\n id,\n organization_id,\n agent_definition_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_definition_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
390
|
export interface CreateAgentRunArgs {
|
|
391
391
|
id: string;
|
|
392
392
|
organizationId: string;
|
|
393
|
-
|
|
393
|
+
agentDefinitionId: string;
|
|
394
394
|
agentVersionId: string;
|
|
395
395
|
status: string;
|
|
396
396
|
createdByUserId: string;
|
|
@@ -402,7 +402,7 @@ export interface CreateAgentRunArgs {
|
|
|
402
402
|
export interface CreateAgentRunRow {
|
|
403
403
|
id: string;
|
|
404
404
|
organizationId: string;
|
|
405
|
-
|
|
405
|
+
agentDefinitionId: string;
|
|
406
406
|
agentVersionId: string;
|
|
407
407
|
status: string;
|
|
408
408
|
createdByUserId: string;
|
|
@@ -418,7 +418,7 @@ export interface CreateAgentRunRow {
|
|
|
418
418
|
finishedAt: Date | null;
|
|
419
419
|
}
|
|
420
420
|
export declare function createAgentRun(client: Client, args: CreateAgentRunArgs): Promise<CreateAgentRunRow | null>;
|
|
421
|
-
export declare const getAgentRunQuery = "-- name: GetAgentRun :one\nSELECT id, organization_id,
|
|
421
|
+
export declare const getAgentRunQuery = "-- name: GetAgentRun :one\nSELECT id, organization_id, agent_definition_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
422
|
export interface GetAgentRunArgs {
|
|
423
423
|
organizationId: string;
|
|
424
424
|
agentRunId: string;
|
|
@@ -426,7 +426,7 @@ export interface GetAgentRunArgs {
|
|
|
426
426
|
export interface GetAgentRunRow {
|
|
427
427
|
id: string;
|
|
428
428
|
organizationId: string;
|
|
429
|
-
|
|
429
|
+
agentDefinitionId: string;
|
|
430
430
|
agentVersionId: string;
|
|
431
431
|
status: string;
|
|
432
432
|
createdByUserId: string;
|
|
@@ -442,10 +442,10 @@ export interface GetAgentRunRow {
|
|
|
442
442
|
finishedAt: Date | null;
|
|
443
443
|
}
|
|
444
444
|
export declare function getAgentRun(client: Client, args: GetAgentRunArgs): Promise<GetAgentRunRow | null>;
|
|
445
|
-
export declare const listAgentRunsQuery = "-- name: ListAgentRuns :many\nSELECT id, organization_id,
|
|
445
|
+
export declare const listAgentRunsQuery = "-- name: ListAgentRuns :many\nSELECT id, organization_id, agent_definition_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_definition_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
446
|
export interface ListAgentRunsArgs {
|
|
447
447
|
organizationId: string;
|
|
448
|
-
|
|
448
|
+
agentDefinitionId: string | null;
|
|
449
449
|
status: string | null;
|
|
450
450
|
pageOffset: string;
|
|
451
451
|
pageSize: string;
|
|
@@ -453,7 +453,7 @@ export interface ListAgentRunsArgs {
|
|
|
453
453
|
export interface ListAgentRunsRow {
|
|
454
454
|
id: string;
|
|
455
455
|
organizationId: string;
|
|
456
|
-
|
|
456
|
+
agentDefinitionId: string;
|
|
457
457
|
agentVersionId: string;
|
|
458
458
|
status: string;
|
|
459
459
|
createdByUserId: string;
|
|
@@ -469,7 +469,7 @@ export interface ListAgentRunsRow {
|
|
|
469
469
|
finishedAt: Date | null;
|
|
470
470
|
}
|
|
471
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,
|
|
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_definition_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
473
|
export interface UpdateAgentRunStatusArgs {
|
|
474
474
|
status: string;
|
|
475
475
|
output: any;
|
|
@@ -483,7 +483,7 @@ export interface UpdateAgentRunStatusArgs {
|
|
|
483
483
|
export interface UpdateAgentRunStatusRow {
|
|
484
484
|
id: string;
|
|
485
485
|
organizationId: string;
|
|
486
|
-
|
|
486
|
+
agentDefinitionId: string;
|
|
487
487
|
agentVersionId: string;
|
|
488
488
|
status: string;
|
|
489
489
|
createdByUserId: string;
|