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.
@@ -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 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 {
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 CreateAgentTemplateRow {
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 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 {
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
- templateId: string;
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 CreateAgentTemplateDraftRow {
48
+ export interface CreateAgentDefinitionDraftRow {
49
49
  id: string;
50
- templateId: string;
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 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 {
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
- templateId: string;
71
+ definitionId: string;
72
72
  }
73
- export interface GetAgentTemplateByIDRow {
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 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 {
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 GetAgentTemplateBySlugRow {
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 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 {
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
- templateId: string;
111
+ definitionId: string;
112
112
  }
113
- export interface GetAgentTemplateDraftRow {
113
+ export interface GetAgentDefinitionDraftRow {
114
114
  id: string;
115
- templateId: string;
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 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 {
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 ListAgentTemplatesRow {
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 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 {
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
- templateId: string;
161
+ definitionId: string;
162
162
  }
163
- export interface UpdateAgentTemplateDraftMetadataRow {
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 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 {
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
- templateId: string;
182
+ definitionId: string;
183
183
  }
184
- export interface UpdateAgentTemplateStatusRow {
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 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";
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
- templateId: string;
213
+ definitionId: string;
214
214
  expectedRevision: number;
215
215
  }
216
216
  export interface UpdateAgentDraftRow {
217
217
  id: string;
218
- templateId: string;
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.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";
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
- templateId: string;
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
- templateId: string;
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 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 {
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
- templateId: string;
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 InsertAgentTemplateVersionRow {
273
+ export interface InsertAgentDefinitionVersionRow {
274
274
  id: string;
275
- templateId: string;
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 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 {
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
- templateId: string;
297
+ definitionId: string;
298
298
  }
299
- export interface SetAgentTemplateLatestVersionRow {
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 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 {
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
- templateId: string;
317
+ definitionId: string;
318
318
  version: number;
319
319
  }
320
- export interface GetAgentTemplateVersionByNumberRow {
320
+ export interface GetAgentDefinitionVersionByNumberRow {
321
321
  id: string;
322
- templateId: string;
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 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 {
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 GetAgentTemplateVersionByIDRow {
344
+ export interface GetAgentDefinitionVersionByIDRow {
345
345
  id: string;
346
- templateId: string;
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 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 {
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
- templateId: string;
366
+ definitionId: string;
367
367
  pageOffset: string;
368
368
  pageSize: string;
369
369
  }
370
- export interface ListAgentTemplateVersionsRow {
370
+ export interface ListAgentDefinitionVersionsRow {
371
371
  id: string;
372
- templateId: string;
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 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";
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
- agentTemplateId: string;
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
- agentTemplateId: string;
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, 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";
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
- agentTemplateId: string;
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, 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";
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
- agentTemplateId: string | null;
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
- agentTemplateId: string;
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, 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";
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
- agentTemplateId: string;
486
+ agentDefinitionId: string;
487
487
  agentVersionId: string;
488
488
  status: string;
489
489
  createdByUserId: string;