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,703 +2,316 @@ 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 createWorkflowQuery = "-- name: CreateWorkflow :one\nINSERT INTO weave.workflow (\n organization_id,\n slug,\n name,\n description,\n definition,\n metadata\n) VALUES (\n $1,\n $2,\n $3,\n COALESCE($4::text, ''),\n COALESCE($5::jsonb, '{}'::jsonb),\n COALESCE($6::jsonb, '{}'::jsonb)\n)\nRETURNING id, organization_id, slug, name, description, status, definition, metadata, created_at, updated_at";
|
|
6
|
+
export interface CreateWorkflowArgs {
|
|
8
7
|
organizationId: string;
|
|
9
8
|
slug: string;
|
|
10
9
|
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
description: string | null;
|
|
11
|
+
definition: any | null;
|
|
12
|
+
metadata: any | null;
|
|
14
13
|
}
|
|
15
|
-
export interface
|
|
14
|
+
export interface CreateWorkflowRow {
|
|
16
15
|
id: string;
|
|
17
16
|
organizationId: string;
|
|
18
17
|
slug: string;
|
|
19
18
|
name: string;
|
|
20
19
|
description: string;
|
|
21
20
|
status: string;
|
|
22
|
-
|
|
23
|
-
draftRevision: number;
|
|
24
|
-
latestVersionId: string | null;
|
|
25
|
-
latestVersion: number;
|
|
26
|
-
createdAt: Date;
|
|
27
|
-
updatedAt: Date;
|
|
28
|
-
}
|
|
29
|
-
export declare function createWorkflowDefinition(client: Client, args: CreateWorkflowDefinitionArgs): Promise<CreateWorkflowDefinitionRow | null>;
|
|
30
|
-
export declare const createWorkflowDefinitionDraftQuery = "-- name: CreateWorkflowDefinitionDraft :one\nINSERT INTO weave.workflow_definition_drafts (\n id,\n definition_id,\n organization_id,\n base_version_id,\n revision,\n name,\n description,\n graph,\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,\n $11,\n $12\n)\nRETURNING id, definition_id, organization_id, base_version_id, revision, name, description, graph, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at";
|
|
31
|
-
export interface CreateWorkflowDefinitionDraftArgs {
|
|
32
|
-
id: string;
|
|
33
|
-
definitionId: string;
|
|
34
|
-
organizationId: string;
|
|
35
|
-
baseVersionId: string | null;
|
|
36
|
-
revision: number;
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
|
-
graph: any;
|
|
40
|
-
inputSchema: any;
|
|
41
|
-
outputSchema: any;
|
|
21
|
+
definition: any;
|
|
42
22
|
metadata: any;
|
|
43
|
-
updatedByUserId: string;
|
|
44
|
-
}
|
|
45
|
-
export interface CreateWorkflowDefinitionDraftRow {
|
|
46
|
-
id: string;
|
|
47
|
-
definitionId: string;
|
|
48
|
-
organizationId: string;
|
|
49
|
-
baseVersionId: string | null;
|
|
50
|
-
revision: number;
|
|
51
|
-
name: string;
|
|
52
|
-
description: string;
|
|
53
|
-
graph: any;
|
|
54
|
-
inputSchema: any;
|
|
55
|
-
outputSchema: any;
|
|
56
|
-
metadata: any;
|
|
57
|
-
updatedByUserId: string;
|
|
58
|
-
createdAt: Date;
|
|
59
|
-
updatedAt: Date;
|
|
60
|
-
}
|
|
61
|
-
export declare function createWorkflowDefinitionDraft(client: Client, args: CreateWorkflowDefinitionDraftArgs): Promise<CreateWorkflowDefinitionDraftRow | null>;
|
|
62
|
-
export declare const getWorkflowDefinitionByIDQuery = "-- name: GetWorkflowDefinitionByID :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.workflow_definitions\nWHERE organization_id = $1\n AND id = $2";
|
|
63
|
-
export interface GetWorkflowDefinitionByIDArgs {
|
|
64
|
-
organizationId: string;
|
|
65
|
-
definitionId: string;
|
|
66
|
-
}
|
|
67
|
-
export interface GetWorkflowDefinitionByIDRow {
|
|
68
|
-
id: string;
|
|
69
|
-
organizationId: string;
|
|
70
|
-
slug: string;
|
|
71
|
-
name: string;
|
|
72
|
-
description: string;
|
|
73
|
-
status: string;
|
|
74
|
-
createdByUserId: string;
|
|
75
|
-
draftRevision: number;
|
|
76
|
-
latestVersionId: string | null;
|
|
77
|
-
latestVersion: number;
|
|
78
23
|
createdAt: Date;
|
|
79
24
|
updatedAt: Date;
|
|
80
25
|
}
|
|
81
|
-
export declare function
|
|
82
|
-
export declare const
|
|
83
|
-
export interface
|
|
26
|
+
export declare function createWorkflow(client: Client, args: CreateWorkflowArgs): Promise<CreateWorkflowRow | null>;
|
|
27
|
+
export declare const getWorkflowQuery = "-- name: GetWorkflow :one\nSELECT id, organization_id, slug, name, description, status, definition, metadata, created_at, updated_at\nFROM weave.workflow\nWHERE organization_id = $1\n AND id = $2";
|
|
28
|
+
export interface GetWorkflowArgs {
|
|
84
29
|
organizationId: string;
|
|
85
|
-
|
|
30
|
+
workflowId: string;
|
|
86
31
|
}
|
|
87
|
-
export interface
|
|
32
|
+
export interface GetWorkflowRow {
|
|
88
33
|
id: string;
|
|
89
34
|
organizationId: string;
|
|
90
35
|
slug: string;
|
|
91
36
|
name: string;
|
|
92
37
|
description: string;
|
|
93
38
|
status: string;
|
|
94
|
-
|
|
95
|
-
draftRevision: number;
|
|
96
|
-
latestVersionId: string | null;
|
|
97
|
-
latestVersion: number;
|
|
98
|
-
createdAt: Date;
|
|
99
|
-
updatedAt: Date;
|
|
100
|
-
}
|
|
101
|
-
export declare function getWorkflowDefinitionBySlug(client: Client, args: GetWorkflowDefinitionBySlugArgs): Promise<GetWorkflowDefinitionBySlugRow | null>;
|
|
102
|
-
export declare const getWorkflowDefinitionDraftQuery = "-- name: GetWorkflowDefinitionDraft :one\nSELECT id, definition_id, organization_id, base_version_id, revision, name, description, graph, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at FROM weave.workflow_definition_drafts\nWHERE organization_id = $1\n AND definition_id = $2";
|
|
103
|
-
export interface GetWorkflowDefinitionDraftArgs {
|
|
104
|
-
organizationId: string;
|
|
105
|
-
definitionId: string;
|
|
106
|
-
}
|
|
107
|
-
export interface GetWorkflowDefinitionDraftRow {
|
|
108
|
-
id: string;
|
|
109
|
-
definitionId: string;
|
|
110
|
-
organizationId: string;
|
|
111
|
-
baseVersionId: string | null;
|
|
112
|
-
revision: number;
|
|
113
|
-
name: string;
|
|
114
|
-
description: string;
|
|
115
|
-
graph: any;
|
|
116
|
-
inputSchema: any;
|
|
117
|
-
outputSchema: any;
|
|
39
|
+
definition: any;
|
|
118
40
|
metadata: any;
|
|
119
|
-
updatedByUserId: string;
|
|
120
41
|
createdAt: Date;
|
|
121
42
|
updatedAt: Date;
|
|
122
43
|
}
|
|
123
|
-
export declare function
|
|
124
|
-
export declare const
|
|
125
|
-
export interface
|
|
126
|
-
|
|
44
|
+
export declare function getWorkflow(client: Client, args: GetWorkflowArgs): Promise<GetWorkflowRow | null>;
|
|
45
|
+
export declare const updateWorkflowQuery = "-- name: UpdateWorkflow :one\nUPDATE weave.workflow\nSET slug = COALESCE($1::text, slug),\n name = COALESCE($2::text, name),\n description = COALESCE($3::text, description),\n status = COALESCE($4::text, status),\n definition = COALESCE($5::jsonb, definition),\n metadata = COALESCE($6::jsonb, metadata)\nWHERE organization_id = $7\n AND id = $8\nRETURNING id, organization_id, slug, name, description, status, definition, metadata, created_at, updated_at";
|
|
46
|
+
export interface UpdateWorkflowArgs {
|
|
47
|
+
slug: string | null;
|
|
48
|
+
name: string | null;
|
|
49
|
+
description: string | null;
|
|
127
50
|
status: string | null;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
export interface ListWorkflowDefinitionsRow {
|
|
132
|
-
id: string;
|
|
51
|
+
definition: any | null;
|
|
52
|
+
metadata: any | null;
|
|
133
53
|
organizationId: string;
|
|
134
|
-
|
|
135
|
-
name: string;
|
|
136
|
-
description: string;
|
|
137
|
-
status: string;
|
|
138
|
-
createdByUserId: string;
|
|
139
|
-
draftRevision: number;
|
|
140
|
-
latestVersionId: string | null;
|
|
141
|
-
latestVersion: number;
|
|
142
|
-
createdAt: Date;
|
|
143
|
-
updatedAt: Date;
|
|
54
|
+
workflowId: string;
|
|
144
55
|
}
|
|
145
|
-
export
|
|
146
|
-
export declare const updateWorkflowDefinitionDraftMetadataQuery = "-- name: UpdateWorkflowDefinitionDraftMetadata :one\nUPDATE weave.workflow_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";
|
|
147
|
-
export interface UpdateWorkflowDefinitionDraftMetadataArgs {
|
|
148
|
-
name: string;
|
|
149
|
-
description: string;
|
|
150
|
-
draftRevision: number;
|
|
151
|
-
organizationId: string;
|
|
152
|
-
definitionId: string;
|
|
153
|
-
}
|
|
154
|
-
export interface UpdateWorkflowDefinitionDraftMetadataRow {
|
|
56
|
+
export interface UpdateWorkflowRow {
|
|
155
57
|
id: string;
|
|
156
58
|
organizationId: string;
|
|
157
59
|
slug: string;
|
|
158
60
|
name: string;
|
|
159
61
|
description: string;
|
|
160
62
|
status: string;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
latestVersionId: string | null;
|
|
164
|
-
latestVersion: number;
|
|
63
|
+
definition: any;
|
|
64
|
+
metadata: any;
|
|
165
65
|
createdAt: Date;
|
|
166
66
|
updatedAt: Date;
|
|
167
67
|
}
|
|
168
|
-
export declare function
|
|
169
|
-
export declare const
|
|
170
|
-
export interface
|
|
171
|
-
status: string;
|
|
68
|
+
export declare function updateWorkflow(client: Client, args: UpdateWorkflowArgs): Promise<UpdateWorkflowRow | null>;
|
|
69
|
+
export declare const listWorkflowsQuery = "-- name: ListWorkflows :many\nSELECT id, organization_id, slug, name, description, status, definition, metadata, created_at, updated_at\nFROM weave.workflow\nWHERE organization_id = $1\nORDER BY name ASC, id ASC\nLIMIT COALESCE($3::integer, 100)\nOFFSET COALESCE($2::integer, 0)";
|
|
70
|
+
export interface ListWorkflowsArgs {
|
|
172
71
|
organizationId: string;
|
|
173
|
-
|
|
72
|
+
pageOffset: number | null;
|
|
73
|
+
pageSize: number | null;
|
|
174
74
|
}
|
|
175
|
-
export interface
|
|
75
|
+
export interface ListWorkflowsRow {
|
|
176
76
|
id: string;
|
|
177
77
|
organizationId: string;
|
|
178
78
|
slug: string;
|
|
179
79
|
name: string;
|
|
180
80
|
description: string;
|
|
181
81
|
status: string;
|
|
182
|
-
|
|
183
|
-
draftRevision: number;
|
|
184
|
-
latestVersionId: string | null;
|
|
185
|
-
latestVersion: number;
|
|
186
|
-
createdAt: Date;
|
|
187
|
-
updatedAt: Date;
|
|
188
|
-
}
|
|
189
|
-
export declare function updateWorkflowDefinitionStatus(client: Client, args: UpdateWorkflowDefinitionStatusArgs): Promise<UpdateWorkflowDefinitionStatusRow | null>;
|
|
190
|
-
export declare const updateWorkflowDraftQuery = "-- name: UpdateWorkflowDraft :one\nUPDATE weave.workflow_definition_drafts\nSET\n base_version_id = $1::uuid,\n revision = revision + 1,\n name = $2,\n description = $3,\n graph = $4,\n input_schema = $5,\n output_schema = $6,\n metadata = $7,\n updated_by_user_id = $8,\n updated_at = now()\nWHERE organization_id = $9\n AND definition_id = $10\n AND revision = $11\nRETURNING id, definition_id, organization_id, base_version_id, revision, name, description, graph, input_schema, output_schema, metadata, updated_by_user_id, created_at, updated_at";
|
|
191
|
-
export interface UpdateWorkflowDraftArgs {
|
|
192
|
-
baseVersionId: string | null;
|
|
193
|
-
name: string;
|
|
194
|
-
description: string;
|
|
195
|
-
graph: any;
|
|
196
|
-
inputSchema: any;
|
|
197
|
-
outputSchema: any;
|
|
82
|
+
definition: any;
|
|
198
83
|
metadata: any;
|
|
199
|
-
updatedByUserId: string;
|
|
200
|
-
organizationId: string;
|
|
201
|
-
definitionId: string;
|
|
202
|
-
expectedRevision: number;
|
|
203
|
-
}
|
|
204
|
-
export interface UpdateWorkflowDraftRow {
|
|
205
|
-
id: string;
|
|
206
|
-
definitionId: string;
|
|
207
|
-
organizationId: string;
|
|
208
|
-
baseVersionId: string | null;
|
|
209
|
-
revision: number;
|
|
210
|
-
name: string;
|
|
211
|
-
description: string;
|
|
212
|
-
graph: any;
|
|
213
|
-
inputSchema: any;
|
|
214
|
-
outputSchema: any;
|
|
215
|
-
metadata: any;
|
|
216
|
-
updatedByUserId: string;
|
|
217
84
|
createdAt: Date;
|
|
218
85
|
updatedAt: Date;
|
|
219
86
|
}
|
|
220
|
-
export declare function
|
|
221
|
-
export declare const
|
|
222
|
-
export interface
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
revision: number;
|
|
227
|
-
patch: any;
|
|
228
|
-
createdByUserId: string;
|
|
229
|
-
}
|
|
230
|
-
export interface InsertWorkflowDraftPatchRow {
|
|
231
|
-
id: string;
|
|
232
|
-
definitionId: string;
|
|
233
|
-
organizationId: string;
|
|
234
|
-
revision: number;
|
|
235
|
-
patch: any;
|
|
236
|
-
createdByUserId: string;
|
|
237
|
-
createdAt: Date;
|
|
238
|
-
}
|
|
239
|
-
export declare function insertWorkflowDraftPatch(client: Client, args: InsertWorkflowDraftPatchArgs): Promise<InsertWorkflowDraftPatchRow | null>;
|
|
240
|
-
export declare const insertWorkflowDraftEventQuery = "-- name: InsertWorkflowDraftEvent :one\nINSERT INTO weave.workflow_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.workflow_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";
|
|
241
|
-
export interface InsertWorkflowDraftEventArgs {
|
|
242
|
-
id: string;
|
|
243
|
-
definitionId: string;
|
|
244
|
-
organizationId: string;
|
|
245
|
-
draftId: string;
|
|
246
|
-
kind: string;
|
|
247
|
-
baseRevision: number;
|
|
248
|
-
resultRevision: number | null;
|
|
249
|
-
changedFields: string[];
|
|
250
|
-
source: string;
|
|
251
|
-
clientRequestId: string;
|
|
252
|
-
conflict: any | null;
|
|
253
|
-
createdByUserId: string;
|
|
254
|
-
}
|
|
255
|
-
export interface InsertWorkflowDraftEventRow {
|
|
256
|
-
id: string;
|
|
257
|
-
organizationId: string;
|
|
258
|
-
definitionId: string;
|
|
259
|
-
draftId: string;
|
|
260
|
-
sequence: 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
|
-
createdAt: Date;
|
|
270
|
-
}
|
|
271
|
-
export declare function insertWorkflowDraftEvent(client: Client, args: InsertWorkflowDraftEventArgs): Promise<InsertWorkflowDraftEventRow | null>;
|
|
272
|
-
export declare const listWorkflowDraftEventsQuery = "-- name: ListWorkflowDraftEvents :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.workflow_definition_draft_events\nWHERE organization_id = $1\n AND definition_id = $2\n AND sequence > $3\nORDER BY sequence\nLIMIT $4";
|
|
273
|
-
export interface ListWorkflowDraftEventsArgs {
|
|
274
|
-
organizationId: string;
|
|
275
|
-
definitionId: string;
|
|
276
|
-
afterSequence: string;
|
|
277
|
-
pageSize: string;
|
|
278
|
-
}
|
|
279
|
-
export interface ListWorkflowDraftEventsRow {
|
|
280
|
-
id: string;
|
|
281
|
-
organizationId: string;
|
|
282
|
-
definitionId: string;
|
|
283
|
-
draftId: string;
|
|
284
|
-
sequence: string;
|
|
285
|
-
kind: string;
|
|
286
|
-
baseRevision: number;
|
|
287
|
-
resultRevision: number | null;
|
|
288
|
-
changedFields: string[];
|
|
289
|
-
source: string;
|
|
290
|
-
clientRequestId: string;
|
|
291
|
-
conflict: any | null;
|
|
292
|
-
createdByUserId: string;
|
|
293
|
-
createdAt: Date;
|
|
294
|
-
}
|
|
295
|
-
export declare function listWorkflowDraftEvents(client: Client, args: ListWorkflowDraftEventsArgs): Promise<ListWorkflowDraftEventsRow[]>;
|
|
296
|
-
export declare const insertWorkflowDefinitionVersionQuery = "-- name: InsertWorkflowDefinitionVersion :one\nINSERT INTO weave.workflow_definition_versions (\n id,\n definition_id,\n organization_id,\n version,\n source_draft_revision,\n name,\n description,\n graph,\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,\n $11,\n $12\n)\nRETURNING id, definition_id, organization_id, version, source_draft_revision, name, description, graph, input_schema, output_schema, metadata, published_by_user_id, published_at";
|
|
297
|
-
export interface InsertWorkflowDefinitionVersionArgs {
|
|
298
|
-
id: string;
|
|
299
|
-
definitionId: string;
|
|
300
|
-
organizationId: string;
|
|
301
|
-
version: number;
|
|
302
|
-
sourceDraftRevision: number;
|
|
303
|
-
name: string;
|
|
304
|
-
description: string;
|
|
305
|
-
graph: any;
|
|
306
|
-
inputSchema: any;
|
|
307
|
-
outputSchema: any;
|
|
308
|
-
metadata: any;
|
|
309
|
-
publishedByUserId: string;
|
|
310
|
-
}
|
|
311
|
-
export interface InsertWorkflowDefinitionVersionRow {
|
|
312
|
-
id: string;
|
|
313
|
-
definitionId: string;
|
|
314
|
-
organizationId: string;
|
|
315
|
-
version: number;
|
|
316
|
-
sourceDraftRevision: number;
|
|
317
|
-
name: string;
|
|
318
|
-
description: string;
|
|
319
|
-
graph: any;
|
|
320
|
-
inputSchema: any;
|
|
321
|
-
outputSchema: any;
|
|
322
|
-
metadata: any;
|
|
323
|
-
publishedByUserId: string;
|
|
324
|
-
publishedAt: Date;
|
|
325
|
-
}
|
|
326
|
-
export declare function insertWorkflowDefinitionVersion(client: Client, args: InsertWorkflowDefinitionVersionArgs): Promise<InsertWorkflowDefinitionVersionRow | null>;
|
|
327
|
-
export declare const setWorkflowDefinitionLatestVersionQuery = "-- name: SetWorkflowDefinitionLatestVersion :one\nUPDATE weave.workflow_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";
|
|
328
|
-
export interface SetWorkflowDefinitionLatestVersionArgs {
|
|
329
|
-
versionId: string | null;
|
|
330
|
-
version: number;
|
|
87
|
+
export declare function listWorkflows(client: Client, args: ListWorkflowsArgs): Promise<ListWorkflowsRow[]>;
|
|
88
|
+
export declare const createWorkflowRunQuery = "-- name: CreateWorkflowRun :one\nWITH selected_workflow AS (\n SELECT id, organization_id, slug, name, description, status, definition, metadata, created_at, updated_at\n FROM weave.workflow\n WHERE weave.workflow.organization_id = $4\n AND weave.workflow.id = $5\n)\nINSERT INTO weave.workflow_run (\n organization_id,\n workflow_id,\n started_by_user_id,\n chat_session_id,\n input,\n definition_snapshot\n)\nSELECT\n selected_workflow.organization_id,\n selected_workflow.id,\n $1,\n $2::uuid,\n COALESCE($3::jsonb, '{}'::jsonb),\n selected_workflow.definition\nFROM selected_workflow\nRETURNING id, organization_id, workflow_id, started_by_user_id, chat_session_id, status, input, output, definition_snapshot, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
89
|
+
export interface CreateWorkflowRunArgs {
|
|
90
|
+
startedByUserId: string;
|
|
91
|
+
chatSessionId: string | null;
|
|
92
|
+
input: any | null;
|
|
331
93
|
organizationId: string;
|
|
332
|
-
|
|
94
|
+
workflowId: string;
|
|
333
95
|
}
|
|
334
|
-
export interface
|
|
96
|
+
export interface CreateWorkflowRunRow {
|
|
335
97
|
id: string;
|
|
336
98
|
organizationId: string;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
99
|
+
workflowId: string;
|
|
100
|
+
startedByUserId: string;
|
|
101
|
+
chatSessionId: string | null;
|
|
340
102
|
status: string;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
103
|
+
input: any;
|
|
104
|
+
output: any | null;
|
|
105
|
+
definitionSnapshot: any | null;
|
|
106
|
+
errorCode: string;
|
|
107
|
+
errorMessage: string;
|
|
108
|
+
startedAt: Date | null;
|
|
109
|
+
completedAt: Date | null;
|
|
345
110
|
createdAt: Date;
|
|
346
111
|
updatedAt: Date;
|
|
347
112
|
}
|
|
348
|
-
export declare function
|
|
349
|
-
export declare const
|
|
350
|
-
export interface
|
|
351
|
-
organizationId: string;
|
|
352
|
-
definitionId: string;
|
|
353
|
-
version: number;
|
|
354
|
-
}
|
|
355
|
-
export interface GetWorkflowDefinitionVersionByNumberRow {
|
|
356
|
-
id: string;
|
|
357
|
-
definitionId: string;
|
|
358
|
-
organizationId: string;
|
|
359
|
-
version: number;
|
|
360
|
-
sourceDraftRevision: number;
|
|
361
|
-
name: string;
|
|
362
|
-
description: string;
|
|
363
|
-
graph: any;
|
|
364
|
-
inputSchema: any;
|
|
365
|
-
outputSchema: any;
|
|
366
|
-
metadata: any;
|
|
367
|
-
publishedByUserId: string;
|
|
368
|
-
publishedAt: Date;
|
|
369
|
-
}
|
|
370
|
-
export declare function getWorkflowDefinitionVersionByNumber(client: Client, args: GetWorkflowDefinitionVersionByNumberArgs): Promise<GetWorkflowDefinitionVersionByNumberRow | null>;
|
|
371
|
-
export declare const getWorkflowDefinitionVersionByIDQuery = "-- name: GetWorkflowDefinitionVersionByID :one\nSELECT id, definition_id, organization_id, version, source_draft_revision, name, description, graph, input_schema, output_schema, metadata, published_by_user_id, published_at FROM weave.workflow_definition_versions\nWHERE organization_id = $1\n AND id = $2";
|
|
372
|
-
export interface GetWorkflowDefinitionVersionByIDArgs {
|
|
373
|
-
organizationId: string;
|
|
374
|
-
versionId: string;
|
|
375
|
-
}
|
|
376
|
-
export interface GetWorkflowDefinitionVersionByIDRow {
|
|
377
|
-
id: string;
|
|
378
|
-
definitionId: string;
|
|
379
|
-
organizationId: string;
|
|
380
|
-
version: number;
|
|
381
|
-
sourceDraftRevision: number;
|
|
382
|
-
name: string;
|
|
383
|
-
description: string;
|
|
384
|
-
graph: any;
|
|
385
|
-
inputSchema: any;
|
|
386
|
-
outputSchema: any;
|
|
387
|
-
metadata: any;
|
|
388
|
-
publishedByUserId: string;
|
|
389
|
-
publishedAt: Date;
|
|
390
|
-
}
|
|
391
|
-
export declare function getWorkflowDefinitionVersionByID(client: Client, args: GetWorkflowDefinitionVersionByIDArgs): Promise<GetWorkflowDefinitionVersionByIDRow | null>;
|
|
392
|
-
export declare const listWorkflowDefinitionVersionsQuery = "-- name: ListWorkflowDefinitionVersions :many\nSELECT id, definition_id, organization_id, version, source_draft_revision, name, description, graph, input_schema, output_schema, metadata, published_by_user_id, published_at FROM weave.workflow_definition_versions\nWHERE organization_id = $1\n AND definition_id = $2\nORDER BY version DESC\nLIMIT $4 OFFSET $3";
|
|
393
|
-
export interface ListWorkflowDefinitionVersionsArgs {
|
|
394
|
-
organizationId: string;
|
|
395
|
-
definitionId: string;
|
|
396
|
-
pageOffset: string;
|
|
397
|
-
pageSize: string;
|
|
398
|
-
}
|
|
399
|
-
export interface ListWorkflowDefinitionVersionsRow {
|
|
400
|
-
id: string;
|
|
401
|
-
definitionId: string;
|
|
113
|
+
export declare function createWorkflowRun(client: Client, args: CreateWorkflowRunArgs): Promise<CreateWorkflowRunRow | null>;
|
|
114
|
+
export declare const getWorkflowRunQuery = "-- name: GetWorkflowRun :one\nSELECT id, organization_id, workflow_id, started_by_user_id, chat_session_id, status, input, output, definition_snapshot, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM weave.workflow_run\nWHERE organization_id = $1\n AND id = $2";
|
|
115
|
+
export interface GetWorkflowRunArgs {
|
|
402
116
|
organizationId: string;
|
|
403
|
-
|
|
404
|
-
sourceDraftRevision: number;
|
|
405
|
-
name: string;
|
|
406
|
-
description: string;
|
|
407
|
-
graph: any;
|
|
408
|
-
inputSchema: any;
|
|
409
|
-
outputSchema: any;
|
|
410
|
-
metadata: any;
|
|
411
|
-
publishedByUserId: string;
|
|
412
|
-
publishedAt: Date;
|
|
117
|
+
workflowRunId: string;
|
|
413
118
|
}
|
|
414
|
-
export
|
|
415
|
-
export declare const createWorkflowRunQuery = "-- name: CreateWorkflowRun :one\nINSERT INTO weave.workflow_runs (\n id,\n organization_id,\n workflow_definition_id,\n workflow_version_id,\n status,\n created_by_user_id,\n chat_session_id,\n input\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7::uuid,\n $8\n)\nRETURNING id, organization_id, workflow_definition_id, workflow_version_id, status, created_by_user_id, chat_session_id, input, output, error_code, safe_error_message, created_at, started_at, finished_at";
|
|
416
|
-
export interface CreateWorkflowRunArgs {
|
|
119
|
+
export interface GetWorkflowRunRow {
|
|
417
120
|
id: string;
|
|
418
121
|
organizationId: string;
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
status: string;
|
|
422
|
-
createdByUserId: string;
|
|
122
|
+
workflowId: string;
|
|
123
|
+
startedByUserId: string;
|
|
423
124
|
chatSessionId: string | null;
|
|
424
|
-
input: any;
|
|
425
|
-
}
|
|
426
|
-
export interface CreateWorkflowRunRow {
|
|
427
|
-
id: string;
|
|
428
|
-
organizationId: string;
|
|
429
|
-
workflowDefinitionId: string;
|
|
430
|
-
workflowVersionId: string;
|
|
431
125
|
status: string;
|
|
432
|
-
createdByUserId: string;
|
|
433
|
-
chatSessionId: string | null;
|
|
434
126
|
input: any;
|
|
435
|
-
output: any;
|
|
127
|
+
output: any | null;
|
|
128
|
+
definitionSnapshot: any | null;
|
|
436
129
|
errorCode: string;
|
|
437
|
-
|
|
438
|
-
createdAt: Date;
|
|
130
|
+
errorMessage: string;
|
|
439
131
|
startedAt: Date | null;
|
|
440
|
-
|
|
132
|
+
completedAt: Date | null;
|
|
133
|
+
createdAt: Date;
|
|
134
|
+
updatedAt: Date;
|
|
441
135
|
}
|
|
442
|
-
export declare function
|
|
443
|
-
export declare const
|
|
444
|
-
export interface
|
|
136
|
+
export declare function getWorkflowRun(client: Client, args: GetWorkflowRunArgs): Promise<GetWorkflowRunRow | null>;
|
|
137
|
+
export declare const cancelWorkflowRunQuery = "-- name: CancelWorkflowRun :one\nWITH canceled_run AS (\n UPDATE weave.workflow_run wr\n SET status = 'canceled',\n error_code = COALESCE($1::text, ''),\n error_message = COALESCE($2::text, ''),\n completed_at = COALESCE($3::timestamptz, now())\n WHERE wr.organization_id = $4\n AND wr.id = $5\n AND wr.status IN ('pending', 'running', 'waiting')\n RETURNING wr.id, wr.organization_id, wr.workflow_id, wr.started_by_user_id, wr.chat_session_id, wr.status, wr.input, wr.output, wr.definition_snapshot, wr.error_code, wr.error_message, wr.started_at, wr.completed_at, wr.created_at, wr.updated_at\n),\ncanceled_steps AS (\n UPDATE weave.workflow_run_step wrs\n SET status = 'canceled',\n completed_at = COALESCE(wrs.completed_at, (SELECT completed_at FROM canceled_run))\n WHERE wrs.organization_id = $4\n AND wrs.workflow_run_id = $5\n AND wrs.status IN ('pending', 'running', 'waiting')\n AND EXISTS (SELECT 1 FROM canceled_run)\n RETURNING wrs.id\n)\nSELECT id, organization_id, workflow_id, started_by_user_id, chat_session_id, status, input, output, definition_snapshot, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM canceled_run";
|
|
138
|
+
export interface CancelWorkflowRunArgs {
|
|
139
|
+
errorCode: string | null;
|
|
140
|
+
errorMessage: string | null;
|
|
141
|
+
completedAt: Date | null;
|
|
445
142
|
organizationId: string;
|
|
446
143
|
workflowRunId: string;
|
|
447
144
|
}
|
|
448
|
-
export interface
|
|
145
|
+
export interface CancelWorkflowRunRow {
|
|
449
146
|
id: string;
|
|
450
147
|
organizationId: string;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
status: string;
|
|
454
|
-
createdByUserId: string;
|
|
148
|
+
workflowId: string;
|
|
149
|
+
startedByUserId: string;
|
|
455
150
|
chatSessionId: string | null;
|
|
151
|
+
status: string;
|
|
456
152
|
input: any;
|
|
457
|
-
output: any;
|
|
153
|
+
output: any | null;
|
|
154
|
+
definitionSnapshot: any | null;
|
|
458
155
|
errorCode: string;
|
|
459
|
-
|
|
460
|
-
createdAt: Date;
|
|
156
|
+
errorMessage: string;
|
|
461
157
|
startedAt: Date | null;
|
|
462
|
-
|
|
158
|
+
completedAt: Date | null;
|
|
159
|
+
createdAt: Date;
|
|
160
|
+
updatedAt: Date;
|
|
463
161
|
}
|
|
464
|
-
export declare function
|
|
465
|
-
export declare const listWorkflowRunsQuery = "-- name: ListWorkflowRuns :many\nSELECT id, organization_id,
|
|
162
|
+
export declare function cancelWorkflowRun(client: Client, args: CancelWorkflowRunArgs): Promise<CancelWorkflowRunRow | null>;
|
|
163
|
+
export declare const listWorkflowRunsQuery = "-- name: ListWorkflowRuns :many\nSELECT id, organization_id, workflow_id, started_by_user_id, chat_session_id, status, input, output, definition_snapshot, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM weave.workflow_run\nWHERE organization_id = $1\n AND ($2::uuid IS NULL OR workflow_id = $2::uuid)\n AND ($3::text IS NULL OR status = $3::text)\nORDER BY created_at DESC, id DESC\nLIMIT COALESCE($5::integer, 100)\nOFFSET COALESCE($4::integer, 0)";
|
|
466
164
|
export interface ListWorkflowRunsArgs {
|
|
467
165
|
organizationId: string;
|
|
468
|
-
|
|
166
|
+
workflowId: string | null;
|
|
469
167
|
status: string | null;
|
|
470
|
-
pageOffset:
|
|
471
|
-
pageSize:
|
|
168
|
+
pageOffset: number | null;
|
|
169
|
+
pageSize: number | null;
|
|
472
170
|
}
|
|
473
171
|
export interface ListWorkflowRunsRow {
|
|
474
172
|
id: string;
|
|
475
173
|
organizationId: string;
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
status: string;
|
|
479
|
-
createdByUserId: string;
|
|
174
|
+
workflowId: string;
|
|
175
|
+
startedByUserId: string;
|
|
480
176
|
chatSessionId: string | null;
|
|
177
|
+
status: string;
|
|
481
178
|
input: any;
|
|
482
|
-
output: any;
|
|
179
|
+
output: any | null;
|
|
180
|
+
definitionSnapshot: any | null;
|
|
483
181
|
errorCode: string;
|
|
484
|
-
|
|
485
|
-
createdAt: Date;
|
|
182
|
+
errorMessage: string;
|
|
486
183
|
startedAt: Date | null;
|
|
487
|
-
|
|
184
|
+
completedAt: Date | null;
|
|
185
|
+
createdAt: Date;
|
|
186
|
+
updatedAt: Date;
|
|
488
187
|
}
|
|
489
188
|
export declare function listWorkflowRuns(client: Client, args: ListWorkflowRunsArgs): Promise<ListWorkflowRunsRow[]>;
|
|
490
|
-
export declare const updateWorkflowRunStatusQuery = "-- name: UpdateWorkflowRunStatus :one\nUPDATE weave.
|
|
189
|
+
export declare const updateWorkflowRunStatusQuery = "-- name: UpdateWorkflowRunStatus :one\nUPDATE weave.workflow_run\nSET status = $1,\n output = $2::jsonb,\n error_code = COALESCE($3::text, ''),\n error_message = COALESCE($4::text, ''),\n started_at = COALESCE($5::timestamptz, started_at),\n completed_at = $6::timestamptz\nWHERE organization_id = $7\n AND id = $8\nRETURNING id, organization_id, workflow_id, started_by_user_id, chat_session_id, status, input, output, definition_snapshot, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
491
190
|
export interface UpdateWorkflowRunStatusArgs {
|
|
492
191
|
status: string;
|
|
493
|
-
output: any;
|
|
494
|
-
errorCode: string;
|
|
495
|
-
|
|
192
|
+
output: any | null;
|
|
193
|
+
errorCode: string | null;
|
|
194
|
+
errorMessage: string | null;
|
|
496
195
|
startedAt: Date | null;
|
|
497
|
-
|
|
196
|
+
completedAt: Date | null;
|
|
498
197
|
organizationId: string;
|
|
499
198
|
workflowRunId: string;
|
|
500
199
|
}
|
|
501
200
|
export interface UpdateWorkflowRunStatusRow {
|
|
502
201
|
id: string;
|
|
503
202
|
organizationId: string;
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
status: string;
|
|
507
|
-
createdByUserId: string;
|
|
203
|
+
workflowId: string;
|
|
204
|
+
startedByUserId: string;
|
|
508
205
|
chatSessionId: string | null;
|
|
206
|
+
status: string;
|
|
509
207
|
input: any;
|
|
510
|
-
output: any;
|
|
208
|
+
output: any | null;
|
|
209
|
+
definitionSnapshot: any | null;
|
|
511
210
|
errorCode: string;
|
|
512
|
-
|
|
513
|
-
createdAt: Date;
|
|
211
|
+
errorMessage: string;
|
|
514
212
|
startedAt: Date | null;
|
|
515
|
-
|
|
213
|
+
completedAt: Date | null;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
updatedAt: Date;
|
|
516
216
|
}
|
|
517
217
|
export declare function updateWorkflowRunStatus(client: Client, args: UpdateWorkflowRunStatusArgs): Promise<UpdateWorkflowRunStatusRow | null>;
|
|
518
|
-
export declare const
|
|
519
|
-
export interface
|
|
520
|
-
id: string;
|
|
218
|
+
export declare const createWorkflowRunStepQuery = "-- name: CreateWorkflowRunStep :one\nINSERT INTO weave.workflow_run_step (\n organization_id,\n workflow_run_id,\n step_key,\n kind,\n status,\n agent_id,\n agent_run_id,\n workflow_id,\n child_workflow_run_id,\n tool_id,\n input\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n COALESCE($5::text, 'pending'),\n $6::uuid,\n $7::uuid,\n $8::uuid,\n $9::uuid,\n $10::uuid,\n COALESCE($11::jsonb, '{}'::jsonb)\n)\nRETURNING id, organization_id, workflow_run_id, step_key, kind, status, agent_id, agent_run_id, workflow_id, child_workflow_run_id, tool_id, input, output, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
219
|
+
export interface CreateWorkflowRunStepArgs {
|
|
521
220
|
organizationId: string;
|
|
522
221
|
workflowRunId: string;
|
|
523
222
|
stepKey: string;
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
223
|
+
kind: string;
|
|
224
|
+
status: string | null;
|
|
225
|
+
agentId: string | null;
|
|
226
|
+
agentRunId: string | null;
|
|
227
|
+
workflowId: string | null;
|
|
228
|
+
childWorkflowRunId: string | null;
|
|
229
|
+
toolId: string | null;
|
|
230
|
+
input: any | null;
|
|
528
231
|
}
|
|
529
|
-
export interface
|
|
232
|
+
export interface CreateWorkflowRunStepRow {
|
|
530
233
|
id: string;
|
|
531
234
|
organizationId: string;
|
|
532
235
|
workflowRunId: string;
|
|
533
236
|
stepKey: string;
|
|
534
|
-
|
|
535
|
-
stepKind: string;
|
|
237
|
+
kind: string;
|
|
536
238
|
status: string;
|
|
239
|
+
agentId: string | null;
|
|
537
240
|
agentRunId: string | null;
|
|
241
|
+
workflowId: string | null;
|
|
538
242
|
childWorkflowRunId: string | null;
|
|
243
|
+
toolId: string | null;
|
|
539
244
|
input: any;
|
|
540
|
-
output: any;
|
|
245
|
+
output: any | null;
|
|
541
246
|
errorCode: string;
|
|
542
|
-
|
|
543
|
-
createdAt: Date;
|
|
247
|
+
errorMessage: string;
|
|
544
248
|
startedAt: Date | null;
|
|
545
|
-
|
|
249
|
+
completedAt: Date | null;
|
|
250
|
+
createdAt: Date;
|
|
251
|
+
updatedAt: Date;
|
|
546
252
|
}
|
|
547
|
-
export declare function
|
|
548
|
-
export declare const
|
|
549
|
-
export interface
|
|
253
|
+
export declare function createWorkflowRunStep(client: Client, args: CreateWorkflowRunStepArgs): Promise<CreateWorkflowRunStepRow | null>;
|
|
254
|
+
export declare const listWorkflowRunStepsQuery = "-- name: ListWorkflowRunSteps :many\nSELECT id, organization_id, workflow_run_id, step_key, kind, status, agent_id, agent_run_id, workflow_id, child_workflow_run_id, tool_id, input, output, error_code, error_message, started_at, completed_at, created_at, updated_at\nFROM weave.workflow_run_step\nWHERE organization_id = $1\n AND workflow_run_id = $2\nORDER BY created_at ASC, id ASC";
|
|
255
|
+
export interface ListWorkflowRunStepsArgs {
|
|
550
256
|
organizationId: string;
|
|
551
257
|
workflowRunId: string;
|
|
552
258
|
}
|
|
553
|
-
export interface
|
|
259
|
+
export interface ListWorkflowRunStepsRow {
|
|
554
260
|
id: string;
|
|
555
261
|
organizationId: string;
|
|
556
262
|
workflowRunId: string;
|
|
557
263
|
stepKey: string;
|
|
558
|
-
|
|
559
|
-
stepKind: string;
|
|
264
|
+
kind: string;
|
|
560
265
|
status: string;
|
|
266
|
+
agentId: string | null;
|
|
561
267
|
agentRunId: string | null;
|
|
268
|
+
workflowId: string | null;
|
|
562
269
|
childWorkflowRunId: string | null;
|
|
270
|
+
toolId: string | null;
|
|
563
271
|
input: any;
|
|
564
|
-
output: any;
|
|
272
|
+
output: any | null;
|
|
565
273
|
errorCode: string;
|
|
566
|
-
|
|
567
|
-
createdAt: Date;
|
|
274
|
+
errorMessage: string;
|
|
568
275
|
startedAt: Date | null;
|
|
569
|
-
|
|
276
|
+
completedAt: Date | null;
|
|
277
|
+
createdAt: Date;
|
|
278
|
+
updatedAt: Date;
|
|
570
279
|
}
|
|
571
|
-
export declare function
|
|
572
|
-
export declare const
|
|
573
|
-
export interface
|
|
280
|
+
export declare function listWorkflowRunSteps(client: Client, args: ListWorkflowRunStepsArgs): Promise<ListWorkflowRunStepsRow[]>;
|
|
281
|
+
export declare const updateWorkflowRunStepStatusQuery = "-- name: UpdateWorkflowRunStepStatus :one\nUPDATE weave.workflow_run_step\nSET status = $1,\n agent_run_id = COALESCE($2::uuid, agent_run_id),\n child_workflow_run_id = COALESCE($3::uuid, child_workflow_run_id),\n output = $4::jsonb,\n error_code = COALESCE($5::text, ''),\n error_message = COALESCE($6::text, ''),\n started_at = COALESCE($7::timestamptz, started_at),\n completed_at = $8::timestamptz\nWHERE organization_id = $9\n AND workflow_run_id = $10\n AND id = $11\nRETURNING id, organization_id, workflow_run_id, step_key, kind, status, agent_id, agent_run_id, workflow_id, child_workflow_run_id, tool_id, input, output, error_code, error_message, started_at, completed_at, created_at, updated_at";
|
|
282
|
+
export interface UpdateWorkflowRunStepStatusArgs {
|
|
574
283
|
status: string;
|
|
575
284
|
agentRunId: string | null;
|
|
576
285
|
childWorkflowRunId: string | null;
|
|
577
|
-
output: any;
|
|
578
|
-
errorCode: string;
|
|
579
|
-
|
|
286
|
+
output: any | null;
|
|
287
|
+
errorCode: string | null;
|
|
288
|
+
errorMessage: string | null;
|
|
580
289
|
startedAt: Date | null;
|
|
581
|
-
|
|
290
|
+
completedAt: Date | null;
|
|
582
291
|
organizationId: string;
|
|
583
|
-
|
|
292
|
+
workflowRunId: string;
|
|
293
|
+
workflowRunStepId: string;
|
|
584
294
|
}
|
|
585
|
-
export interface
|
|
295
|
+
export interface UpdateWorkflowRunStepStatusRow {
|
|
586
296
|
id: string;
|
|
587
297
|
organizationId: string;
|
|
588
298
|
workflowRunId: string;
|
|
589
299
|
stepKey: string;
|
|
590
|
-
|
|
591
|
-
stepKind: string;
|
|
300
|
+
kind: string;
|
|
592
301
|
status: string;
|
|
302
|
+
agentId: string | null;
|
|
593
303
|
agentRunId: string | null;
|
|
304
|
+
workflowId: string | null;
|
|
594
305
|
childWorkflowRunId: string | null;
|
|
306
|
+
toolId: string | null;
|
|
595
307
|
input: any;
|
|
596
|
-
output: any;
|
|
308
|
+
output: any | null;
|
|
597
309
|
errorCode: string;
|
|
598
|
-
|
|
599
|
-
createdAt: Date;
|
|
310
|
+
errorMessage: string;
|
|
600
311
|
startedAt: Date | null;
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
export declare function updateWorkflowStepRunStatus(client: Client, args: UpdateWorkflowStepRunStatusArgs): Promise<UpdateWorkflowStepRunStatusRow | null>;
|
|
604
|
-
export declare const insertWorkflowRunEventQuery = "-- name: InsertWorkflowRunEvent :one\nINSERT INTO weave.workflow_run_events (\n id,\n organization_id,\n workflow_run_id,\n workflow_step_run_id,\n agent_run_id,\n sequence,\n kind,\n message,\n payload\n) VALUES (\n $1,\n $2,\n $3,\n $4::uuid,\n $5::uuid,\n $6,\n $7,\n $8,\n $9\n)\nRETURNING id, organization_id, workflow_run_id, workflow_step_run_id, agent_run_id, sequence, kind, message, payload, created_at";
|
|
605
|
-
export interface InsertWorkflowRunEventArgs {
|
|
606
|
-
id: string;
|
|
607
|
-
organizationId: string;
|
|
608
|
-
workflowRunId: string;
|
|
609
|
-
workflowStepRunId: string | null;
|
|
610
|
-
agentRunId: string | null;
|
|
611
|
-
sequence: string;
|
|
612
|
-
kind: string;
|
|
613
|
-
message: string;
|
|
614
|
-
payload: any;
|
|
615
|
-
}
|
|
616
|
-
export interface InsertWorkflowRunEventRow {
|
|
617
|
-
id: string;
|
|
618
|
-
organizationId: string;
|
|
619
|
-
workflowRunId: string;
|
|
620
|
-
workflowStepRunId: string | null;
|
|
621
|
-
agentRunId: string | null;
|
|
622
|
-
sequence: string;
|
|
623
|
-
kind: string;
|
|
624
|
-
message: string;
|
|
625
|
-
payload: any;
|
|
626
|
-
createdAt: Date;
|
|
627
|
-
}
|
|
628
|
-
export declare function insertWorkflowRunEvent(client: Client, args: InsertWorkflowRunEventArgs): Promise<InsertWorkflowRunEventRow | null>;
|
|
629
|
-
export declare const listWorkflowRunEventsQuery = "-- name: ListWorkflowRunEvents :many\nSELECT id, organization_id, workflow_run_id, workflow_step_run_id, agent_run_id, sequence, kind, message, payload, created_at FROM weave.workflow_run_events\nWHERE organization_id = $1\n AND workflow_run_id = $2\n AND sequence > $3\nORDER BY sequence\nLIMIT $4";
|
|
630
|
-
export interface ListWorkflowRunEventsArgs {
|
|
631
|
-
organizationId: string;
|
|
632
|
-
workflowRunId: string;
|
|
633
|
-
afterSequence: string;
|
|
634
|
-
pageSize: string;
|
|
635
|
-
}
|
|
636
|
-
export interface ListWorkflowRunEventsRow {
|
|
637
|
-
id: string;
|
|
638
|
-
organizationId: string;
|
|
639
|
-
workflowRunId: string;
|
|
640
|
-
workflowStepRunId: string | null;
|
|
641
|
-
agentRunId: string | null;
|
|
642
|
-
sequence: string;
|
|
643
|
-
kind: string;
|
|
644
|
-
message: string;
|
|
645
|
-
payload: any;
|
|
646
|
-
createdAt: Date;
|
|
647
|
-
}
|
|
648
|
-
export declare function listWorkflowRunEvents(client: Client, args: ListWorkflowRunEventsArgs): Promise<ListWorkflowRunEventsRow[]>;
|
|
649
|
-
export declare const insertToolCallEventQuery = "-- name: InsertToolCallEvent :one\nINSERT INTO weave.tool_call_events (\n id,\n organization_id,\n workflow_run_id,\n workflow_step_run_id,\n agent_run_id,\n tool_call_id,\n tool_name,\n state,\n arguments,\n result,\n error_code,\n safe_error_message\n) VALUES (\n $1,\n $2,\n $3::uuid,\n $4::uuid,\n $5::uuid,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12\n)\nRETURNING id, organization_id, workflow_run_id, workflow_step_run_id, agent_run_id, tool_call_id, tool_name, state, arguments, result, error_code, safe_error_message, created_at";
|
|
650
|
-
export interface InsertToolCallEventArgs {
|
|
651
|
-
id: string;
|
|
652
|
-
organizationId: string;
|
|
653
|
-
workflowRunId: string | null;
|
|
654
|
-
workflowStepRunId: string | null;
|
|
655
|
-
agentRunId: string | null;
|
|
656
|
-
toolCallId: string;
|
|
657
|
-
toolName: string;
|
|
658
|
-
state: string;
|
|
659
|
-
arguments: any;
|
|
660
|
-
result: any;
|
|
661
|
-
errorCode: string;
|
|
662
|
-
safeErrorMessage: string;
|
|
663
|
-
}
|
|
664
|
-
export interface InsertToolCallEventRow {
|
|
665
|
-
id: string;
|
|
666
|
-
organizationId: string;
|
|
667
|
-
workflowRunId: string | null;
|
|
668
|
-
workflowStepRunId: string | null;
|
|
669
|
-
agentRunId: string | null;
|
|
670
|
-
toolCallId: string;
|
|
671
|
-
toolName: string;
|
|
672
|
-
state: string;
|
|
673
|
-
arguments: any;
|
|
674
|
-
result: any;
|
|
675
|
-
errorCode: string;
|
|
676
|
-
safeErrorMessage: string;
|
|
677
|
-
createdAt: Date;
|
|
678
|
-
}
|
|
679
|
-
export declare function insertToolCallEvent(client: Client, args: InsertToolCallEventArgs): Promise<InsertToolCallEventRow | null>;
|
|
680
|
-
export declare const listToolCallEventsQuery = "-- name: ListToolCallEvents :many\nSELECT id, organization_id, workflow_run_id, workflow_step_run_id, agent_run_id, tool_call_id, tool_name, state, arguments, result, error_code, safe_error_message, created_at FROM weave.tool_call_events\nWHERE organization_id = $1\n AND (\n $2::uuid IS NULL\n OR workflow_run_id = $2::uuid\n )\n AND (\n $3::uuid IS NULL\n OR agent_run_id = $3::uuid\n )\nORDER BY created_at\nLIMIT $5 OFFSET $4";
|
|
681
|
-
export interface ListToolCallEventsArgs {
|
|
682
|
-
organizationId: string;
|
|
683
|
-
workflowRunId: string | null;
|
|
684
|
-
agentRunId: string | null;
|
|
685
|
-
pageOffset: string;
|
|
686
|
-
pageSize: string;
|
|
687
|
-
}
|
|
688
|
-
export interface ListToolCallEventsRow {
|
|
689
|
-
id: string;
|
|
690
|
-
organizationId: string;
|
|
691
|
-
workflowRunId: string | null;
|
|
692
|
-
workflowStepRunId: string | null;
|
|
693
|
-
agentRunId: string | null;
|
|
694
|
-
toolCallId: string;
|
|
695
|
-
toolName: string;
|
|
696
|
-
state: string;
|
|
697
|
-
arguments: any;
|
|
698
|
-
result: any;
|
|
699
|
-
errorCode: string;
|
|
700
|
-
safeErrorMessage: string;
|
|
312
|
+
completedAt: Date | null;
|
|
701
313
|
createdAt: Date;
|
|
314
|
+
updatedAt: Date;
|
|
702
315
|
}
|
|
703
|
-
export declare function
|
|
316
|
+
export declare function updateWorkflowRunStepStatus(client: Client, args: UpdateWorkflowRunStepStatusArgs): Promise<UpdateWorkflowRunStepStatusRow | null>;
|
|
704
317
|
export {};
|