weave-typescript 0.51.2 → 0.52.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/google/protobuf/duration.pb.d.ts +99 -0
- package/dist/google/protobuf/duration.pb.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/weave/authz/v1/index.d.ts +1 -0
- package/dist/weave/authz/v1/index.js +38 -0
- package/dist/weave/authz/v1/options.pb.d.ts +52 -0
- package/dist/weave/authz/v1/options.pb.js +403 -0
- package/dist/weave/filter/v1/index.d.ts +1 -0
- package/dist/weave/filter/v1/index.js +38 -0
- package/dist/{weaveapi/atc/v1/message.pb.d.ts → weave/filter/v1/options.pb.d.ts} +33 -21
- package/dist/weave/filter/v1/options.pb.js +417 -0
- package/dist/weave/index.d.ts +2 -0
- package/dist/weave/index.js +39 -0
- package/dist/weaveapi/agent/v1/agent.pb.d.ts +137 -188
- package/dist/weaveapi/agent/v1/agent.pb.js +891 -2151
- package/dist/weaveapi/agent/v1/index.d.ts +1 -1
- package/dist/weaveapi/agent/v1/index.js +2 -2
- package/dist/weaveapi/agent/v1/run.pb.d.ts +289 -0
- package/dist/weaveapi/agent/v1/run.pb.js +2763 -0
- package/dist/weaveapi/auth/v1/auth.pb.d.ts +67 -14
- package/dist/weaveapi/auth/v1/auth.pb.js +829 -89
- package/dist/weaveapi/auth/v1/index.d.ts +4 -1
- package/dist/weaveapi/auth/v1/index.js +5 -2
- package/dist/weaveapi/auth/v1/{service.pb.d.ts → organization_admin.pb.d.ts} +39 -530
- package/dist/weaveapi/auth/v1/{service.pb.js → organization_admin.pb.js} +2978 -5812
- package/dist/weaveapi/auth/v1/personal_access_token.pb.d.ts +114 -0
- package/dist/weaveapi/auth/v1/personal_access_token.pb.js +750 -0
- package/dist/weaveapi/auth/v1/profile.pb.d.ts +161 -0
- package/dist/weaveapi/auth/v1/profile.pb.js +1007 -0
- package/dist/weaveapi/auth/v1/session.pb.d.ts +460 -0
- package/dist/weaveapi/auth/v1/session.pb.js +3544 -0
- package/dist/weaveapi/chat/v1/chat.pb.d.ts +377 -149
- package/dist/weaveapi/chat/v1/chat.pb.js +3492 -1614
- package/dist/weaveapi/chat/v1/index.d.ts +0 -1
- package/dist/weaveapi/chat/v1/index.js +1 -2
- package/dist/weaveapi/consolidation/v1/consolidation.pb.d.ts +95 -0
- package/dist/weaveapi/consolidation/v1/consolidation.pb.js +770 -1
- package/dist/weaveapi/consolidation/v1/index.d.ts +0 -1
- package/dist/weaveapi/consolidation/v1/index.js +1 -2
- package/dist/weaveapi/content/v1/content.pb.d.ts +63 -0
- package/dist/weaveapi/content/v1/content.pb.js +470 -0
- package/dist/weaveapi/content/v1/index.d.ts +1 -0
- package/dist/weaveapi/content/v1/index.js +38 -0
- package/dist/weaveapi/gateway/v1/gateway.pb.d.ts +247 -523
- package/dist/weaveapi/gateway/v1/gateway.pb.js +1648 -5783
- package/dist/weaveapi/gateway/v1/index.d.ts +0 -1
- package/dist/weaveapi/gateway/v1/index.js +1 -2
- package/dist/weaveapi/index.d.ts +5 -5
- package/dist/weaveapi/index.js +6 -6
- package/dist/weaveapi/inference/v1/generate.pb.d.ts +120 -0
- package/dist/weaveapi/inference/v1/generate.pb.js +1159 -0
- package/dist/weaveapi/inference/v1/index.d.ts +4 -0
- package/dist/weaveapi/{provider → inference}/v1/index.js +4 -2
- package/dist/weaveapi/{model → inference}/v1/model.pb.d.ts +52 -15
- package/dist/weaveapi/{model → inference}/v1/model.pb.js +529 -116
- package/dist/weaveapi/{model/v1/service.pb.d.ts → inference/v1/model_route.pb.d.ts} +182 -110
- package/dist/weaveapi/{model/v1/service.pb.js → inference/v1/model_route.pb.js} +2197 -1061
- package/dist/weaveapi/inference/v1/provider.pb.d.ts +264 -0
- package/dist/weaveapi/inference/v1/provider.pb.js +2590 -0
- package/dist/weaveapi/ingestion/v1/index.d.ts +0 -2
- package/dist/weaveapi/ingestion/v1/index.js +1 -3
- package/dist/weaveapi/ingestion/v1/ingestion.pb.d.ts +543 -0
- package/dist/weaveapi/ingestion/v1/ingestion.pb.js +5550 -16
- package/dist/weaveapi/initialization/v1/index.d.ts +1 -0
- package/dist/weaveapi/initialization/v1/index.js +38 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.d.ts +99 -0
- package/dist/weaveapi/initialization/v1/initialization.pb.js +510 -0
- package/dist/weaveapi/organization/v1/index.d.ts +0 -1
- package/dist/weaveapi/organization/v1/index.js +1 -2
- package/dist/weaveapi/organization/v1/organization.pb.d.ts +241 -0
- package/dist/weaveapi/organization/v1/organization.pb.js +1838 -1
- package/dist/weaveapi/reporting/index.d.ts +1 -0
- package/dist/weaveapi/reporting/index.js +38 -0
- package/dist/weaveapi/{task → reporting}/v1/index.d.ts +1 -1
- package/dist/weaveapi/{model → reporting}/v1/index.js +2 -2
- package/dist/weaveapi/reporting/v1/service.pb.d.ts +38 -0
- package/dist/weaveapi/reporting/v1/service.pb.js +167 -0
- package/dist/weaveapi/reporting/v1/usage.pb.d.ts +150 -0
- package/dist/weaveapi/reporting/v1/usage.pb.js +1837 -0
- package/dist/weaveapi/retrieval/v1/index.d.ts +0 -1
- package/dist/weaveapi/retrieval/v1/index.js +1 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.d.ts +96 -2
- package/dist/weaveapi/retrieval/v1/retrieval.pb.js +690 -10
- package/dist/weaveapi/tool/index.d.ts +1 -0
- package/dist/weaveapi/tool/index.js +38 -0
- package/dist/weaveapi/tool/v1/index.d.ts +1 -0
- package/dist/weaveapi/tool/v1/index.js +38 -0
- package/dist/weaveapi/tool/v1/tool.pb.d.ts +370 -0
- package/dist/weaveapi/tool/v1/tool.pb.js +2717 -0
- package/dist/weaveapi/workflow/v1/index.d.ts +1 -1
- package/dist/weaveapi/workflow/v1/index.js +2 -2
- package/dist/weaveapi/workflow/v1/run.pb.d.ts +244 -0
- package/dist/weaveapi/workflow/v1/run.pb.js +2084 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +122 -275
- package/dist/weaveapi/workflow/v1/workflow.pb.js +790 -3261
- package/dist/weavesql/weavedb/agent_sql.d.ts +173 -477
- package/dist/weavesql/weavedb/agent_sql.js +281 -758
- package/dist/weavesql/weavedb/authorization_outbox_sql.d.ts +261 -0
- package/dist/weavesql/weavedb/authorization_outbox_sql.js +445 -0
- package/dist/weavesql/weavedb/chat_sql.d.ts +103 -345
- package/dist/weavesql/weavedb/chat_sql.js +312 -597
- package/dist/weavesql/weavedb/document_consolidation_sql.d.ts +217 -0
- package/dist/weavesql/weavedb/document_consolidation_sql.js +486 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.d.ts +1433 -0
- package/dist/weavesql/weavedb/document_ingestion_sql.js +3488 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.d.ts +314 -0
- package/dist/weavesql/weavedb/document_retrieval_sql.js +965 -0
- package/dist/weavesql/weavedb/document_table_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/document_table_sql.js +12 -12
- package/dist/weavesql/weavedb/identity_sql.d.ts +1014 -0
- package/dist/weavesql/weavedb/identity_sql.js +1811 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.d.ts +161 -0
- package/dist/weavesql/weavedb/inference_model_route_sql.js +408 -0
- package/dist/weavesql/weavedb/inference_provider_sql.d.ts +125 -0
- package/dist/weavesql/weavedb/inference_provider_sql.js +228 -0
- package/dist/weavesql/weavedb/initialization_sql.d.ts +15 -0
- package/dist/weavesql/weavedb/initialization_sql.js +33 -0
- package/dist/weavesql/weavedb/model_catalog_sql.d.ts +6 -6
- package/dist/weavesql/weavedb/model_catalog_sql.js +6 -6
- package/dist/weavesql/weavedb/organization_sql.d.ts +22 -102
- package/dist/weavesql/weavedb/organization_sql.js +54 -262
- package/dist/weavesql/weavedb/tool_sql.d.ts +209 -0
- package/dist/weavesql/weavedb/tool_sql.js +407 -0
- package/dist/weavesql/weavedb/usage_sql.d.ts +356 -0
- package/dist/weavesql/weavedb/usage_sql.js +568 -0
- package/dist/weavesql/weavedb/workflow_sql.d.ts +159 -546
- package/dist/weavesql/weavedb/workflow_sql.js +281 -909
- package/package.json +2 -2
- package/dist/weaveapi/agent/v1/service.pb.d.ts +0 -397
- package/dist/weaveapi/agent/v1/service.pb.js +0 -3152
- package/dist/weaveapi/atc/v1/event.pb.d.ts +0 -134
- package/dist/weaveapi/atc/v1/event.pb.js +0 -1124
- package/dist/weaveapi/atc/v1/index.d.ts +0 -5
- package/dist/weaveapi/atc/v1/index.js +0 -42
- package/dist/weaveapi/atc/v1/message.pb.js +0 -287
- package/dist/weaveapi/atc/v1/process.pb.d.ts +0 -91
- package/dist/weaveapi/atc/v1/process.pb.js +0 -658
- package/dist/weaveapi/atc/v1/run.pb.d.ts +0 -71
- package/dist/weaveapi/atc/v1/run.pb.js +0 -525
- package/dist/weaveapi/atc/v1/service.pb.d.ts +0 -472
- package/dist/weaveapi/atc/v1/service.pb.js +0 -3093
- package/dist/weaveapi/chat/v1/service.pb.d.ts +0 -345
- package/dist/weaveapi/chat/v1/service.pb.js +0 -2545
- package/dist/weaveapi/consolidation/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/consolidation/v1/service.pb.js +0 -427
- package/dist/weaveapi/gateway/v1/service.pb.d.ts +0 -235
- package/dist/weaveapi/gateway/v1/service.pb.js +0 -651
- package/dist/weaveapi/ingestion/v1/service.pb.d.ts +0 -420
- package/dist/weaveapi/ingestion/v1/service.pb.js +0 -2311
- package/dist/weaveapi/ingestion/v1/table.pb.d.ts +0 -121
- package/dist/weaveapi/ingestion/v1/table.pb.js +0 -1478
- package/dist/weaveapi/model/v1/index.d.ts +0 -2
- package/dist/weaveapi/organization/v1/service.pb.d.ts +0 -261
- package/dist/weaveapi/organization/v1/service.pb.js +0 -1561
- package/dist/weaveapi/project/v1/index.d.ts +0 -2
- package/dist/weaveapi/project/v1/index.js +0 -39
- package/dist/weaveapi/project/v1/project.pb.d.ts +0 -105
- package/dist/weaveapi/project/v1/project.pb.js +0 -1004
- package/dist/weaveapi/project/v1/service.pb.d.ts +0 -247
- package/dist/weaveapi/project/v1/service.pb.js +0 -1994
- package/dist/weaveapi/provider/v1/index.d.ts +0 -2
- package/dist/weaveapi/provider/v1/provider.pb.d.ts +0 -137
- package/dist/weaveapi/provider/v1/provider.pb.js +0 -1000
- package/dist/weaveapi/provider/v1/service.pb.d.ts +0 -223
- package/dist/weaveapi/provider/v1/service.pb.js +0 -1888
- package/dist/weaveapi/retrieval/v1/service.pb.d.ts +0 -93
- package/dist/weaveapi/retrieval/v1/service.pb.js +0 -385
- package/dist/weaveapi/task/v1/index.js +0 -39
- package/dist/weaveapi/task/v1/service.pb.d.ts +0 -172
- package/dist/weaveapi/task/v1/service.pb.js +0 -1436
- package/dist/weaveapi/task/v1/task.pb.d.ts +0 -85
- package/dist/weaveapi/task/v1/task.pb.js +0 -802
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -392
- package/dist/weaveapi/workflow/v1/service.pb.js +0 -3146
- /package/dist/{weaveapi/atc → weave/authz}/index.d.ts +0 -0
- /package/dist/{weaveapi/atc → weave/authz}/index.js +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.d.ts +0 -0
- /package/dist/{weaveapi/model → weave/filter}/index.js +0 -0
- /package/dist/weaveapi/{project → content}/index.d.ts +0 -0
- /package/dist/weaveapi/{project → content}/index.js +0 -0
- /package/dist/weaveapi/{provider → inference}/index.d.ts +0 -0
- /package/dist/weaveapi/{provider → inference}/index.js +0 -0
- /package/dist/weaveapi/{task → initialization}/index.d.ts +0 -0
- /package/dist/weaveapi/{task → initialization}/index.js +0 -0
|
@@ -2,479 +2,185 @@ 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
|
|
7
|
-
id: string;
|
|
5
|
+
export declare const createAgentQuery = "-- name: CreateAgent :one\nINSERT INTO weave.agent (\n organization_id,\n slug,\n name,\n description,\n instructions,\n default_model_id,\n default_generate_config,\n include_contents,\n output_key,\n input_schema,\n output_schema,\n metadata\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n COALESCE($7::jsonb, '{}'::jsonb),\n $8,\n $9,\n $10::jsonb,\n $11::jsonb,\n COALESCE($12::jsonb, '{}'::jsonb)\n)\nRETURNING id, organization_id, slug, name, description, instructions, default_model_id, default_generate_config, include_contents, output_key, input_schema, output_schema, metadata, created_at, updated_at";
|
|
6
|
+
export interface CreateAgentArgs {
|
|
8
7
|
organizationId: string;
|
|
9
8
|
slug: string;
|
|
10
9
|
name: string;
|
|
11
10
|
description: string;
|
|
12
|
-
status: string;
|
|
13
|
-
createdByUserId: string;
|
|
14
|
-
}
|
|
15
|
-
export interface CreateAgentDefinitionRow {
|
|
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 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
|
-
id: string;
|
|
33
|
-
definitionId: string;
|
|
34
|
-
organizationId: string;
|
|
35
|
-
baseVersionId: string | null;
|
|
36
|
-
revision: number;
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
11
|
instructions: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
export interface
|
|
12
|
+
defaultModelId: string;
|
|
13
|
+
defaultGenerateConfig: any | null;
|
|
14
|
+
includeContents: string;
|
|
15
|
+
outputKey: string;
|
|
16
|
+
inputSchema: any | null;
|
|
17
|
+
outputSchema: any | null;
|
|
18
|
+
metadata: any | null;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateAgentRow {
|
|
49
21
|
id: string;
|
|
50
|
-
definitionId: string;
|
|
51
22
|
organizationId: string;
|
|
52
|
-
|
|
53
|
-
revision: number;
|
|
23
|
+
slug: string;
|
|
54
24
|
name: string;
|
|
55
25
|
description: string;
|
|
56
26
|
instructions: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
27
|
+
defaultModelId: string;
|
|
28
|
+
defaultGenerateConfig: any;
|
|
29
|
+
includeContents: string;
|
|
30
|
+
outputKey: string;
|
|
31
|
+
inputSchema: any | null;
|
|
32
|
+
outputSchema: any | null;
|
|
62
33
|
metadata: any;
|
|
63
|
-
updatedByUserId: string;
|
|
64
34
|
createdAt: Date;
|
|
65
35
|
updatedAt: Date;
|
|
66
36
|
}
|
|
67
|
-
export declare function
|
|
68
|
-
export declare const
|
|
69
|
-
export interface
|
|
37
|
+
export declare function createAgent(client: Client, args: CreateAgentArgs): Promise<CreateAgentRow | null>;
|
|
38
|
+
export declare const getAgentQuery = "-- name: GetAgent :one\nSELECT id, organization_id, slug, name, description, instructions, default_model_id, default_generate_config, include_contents, output_key, input_schema, output_schema, metadata, created_at, updated_at FROM weave.agent\nWHERE organization_id = $1\n AND id = $2";
|
|
39
|
+
export interface GetAgentArgs {
|
|
70
40
|
organizationId: string;
|
|
71
|
-
|
|
41
|
+
agentId: string;
|
|
72
42
|
}
|
|
73
|
-
export interface
|
|
43
|
+
export interface GetAgentRow {
|
|
74
44
|
id: string;
|
|
75
45
|
organizationId: string;
|
|
76
46
|
slug: string;
|
|
77
47
|
name: string;
|
|
78
48
|
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 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
|
-
organizationId: string;
|
|
91
|
-
slug: string;
|
|
92
|
-
}
|
|
93
|
-
export interface GetAgentDefinitionBySlugRow {
|
|
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 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
|
-
organizationId: string;
|
|
111
|
-
definitionId: string;
|
|
112
|
-
}
|
|
113
|
-
export interface GetAgentDefinitionDraftRow {
|
|
114
|
-
id: string;
|
|
115
|
-
definitionId: string;
|
|
116
|
-
organizationId: string;
|
|
117
|
-
baseVersionId: string | null;
|
|
118
|
-
revision: number;
|
|
119
|
-
name: string;
|
|
120
|
-
description: string;
|
|
121
49
|
instructions: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
50
|
+
defaultModelId: string;
|
|
51
|
+
defaultGenerateConfig: any;
|
|
52
|
+
includeContents: string;
|
|
53
|
+
outputKey: string;
|
|
54
|
+
inputSchema: any | null;
|
|
55
|
+
outputSchema: any | null;
|
|
127
56
|
metadata: any;
|
|
128
|
-
updatedByUserId: string;
|
|
129
57
|
createdAt: Date;
|
|
130
58
|
updatedAt: Date;
|
|
131
59
|
}
|
|
132
|
-
export declare function
|
|
133
|
-
export declare const
|
|
134
|
-
export interface
|
|
135
|
-
organizationId: string;
|
|
136
|
-
status: string | null;
|
|
137
|
-
pageOffset: string;
|
|
138
|
-
pageSize: string;
|
|
139
|
-
}
|
|
140
|
-
export interface ListAgentDefinitionsRow {
|
|
141
|
-
id: string;
|
|
142
|
-
organizationId: string;
|
|
60
|
+
export declare function getAgent(client: Client, args: GetAgentArgs): Promise<GetAgentRow | null>;
|
|
61
|
+
export declare const updateAgentQuery = "-- name: UpdateAgent :one\nUPDATE weave.agent\nSET slug = $1,\n name = $2,\n description = COALESCE($3::text, ''),\n instructions = COALESCE($4::text, ''),\n default_model_id = $5,\n default_generate_config = COALESCE($6::jsonb, '{}'::jsonb),\n include_contents = $7,\n output_key = COALESCE($8::text, ''),\n input_schema = $9::jsonb,\n output_schema = $10::jsonb,\n metadata = COALESCE($11::jsonb, '{}'::jsonb)\nWHERE organization_id = $12\n AND id = $13\nRETURNING id, organization_id, slug, name, description, instructions, default_model_id, default_generate_config, include_contents, output_key, input_schema, output_schema, metadata, created_at, updated_at";
|
|
62
|
+
export interface UpdateAgentArgs {
|
|
143
63
|
slug: string;
|
|
144
64
|
name: string;
|
|
145
|
-
description: string;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
description: string;
|
|
159
|
-
draftRevision: number;
|
|
160
|
-
organizationId: string;
|
|
161
|
-
definitionId: string;
|
|
162
|
-
}
|
|
163
|
-
export interface UpdateAgentDefinitionDraftMetadataRow {
|
|
65
|
+
description: string | null;
|
|
66
|
+
instructions: string | null;
|
|
67
|
+
defaultModelId: string;
|
|
68
|
+
defaultGenerateConfig: any | null;
|
|
69
|
+
includeContents: string;
|
|
70
|
+
outputKey: string | null;
|
|
71
|
+
inputSchema: any | null;
|
|
72
|
+
outputSchema: any | null;
|
|
73
|
+
metadata: any | null;
|
|
74
|
+
organizationId: string;
|
|
75
|
+
agentId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface UpdateAgentRow {
|
|
164
78
|
id: string;
|
|
165
79
|
organizationId: string;
|
|
166
80
|
slug: string;
|
|
167
81
|
name: string;
|
|
168
82
|
description: string;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
83
|
+
instructions: string;
|
|
84
|
+
defaultModelId: string;
|
|
85
|
+
defaultGenerateConfig: any;
|
|
86
|
+
includeContents: string;
|
|
87
|
+
outputKey: string;
|
|
88
|
+
inputSchema: any | null;
|
|
89
|
+
outputSchema: any | null;
|
|
90
|
+
metadata: any;
|
|
174
91
|
createdAt: Date;
|
|
175
92
|
updatedAt: Date;
|
|
176
93
|
}
|
|
177
|
-
export declare function
|
|
178
|
-
export declare const
|
|
179
|
-
export interface
|
|
180
|
-
status: string;
|
|
94
|
+
export declare function updateAgent(client: Client, args: UpdateAgentArgs): Promise<UpdateAgentRow | null>;
|
|
95
|
+
export declare const listAgentsQuery = "-- name: ListAgents :many\nSELECT id, organization_id, slug, name, description, instructions, default_model_id, default_generate_config, include_contents, output_key, input_schema, output_schema, metadata, created_at, updated_at\nFROM weave.agent\nWHERE organization_id = $1\nORDER BY name ASC, id ASC\nLIMIT COALESCE($3::integer, 100)\nOFFSET COALESCE($2::integer, 0)";
|
|
96
|
+
export interface ListAgentsArgs {
|
|
181
97
|
organizationId: string;
|
|
182
|
-
|
|
98
|
+
pageOffset: number | null;
|
|
99
|
+
pageSize: number | null;
|
|
183
100
|
}
|
|
184
|
-
export interface
|
|
101
|
+
export interface ListAgentsRow {
|
|
185
102
|
id: string;
|
|
186
103
|
organizationId: string;
|
|
187
104
|
slug: string;
|
|
188
105
|
name: string;
|
|
189
106
|
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 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
|
-
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
|
-
definitionId: string;
|
|
214
|
-
expectedRevision: number;
|
|
215
|
-
}
|
|
216
|
-
export interface UpdateAgentDraftRow {
|
|
217
|
-
id: string;
|
|
218
|
-
definitionId: string;
|
|
219
|
-
organizationId: string;
|
|
220
|
-
baseVersionId: string | null;
|
|
221
|
-
revision: number;
|
|
222
|
-
name: string;
|
|
223
|
-
description: string;
|
|
224
107
|
instructions: string;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
108
|
+
defaultModelId: string;
|
|
109
|
+
defaultGenerateConfig: any;
|
|
110
|
+
includeContents: string;
|
|
111
|
+
outputKey: string;
|
|
112
|
+
inputSchema: any | null;
|
|
113
|
+
outputSchema: any | null;
|
|
230
114
|
metadata: any;
|
|
231
|
-
updatedByUserId: string;
|
|
232
115
|
createdAt: Date;
|
|
233
116
|
updatedAt: Date;
|
|
234
117
|
}
|
|
235
|
-
export declare function
|
|
236
|
-
export declare const
|
|
237
|
-
export interface
|
|
238
|
-
id: string;
|
|
239
|
-
definitionId: string;
|
|
240
|
-
organizationId: string;
|
|
241
|
-
revision: number;
|
|
242
|
-
patch: any;
|
|
243
|
-
createdByUserId: string;
|
|
244
|
-
}
|
|
245
|
-
export interface InsertAgentDraftPatchRow {
|
|
246
|
-
id: string;
|
|
247
|
-
definitionId: 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 insertAgentDraftEventQuery = "-- name: InsertAgentDraftEvent :one\nINSERT INTO weave.agent_definition_draft_events (\n id,\n definition_id,\n organization_id,\n draft_id,\n sequence,\n kind,\n base_revision,\n result_revision,\n changed_fields,\n source,\n client_request_id,\n conflict,\n created_by_user_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n COALESCE(\n (\n SELECT max(sequence) + 1\n FROM weave.agent_definition_draft_events\n WHERE definition_id = $2\n ),\n 1\n ),\n $5,\n $6,\n $7::integer,\n $8::text[],\n $9,\n $10,\n $11::jsonb,\n $12\n)\nRETURNING id, organization_id, definition_id, draft_id, sequence, kind, base_revision, result_revision, changed_fields, source, client_request_id, conflict, created_by_user_id, created_at";
|
|
256
|
-
export interface InsertAgentDraftEventArgs {
|
|
257
|
-
id: string;
|
|
258
|
-
definitionId: string;
|
|
259
|
-
organizationId: string;
|
|
260
|
-
draftId: string;
|
|
261
|
-
kind: string;
|
|
262
|
-
baseRevision: number;
|
|
263
|
-
resultRevision: number | null;
|
|
264
|
-
changedFields: string[];
|
|
265
|
-
source: string;
|
|
266
|
-
clientRequestId: string;
|
|
267
|
-
conflict: any | null;
|
|
268
|
-
createdByUserId: string;
|
|
269
|
-
}
|
|
270
|
-
export interface InsertAgentDraftEventRow {
|
|
271
|
-
id: string;
|
|
272
|
-
organizationId: string;
|
|
273
|
-
definitionId: string;
|
|
274
|
-
draftId: string;
|
|
275
|
-
sequence: string;
|
|
276
|
-
kind: string;
|
|
277
|
-
baseRevision: number;
|
|
278
|
-
resultRevision: number | null;
|
|
279
|
-
changedFields: string[];
|
|
280
|
-
source: string;
|
|
281
|
-
clientRequestId: string;
|
|
282
|
-
conflict: any | null;
|
|
283
|
-
createdByUserId: string;
|
|
284
|
-
createdAt: Date;
|
|
285
|
-
}
|
|
286
|
-
export declare function insertAgentDraftEvent(client: Client, args: InsertAgentDraftEventArgs): Promise<InsertAgentDraftEventRow | null>;
|
|
287
|
-
export declare const listAgentDraftEventsQuery = "-- name: ListAgentDraftEvents :many\nSELECT id, organization_id, definition_id, draft_id, sequence, kind, base_revision, result_revision, changed_fields, source, client_request_id, conflict, created_by_user_id, created_at FROM weave.agent_definition_draft_events\nWHERE organization_id = $1\n AND definition_id = $2\n AND sequence > $3\nORDER BY sequence\nLIMIT $4";
|
|
288
|
-
export interface ListAgentDraftEventsArgs {
|
|
289
|
-
organizationId: string;
|
|
290
|
-
definitionId: string;
|
|
291
|
-
afterSequence: string;
|
|
292
|
-
pageSize: string;
|
|
293
|
-
}
|
|
294
|
-
export interface ListAgentDraftEventsRow {
|
|
295
|
-
id: string;
|
|
296
|
-
organizationId: string;
|
|
297
|
-
definitionId: string;
|
|
298
|
-
draftId: string;
|
|
299
|
-
sequence: string;
|
|
300
|
-
kind: string;
|
|
301
|
-
baseRevision: number;
|
|
302
|
-
resultRevision: number | null;
|
|
303
|
-
changedFields: string[];
|
|
304
|
-
source: string;
|
|
305
|
-
clientRequestId: string;
|
|
306
|
-
conflict: any | null;
|
|
307
|
-
createdByUserId: string;
|
|
308
|
-
createdAt: Date;
|
|
309
|
-
}
|
|
310
|
-
export declare function listAgentDraftEvents(client: Client, args: ListAgentDraftEventsArgs): Promise<ListAgentDraftEventsRow[]>;
|
|
311
|
-
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";
|
|
312
|
-
export interface InsertAgentDefinitionVersionArgs {
|
|
313
|
-
id: string;
|
|
314
|
-
definitionId: string;
|
|
118
|
+
export declare function listAgents(client: Client, args: ListAgentsArgs): Promise<ListAgentsRow[]>;
|
|
119
|
+
export declare const upsertDefaultChatAgentQuery = "-- name: UpsertDefaultChatAgent :one\nINSERT INTO weave.agent (\n organization_id,\n slug,\n name,\n description,\n instructions,\n default_model_id,\n default_generate_config,\n include_contents,\n output_key,\n metadata\n) VALUES (\n $1,\n $2,\n $3,\n COALESCE($4::text, ''),\n $5,\n $6,\n '{}'::jsonb,\n 'default',\n '',\n COALESCE($7::jsonb, '{}'::jsonb)\n)\nON CONFLICT (organization_id, slug) DO UPDATE\nSET name = EXCLUDED.name,\n description = EXCLUDED.description,\n instructions = EXCLUDED.instructions,\n default_model_id = EXCLUDED.default_model_id,\n metadata = EXCLUDED.metadata,\n updated_at = now()\nRETURNING\n id,\n organization_id,\n slug,\n name,\n description,\n instructions,\n default_model_id,\n default_generate_config,\n include_contents,\n output_key,\n input_schema,\n output_schema,\n metadata,\n created_at,\n updated_at,\n (xmax = 0)::bool AS created";
|
|
120
|
+
export interface UpsertDefaultChatAgentArgs {
|
|
315
121
|
organizationId: string;
|
|
316
|
-
|
|
317
|
-
sourceDraftRevision: number;
|
|
122
|
+
slug: string;
|
|
318
123
|
name: string;
|
|
319
|
-
description: string;
|
|
124
|
+
description: string | null;
|
|
320
125
|
instructions: string;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
toolDescriptors: any;
|
|
324
|
-
inputSchema: any;
|
|
325
|
-
outputSchema: any;
|
|
326
|
-
metadata: any;
|
|
327
|
-
publishedByUserId: string;
|
|
126
|
+
defaultModelId: string;
|
|
127
|
+
metadata: any | null;
|
|
328
128
|
}
|
|
329
|
-
export interface
|
|
129
|
+
export interface UpsertDefaultChatAgentRow {
|
|
330
130
|
id: string;
|
|
331
|
-
definitionId: string;
|
|
332
131
|
organizationId: string;
|
|
333
|
-
|
|
334
|
-
sourceDraftRevision: number;
|
|
132
|
+
slug: string;
|
|
335
133
|
name: string;
|
|
336
134
|
description: string;
|
|
337
135
|
instructions: string;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
136
|
+
defaultModelId: string;
|
|
137
|
+
defaultGenerateConfig: any;
|
|
138
|
+
includeContents: string;
|
|
139
|
+
outputKey: string;
|
|
140
|
+
inputSchema: any | null;
|
|
141
|
+
outputSchema: any | null;
|
|
343
142
|
metadata: any;
|
|
344
|
-
publishedByUserId: string;
|
|
345
|
-
publishedAt: Date;
|
|
346
|
-
}
|
|
347
|
-
export declare function insertAgentDefinitionVersion(client: Client, args: InsertAgentDefinitionVersionArgs): Promise<InsertAgentDefinitionVersionRow | null>;
|
|
348
|
-
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";
|
|
349
|
-
export interface SetAgentDefinitionLatestVersionArgs {
|
|
350
|
-
versionId: string | null;
|
|
351
|
-
version: number;
|
|
352
|
-
organizationId: string;
|
|
353
|
-
definitionId: string;
|
|
354
|
-
}
|
|
355
|
-
export interface SetAgentDefinitionLatestVersionRow {
|
|
356
|
-
id: string;
|
|
357
|
-
organizationId: string;
|
|
358
|
-
slug: string;
|
|
359
|
-
name: string;
|
|
360
|
-
description: string;
|
|
361
|
-
status: string;
|
|
362
|
-
createdByUserId: string;
|
|
363
|
-
draftRevision: number;
|
|
364
|
-
latestVersionId: string | null;
|
|
365
|
-
latestVersion: number;
|
|
366
143
|
createdAt: Date;
|
|
367
144
|
updatedAt: Date;
|
|
145
|
+
created: boolean;
|
|
368
146
|
}
|
|
369
|
-
export declare function
|
|
370
|
-
export declare const
|
|
371
|
-
export interface GetAgentDefinitionVersionByNumberArgs {
|
|
372
|
-
organizationId: string;
|
|
373
|
-
definitionId: string;
|
|
374
|
-
version: number;
|
|
375
|
-
}
|
|
376
|
-
export interface GetAgentDefinitionVersionByNumberRow {
|
|
377
|
-
id: string;
|
|
378
|
-
definitionId: string;
|
|
379
|
-
organizationId: string;
|
|
380
|
-
version: number;
|
|
381
|
-
sourceDraftRevision: number;
|
|
382
|
-
name: string;
|
|
383
|
-
description: string;
|
|
384
|
-
instructions: string;
|
|
385
|
-
modelId: string;
|
|
386
|
-
providerConfigurationId: string | null;
|
|
387
|
-
toolDescriptors: any;
|
|
388
|
-
inputSchema: any;
|
|
389
|
-
outputSchema: any;
|
|
390
|
-
metadata: any;
|
|
391
|
-
publishedByUserId: string;
|
|
392
|
-
publishedAt: Date;
|
|
393
|
-
}
|
|
394
|
-
export declare function getAgentDefinitionVersionByNumber(client: Client, args: GetAgentDefinitionVersionByNumberArgs): Promise<GetAgentDefinitionVersionByNumberRow | null>;
|
|
395
|
-
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";
|
|
396
|
-
export interface GetAgentDefinitionVersionByIDArgs {
|
|
397
|
-
organizationId: string;
|
|
398
|
-
versionId: string;
|
|
399
|
-
}
|
|
400
|
-
export interface GetAgentDefinitionVersionByIDRow {
|
|
401
|
-
id: string;
|
|
402
|
-
definitionId: string;
|
|
403
|
-
organizationId: string;
|
|
404
|
-
version: number;
|
|
405
|
-
sourceDraftRevision: number;
|
|
406
|
-
name: string;
|
|
407
|
-
description: string;
|
|
408
|
-
instructions: string;
|
|
409
|
-
modelId: string;
|
|
410
|
-
providerConfigurationId: string | null;
|
|
411
|
-
toolDescriptors: any;
|
|
412
|
-
inputSchema: any;
|
|
413
|
-
outputSchema: any;
|
|
414
|
-
metadata: any;
|
|
415
|
-
publishedByUserId: string;
|
|
416
|
-
publishedAt: Date;
|
|
417
|
-
}
|
|
418
|
-
export declare function getAgentDefinitionVersionByID(client: Client, args: GetAgentDefinitionVersionByIDArgs): Promise<GetAgentDefinitionVersionByIDRow | null>;
|
|
419
|
-
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";
|
|
420
|
-
export interface ListAgentDefinitionVersionsArgs {
|
|
421
|
-
organizationId: string;
|
|
422
|
-
definitionId: string;
|
|
423
|
-
pageOffset: string;
|
|
424
|
-
pageSize: string;
|
|
425
|
-
}
|
|
426
|
-
export interface ListAgentDefinitionVersionsRow {
|
|
427
|
-
id: string;
|
|
428
|
-
definitionId: string;
|
|
429
|
-
organizationId: string;
|
|
430
|
-
version: number;
|
|
431
|
-
sourceDraftRevision: number;
|
|
432
|
-
name: string;
|
|
433
|
-
description: string;
|
|
434
|
-
instructions: string;
|
|
435
|
-
modelId: string;
|
|
436
|
-
providerConfigurationId: string | null;
|
|
437
|
-
toolDescriptors: any;
|
|
438
|
-
inputSchema: any;
|
|
439
|
-
outputSchema: any;
|
|
440
|
-
metadata: any;
|
|
441
|
-
publishedByUserId: string;
|
|
442
|
-
publishedAt: Date;
|
|
443
|
-
}
|
|
444
|
-
export declare function listAgentDefinitionVersions(client: Client, args: ListAgentDefinitionVersionsArgs): Promise<ListAgentDefinitionVersionsRow[]>;
|
|
445
|
-
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";
|
|
147
|
+
export declare function upsertDefaultChatAgent(client: Client, args: UpsertDefaultChatAgentArgs): Promise<UpsertDefaultChatAgentRow | null>;
|
|
148
|
+
export declare const createAgentRunQuery = "-- name: CreateAgentRun :one\nINSERT INTO weave.agent_run (\n organization_id,\n root_agent_id,\n runtime_invocation_id,\n started_by_user_id,\n chat_session_id,\n status,\n input,\n model_id,\n inference_model_route_id,\n generate_config\n) VALUES (\n $1,\n $2,\n COALESCE($3::text, ''),\n $4,\n $5::uuid,\n COALESCE($6::text, 'pending'),\n COALESCE($7::jsonb, '{}'::jsonb),\n COALESCE($8::text, ''),\n $9::uuid,\n COALESCE($10::jsonb, '{}'::jsonb)\n)\nRETURNING id, organization_id, root_agent_id, runtime_invocation_id, started_by_user_id, chat_session_id, status, input, output, model_id, inference_model_route_id, generate_config, generation_details, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
446
149
|
export interface CreateAgentRunArgs {
|
|
447
|
-
id: string;
|
|
448
150
|
organizationId: string;
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
createdByUserId: string;
|
|
151
|
+
rootAgentId: string;
|
|
152
|
+
runtimeInvocationId: string | null;
|
|
153
|
+
startedByUserId: string;
|
|
453
154
|
chatSessionId: string | null;
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
155
|
+
status: string | null;
|
|
156
|
+
input: any | null;
|
|
157
|
+
modelId: string | null;
|
|
158
|
+
inferenceModelRouteId: string | null;
|
|
159
|
+
generateConfig: any | null;
|
|
457
160
|
}
|
|
458
161
|
export interface CreateAgentRunRow {
|
|
459
162
|
id: string;
|
|
460
163
|
organizationId: string;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
createdByUserId: string;
|
|
164
|
+
rootAgentId: string;
|
|
165
|
+
runtimeInvocationId: string;
|
|
166
|
+
startedByUserId: string;
|
|
465
167
|
chatSessionId: string | null;
|
|
466
|
-
|
|
467
|
-
workflowStepRunId: string | null;
|
|
168
|
+
status: string;
|
|
468
169
|
input: any;
|
|
469
|
-
output: any;
|
|
170
|
+
output: any | null;
|
|
171
|
+
modelId: string;
|
|
172
|
+
inferenceModelRouteId: string | null;
|
|
173
|
+
generateConfig: any;
|
|
174
|
+
generationDetails: any | null;
|
|
470
175
|
errorCode: string;
|
|
471
|
-
|
|
472
|
-
createdAt: Date;
|
|
176
|
+
errorMessage: string;
|
|
473
177
|
startedAt: Date | null;
|
|
474
|
-
|
|
178
|
+
completedAt: Date | null;
|
|
179
|
+
createdAt: Date;
|
|
180
|
+
updatedAt: Date;
|
|
475
181
|
}
|
|
476
182
|
export declare function createAgentRun(client: Client, args: CreateAgentRunArgs): Promise<CreateAgentRunRow | null>;
|
|
477
|
-
export declare const getAgentRunQuery = "-- name: GetAgentRun :one\nSELECT id, organization_id,
|
|
183
|
+
export declare const getAgentRunQuery = "-- name: GetAgentRun :one\nSELECT id, organization_id, root_agent_id, runtime_invocation_id, started_by_user_id, chat_session_id, status, input, output, model_id, inference_model_route_id, generate_config, generation_details, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM weave.agent_run\nWHERE organization_id = $1\n AND id = $2";
|
|
478
184
|
export interface GetAgentRunArgs {
|
|
479
185
|
organizationId: string;
|
|
480
186
|
agentRunId: string;
|
|
@@ -482,133 +188,122 @@ export interface GetAgentRunArgs {
|
|
|
482
188
|
export interface GetAgentRunRow {
|
|
483
189
|
id: string;
|
|
484
190
|
organizationId: string;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
createdByUserId: string;
|
|
191
|
+
rootAgentId: string;
|
|
192
|
+
runtimeInvocationId: string;
|
|
193
|
+
startedByUserId: string;
|
|
489
194
|
chatSessionId: string | null;
|
|
490
|
-
workflowRunId: string | null;
|
|
491
|
-
workflowStepRunId: string | null;
|
|
492
|
-
input: any;
|
|
493
|
-
output: any;
|
|
494
|
-
errorCode: string;
|
|
495
|
-
safeErrorMessage: string;
|
|
496
|
-
createdAt: Date;
|
|
497
|
-
startedAt: Date | null;
|
|
498
|
-
finishedAt: Date | null;
|
|
499
|
-
}
|
|
500
|
-
export declare function getAgentRun(client: Client, args: GetAgentRunArgs): Promise<GetAgentRunRow | null>;
|
|
501
|
-
export declare const claimAgentRunQuery = "-- name: ClaimAgentRun :one\nUPDATE weave.agent_runs\nSET\n status = $1,\n error_code = '',\n safe_error_message = '',\n started_at = COALESCE(started_at, $2::timestamptz),\n finished_at = NULL\nWHERE organization_id = $3\n AND id = $4\n AND status = $5\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";
|
|
502
|
-
export interface ClaimAgentRunArgs {
|
|
503
|
-
status: string;
|
|
504
|
-
startedAt: Date;
|
|
505
|
-
organizationId: string;
|
|
506
|
-
agentRunId: string;
|
|
507
|
-
expectedStatus: string;
|
|
508
|
-
}
|
|
509
|
-
export interface ClaimAgentRunRow {
|
|
510
|
-
id: string;
|
|
511
|
-
organizationId: string;
|
|
512
|
-
agentDefinitionId: string;
|
|
513
|
-
agentVersionId: string;
|
|
514
195
|
status: string;
|
|
515
|
-
createdByUserId: string;
|
|
516
|
-
chatSessionId: string | null;
|
|
517
|
-
workflowRunId: string | null;
|
|
518
|
-
workflowStepRunId: string | null;
|
|
519
196
|
input: any;
|
|
520
|
-
output: any;
|
|
197
|
+
output: any | null;
|
|
198
|
+
modelId: string;
|
|
199
|
+
inferenceModelRouteId: string | null;
|
|
200
|
+
generateConfig: any;
|
|
201
|
+
generationDetails: any | null;
|
|
521
202
|
errorCode: string;
|
|
522
|
-
|
|
523
|
-
createdAt: Date;
|
|
203
|
+
errorMessage: string;
|
|
524
204
|
startedAt: Date | null;
|
|
525
|
-
|
|
205
|
+
completedAt: Date | null;
|
|
206
|
+
createdAt: Date;
|
|
207
|
+
updatedAt: Date;
|
|
526
208
|
}
|
|
527
|
-
export declare function
|
|
528
|
-
export declare const listAgentRunsQuery = "-- name: ListAgentRuns :many\nSELECT id, organization_id,
|
|
209
|
+
export declare function getAgentRun(client: Client, args: GetAgentRunArgs): Promise<GetAgentRunRow | null>;
|
|
210
|
+
export declare const listAgentRunsQuery = "-- name: ListAgentRuns :many\nSELECT id, organization_id, root_agent_id, runtime_invocation_id, started_by_user_id, chat_session_id, status, input, output, model_id, inference_model_route_id, generate_config, generation_details, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM weave.agent_run\nWHERE organization_id = $1\n AND ($2::uuid IS NULL OR root_agent_id = $2::uuid)\n AND ($3::uuid IS NULL OR chat_session_id = $3::uuid)\n AND ($4::text IS NULL OR status = $4::text)\nORDER BY created_at DESC, id DESC\nLIMIT COALESCE($6::integer, 100)\nOFFSET COALESCE($5::integer, 0)";
|
|
529
211
|
export interface ListAgentRunsArgs {
|
|
530
212
|
organizationId: string;
|
|
531
|
-
|
|
213
|
+
rootAgentId: string | null;
|
|
214
|
+
chatSessionId: string | null;
|
|
532
215
|
status: string | null;
|
|
533
|
-
pageOffset:
|
|
534
|
-
pageSize:
|
|
216
|
+
pageOffset: number | null;
|
|
217
|
+
pageSize: number | null;
|
|
535
218
|
}
|
|
536
219
|
export interface ListAgentRunsRow {
|
|
537
220
|
id: string;
|
|
538
221
|
organizationId: string;
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
createdByUserId: string;
|
|
222
|
+
rootAgentId: string;
|
|
223
|
+
runtimeInvocationId: string;
|
|
224
|
+
startedByUserId: string;
|
|
543
225
|
chatSessionId: string | null;
|
|
544
|
-
|
|
545
|
-
workflowStepRunId: string | null;
|
|
226
|
+
status: string;
|
|
546
227
|
input: any;
|
|
547
|
-
output: any;
|
|
228
|
+
output: any | null;
|
|
229
|
+
modelId: string;
|
|
230
|
+
inferenceModelRouteId: string | null;
|
|
231
|
+
generateConfig: any;
|
|
232
|
+
generationDetails: any | null;
|
|
548
233
|
errorCode: string;
|
|
549
|
-
|
|
550
|
-
createdAt: Date;
|
|
234
|
+
errorMessage: string;
|
|
551
235
|
startedAt: Date | null;
|
|
552
|
-
|
|
236
|
+
completedAt: Date | null;
|
|
237
|
+
createdAt: Date;
|
|
238
|
+
updatedAt: Date;
|
|
553
239
|
}
|
|
554
240
|
export declare function listAgentRuns(client: Client, args: ListAgentRunsArgs): Promise<ListAgentRunsRow[]>;
|
|
555
|
-
export declare const updateAgentRunStatusQuery = "-- name: UpdateAgentRunStatus :one\nUPDATE weave.
|
|
241
|
+
export declare const updateAgentRunStatusQuery = "-- name: UpdateAgentRunStatus :one\nUPDATE weave.agent_run\nSET status = $1,\n runtime_invocation_id = COALESCE($2::text, runtime_invocation_id),\n output = $3::jsonb,\n model_id = COALESCE($4::text, model_id),\n inference_model_route_id = COALESCE($5::uuid, inference_model_route_id),\n generate_config = COALESCE($6::jsonb, generate_config),\n generation_details = $7::jsonb,\n error_code = COALESCE($8::text, ''),\n error_message = COALESCE($9::text, ''),\n started_at = COALESCE($10::timestamptz, started_at),\n completed_at = $11::timestamptz\nWHERE organization_id = $12\n AND id = $13\nRETURNING id, organization_id, root_agent_id, runtime_invocation_id, started_by_user_id, chat_session_id, status, input, output, model_id, inference_model_route_id, generate_config, generation_details, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
556
242
|
export interface UpdateAgentRunStatusArgs {
|
|
557
243
|
status: string;
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
244
|
+
runtimeInvocationId: string | null;
|
|
245
|
+
output: any | null;
|
|
246
|
+
modelId: string | null;
|
|
247
|
+
inferenceModelRouteId: string | null;
|
|
248
|
+
generateConfig: any | null;
|
|
249
|
+
generationDetails: any | null;
|
|
250
|
+
errorCode: string | null;
|
|
251
|
+
errorMessage: string | null;
|
|
561
252
|
startedAt: Date | null;
|
|
562
|
-
|
|
253
|
+
completedAt: Date | null;
|
|
563
254
|
organizationId: string;
|
|
564
255
|
agentRunId: string;
|
|
565
256
|
}
|
|
566
257
|
export interface UpdateAgentRunStatusRow {
|
|
567
258
|
id: string;
|
|
568
259
|
organizationId: string;
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
createdByUserId: string;
|
|
260
|
+
rootAgentId: string;
|
|
261
|
+
runtimeInvocationId: string;
|
|
262
|
+
startedByUserId: string;
|
|
573
263
|
chatSessionId: string | null;
|
|
574
|
-
|
|
575
|
-
workflowStepRunId: string | null;
|
|
264
|
+
status: string;
|
|
576
265
|
input: any;
|
|
577
|
-
output: any;
|
|
266
|
+
output: any | null;
|
|
267
|
+
modelId: string;
|
|
268
|
+
inferenceModelRouteId: string | null;
|
|
269
|
+
generateConfig: any;
|
|
270
|
+
generationDetails: any | null;
|
|
578
271
|
errorCode: string;
|
|
579
|
-
|
|
580
|
-
createdAt: Date;
|
|
272
|
+
errorMessage: string;
|
|
581
273
|
startedAt: Date | null;
|
|
582
|
-
|
|
274
|
+
completedAt: Date | null;
|
|
275
|
+
createdAt: Date;
|
|
276
|
+
updatedAt: Date;
|
|
583
277
|
}
|
|
584
278
|
export declare function updateAgentRunStatus(client: Client, args: UpdateAgentRunStatusArgs): Promise<UpdateAgentRunStatusRow | null>;
|
|
585
|
-
export declare const
|
|
586
|
-
export interface
|
|
587
|
-
id: string;
|
|
279
|
+
export declare const createAgentRunEventQuery = "-- name: CreateAgentRunEvent :one\nINSERT INTO weave.agent_run_event (\n organization_id,\n agent_run_id,\n sequence,\n kind,\n agent_id,\n payload,\n generation_details\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5::uuid,\n COALESCE($6::jsonb, '{}'::jsonb),\n $7::jsonb\n)\nRETURNING id, organization_id, agent_run_id, sequence, kind, agent_id, payload, generation_details, created_at";
|
|
280
|
+
export interface CreateAgentRunEventArgs {
|
|
588
281
|
organizationId: string;
|
|
589
282
|
agentRunId: string;
|
|
590
283
|
sequence: string;
|
|
591
284
|
kind: string;
|
|
592
|
-
|
|
593
|
-
payload: any;
|
|
285
|
+
agentId: string | null;
|
|
286
|
+
payload: any | null;
|
|
287
|
+
generationDetails: any | null;
|
|
594
288
|
}
|
|
595
|
-
export interface
|
|
289
|
+
export interface CreateAgentRunEventRow {
|
|
596
290
|
id: string;
|
|
597
291
|
organizationId: string;
|
|
598
292
|
agentRunId: string;
|
|
599
293
|
sequence: string;
|
|
600
294
|
kind: string;
|
|
601
|
-
|
|
295
|
+
agentId: string | null;
|
|
602
296
|
payload: any;
|
|
297
|
+
generationDetails: any | null;
|
|
603
298
|
createdAt: Date;
|
|
604
299
|
}
|
|
605
|
-
export declare function
|
|
606
|
-
export declare const listAgentRunEventsQuery = "-- name: ListAgentRunEvents :many\nSELECT id, organization_id, agent_run_id, sequence, kind,
|
|
300
|
+
export declare function createAgentRunEvent(client: Client, args: CreateAgentRunEventArgs): Promise<CreateAgentRunEventRow | null>;
|
|
301
|
+
export declare const listAgentRunEventsQuery = "-- name: ListAgentRunEvents :many\nSELECT id, organization_id, agent_run_id, sequence, kind, agent_id, payload, generation_details, created_at\nFROM weave.agent_run_event\nWHERE organization_id = $1\n AND agent_run_id = $2\n AND sequence > COALESCE($3::bigint, 0)\nORDER BY sequence ASC\nLIMIT COALESCE($4::integer, 100)";
|
|
607
302
|
export interface ListAgentRunEventsArgs {
|
|
608
303
|
organizationId: string;
|
|
609
304
|
agentRunId: string;
|
|
610
|
-
afterSequence: string;
|
|
611
|
-
pageSize:
|
|
305
|
+
afterSequence: string | null;
|
|
306
|
+
pageSize: number | null;
|
|
612
307
|
}
|
|
613
308
|
export interface ListAgentRunEventsRow {
|
|
614
309
|
id: string;
|
|
@@ -616,8 +311,9 @@ export interface ListAgentRunEventsRow {
|
|
|
616
311
|
agentRunId: string;
|
|
617
312
|
sequence: string;
|
|
618
313
|
kind: string;
|
|
619
|
-
|
|
314
|
+
agentId: string | null;
|
|
620
315
|
payload: any;
|
|
316
|
+
generationDetails: any | null;
|
|
621
317
|
createdAt: Date;
|
|
622
318
|
}
|
|
623
319
|
export declare function listAgentRunEvents(client: Client, args: ListAgentRunEventsArgs): Promise<ListAgentRunEventsRow[]>;
|