weave-typescript 0.47.1 → 0.49.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.
@@ -64,6 +64,14 @@ export declare enum WorkflowRunEventKind {
64
64
  }
65
65
  export declare function workflowRunEventKindFromJSON(object: any): WorkflowRunEventKind;
66
66
  export declare function workflowRunEventKindToJSON(object: WorkflowRunEventKind): string;
67
+ export declare enum WorkflowDraftEventKind {
68
+ WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED = 0,
69
+ WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED = 1,
70
+ WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED = 2,
71
+ UNRECOGNIZED = -1
72
+ }
73
+ export declare function workflowDraftEventKindFromJSON(object: any): WorkflowDraftEventKind;
74
+ export declare function workflowDraftEventKindToJSON(object: WorkflowDraftEventKind): string;
67
75
  export declare enum ToolCallState {
68
76
  TOOL_CALL_STATE_UNSPECIFIED = 0,
69
77
  TOOL_CALL_STATE_PROPOSED = 1,
@@ -123,6 +131,27 @@ export interface WorkflowDraftPatch {
123
131
  createdByUserId: string;
124
132
  createdAt: Date | undefined;
125
133
  }
134
+ export interface WorkflowDraftPatchConflict {
135
+ baseRevision: number;
136
+ currentRevision: number;
137
+ reason: string;
138
+ }
139
+ export interface WorkflowDraftEvent {
140
+ id: string;
141
+ organizationId: string;
142
+ definitionId: string;
143
+ draftId: string;
144
+ sequence: number;
145
+ kind: WorkflowDraftEventKind;
146
+ baseRevision: number;
147
+ resultRevision: number;
148
+ changedFields: string[];
149
+ source: string;
150
+ clientRequestId: string;
151
+ conflict: WorkflowDraftPatchConflict | undefined;
152
+ createdByUserId: string;
153
+ createdAt: Date | undefined;
154
+ }
126
155
  export interface WorkflowVersion {
127
156
  id: string;
128
157
  definitionId: string;
@@ -266,6 +295,8 @@ export interface ToolCallEvent {
266
295
  export declare const WorkflowDefinition: MessageFns<WorkflowDefinition>;
267
296
  export declare const WorkflowDraft: MessageFns<WorkflowDraft>;
268
297
  export declare const WorkflowDraftPatch: MessageFns<WorkflowDraftPatch>;
298
+ export declare const WorkflowDraftPatchConflict: MessageFns<WorkflowDraftPatchConflict>;
299
+ export declare const WorkflowDraftEvent: MessageFns<WorkflowDraftEvent>;
269
300
  export declare const WorkflowVersion: MessageFns<WorkflowVersion>;
270
301
  export declare const WorkflowGraph: MessageFns<WorkflowGraph>;
271
302
  export declare const WorkflowStepDefinition: MessageFns<WorkflowStepDefinition>;
@@ -5,7 +5,7 @@
5
5
  // protoc unknown
6
6
  // source: weaveapi/workflow/v1/workflow.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ToolCallEvent = exports.WorkflowRunEvent = exports.WorkflowStepRun = exports.WorkflowRun = exports.WorkflowPublishPlanIssue = exports.WorkflowPublishPlan = exports.WorkflowEdge = exports.WorkflowStepDefinition = exports.WorkflowGraph = exports.WorkflowVersion = exports.WorkflowDraftPatch = exports.WorkflowDraft = exports.WorkflowDefinition = exports.ToolCallState = exports.WorkflowRunEventKind = exports.WorkflowStepRunStatus = exports.WorkflowRunStatus = exports.WorkflowStepKind = exports.WorkflowDefinitionStatus = exports.protobufPackage = void 0;
8
+ exports.ToolCallEvent = exports.WorkflowRunEvent = exports.WorkflowStepRun = exports.WorkflowRun = exports.WorkflowPublishPlanIssue = exports.WorkflowPublishPlan = exports.WorkflowEdge = exports.WorkflowStepDefinition = exports.WorkflowGraph = exports.WorkflowVersion = exports.WorkflowDraftEvent = exports.WorkflowDraftPatchConflict = exports.WorkflowDraftPatch = exports.WorkflowDraft = exports.WorkflowDefinition = exports.ToolCallState = exports.WorkflowDraftEventKind = exports.WorkflowRunEventKind = exports.WorkflowStepRunStatus = exports.WorkflowRunStatus = exports.WorkflowStepKind = exports.WorkflowDefinitionStatus = exports.protobufPackage = void 0;
9
9
  exports.workflowDefinitionStatusFromJSON = workflowDefinitionStatusFromJSON;
10
10
  exports.workflowDefinitionStatusToJSON = workflowDefinitionStatusToJSON;
11
11
  exports.workflowStepKindFromJSON = workflowStepKindFromJSON;
@@ -16,6 +16,8 @@ exports.workflowStepRunStatusFromJSON = workflowStepRunStatusFromJSON;
16
16
  exports.workflowStepRunStatusToJSON = workflowStepRunStatusToJSON;
17
17
  exports.workflowRunEventKindFromJSON = workflowRunEventKindFromJSON;
18
18
  exports.workflowRunEventKindToJSON = workflowRunEventKindToJSON;
19
+ exports.workflowDraftEventKindFromJSON = workflowDraftEventKindFromJSON;
20
+ exports.workflowDraftEventKindToJSON = workflowDraftEventKindToJSON;
19
21
  exports.toolCallStateFromJSON = toolCallStateFromJSON;
20
22
  exports.toolCallStateToJSON = toolCallStateToJSON;
21
23
  /* eslint-disable */
@@ -352,6 +354,43 @@ function workflowRunEventKindToJSON(object) {
352
354
  return "UNRECOGNIZED";
353
355
  }
354
356
  }
357
+ var WorkflowDraftEventKind;
358
+ (function (WorkflowDraftEventKind) {
359
+ WorkflowDraftEventKind[WorkflowDraftEventKind["WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED"] = 0] = "WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED";
360
+ WorkflowDraftEventKind[WorkflowDraftEventKind["WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED"] = 1] = "WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED";
361
+ WorkflowDraftEventKind[WorkflowDraftEventKind["WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED"] = 2] = "WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED";
362
+ WorkflowDraftEventKind[WorkflowDraftEventKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
363
+ })(WorkflowDraftEventKind || (exports.WorkflowDraftEventKind = WorkflowDraftEventKind = {}));
364
+ function workflowDraftEventKindFromJSON(object) {
365
+ switch (object) {
366
+ case 0:
367
+ case "WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED":
368
+ return WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED;
369
+ case 1:
370
+ case "WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED":
371
+ return WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED;
372
+ case 2:
373
+ case "WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED":
374
+ return WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED;
375
+ case -1:
376
+ case "UNRECOGNIZED":
377
+ default:
378
+ return WorkflowDraftEventKind.UNRECOGNIZED;
379
+ }
380
+ }
381
+ function workflowDraftEventKindToJSON(object) {
382
+ switch (object) {
383
+ case WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED:
384
+ return "WORKFLOW_DRAFT_EVENT_KIND_UNSPECIFIED";
385
+ case WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED:
386
+ return "WORKFLOW_DRAFT_EVENT_KIND_PATCH_APPLIED";
387
+ case WorkflowDraftEventKind.WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED:
388
+ return "WORKFLOW_DRAFT_EVENT_KIND_PATCH_REJECTED";
389
+ case WorkflowDraftEventKind.UNRECOGNIZED:
390
+ default:
391
+ return "UNRECOGNIZED";
392
+ }
393
+ }
355
394
  var ToolCallState;
356
395
  (function (ToolCallState) {
357
396
  ToolCallState[ToolCallState["TOOL_CALL_STATE_UNSPECIFIED"] = 0] = "TOOL_CALL_STATE_UNSPECIFIED";
@@ -1139,6 +1178,402 @@ exports.WorkflowDraftPatch = {
1139
1178
  return message;
1140
1179
  },
1141
1180
  };
1181
+ function createBaseWorkflowDraftPatchConflict() {
1182
+ return { baseRevision: 0, currentRevision: 0, reason: "" };
1183
+ }
1184
+ exports.WorkflowDraftPatchConflict = {
1185
+ encode(message, writer = new wire_1.BinaryWriter()) {
1186
+ if (message.baseRevision !== 0) {
1187
+ writer.uint32(8).int32(message.baseRevision);
1188
+ }
1189
+ if (message.currentRevision !== 0) {
1190
+ writer.uint32(16).int32(message.currentRevision);
1191
+ }
1192
+ if (message.reason !== "") {
1193
+ writer.uint32(26).string(message.reason);
1194
+ }
1195
+ return writer;
1196
+ },
1197
+ decode(input, length) {
1198
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1199
+ const end = length === undefined ? reader.len : reader.pos + length;
1200
+ const message = createBaseWorkflowDraftPatchConflict();
1201
+ while (reader.pos < end) {
1202
+ const tag = reader.uint32();
1203
+ switch (tag >>> 3) {
1204
+ case 1: {
1205
+ if (tag !== 8) {
1206
+ break;
1207
+ }
1208
+ message.baseRevision = reader.int32();
1209
+ continue;
1210
+ }
1211
+ case 2: {
1212
+ if (tag !== 16) {
1213
+ break;
1214
+ }
1215
+ message.currentRevision = reader.int32();
1216
+ continue;
1217
+ }
1218
+ case 3: {
1219
+ if (tag !== 26) {
1220
+ break;
1221
+ }
1222
+ message.reason = reader.string();
1223
+ continue;
1224
+ }
1225
+ }
1226
+ if ((tag & 7) === 4 || tag === 0) {
1227
+ break;
1228
+ }
1229
+ reader.skip(tag & 7);
1230
+ }
1231
+ return message;
1232
+ },
1233
+ fromJSON(object) {
1234
+ return {
1235
+ baseRevision: isSet(object.baseRevision)
1236
+ ? globalThis.Number(object.baseRevision)
1237
+ : isSet(object.base_revision)
1238
+ ? globalThis.Number(object.base_revision)
1239
+ : 0,
1240
+ currentRevision: isSet(object.currentRevision)
1241
+ ? globalThis.Number(object.currentRevision)
1242
+ : isSet(object.current_revision)
1243
+ ? globalThis.Number(object.current_revision)
1244
+ : 0,
1245
+ reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
1246
+ };
1247
+ },
1248
+ toJSON(message) {
1249
+ const obj = {};
1250
+ if (message.baseRevision !== 0) {
1251
+ obj.baseRevision = Math.round(message.baseRevision);
1252
+ }
1253
+ if (message.currentRevision !== 0) {
1254
+ obj.currentRevision = Math.round(message.currentRevision);
1255
+ }
1256
+ if (message.reason !== "") {
1257
+ obj.reason = message.reason;
1258
+ }
1259
+ return obj;
1260
+ },
1261
+ create(base) {
1262
+ return exports.WorkflowDraftPatchConflict.fromPartial(base !== null && base !== void 0 ? base : {});
1263
+ },
1264
+ fromPartial(object) {
1265
+ var _a, _b, _c;
1266
+ const message = createBaseWorkflowDraftPatchConflict();
1267
+ message.baseRevision = (_a = object.baseRevision) !== null && _a !== void 0 ? _a : 0;
1268
+ message.currentRevision = (_b = object.currentRevision) !== null && _b !== void 0 ? _b : 0;
1269
+ message.reason = (_c = object.reason) !== null && _c !== void 0 ? _c : "";
1270
+ return message;
1271
+ },
1272
+ };
1273
+ function createBaseWorkflowDraftEvent() {
1274
+ return {
1275
+ id: "",
1276
+ organizationId: "",
1277
+ definitionId: "",
1278
+ draftId: "",
1279
+ sequence: 0,
1280
+ kind: 0,
1281
+ baseRevision: 0,
1282
+ resultRevision: 0,
1283
+ changedFields: [],
1284
+ source: "",
1285
+ clientRequestId: "",
1286
+ conflict: undefined,
1287
+ createdByUserId: "",
1288
+ createdAt: undefined,
1289
+ };
1290
+ }
1291
+ exports.WorkflowDraftEvent = {
1292
+ encode(message, writer = new wire_1.BinaryWriter()) {
1293
+ if (message.id !== "") {
1294
+ writer.uint32(10).string(message.id);
1295
+ }
1296
+ if (message.organizationId !== "") {
1297
+ writer.uint32(18).string(message.organizationId);
1298
+ }
1299
+ if (message.definitionId !== "") {
1300
+ writer.uint32(26).string(message.definitionId);
1301
+ }
1302
+ if (message.draftId !== "") {
1303
+ writer.uint32(34).string(message.draftId);
1304
+ }
1305
+ if (message.sequence !== 0) {
1306
+ writer.uint32(40).uint64(message.sequence);
1307
+ }
1308
+ if (message.kind !== 0) {
1309
+ writer.uint32(48).int32(message.kind);
1310
+ }
1311
+ if (message.baseRevision !== 0) {
1312
+ writer.uint32(56).int32(message.baseRevision);
1313
+ }
1314
+ if (message.resultRevision !== 0) {
1315
+ writer.uint32(64).int32(message.resultRevision);
1316
+ }
1317
+ for (const v of message.changedFields) {
1318
+ writer.uint32(74).string(v);
1319
+ }
1320
+ if (message.source !== "") {
1321
+ writer.uint32(82).string(message.source);
1322
+ }
1323
+ if (message.clientRequestId !== "") {
1324
+ writer.uint32(90).string(message.clientRequestId);
1325
+ }
1326
+ if (message.conflict !== undefined) {
1327
+ exports.WorkflowDraftPatchConflict.encode(message.conflict, writer.uint32(98).fork()).join();
1328
+ }
1329
+ if (message.createdByUserId !== "") {
1330
+ writer.uint32(106).string(message.createdByUserId);
1331
+ }
1332
+ if (message.createdAt !== undefined) {
1333
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
1334
+ }
1335
+ return writer;
1336
+ },
1337
+ decode(input, length) {
1338
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1339
+ const end = length === undefined ? reader.len : reader.pos + length;
1340
+ const message = createBaseWorkflowDraftEvent();
1341
+ while (reader.pos < end) {
1342
+ const tag = reader.uint32();
1343
+ switch (tag >>> 3) {
1344
+ case 1: {
1345
+ if (tag !== 10) {
1346
+ break;
1347
+ }
1348
+ message.id = reader.string();
1349
+ continue;
1350
+ }
1351
+ case 2: {
1352
+ if (tag !== 18) {
1353
+ break;
1354
+ }
1355
+ message.organizationId = reader.string();
1356
+ continue;
1357
+ }
1358
+ case 3: {
1359
+ if (tag !== 26) {
1360
+ break;
1361
+ }
1362
+ message.definitionId = reader.string();
1363
+ continue;
1364
+ }
1365
+ case 4: {
1366
+ if (tag !== 34) {
1367
+ break;
1368
+ }
1369
+ message.draftId = reader.string();
1370
+ continue;
1371
+ }
1372
+ case 5: {
1373
+ if (tag !== 40) {
1374
+ break;
1375
+ }
1376
+ message.sequence = longToNumber(reader.uint64());
1377
+ continue;
1378
+ }
1379
+ case 6: {
1380
+ if (tag !== 48) {
1381
+ break;
1382
+ }
1383
+ message.kind = reader.int32();
1384
+ continue;
1385
+ }
1386
+ case 7: {
1387
+ if (tag !== 56) {
1388
+ break;
1389
+ }
1390
+ message.baseRevision = reader.int32();
1391
+ continue;
1392
+ }
1393
+ case 8: {
1394
+ if (tag !== 64) {
1395
+ break;
1396
+ }
1397
+ message.resultRevision = reader.int32();
1398
+ continue;
1399
+ }
1400
+ case 9: {
1401
+ if (tag !== 74) {
1402
+ break;
1403
+ }
1404
+ message.changedFields.push(reader.string());
1405
+ continue;
1406
+ }
1407
+ case 10: {
1408
+ if (tag !== 82) {
1409
+ break;
1410
+ }
1411
+ message.source = reader.string();
1412
+ continue;
1413
+ }
1414
+ case 11: {
1415
+ if (tag !== 90) {
1416
+ break;
1417
+ }
1418
+ message.clientRequestId = reader.string();
1419
+ continue;
1420
+ }
1421
+ case 12: {
1422
+ if (tag !== 98) {
1423
+ break;
1424
+ }
1425
+ message.conflict = exports.WorkflowDraftPatchConflict.decode(reader, reader.uint32());
1426
+ continue;
1427
+ }
1428
+ case 13: {
1429
+ if (tag !== 106) {
1430
+ break;
1431
+ }
1432
+ message.createdByUserId = reader.string();
1433
+ continue;
1434
+ }
1435
+ case 14: {
1436
+ if (tag !== 114) {
1437
+ break;
1438
+ }
1439
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1440
+ continue;
1441
+ }
1442
+ }
1443
+ if ((tag & 7) === 4 || tag === 0) {
1444
+ break;
1445
+ }
1446
+ reader.skip(tag & 7);
1447
+ }
1448
+ return message;
1449
+ },
1450
+ fromJSON(object) {
1451
+ return {
1452
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1453
+ organizationId: isSet(object.organizationId)
1454
+ ? globalThis.String(object.organizationId)
1455
+ : isSet(object.organization_id)
1456
+ ? globalThis.String(object.organization_id)
1457
+ : "",
1458
+ definitionId: isSet(object.definitionId)
1459
+ ? globalThis.String(object.definitionId)
1460
+ : isSet(object.definition_id)
1461
+ ? globalThis.String(object.definition_id)
1462
+ : "",
1463
+ draftId: isSet(object.draftId)
1464
+ ? globalThis.String(object.draftId)
1465
+ : isSet(object.draft_id)
1466
+ ? globalThis.String(object.draft_id)
1467
+ : "",
1468
+ sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
1469
+ kind: isSet(object.kind) ? workflowDraftEventKindFromJSON(object.kind) : 0,
1470
+ baseRevision: isSet(object.baseRevision)
1471
+ ? globalThis.Number(object.baseRevision)
1472
+ : isSet(object.base_revision)
1473
+ ? globalThis.Number(object.base_revision)
1474
+ : 0,
1475
+ resultRevision: isSet(object.resultRevision)
1476
+ ? globalThis.Number(object.resultRevision)
1477
+ : isSet(object.result_revision)
1478
+ ? globalThis.Number(object.result_revision)
1479
+ : 0,
1480
+ changedFields: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.changedFields)
1481
+ ? object.changedFields.map((e) => globalThis.String(e))
1482
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.changed_fields)
1483
+ ? object.changed_fields.map((e) => globalThis.String(e))
1484
+ : [],
1485
+ source: isSet(object.source) ? globalThis.String(object.source) : "",
1486
+ clientRequestId: isSet(object.clientRequestId)
1487
+ ? globalThis.String(object.clientRequestId)
1488
+ : isSet(object.client_request_id)
1489
+ ? globalThis.String(object.client_request_id)
1490
+ : "",
1491
+ conflict: isSet(object.conflict) ? exports.WorkflowDraftPatchConflict.fromJSON(object.conflict) : undefined,
1492
+ createdByUserId: isSet(object.createdByUserId)
1493
+ ? globalThis.String(object.createdByUserId)
1494
+ : isSet(object.created_by_user_id)
1495
+ ? globalThis.String(object.created_by_user_id)
1496
+ : "",
1497
+ createdAt: isSet(object.createdAt)
1498
+ ? fromJsonTimestamp(object.createdAt)
1499
+ : isSet(object.created_at)
1500
+ ? fromJsonTimestamp(object.created_at)
1501
+ : undefined,
1502
+ };
1503
+ },
1504
+ toJSON(message) {
1505
+ var _a;
1506
+ const obj = {};
1507
+ if (message.id !== "") {
1508
+ obj.id = message.id;
1509
+ }
1510
+ if (message.organizationId !== "") {
1511
+ obj.organizationId = message.organizationId;
1512
+ }
1513
+ if (message.definitionId !== "") {
1514
+ obj.definitionId = message.definitionId;
1515
+ }
1516
+ if (message.draftId !== "") {
1517
+ obj.draftId = message.draftId;
1518
+ }
1519
+ if (message.sequence !== 0) {
1520
+ obj.sequence = Math.round(message.sequence);
1521
+ }
1522
+ if (message.kind !== 0) {
1523
+ obj.kind = workflowDraftEventKindToJSON(message.kind);
1524
+ }
1525
+ if (message.baseRevision !== 0) {
1526
+ obj.baseRevision = Math.round(message.baseRevision);
1527
+ }
1528
+ if (message.resultRevision !== 0) {
1529
+ obj.resultRevision = Math.round(message.resultRevision);
1530
+ }
1531
+ if ((_a = message.changedFields) === null || _a === void 0 ? void 0 : _a.length) {
1532
+ obj.changedFields = message.changedFields;
1533
+ }
1534
+ if (message.source !== "") {
1535
+ obj.source = message.source;
1536
+ }
1537
+ if (message.clientRequestId !== "") {
1538
+ obj.clientRequestId = message.clientRequestId;
1539
+ }
1540
+ if (message.conflict !== undefined) {
1541
+ obj.conflict = exports.WorkflowDraftPatchConflict.toJSON(message.conflict);
1542
+ }
1543
+ if (message.createdByUserId !== "") {
1544
+ obj.createdByUserId = message.createdByUserId;
1545
+ }
1546
+ if (message.createdAt !== undefined) {
1547
+ obj.createdAt = message.createdAt.toISOString();
1548
+ }
1549
+ return obj;
1550
+ },
1551
+ create(base) {
1552
+ return exports.WorkflowDraftEvent.fromPartial(base !== null && base !== void 0 ? base : {});
1553
+ },
1554
+ fromPartial(object) {
1555
+ var _a;
1556
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
1557
+ const message = createBaseWorkflowDraftEvent();
1558
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
1559
+ message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : "";
1560
+ message.definitionId = (_d = object.definitionId) !== null && _d !== void 0 ? _d : "";
1561
+ message.draftId = (_e = object.draftId) !== null && _e !== void 0 ? _e : "";
1562
+ message.sequence = (_f = object.sequence) !== null && _f !== void 0 ? _f : 0;
1563
+ message.kind = (_g = object.kind) !== null && _g !== void 0 ? _g : 0;
1564
+ message.baseRevision = (_h = object.baseRevision) !== null && _h !== void 0 ? _h : 0;
1565
+ message.resultRevision = (_j = object.resultRevision) !== null && _j !== void 0 ? _j : 0;
1566
+ message.changedFields = ((_a = object.changedFields) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
1567
+ message.source = (_k = object.source) !== null && _k !== void 0 ? _k : "";
1568
+ message.clientRequestId = (_l = object.clientRequestId) !== null && _l !== void 0 ? _l : "";
1569
+ message.conflict = (object.conflict !== undefined && object.conflict !== null)
1570
+ ? exports.WorkflowDraftPatchConflict.fromPartial(object.conflict)
1571
+ : undefined;
1572
+ message.createdByUserId = (_m = object.createdByUserId) !== null && _m !== void 0 ? _m : "";
1573
+ message.createdAt = (_o = object.createdAt) !== null && _o !== void 0 ? _o : undefined;
1574
+ return message;
1575
+ },
1576
+ };
1142
1577
  function createBaseWorkflowVersion() {
1143
1578
  return {
1144
1579
  id: "",
@@ -252,6 +252,62 @@ export interface InsertAgentDraftPatchRow {
252
252
  createdAt: Date;
253
253
  }
254
254
  export declare function insertAgentDraftPatch(client: Client, args: InsertAgentDraftPatchArgs): Promise<InsertAgentDraftPatchRow | null>;
255
+ export declare const 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[]>;
255
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";
256
312
  export interface InsertAgentDefinitionVersionArgs {
257
313
  id: string;