@ag-ui/proto 0.0.52 → 0.0.54

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/proto.ts","../src/index.ts"],"mappings":";;;;;AAiLA;iBAAgB,MAAA,CAAO,KAAA,EAAO,SAAA,GAAY,UAAA;;;;;iBA0E1B,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,SAAA;;;cCzP7B,eAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/proto.ts","../src/index.ts"],"mappings":";;;;;AAwLA;iBAAgB,MAAA,CAAO,KAAA,EAAO,SAAA,GAAY,UAAA;;;;;iBA2F1B,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,SAAA;;;cCjR7B,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/proto.ts","../src/index.ts"],"mappings":";;;;;AAiLA;iBAAgB,MAAA,CAAO,KAAA,EAAO,SAAA,GAAY,UAAA;;;;;iBA0E1B,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,SAAA;;;cCzP7B,eAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/proto.ts","../src/index.ts"],"mappings":";;;;;AAwLA;iBAAgB,MAAA,CAAO,KAAA,EAAO,SAAA,GAAY,UAAA;;;;;iBA2F1B,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,SAAA;;;cCjR7B,eAAA"}
package/dist/index.js CHANGED
@@ -894,6 +894,84 @@ const Message = {
894
894
  return message;
895
895
  }
896
896
  };
897
+ function createBaseInterrupt() {
898
+ return {
899
+ id: "",
900
+ reason: "",
901
+ message: void 0,
902
+ toolCallId: void 0,
903
+ responseSchema: void 0,
904
+ expiresAt: void 0,
905
+ metadata: void 0
906
+ };
907
+ }
908
+ const Interrupt = {
909
+ encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
910
+ if (message.id !== "") writer.uint32(10).string(message.id);
911
+ if (message.reason !== "") writer.uint32(18).string(message.reason);
912
+ if (message.message !== void 0) writer.uint32(26).string(message.message);
913
+ if (message.toolCallId !== void 0) writer.uint32(34).string(message.toolCallId);
914
+ if (message.responseSchema !== void 0) Value.encode(Value.wrap(message.responseSchema), writer.uint32(42).fork()).join();
915
+ if (message.expiresAt !== void 0) writer.uint32(50).string(message.expiresAt);
916
+ if (message.metadata !== void 0) Value.encode(Value.wrap(message.metadata), writer.uint32(58).fork()).join();
917
+ return writer;
918
+ },
919
+ decode(input, length) {
920
+ const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
921
+ const end = length === void 0 ? reader.len : reader.pos + length;
922
+ const message = createBaseInterrupt();
923
+ while (reader.pos < end) {
924
+ const tag = reader.uint32();
925
+ switch (tag >>> 3) {
926
+ case 1:
927
+ if (tag !== 10) break;
928
+ message.id = reader.string();
929
+ continue;
930
+ case 2:
931
+ if (tag !== 18) break;
932
+ message.reason = reader.string();
933
+ continue;
934
+ case 3:
935
+ if (tag !== 26) break;
936
+ message.message = reader.string();
937
+ continue;
938
+ case 4:
939
+ if (tag !== 34) break;
940
+ message.toolCallId = reader.string();
941
+ continue;
942
+ case 5:
943
+ if (tag !== 42) break;
944
+ message.responseSchema = Value.unwrap(Value.decode(reader, reader.uint32()));
945
+ continue;
946
+ case 6:
947
+ if (tag !== 50) break;
948
+ message.expiresAt = reader.string();
949
+ continue;
950
+ case 7:
951
+ if (tag !== 58) break;
952
+ message.metadata = Value.unwrap(Value.decode(reader, reader.uint32()));
953
+ continue;
954
+ }
955
+ if ((tag & 7) === 4 || tag === 0) break;
956
+ reader.skip(tag & 7);
957
+ }
958
+ return message;
959
+ },
960
+ create(base) {
961
+ return Interrupt.fromPartial(base ?? {});
962
+ },
963
+ fromPartial(object) {
964
+ const message = createBaseInterrupt();
965
+ message.id = object.id ?? "";
966
+ message.reason = object.reason ?? "";
967
+ message.message = object.message ?? void 0;
968
+ message.toolCallId = object.toolCallId ?? void 0;
969
+ message.responseSchema = object.responseSchema ?? void 0;
970
+ message.expiresAt = object.expiresAt ?? void 0;
971
+ message.metadata = object.metadata ?? void 0;
972
+ return message;
973
+ }
974
+ };
897
975
 
898
976
  //#endregion
899
977
  //#region src/generated/events.ts
@@ -1551,7 +1629,9 @@ function createBaseRunFinishedEvent() {
1551
1629
  baseEvent: void 0,
1552
1630
  threadId: "",
1553
1631
  runId: "",
1554
- result: void 0
1632
+ result: void 0,
1633
+ outcome: "",
1634
+ interrupts: []
1555
1635
  };
1556
1636
  }
1557
1637
  const RunFinishedEvent = {
@@ -1560,6 +1640,8 @@ const RunFinishedEvent = {
1560
1640
  if (message.threadId !== "") writer.uint32(18).string(message.threadId);
1561
1641
  if (message.runId !== "") writer.uint32(26).string(message.runId);
1562
1642
  if (message.result !== void 0) Value.encode(Value.wrap(message.result), writer.uint32(34).fork()).join();
1643
+ if (message.outcome !== "") writer.uint32(42).string(message.outcome);
1644
+ for (const v of message.interrupts) Interrupt.encode(v, writer.uint32(50).fork()).join();
1563
1645
  return writer;
1564
1646
  },
1565
1647
  decode(input, length) {
@@ -1585,6 +1667,14 @@ const RunFinishedEvent = {
1585
1667
  if (tag !== 34) break;
1586
1668
  message.result = Value.unwrap(Value.decode(reader, reader.uint32()));
1587
1669
  continue;
1670
+ case 5:
1671
+ if (tag !== 42) break;
1672
+ message.outcome = reader.string();
1673
+ continue;
1674
+ case 6:
1675
+ if (tag !== 50) break;
1676
+ message.interrupts.push(Interrupt.decode(reader, reader.uint32()));
1677
+ continue;
1588
1678
  }
1589
1679
  if ((tag & 7) === 4 || tag === 0) break;
1590
1680
  reader.skip(tag & 7);
@@ -1600,6 +1690,8 @@ const RunFinishedEvent = {
1600
1690
  message.threadId = object.threadId ?? "";
1601
1691
  message.runId = object.runId ?? "";
1602
1692
  message.result = object.result ?? void 0;
1693
+ message.outcome = object.outcome ?? "";
1694
+ message.interrupts = object.interrupts?.map((e) => Interrupt.fromPartial(e)) || [];
1603
1695
  return message;
1604
1696
  }
1605
1697
  };
@@ -2166,6 +2258,19 @@ function encode(event) {
2166
2258
  if (untypedMessage.toolCalls === void 0) normalizedMessage.toolCalls = [];
2167
2259
  return normalizedMessage;
2168
2260
  });
2261
+ if (type === _ag_ui_core.EventType.RUN_FINISHED) {
2262
+ const outcome = rest.outcome;
2263
+ if (outcome === void 0) {
2264
+ rest.outcome = "";
2265
+ rest.interrupts = [];
2266
+ } else if (outcome.type === "interrupt") {
2267
+ rest.outcome = "interrupt";
2268
+ rest.interrupts = outcome.interrupts;
2269
+ } else {
2270
+ rest.outcome = "success";
2271
+ rest.interrupts = [];
2272
+ }
2273
+ }
2169
2274
  if (type === _ag_ui_core.EventType.STATE_DELTA && Array.isArray(rest.delta)) rest.delta = rest.delta.map((operation) => ({
2170
2275
  ...operation,
2171
2276
  op: JsonPatchOperationType[operation.op.toUpperCase()]
@@ -2191,6 +2296,7 @@ function decode(data) {
2191
2296
  decoded.type = EventType$1[decoded.baseEvent.type];
2192
2297
  decoded.timestamp = decoded.baseEvent.timestamp;
2193
2298
  decoded.rawEvent = decoded.baseEvent.rawEvent;
2299
+ delete decoded.baseEvent;
2194
2300
  if (decoded.type === _ag_ui_core.EventType.MESSAGES_SNAPSHOT) for (const message of decoded.messages) {
2195
2301
  const untypedMessage = message;
2196
2302
  if (untypedMessage.role === "user" && Array.isArray(untypedMessage.contentParts)) {
@@ -2200,6 +2306,18 @@ function decode(data) {
2200
2306
  if (Array.isArray(untypedMessage.contentParts) && untypedMessage.contentParts.length === 0) untypedMessage.contentParts = void 0;
2201
2307
  if (untypedMessage.toolCalls?.length === 0) untypedMessage.toolCalls = void 0;
2202
2308
  }
2309
+ if (decoded.type === _ag_ui_core.EventType.RUN_FINISHED) {
2310
+ const runFinished = decoded;
2311
+ const wireOutcome = typeof runFinished.outcome === "string" && runFinished.outcome !== "" ? runFinished.outcome : void 0;
2312
+ const wireInterrupts = Array.isArray(runFinished.interrupts) ? runFinished.interrupts : [];
2313
+ delete runFinished.interrupts;
2314
+ if (wireOutcome === "interrupt") runFinished.outcome = {
2315
+ type: "interrupt",
2316
+ interrupts: wireInterrupts
2317
+ };
2318
+ else if (wireOutcome === "success") runFinished.outcome = { type: "success" };
2319
+ else delete runFinished.outcome;
2320
+ }
2203
2321
  if (decoded.type === _ag_ui_core.EventType.STATE_DELTA) for (const operation of decoded.delta) {
2204
2322
  operation.op = JsonPatchOperationType[operation.op].toLowerCase();
2205
2323
  Object.keys(operation).forEach((key) => {