@boundaryml/baml-bridge-web 0.16.0 → 0.17.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.
Files changed (48) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/shared/define_function.d.ts.map +1 -1
  6. package/dist/shared/define_function.js +17 -19
  7. package/dist/shared/define_function.js.map +1 -1
  8. package/dist/shared/proto/baml_cffi.d.ts +1165 -251
  9. package/dist/shared/proto/baml_cffi.js +1733 -124
  10. package/dist/shared/proto.d.ts +2 -1
  11. package/dist/shared/proto.d.ts.map +1 -1
  12. package/dist/shared/proto.js +26 -8
  13. package/dist/shared/proto.js.map +1 -1
  14. package/dist/shared/typemap.d.ts.map +1 -1
  15. package/dist/shared/typemap.js +9 -1
  16. package/dist/shared/typemap.js.map +1 -1
  17. package/dist/shared/wire_ty.d.ts +57 -37
  18. package/dist/shared/wire_ty.d.ts.map +1 -1
  19. package/dist/shared/wire_ty.js +156 -88
  20. package/dist/shared/wire_ty.js.map +1 -1
  21. package/dist/wasm/bridge_web_core.d.ts +2 -2
  22. package/dist/wasm/bridge_web_core.js +7 -7
  23. package/dist/wasm/bridge_web_core_bg.wasm +0 -0
  24. package/dist/wasm/bridge_web_core_bg.wasm.d.ts +2 -2
  25. package/dist/workerd/index.d.ts +2 -1
  26. package/dist/workerd/index.d.ts.map +1 -1
  27. package/dist/workerd/index.js +1 -0
  28. package/dist/workerd/index.js.map +1 -1
  29. package/dist/workerd/shared/define_function.d.ts.map +1 -1
  30. package/dist/workerd/shared/define_function.js +17 -19
  31. package/dist/workerd/shared/define_function.js.map +1 -1
  32. package/dist/workerd/shared/proto/baml_cffi.d.ts +1165 -251
  33. package/dist/workerd/shared/proto/baml_cffi.js +1733 -124
  34. package/dist/workerd/shared/proto.d.ts +2 -1
  35. package/dist/workerd/shared/proto.d.ts.map +1 -1
  36. package/dist/workerd/shared/proto.js +26 -8
  37. package/dist/workerd/shared/proto.js.map +1 -1
  38. package/dist/workerd/shared/typemap.d.ts.map +1 -1
  39. package/dist/workerd/shared/typemap.js +9 -1
  40. package/dist/workerd/shared/typemap.js.map +1 -1
  41. package/dist/workerd/shared/wire_ty.d.ts +57 -37
  42. package/dist/workerd/shared/wire_ty.d.ts.map +1 -1
  43. package/dist/workerd/shared/wire_ty.js +156 -88
  44. package/dist/workerd/shared/wire_ty.js.map +1 -1
  45. package/dist/workerd-wasm/bridge_web_core_bg.js +7 -7
  46. package/dist/workerd-wasm/bridge_web_core_bg.wasm +0 -0
  47. package/dist/workerd-wasm/bridge_web_core_bg.wasm.d.ts +2 -2
  48. package/package.json +1 -1
@@ -2445,9 +2445,10 @@ var baml_bridge = $root.baml_bridge = (() => {
2445
2445
  InboundValue.prototype.uint8arrayValue = null;
2446
2446
  InboundValue.prototype.bigintValue = null;
2447
2447
  InboundValue.prototype.tyValue = null;
2448
+ InboundValue.prototype.tyDefValue = null;
2448
2449
  let $oneOfFields;
2449
2450
  Object.defineProperty(InboundValue.prototype, "value", {
2450
- get: $util.oneOfGetter($oneOfFields = ["stringValue", "intValue", "floatValue", "boolValue", "listValue", "mapValue", "classValue", "enumValue", "handle", "uint8arrayValue", "bigintValue", "tyValue"]),
2451
+ get: $util.oneOfGetter($oneOfFields = ["stringValue", "intValue", "floatValue", "boolValue", "listValue", "mapValue", "classValue", "enumValue", "handle", "uint8arrayValue", "bigintValue", "tyValue", "tyDefValue"]),
2451
2452
  set: $util.oneOfSetter($oneOfFields)
2452
2453
  });
2453
2454
  InboundValue.create = function create(properties) {
@@ -2525,6 +2526,11 @@ var baml_bridge = $root.baml_bridge = (() => {
2525
2526
  /* id 13, wireType 2 =*/
2526
2527
  106
2527
2528
  ).fork(), q + 1).ldelim();
2529
+ if (message.tyDefValue != null && Object.hasOwnProperty.call(message, "tyDefValue"))
2530
+ $root.baml_bridge.cffi.v1.BamlTyDef.encode(message.tyDefValue, writer.uint32(
2531
+ /* id 14, wireType 2 =*/
2532
+ 114
2533
+ ).fork(), q + 1).ldelim();
2528
2534
  return writer;
2529
2535
  };
2530
2536
  InboundValue.encodeDelimited = function encodeDelimited(message, writer) {
@@ -2595,6 +2601,10 @@ var baml_bridge = $root.baml_bridge = (() => {
2595
2601
  message.tyValue = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
2596
2602
  break;
2597
2603
  }
2604
+ case 14: {
2605
+ message.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.decode(reader, reader.uint32(), void 0, long + 1);
2606
+ break;
2607
+ }
2598
2608
  default:
2599
2609
  reader.skipType(tag & 7, long);
2600
2610
  break;
@@ -2720,6 +2730,16 @@ var baml_bridge = $root.baml_bridge = (() => {
2720
2730
  return "tyValue." + error;
2721
2731
  }
2722
2732
  }
2733
+ if (message.tyDefValue != null && message.hasOwnProperty("tyDefValue")) {
2734
+ if (properties.value === 1)
2735
+ return "value: multiple values";
2736
+ properties.value = 1;
2737
+ {
2738
+ let error = $root.baml_bridge.cffi.v1.BamlTyDef.verify(message.tyDefValue, long + 1);
2739
+ if (error)
2740
+ return "tyDefValue." + error;
2741
+ }
2742
+ }
2723
2743
  return null;
2724
2744
  };
2725
2745
  InboundValue.fromObject = function fromObject(object, long) {
@@ -2791,6 +2811,11 @@ var baml_bridge = $root.baml_bridge = (() => {
2791
2811
  throw TypeError(".baml_bridge.cffi.v1.InboundValue.tyValue: object expected");
2792
2812
  message.tyValue = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.tyValue, long + 1);
2793
2813
  }
2814
+ if (object.tyDefValue != null) {
2815
+ if (!$util.isObject(object.tyDefValue))
2816
+ throw TypeError(".baml_bridge.cffi.v1.InboundValue.tyDefValue: object expected");
2817
+ message.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.fromObject(object.tyDefValue, long + 1);
2818
+ }
2794
2819
  return message;
2795
2820
  };
2796
2821
  InboundValue.toObject = function toObject(message, options, q) {
@@ -2870,6 +2895,11 @@ var baml_bridge = $root.baml_bridge = (() => {
2870
2895
  if (options.oneofs)
2871
2896
  object.value = "tyValue";
2872
2897
  }
2898
+ if (message.tyDefValue != null && message.hasOwnProperty("tyDefValue")) {
2899
+ object.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.toObject(message.tyDefValue, options, q + 1);
2900
+ if (options.oneofs)
2901
+ object.value = "tyDefValue";
2902
+ }
2873
2903
  return object;
2874
2904
  };
2875
2905
  InboundValue.prototype.toJSON = function toJSON() {
@@ -3646,6 +3676,7 @@ var baml_bridge = $root.baml_bridge = (() => {
3646
3676
  }
3647
3677
  BamlTyArg.prototype.typeVar = "";
3648
3678
  BamlTyArg.prototype.typeValue = null;
3679
+ BamlTyArg.prototype.typeDefinition = null;
3649
3680
  BamlTyArg.create = function create(properties) {
3650
3681
  return new BamlTyArg(properties);
3651
3682
  };
@@ -3666,6 +3697,11 @@ var baml_bridge = $root.baml_bridge = (() => {
3666
3697
  /* id 2, wireType 2 =*/
3667
3698
  18
3668
3699
  ).fork(), q + 1).ldelim();
3700
+ if (message.typeDefinition != null && Object.hasOwnProperty.call(message, "typeDefinition"))
3701
+ $root.baml_bridge.cffi.v1.BamlTyDef.encode(message.typeDefinition, writer.uint32(
3702
+ /* id 3, wireType 2 =*/
3703
+ 26
3704
+ ).fork(), q + 1).ldelim();
3669
3705
  return writer;
3670
3706
  };
3671
3707
  BamlTyArg.encodeDelimited = function encodeDelimited(message, writer) {
@@ -3692,6 +3728,10 @@ var baml_bridge = $root.baml_bridge = (() => {
3692
3728
  message.typeValue = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
3693
3729
  break;
3694
3730
  }
3731
+ case 3: {
3732
+ message.typeDefinition = $root.baml_bridge.cffi.v1.BamlTyDef.decode(reader, reader.uint32(), void 0, long + 1);
3733
+ break;
3734
+ }
3695
3735
  default:
3696
3736
  reader.skipType(tag & 7, long);
3697
3737
  break;
@@ -3720,6 +3760,11 @@ var baml_bridge = $root.baml_bridge = (() => {
3720
3760
  if (error)
3721
3761
  return "typeValue." + error;
3722
3762
  }
3763
+ if (message.typeDefinition != null && message.hasOwnProperty("typeDefinition")) {
3764
+ let error = $root.baml_bridge.cffi.v1.BamlTyDef.verify(message.typeDefinition, long + 1);
3765
+ if (error)
3766
+ return "typeDefinition." + error;
3767
+ }
3723
3768
  return null;
3724
3769
  };
3725
3770
  BamlTyArg.fromObject = function fromObject(object, long) {
@@ -3739,6 +3784,11 @@ var baml_bridge = $root.baml_bridge = (() => {
3739
3784
  throw TypeError(".baml_bridge.cffi.v1.BamlTyArg.typeValue: object expected");
3740
3785
  message.typeValue = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.typeValue, long + 1);
3741
3786
  }
3787
+ if (object.typeDefinition != null) {
3788
+ if (!$util.isObject(object.typeDefinition))
3789
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyArg.typeDefinition: object expected");
3790
+ message.typeDefinition = $root.baml_bridge.cffi.v1.BamlTyDef.fromObject(object.typeDefinition, long + 1);
3791
+ }
3742
3792
  return message;
3743
3793
  };
3744
3794
  BamlTyArg.toObject = function toObject(message, options, q) {
@@ -3752,11 +3802,14 @@ var baml_bridge = $root.baml_bridge = (() => {
3752
3802
  if (options.defaults) {
3753
3803
  object.typeVar = "";
3754
3804
  object.typeValue = null;
3805
+ object.typeDefinition = null;
3755
3806
  }
3756
3807
  if (message.typeVar != null && message.hasOwnProperty("typeVar"))
3757
3808
  object.typeVar = message.typeVar;
3758
3809
  if (message.typeValue != null && message.hasOwnProperty("typeValue"))
3759
3810
  object.typeValue = $root.baml_bridge.cffi.v1.BamlTy.toObject(message.typeValue, options, q + 1);
3811
+ if (message.typeDefinition != null && message.hasOwnProperty("typeDefinition"))
3812
+ object.typeDefinition = $root.baml_bridge.cffi.v1.BamlTyDef.toObject(message.typeDefinition, options, q + 1);
3760
3813
  return object;
3761
3814
  };
3762
3815
  BamlTyArg.prototype.toJSON = function toJSON() {
@@ -5040,24 +5093,1497 @@ var baml_bridge = $root.baml_bridge = (() => {
5040
5093
  throw TypeError(".baml_bridge.cffi.v1.BamlTy.void: object expected");
5041
5094
  message["void"] = $root.baml_bridge.cffi.v1.BamlTyVoid.fromObject(object["void"], long + 1);
5042
5095
  }
5043
- if (object.typeVar != null) {
5044
- if (!$util.isObject(object.typeVar))
5045
- throw TypeError(".baml_bridge.cffi.v1.BamlTy.typeVar: object expected");
5046
- message.typeVar = $root.baml_bridge.cffi.v1.BamlTyTypeVar.fromObject(object.typeVar, long + 1);
5096
+ if (object.typeVar != null) {
5097
+ if (!$util.isObject(object.typeVar))
5098
+ throw TypeError(".baml_bridge.cffi.v1.BamlTy.typeVar: object expected");
5099
+ message.typeVar = $root.baml_bridge.cffi.v1.BamlTyTypeVar.fromObject(object.typeVar, long + 1);
5100
+ }
5101
+ if (object.associatedTypeProjection != null) {
5102
+ if (!$util.isObject(object.associatedTypeProjection))
5103
+ throw TypeError(".baml_bridge.cffi.v1.BamlTy.associatedTypeProjection: object expected");
5104
+ message.associatedTypeProjection = $root.baml_bridge.cffi.v1.BamlTyAssociatedTypeProjection.fromObject(object.associatedTypeProjection, long + 1);
5105
+ }
5106
+ if (object.never != null) {
5107
+ if (!$util.isObject(object.never))
5108
+ throw TypeError(".baml_bridge.cffi.v1.BamlTy.never: object expected");
5109
+ message.never = $root.baml_bridge.cffi.v1.BamlTyNever.fromObject(object.never, long + 1);
5110
+ }
5111
+ return message;
5112
+ };
5113
+ BamlTy.toObject = function toObject(message, options, q) {
5114
+ if (!options)
5115
+ options = {};
5116
+ if (q === void 0)
5117
+ q = 0;
5118
+ if (q > $util.recursionLimit)
5119
+ throw Error("max depth exceeded");
5120
+ let object = {};
5121
+ if (message.primitive != null && message.hasOwnProperty("primitive")) {
5122
+ object.primitive = $root.baml_bridge.cffi.v1.BamlTyPrimitive.toObject(message.primitive, options, q + 1);
5123
+ if (options.oneofs)
5124
+ object.ty = "primitive";
5125
+ }
5126
+ if (message.classTy != null && message.hasOwnProperty("classTy")) {
5127
+ object.classTy = $root.baml_bridge.cffi.v1.BamlTyClass.toObject(message.classTy, options, q + 1);
5128
+ if (options.oneofs)
5129
+ object.ty = "classTy";
5130
+ }
5131
+ if (message["enum"] != null && message.hasOwnProperty("enum")) {
5132
+ object["enum"] = $root.baml_bridge.cffi.v1.BamlTyEnum.toObject(message["enum"], options, q + 1);
5133
+ if (options.oneofs)
5134
+ object.ty = "enum";
5135
+ }
5136
+ if (message.list != null && message.hasOwnProperty("list")) {
5137
+ object.list = $root.baml_bridge.cffi.v1.BamlTyList.toObject(message.list, options, q + 1);
5138
+ if (options.oneofs)
5139
+ object.ty = "list";
5140
+ }
5141
+ if (message.map != null && message.hasOwnProperty("map")) {
5142
+ object.map = $root.baml_bridge.cffi.v1.BamlTyMap.toObject(message.map, options, q + 1);
5143
+ if (options.oneofs)
5144
+ object.ty = "map";
5145
+ }
5146
+ if (message.optional != null && message.hasOwnProperty("optional")) {
5147
+ object.optional = $root.baml_bridge.cffi.v1.BamlTyOptional.toObject(message.optional, options, q + 1);
5148
+ if (options.oneofs)
5149
+ object.ty = "optional";
5150
+ }
5151
+ if (message.union != null && message.hasOwnProperty("union")) {
5152
+ object.union = $root.baml_bridge.cffi.v1.BamlTyUnion.toObject(message.union, options, q + 1);
5153
+ if (options.oneofs)
5154
+ object.ty = "union";
5155
+ }
5156
+ if (message.literal != null && message.hasOwnProperty("literal")) {
5157
+ object.literal = $root.baml_bridge.cffi.v1.BamlTyLiteral.toObject(message.literal, options, q + 1);
5158
+ if (options.oneofs)
5159
+ object.ty = "literal";
5160
+ }
5161
+ if (message.typeAlias != null && message.hasOwnProperty("typeAlias")) {
5162
+ object.typeAlias = $root.baml_bridge.cffi.v1.BamlTyTypeAlias.toObject(message.typeAlias, options, q + 1);
5163
+ if (options.oneofs)
5164
+ object.ty = "typeAlias";
5165
+ }
5166
+ if (message.unknown != null && message.hasOwnProperty("unknown")) {
5167
+ object.unknown = $root.baml_bridge.cffi.v1.BamlTyUnknown.toObject(message.unknown, options, q + 1);
5168
+ if (options.oneofs)
5169
+ object.ty = "unknown";
5170
+ }
5171
+ if (message.media != null && message.hasOwnProperty("media")) {
5172
+ object.media = $root.baml_bridge.cffi.v1.BamlTyMedia.toObject(message.media, options, q + 1);
5173
+ if (options.oneofs)
5174
+ object.ty = "media";
5175
+ }
5176
+ if (message["interface"] != null && message.hasOwnProperty("interface")) {
5177
+ object["interface"] = $root.baml_bridge.cffi.v1.BamlTyInterface.toObject(message["interface"], options, q + 1);
5178
+ if (options.oneofs)
5179
+ object.ty = "interface";
5180
+ }
5181
+ if (message.enumVariant != null && message.hasOwnProperty("enumVariant")) {
5182
+ object.enumVariant = $root.baml_bridge.cffi.v1.BamlTyEnumVariant.toObject(message.enumVariant, options, q + 1);
5183
+ if (options.oneofs)
5184
+ object.ty = "enumVariant";
5185
+ }
5186
+ if (message["function"] != null && message.hasOwnProperty("function")) {
5187
+ object["function"] = $root.baml_bridge.cffi.v1.BamlTyFunction.toObject(message["function"], options, q + 1);
5188
+ if (options.oneofs)
5189
+ object.ty = "function";
5190
+ }
5191
+ if (message.future != null && message.hasOwnProperty("future")) {
5192
+ object.future = $root.baml_bridge.cffi.v1.BamlTyFuture.toObject(message.future, options, q + 1);
5193
+ if (options.oneofs)
5194
+ object.ty = "future";
5195
+ }
5196
+ if (message.rustType != null && message.hasOwnProperty("rustType")) {
5197
+ object.rustType = $root.baml_bridge.cffi.v1.BamlTyRustType.toObject(message.rustType, options, q + 1);
5198
+ if (options.oneofs)
5199
+ object.ty = "rustType";
5200
+ }
5201
+ if (message.metaType != null && message.hasOwnProperty("metaType")) {
5202
+ object.metaType = $root.baml_bridge.cffi.v1.BamlTyMetaType.toObject(message.metaType, options, q + 1);
5203
+ if (options.oneofs)
5204
+ object.ty = "metaType";
5205
+ }
5206
+ if (message.resource != null && message.hasOwnProperty("resource")) {
5207
+ object.resource = $root.baml_bridge.cffi.v1.BamlTyResource.toObject(message.resource, options, q + 1);
5208
+ if (options.oneofs)
5209
+ object.ty = "resource";
5210
+ }
5211
+ if (message.promptAst != null && message.hasOwnProperty("promptAst")) {
5212
+ object.promptAst = $root.baml_bridge.cffi.v1.BamlTyPromptAst.toObject(message.promptAst, options, q + 1);
5213
+ if (options.oneofs)
5214
+ object.ty = "promptAst";
5215
+ }
5216
+ if (message["void"] != null && message.hasOwnProperty("void")) {
5217
+ object["void"] = $root.baml_bridge.cffi.v1.BamlTyVoid.toObject(message["void"], options, q + 1);
5218
+ if (options.oneofs)
5219
+ object.ty = "void";
5220
+ }
5221
+ if (message.typeVar != null && message.hasOwnProperty("typeVar")) {
5222
+ object.typeVar = $root.baml_bridge.cffi.v1.BamlTyTypeVar.toObject(message.typeVar, options, q + 1);
5223
+ if (options.oneofs)
5224
+ object.ty = "typeVar";
5225
+ }
5226
+ if (message.associatedTypeProjection != null && message.hasOwnProperty("associatedTypeProjection")) {
5227
+ object.associatedTypeProjection = $root.baml_bridge.cffi.v1.BamlTyAssociatedTypeProjection.toObject(message.associatedTypeProjection, options, q + 1);
5228
+ if (options.oneofs)
5229
+ object.ty = "associatedTypeProjection";
5230
+ }
5231
+ if (message.never != null && message.hasOwnProperty("never")) {
5232
+ object.never = $root.baml_bridge.cffi.v1.BamlTyNever.toObject(message.never, options, q + 1);
5233
+ if (options.oneofs)
5234
+ object.ty = "never";
5235
+ }
5236
+ return object;
5237
+ };
5238
+ BamlTy.prototype.toJSON = function toJSON() {
5239
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5240
+ };
5241
+ BamlTy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
5242
+ if (typeUrlPrefix === void 0) {
5243
+ typeUrlPrefix = "type.googleapis.com";
5244
+ }
5245
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlTy";
5246
+ };
5247
+ return BamlTy;
5248
+ })();
5249
+ v1.BamlTyDef = (function() {
5250
+ function BamlTyDef(properties) {
5251
+ this.classes = [];
5252
+ this.enums = [];
5253
+ this.witnesses = [];
5254
+ if (properties) {
5255
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5256
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
5257
+ this[keys[i]] = properties[keys[i]];
5258
+ }
5259
+ }
5260
+ BamlTyDef.prototype.root = null;
5261
+ BamlTyDef.prototype.classes = $util.emptyArray;
5262
+ BamlTyDef.prototype.enums = $util.emptyArray;
5263
+ BamlTyDef.prototype.witnesses = $util.emptyArray;
5264
+ BamlTyDef.create = function create(properties) {
5265
+ return new BamlTyDef(properties);
5266
+ };
5267
+ BamlTyDef.encode = function encode(message, writer, q) {
5268
+ if (!writer)
5269
+ writer = $Writer.create();
5270
+ if (q === void 0)
5271
+ q = 0;
5272
+ if (q > $util.recursionLimit)
5273
+ throw Error("max depth exceeded");
5274
+ if (message.root != null && Object.hasOwnProperty.call(message, "root"))
5275
+ $root.baml_bridge.cffi.v1.BamlTy.encode(message.root, writer.uint32(
5276
+ /* id 1, wireType 2 =*/
5277
+ 10
5278
+ ).fork(), q + 1).ldelim();
5279
+ if (message.classes != null && message.classes.length)
5280
+ for (let i = 0; i < message.classes.length; ++i)
5281
+ $root.baml_bridge.cffi.v1.BamlClassDef.encode(message.classes[i], writer.uint32(
5282
+ /* id 2, wireType 2 =*/
5283
+ 18
5284
+ ).fork(), q + 1).ldelim();
5285
+ if (message.enums != null && message.enums.length)
5286
+ for (let i = 0; i < message.enums.length; ++i)
5287
+ $root.baml_bridge.cffi.v1.BamlEnumDef.encode(message.enums[i], writer.uint32(
5288
+ /* id 3, wireType 2 =*/
5289
+ 26
5290
+ ).fork(), q + 1).ldelim();
5291
+ if (message.witnesses != null && message.witnesses.length)
5292
+ for (let i = 0; i < message.witnesses.length; ++i)
5293
+ $root.baml_bridge.cffi.v1.BamlWitnessDef.encode(message.witnesses[i], writer.uint32(
5294
+ /* id 4, wireType 2 =*/
5295
+ 34
5296
+ ).fork(), q + 1).ldelim();
5297
+ return writer;
5298
+ };
5299
+ BamlTyDef.encodeDelimited = function encodeDelimited(message, writer) {
5300
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5301
+ };
5302
+ BamlTyDef.decode = function decode(reader, length, error, long) {
5303
+ if (!(reader instanceof $Reader))
5304
+ reader = $Reader.create(reader);
5305
+ if (long === void 0)
5306
+ long = 0;
5307
+ if (long > $Reader.recursionLimit)
5308
+ throw Error("maximum nesting depth exceeded");
5309
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlTyDef();
5310
+ while (reader.pos < end) {
5311
+ let tag = reader.uint32();
5312
+ if (tag === error)
5313
+ break;
5314
+ switch (tag >>> 3) {
5315
+ case 1: {
5316
+ message.root = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
5317
+ break;
5318
+ }
5319
+ case 2: {
5320
+ if (!(message.classes && message.classes.length))
5321
+ message.classes = [];
5322
+ message.classes.push($root.baml_bridge.cffi.v1.BamlClassDef.decode(reader, reader.uint32(), void 0, long + 1));
5323
+ break;
5324
+ }
5325
+ case 3: {
5326
+ if (!(message.enums && message.enums.length))
5327
+ message.enums = [];
5328
+ message.enums.push($root.baml_bridge.cffi.v1.BamlEnumDef.decode(reader, reader.uint32(), void 0, long + 1));
5329
+ break;
5330
+ }
5331
+ case 4: {
5332
+ if (!(message.witnesses && message.witnesses.length))
5333
+ message.witnesses = [];
5334
+ message.witnesses.push($root.baml_bridge.cffi.v1.BamlWitnessDef.decode(reader, reader.uint32(), void 0, long + 1));
5335
+ break;
5336
+ }
5337
+ default:
5338
+ reader.skipType(tag & 7, long);
5339
+ break;
5340
+ }
5341
+ }
5342
+ return message;
5343
+ };
5344
+ BamlTyDef.decodeDelimited = function decodeDelimited(reader) {
5345
+ if (!(reader instanceof $Reader))
5346
+ reader = new $Reader(reader);
5347
+ return this.decode(reader, reader.uint32());
5348
+ };
5349
+ BamlTyDef.verify = function verify(message, long) {
5350
+ if (typeof message !== "object" || message === null)
5351
+ return "object expected";
5352
+ if (long === void 0)
5353
+ long = 0;
5354
+ if (long > $util.recursionLimit)
5355
+ return "maximum nesting depth exceeded";
5356
+ if (message.root != null && message.hasOwnProperty("root")) {
5357
+ let error = $root.baml_bridge.cffi.v1.BamlTy.verify(message.root, long + 1);
5358
+ if (error)
5359
+ return "root." + error;
5360
+ }
5361
+ if (message.classes != null && message.hasOwnProperty("classes")) {
5362
+ if (!Array.isArray(message.classes))
5363
+ return "classes: array expected";
5364
+ for (let i = 0; i < message.classes.length; ++i) {
5365
+ let error = $root.baml_bridge.cffi.v1.BamlClassDef.verify(message.classes[i], long + 1);
5366
+ if (error)
5367
+ return "classes." + error;
5368
+ }
5369
+ }
5370
+ if (message.enums != null && message.hasOwnProperty("enums")) {
5371
+ if (!Array.isArray(message.enums))
5372
+ return "enums: array expected";
5373
+ for (let i = 0; i < message.enums.length; ++i) {
5374
+ let error = $root.baml_bridge.cffi.v1.BamlEnumDef.verify(message.enums[i], long + 1);
5375
+ if (error)
5376
+ return "enums." + error;
5377
+ }
5378
+ }
5379
+ if (message.witnesses != null && message.hasOwnProperty("witnesses")) {
5380
+ if (!Array.isArray(message.witnesses))
5381
+ return "witnesses: array expected";
5382
+ for (let i = 0; i < message.witnesses.length; ++i) {
5383
+ let error = $root.baml_bridge.cffi.v1.BamlWitnessDef.verify(message.witnesses[i], long + 1);
5384
+ if (error)
5385
+ return "witnesses." + error;
5386
+ }
5387
+ }
5388
+ return null;
5389
+ };
5390
+ BamlTyDef.fromObject = function fromObject(object, long) {
5391
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlTyDef)
5392
+ return object;
5393
+ if (!$util.isObject(object))
5394
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef: object expected");
5395
+ if (long === void 0)
5396
+ long = 0;
5397
+ if (long > $util.recursionLimit)
5398
+ throw Error("maximum nesting depth exceeded");
5399
+ let message = new $root.baml_bridge.cffi.v1.BamlTyDef();
5400
+ if (object.root != null) {
5401
+ if (!$util.isObject(object.root))
5402
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.root: object expected");
5403
+ message.root = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.root, long + 1);
5404
+ }
5405
+ if (object.classes) {
5406
+ if (!Array.isArray(object.classes))
5407
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.classes: array expected");
5408
+ message.classes = [];
5409
+ for (let i = 0; i < object.classes.length; ++i) {
5410
+ if (!$util.isObject(object.classes[i]))
5411
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.classes: object expected");
5412
+ message.classes[i] = $root.baml_bridge.cffi.v1.BamlClassDef.fromObject(object.classes[i], long + 1);
5413
+ }
5414
+ }
5415
+ if (object.enums) {
5416
+ if (!Array.isArray(object.enums))
5417
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.enums: array expected");
5418
+ message.enums = [];
5419
+ for (let i = 0; i < object.enums.length; ++i) {
5420
+ if (!$util.isObject(object.enums[i]))
5421
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.enums: object expected");
5422
+ message.enums[i] = $root.baml_bridge.cffi.v1.BamlEnumDef.fromObject(object.enums[i], long + 1);
5423
+ }
5424
+ }
5425
+ if (object.witnesses) {
5426
+ if (!Array.isArray(object.witnesses))
5427
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.witnesses: array expected");
5428
+ message.witnesses = [];
5429
+ for (let i = 0; i < object.witnesses.length; ++i) {
5430
+ if (!$util.isObject(object.witnesses[i]))
5431
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyDef.witnesses: object expected");
5432
+ message.witnesses[i] = $root.baml_bridge.cffi.v1.BamlWitnessDef.fromObject(object.witnesses[i], long + 1);
5433
+ }
5434
+ }
5435
+ return message;
5436
+ };
5437
+ BamlTyDef.toObject = function toObject(message, options, q) {
5438
+ if (!options)
5439
+ options = {};
5440
+ if (q === void 0)
5441
+ q = 0;
5442
+ if (q > $util.recursionLimit)
5443
+ throw Error("max depth exceeded");
5444
+ let object = {};
5445
+ if (options.arrays || options.defaults) {
5446
+ object.classes = [];
5447
+ object.enums = [];
5448
+ object.witnesses = [];
5449
+ }
5450
+ if (options.defaults)
5451
+ object.root = null;
5452
+ if (message.root != null && message.hasOwnProperty("root"))
5453
+ object.root = $root.baml_bridge.cffi.v1.BamlTy.toObject(message.root, options, q + 1);
5454
+ if (message.classes && message.classes.length) {
5455
+ object.classes = [];
5456
+ for (let j = 0; j < message.classes.length; ++j)
5457
+ object.classes[j] = $root.baml_bridge.cffi.v1.BamlClassDef.toObject(message.classes[j], options, q + 1);
5458
+ }
5459
+ if (message.enums && message.enums.length) {
5460
+ object.enums = [];
5461
+ for (let j = 0; j < message.enums.length; ++j)
5462
+ object.enums[j] = $root.baml_bridge.cffi.v1.BamlEnumDef.toObject(message.enums[j], options, q + 1);
5463
+ }
5464
+ if (message.witnesses && message.witnesses.length) {
5465
+ object.witnesses = [];
5466
+ for (let j = 0; j < message.witnesses.length; ++j)
5467
+ object.witnesses[j] = $root.baml_bridge.cffi.v1.BamlWitnessDef.toObject(message.witnesses[j], options, q + 1);
5468
+ }
5469
+ return object;
5470
+ };
5471
+ BamlTyDef.prototype.toJSON = function toJSON() {
5472
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5473
+ };
5474
+ BamlTyDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
5475
+ if (typeUrlPrefix === void 0) {
5476
+ typeUrlPrefix = "type.googleapis.com";
5477
+ }
5478
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlTyDef";
5479
+ };
5480
+ return BamlTyDef;
5481
+ })();
5482
+ v1.BamlWitnessDef = (function() {
5483
+ function BamlWitnessDef(properties) {
5484
+ this.interfaceArgs = [];
5485
+ this.associatedTypes = [];
5486
+ this.fieldLinks = [];
5487
+ if (properties) {
5488
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5489
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
5490
+ this[keys[i]] = properties[keys[i]];
5491
+ }
5492
+ }
5493
+ BamlWitnessDef.prototype["interface"] = "";
5494
+ BamlWitnessDef.prototype.interfaceArgs = $util.emptyArray;
5495
+ BamlWitnessDef.prototype.associatedTypes = $util.emptyArray;
5496
+ BamlWitnessDef.prototype.fieldLinks = $util.emptyArray;
5497
+ BamlWitnessDef.create = function create(properties) {
5498
+ return new BamlWitnessDef(properties);
5499
+ };
5500
+ BamlWitnessDef.encode = function encode(message, writer, q) {
5501
+ if (!writer)
5502
+ writer = $Writer.create();
5503
+ if (q === void 0)
5504
+ q = 0;
5505
+ if (q > $util.recursionLimit)
5506
+ throw Error("max depth exceeded");
5507
+ if (message["interface"] != null && Object.hasOwnProperty.call(message, "interface"))
5508
+ writer.uint32(
5509
+ /* id 1, wireType 2 =*/
5510
+ 10
5511
+ ).string(message["interface"]);
5512
+ if (message.interfaceArgs != null && message.interfaceArgs.length)
5513
+ for (let i = 0; i < message.interfaceArgs.length; ++i)
5514
+ $root.baml_bridge.cffi.v1.BamlTy.encode(message.interfaceArgs[i], writer.uint32(
5515
+ /* id 2, wireType 2 =*/
5516
+ 18
5517
+ ).fork(), q + 1).ldelim();
5518
+ if (message.associatedTypes != null && message.associatedTypes.length)
5519
+ for (let i = 0; i < message.associatedTypes.length; ++i)
5520
+ $root.baml_bridge.cffi.v1.BamlTyAssociatedBinding.encode(message.associatedTypes[i], writer.uint32(
5521
+ /* id 3, wireType 2 =*/
5522
+ 26
5523
+ ).fork(), q + 1).ldelim();
5524
+ if (message.fieldLinks != null && message.fieldLinks.length)
5525
+ for (let i = 0; i < message.fieldLinks.length; ++i)
5526
+ $root.baml_bridge.cffi.v1.BamlWitnessFieldLink.encode(message.fieldLinks[i], writer.uint32(
5527
+ /* id 4, wireType 2 =*/
5528
+ 34
5529
+ ).fork(), q + 1).ldelim();
5530
+ return writer;
5531
+ };
5532
+ BamlWitnessDef.encodeDelimited = function encodeDelimited(message, writer) {
5533
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5534
+ };
5535
+ BamlWitnessDef.decode = function decode(reader, length, error, long) {
5536
+ if (!(reader instanceof $Reader))
5537
+ reader = $Reader.create(reader);
5538
+ if (long === void 0)
5539
+ long = 0;
5540
+ if (long > $Reader.recursionLimit)
5541
+ throw Error("maximum nesting depth exceeded");
5542
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlWitnessDef();
5543
+ while (reader.pos < end) {
5544
+ let tag = reader.uint32();
5545
+ if (tag === error)
5546
+ break;
5547
+ switch (tag >>> 3) {
5548
+ case 1: {
5549
+ message["interface"] = reader.string();
5550
+ break;
5551
+ }
5552
+ case 2: {
5553
+ if (!(message.interfaceArgs && message.interfaceArgs.length))
5554
+ message.interfaceArgs = [];
5555
+ message.interfaceArgs.push($root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1));
5556
+ break;
5557
+ }
5558
+ case 3: {
5559
+ if (!(message.associatedTypes && message.associatedTypes.length))
5560
+ message.associatedTypes = [];
5561
+ message.associatedTypes.push($root.baml_bridge.cffi.v1.BamlTyAssociatedBinding.decode(reader, reader.uint32(), void 0, long + 1));
5562
+ break;
5563
+ }
5564
+ case 4: {
5565
+ if (!(message.fieldLinks && message.fieldLinks.length))
5566
+ message.fieldLinks = [];
5567
+ message.fieldLinks.push($root.baml_bridge.cffi.v1.BamlWitnessFieldLink.decode(reader, reader.uint32(), void 0, long + 1));
5568
+ break;
5569
+ }
5570
+ default:
5571
+ reader.skipType(tag & 7, long);
5572
+ break;
5573
+ }
5574
+ }
5575
+ return message;
5576
+ };
5577
+ BamlWitnessDef.decodeDelimited = function decodeDelimited(reader) {
5578
+ if (!(reader instanceof $Reader))
5579
+ reader = new $Reader(reader);
5580
+ return this.decode(reader, reader.uint32());
5581
+ };
5582
+ BamlWitnessDef.verify = function verify(message, long) {
5583
+ if (typeof message !== "object" || message === null)
5584
+ return "object expected";
5585
+ if (long === void 0)
5586
+ long = 0;
5587
+ if (long > $util.recursionLimit)
5588
+ return "maximum nesting depth exceeded";
5589
+ if (message["interface"] != null && message.hasOwnProperty("interface")) {
5590
+ if (!$util.isString(message["interface"]))
5591
+ return "interface: string expected";
5592
+ }
5593
+ if (message.interfaceArgs != null && message.hasOwnProperty("interfaceArgs")) {
5594
+ if (!Array.isArray(message.interfaceArgs))
5595
+ return "interfaceArgs: array expected";
5596
+ for (let i = 0; i < message.interfaceArgs.length; ++i) {
5597
+ let error = $root.baml_bridge.cffi.v1.BamlTy.verify(message.interfaceArgs[i], long + 1);
5598
+ if (error)
5599
+ return "interfaceArgs." + error;
5600
+ }
5601
+ }
5602
+ if (message.associatedTypes != null && message.hasOwnProperty("associatedTypes")) {
5603
+ if (!Array.isArray(message.associatedTypes))
5604
+ return "associatedTypes: array expected";
5605
+ for (let i = 0; i < message.associatedTypes.length; ++i) {
5606
+ let error = $root.baml_bridge.cffi.v1.BamlTyAssociatedBinding.verify(message.associatedTypes[i], long + 1);
5607
+ if (error)
5608
+ return "associatedTypes." + error;
5609
+ }
5610
+ }
5611
+ if (message.fieldLinks != null && message.hasOwnProperty("fieldLinks")) {
5612
+ if (!Array.isArray(message.fieldLinks))
5613
+ return "fieldLinks: array expected";
5614
+ for (let i = 0; i < message.fieldLinks.length; ++i) {
5615
+ let error = $root.baml_bridge.cffi.v1.BamlWitnessFieldLink.verify(message.fieldLinks[i], long + 1);
5616
+ if (error)
5617
+ return "fieldLinks." + error;
5618
+ }
5619
+ }
5620
+ return null;
5621
+ };
5622
+ BamlWitnessDef.fromObject = function fromObject(object, long) {
5623
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlWitnessDef)
5624
+ return object;
5625
+ if (!$util.isObject(object))
5626
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef: object expected");
5627
+ if (long === void 0)
5628
+ long = 0;
5629
+ if (long > $util.recursionLimit)
5630
+ throw Error("maximum nesting depth exceeded");
5631
+ let message = new $root.baml_bridge.cffi.v1.BamlWitnessDef();
5632
+ if (object["interface"] != null)
5633
+ message["interface"] = String(object["interface"]);
5634
+ if (object.interfaceArgs) {
5635
+ if (!Array.isArray(object.interfaceArgs))
5636
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.interfaceArgs: array expected");
5637
+ message.interfaceArgs = [];
5638
+ for (let i = 0; i < object.interfaceArgs.length; ++i) {
5639
+ if (!$util.isObject(object.interfaceArgs[i]))
5640
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.interfaceArgs: object expected");
5641
+ message.interfaceArgs[i] = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.interfaceArgs[i], long + 1);
5642
+ }
5643
+ }
5644
+ if (object.associatedTypes) {
5645
+ if (!Array.isArray(object.associatedTypes))
5646
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.associatedTypes: array expected");
5647
+ message.associatedTypes = [];
5648
+ for (let i = 0; i < object.associatedTypes.length; ++i) {
5649
+ if (!$util.isObject(object.associatedTypes[i]))
5650
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.associatedTypes: object expected");
5651
+ message.associatedTypes[i] = $root.baml_bridge.cffi.v1.BamlTyAssociatedBinding.fromObject(object.associatedTypes[i], long + 1);
5652
+ }
5653
+ }
5654
+ if (object.fieldLinks) {
5655
+ if (!Array.isArray(object.fieldLinks))
5656
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.fieldLinks: array expected");
5657
+ message.fieldLinks = [];
5658
+ for (let i = 0; i < object.fieldLinks.length; ++i) {
5659
+ if (!$util.isObject(object.fieldLinks[i]))
5660
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessDef.fieldLinks: object expected");
5661
+ message.fieldLinks[i] = $root.baml_bridge.cffi.v1.BamlWitnessFieldLink.fromObject(object.fieldLinks[i], long + 1);
5662
+ }
5663
+ }
5664
+ return message;
5665
+ };
5666
+ BamlWitnessDef.toObject = function toObject(message, options, q) {
5667
+ if (!options)
5668
+ options = {};
5669
+ if (q === void 0)
5670
+ q = 0;
5671
+ if (q > $util.recursionLimit)
5672
+ throw Error("max depth exceeded");
5673
+ let object = {};
5674
+ if (options.arrays || options.defaults) {
5675
+ object.interfaceArgs = [];
5676
+ object.associatedTypes = [];
5677
+ object.fieldLinks = [];
5678
+ }
5679
+ if (options.defaults)
5680
+ object["interface"] = "";
5681
+ if (message["interface"] != null && message.hasOwnProperty("interface"))
5682
+ object["interface"] = message["interface"];
5683
+ if (message.interfaceArgs && message.interfaceArgs.length) {
5684
+ object.interfaceArgs = [];
5685
+ for (let j = 0; j < message.interfaceArgs.length; ++j)
5686
+ object.interfaceArgs[j] = $root.baml_bridge.cffi.v1.BamlTy.toObject(message.interfaceArgs[j], options, q + 1);
5687
+ }
5688
+ if (message.associatedTypes && message.associatedTypes.length) {
5689
+ object.associatedTypes = [];
5690
+ for (let j = 0; j < message.associatedTypes.length; ++j)
5691
+ object.associatedTypes[j] = $root.baml_bridge.cffi.v1.BamlTyAssociatedBinding.toObject(message.associatedTypes[j], options, q + 1);
5692
+ }
5693
+ if (message.fieldLinks && message.fieldLinks.length) {
5694
+ object.fieldLinks = [];
5695
+ for (let j = 0; j < message.fieldLinks.length; ++j)
5696
+ object.fieldLinks[j] = $root.baml_bridge.cffi.v1.BamlWitnessFieldLink.toObject(message.fieldLinks[j], options, q + 1);
5697
+ }
5698
+ return object;
5699
+ };
5700
+ BamlWitnessDef.prototype.toJSON = function toJSON() {
5701
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5702
+ };
5703
+ BamlWitnessDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
5704
+ if (typeUrlPrefix === void 0) {
5705
+ typeUrlPrefix = "type.googleapis.com";
5706
+ }
5707
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlWitnessDef";
5708
+ };
5709
+ return BamlWitnessDef;
5710
+ })();
5711
+ v1.BamlWitnessFieldLink = (function() {
5712
+ function BamlWitnessFieldLink(properties) {
5713
+ if (properties) {
5714
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5715
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
5716
+ this[keys[i]] = properties[keys[i]];
5717
+ }
5718
+ }
5719
+ BamlWitnessFieldLink.prototype.interfaceField = "";
5720
+ BamlWitnessFieldLink.prototype.classField = "";
5721
+ BamlWitnessFieldLink.create = function create(properties) {
5722
+ return new BamlWitnessFieldLink(properties);
5723
+ };
5724
+ BamlWitnessFieldLink.encode = function encode(message, writer, q) {
5725
+ if (!writer)
5726
+ writer = $Writer.create();
5727
+ if (q === void 0)
5728
+ q = 0;
5729
+ if (q > $util.recursionLimit)
5730
+ throw Error("max depth exceeded");
5731
+ if (message.interfaceField != null && Object.hasOwnProperty.call(message, "interfaceField"))
5732
+ writer.uint32(
5733
+ /* id 1, wireType 2 =*/
5734
+ 10
5735
+ ).string(message.interfaceField);
5736
+ if (message.classField != null && Object.hasOwnProperty.call(message, "classField"))
5737
+ writer.uint32(
5738
+ /* id 2, wireType 2 =*/
5739
+ 18
5740
+ ).string(message.classField);
5741
+ return writer;
5742
+ };
5743
+ BamlWitnessFieldLink.encodeDelimited = function encodeDelimited(message, writer) {
5744
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5745
+ };
5746
+ BamlWitnessFieldLink.decode = function decode(reader, length, error, long) {
5747
+ if (!(reader instanceof $Reader))
5748
+ reader = $Reader.create(reader);
5749
+ if (long === void 0)
5750
+ long = 0;
5751
+ if (long > $Reader.recursionLimit)
5752
+ throw Error("maximum nesting depth exceeded");
5753
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlWitnessFieldLink();
5754
+ while (reader.pos < end) {
5755
+ let tag = reader.uint32();
5756
+ if (tag === error)
5757
+ break;
5758
+ switch (tag >>> 3) {
5759
+ case 1: {
5760
+ message.interfaceField = reader.string();
5761
+ break;
5762
+ }
5763
+ case 2: {
5764
+ message.classField = reader.string();
5765
+ break;
5766
+ }
5767
+ default:
5768
+ reader.skipType(tag & 7, long);
5769
+ break;
5770
+ }
5771
+ }
5772
+ return message;
5773
+ };
5774
+ BamlWitnessFieldLink.decodeDelimited = function decodeDelimited(reader) {
5775
+ if (!(reader instanceof $Reader))
5776
+ reader = new $Reader(reader);
5777
+ return this.decode(reader, reader.uint32());
5778
+ };
5779
+ BamlWitnessFieldLink.verify = function verify(message, long) {
5780
+ if (typeof message !== "object" || message === null)
5781
+ return "object expected";
5782
+ if (long === void 0)
5783
+ long = 0;
5784
+ if (long > $util.recursionLimit)
5785
+ return "maximum nesting depth exceeded";
5786
+ if (message.interfaceField != null && message.hasOwnProperty("interfaceField")) {
5787
+ if (!$util.isString(message.interfaceField))
5788
+ return "interfaceField: string expected";
5789
+ }
5790
+ if (message.classField != null && message.hasOwnProperty("classField")) {
5791
+ if (!$util.isString(message.classField))
5792
+ return "classField: string expected";
5793
+ }
5794
+ return null;
5795
+ };
5796
+ BamlWitnessFieldLink.fromObject = function fromObject(object, long) {
5797
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlWitnessFieldLink)
5798
+ return object;
5799
+ if (!$util.isObject(object))
5800
+ throw TypeError(".baml_bridge.cffi.v1.BamlWitnessFieldLink: object expected");
5801
+ if (long === void 0)
5802
+ long = 0;
5803
+ if (long > $util.recursionLimit)
5804
+ throw Error("maximum nesting depth exceeded");
5805
+ let message = new $root.baml_bridge.cffi.v1.BamlWitnessFieldLink();
5806
+ if (object.interfaceField != null)
5807
+ message.interfaceField = String(object.interfaceField);
5808
+ if (object.classField != null)
5809
+ message.classField = String(object.classField);
5810
+ return message;
5811
+ };
5812
+ BamlWitnessFieldLink.toObject = function toObject(message, options, q) {
5813
+ if (!options)
5814
+ options = {};
5815
+ if (q === void 0)
5816
+ q = 0;
5817
+ if (q > $util.recursionLimit)
5818
+ throw Error("max depth exceeded");
5819
+ let object = {};
5820
+ if (options.defaults) {
5821
+ object.interfaceField = "";
5822
+ object.classField = "";
5823
+ }
5824
+ if (message.interfaceField != null && message.hasOwnProperty("interfaceField"))
5825
+ object.interfaceField = message.interfaceField;
5826
+ if (message.classField != null && message.hasOwnProperty("classField"))
5827
+ object.classField = message.classField;
5828
+ return object;
5829
+ };
5830
+ BamlWitnessFieldLink.prototype.toJSON = function toJSON() {
5831
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5832
+ };
5833
+ BamlWitnessFieldLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
5834
+ if (typeUrlPrefix === void 0) {
5835
+ typeUrlPrefix = "type.googleapis.com";
5836
+ }
5837
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlWitnessFieldLink";
5838
+ };
5839
+ return BamlWitnessFieldLink;
5840
+ })();
5841
+ v1.BamlTyMetadata = (function() {
5842
+ function BamlTyMetadata(properties) {
5843
+ this.other = {};
5844
+ if (properties) {
5845
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
5846
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
5847
+ this[keys[i]] = properties[keys[i]];
5848
+ }
5849
+ }
5850
+ BamlTyMetadata.prototype.description = null;
5851
+ BamlTyMetadata.prototype.alias = null;
5852
+ BamlTyMetadata.prototype.docstring = null;
5853
+ BamlTyMetadata.prototype.other = $util.emptyObject;
5854
+ let $oneOfFields;
5855
+ Object.defineProperty(BamlTyMetadata.prototype, "_description", {
5856
+ get: $util.oneOfGetter($oneOfFields = ["description"]),
5857
+ set: $util.oneOfSetter($oneOfFields)
5858
+ });
5859
+ Object.defineProperty(BamlTyMetadata.prototype, "_alias", {
5860
+ get: $util.oneOfGetter($oneOfFields = ["alias"]),
5861
+ set: $util.oneOfSetter($oneOfFields)
5862
+ });
5863
+ Object.defineProperty(BamlTyMetadata.prototype, "_docstring", {
5864
+ get: $util.oneOfGetter($oneOfFields = ["docstring"]),
5865
+ set: $util.oneOfSetter($oneOfFields)
5866
+ });
5867
+ BamlTyMetadata.create = function create(properties) {
5868
+ return new BamlTyMetadata(properties);
5869
+ };
5870
+ BamlTyMetadata.encode = function encode(message, writer, q) {
5871
+ if (!writer)
5872
+ writer = $Writer.create();
5873
+ if (q === void 0)
5874
+ q = 0;
5875
+ if (q > $util.recursionLimit)
5876
+ throw Error("max depth exceeded");
5877
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
5878
+ writer.uint32(
5879
+ /* id 1, wireType 2 =*/
5880
+ 10
5881
+ ).string(message.description);
5882
+ if (message.alias != null && Object.hasOwnProperty.call(message, "alias"))
5883
+ writer.uint32(
5884
+ /* id 2, wireType 2 =*/
5885
+ 18
5886
+ ).string(message.alias);
5887
+ if (message.docstring != null && Object.hasOwnProperty.call(message, "docstring"))
5888
+ writer.uint32(
5889
+ /* id 3, wireType 2 =*/
5890
+ 26
5891
+ ).string(message.docstring);
5892
+ if (message.other != null && Object.hasOwnProperty.call(message, "other"))
5893
+ for (let keys = Object.keys(message.other), i = 0; i < keys.length; ++i)
5894
+ writer.uint32(
5895
+ /* id 4, wireType 2 =*/
5896
+ 34
5897
+ ).fork().uint32(
5898
+ /* id 1, wireType 2 =*/
5899
+ 10
5900
+ ).string(keys[i]).uint32(
5901
+ /* id 2, wireType 2 =*/
5902
+ 18
5903
+ ).string(message.other[keys[i]]).ldelim();
5904
+ return writer;
5905
+ };
5906
+ BamlTyMetadata.encodeDelimited = function encodeDelimited(message, writer) {
5907
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
5908
+ };
5909
+ BamlTyMetadata.decode = function decode(reader, length, error, long) {
5910
+ if (!(reader instanceof $Reader))
5911
+ reader = $Reader.create(reader);
5912
+ if (long === void 0)
5913
+ long = 0;
5914
+ if (long > $Reader.recursionLimit)
5915
+ throw Error("maximum nesting depth exceeded");
5916
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlTyMetadata(), key, value;
5917
+ while (reader.pos < end) {
5918
+ let tag = reader.uint32();
5919
+ if (tag === error)
5920
+ break;
5921
+ switch (tag >>> 3) {
5922
+ case 1: {
5923
+ message.description = reader.string();
5924
+ break;
5925
+ }
5926
+ case 2: {
5927
+ message.alias = reader.string();
5928
+ break;
5929
+ }
5930
+ case 3: {
5931
+ message.docstring = reader.string();
5932
+ break;
5933
+ }
5934
+ case 4: {
5935
+ if (message.other === $util.emptyObject)
5936
+ message.other = {};
5937
+ let end2 = reader.uint32() + reader.pos;
5938
+ key = "";
5939
+ value = "";
5940
+ while (reader.pos < end2) {
5941
+ let tag2 = reader.uint32();
5942
+ switch (tag2 >>> 3) {
5943
+ case 1:
5944
+ key = reader.string();
5945
+ break;
5946
+ case 2:
5947
+ value = reader.string();
5948
+ break;
5949
+ default:
5950
+ reader.skipType(tag2 & 7, long);
5951
+ break;
5952
+ }
5953
+ }
5954
+ if (key === "__proto__")
5955
+ $util.makeProp(message.other, key);
5956
+ message.other[key] = value;
5957
+ break;
5958
+ }
5959
+ default:
5960
+ reader.skipType(tag & 7, long);
5961
+ break;
5962
+ }
5963
+ }
5964
+ return message;
5965
+ };
5966
+ BamlTyMetadata.decodeDelimited = function decodeDelimited(reader) {
5967
+ if (!(reader instanceof $Reader))
5968
+ reader = new $Reader(reader);
5969
+ return this.decode(reader, reader.uint32());
5970
+ };
5971
+ BamlTyMetadata.verify = function verify(message, long) {
5972
+ if (typeof message !== "object" || message === null)
5973
+ return "object expected";
5974
+ if (long === void 0)
5975
+ long = 0;
5976
+ if (long > $util.recursionLimit)
5977
+ return "maximum nesting depth exceeded";
5978
+ let properties = {};
5979
+ if (message.description != null && message.hasOwnProperty("description")) {
5980
+ properties._description = 1;
5981
+ if (!$util.isString(message.description))
5982
+ return "description: string expected";
5983
+ }
5984
+ if (message.alias != null && message.hasOwnProperty("alias")) {
5985
+ properties._alias = 1;
5986
+ if (!$util.isString(message.alias))
5987
+ return "alias: string expected";
5988
+ }
5989
+ if (message.docstring != null && message.hasOwnProperty("docstring")) {
5990
+ properties._docstring = 1;
5991
+ if (!$util.isString(message.docstring))
5992
+ return "docstring: string expected";
5993
+ }
5994
+ if (message.other != null && message.hasOwnProperty("other")) {
5995
+ if (!$util.isObject(message.other))
5996
+ return "other: object expected";
5997
+ let key = Object.keys(message.other);
5998
+ for (let i = 0; i < key.length; ++i)
5999
+ if (!$util.isString(message.other[key[i]]))
6000
+ return "other: string{k:string} expected";
6001
+ }
6002
+ return null;
6003
+ };
6004
+ BamlTyMetadata.fromObject = function fromObject(object, long) {
6005
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlTyMetadata)
6006
+ return object;
6007
+ if (!$util.isObject(object))
6008
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyMetadata: object expected");
6009
+ if (long === void 0)
6010
+ long = 0;
6011
+ if (long > $util.recursionLimit)
6012
+ throw Error("maximum nesting depth exceeded");
6013
+ let message = new $root.baml_bridge.cffi.v1.BamlTyMetadata();
6014
+ if (object.description != null)
6015
+ message.description = String(object.description);
6016
+ if (object.alias != null)
6017
+ message.alias = String(object.alias);
6018
+ if (object.docstring != null)
6019
+ message.docstring = String(object.docstring);
6020
+ if (object.other) {
6021
+ if (!$util.isObject(object.other))
6022
+ throw TypeError(".baml_bridge.cffi.v1.BamlTyMetadata.other: object expected");
6023
+ message.other = {};
6024
+ for (let keys = Object.keys(object.other), i = 0; i < keys.length; ++i) {
6025
+ if (keys[i] === "__proto__")
6026
+ $util.makeProp(message.other, keys[i]);
6027
+ message.other[keys[i]] = String(object.other[keys[i]]);
6028
+ }
6029
+ }
6030
+ return message;
6031
+ };
6032
+ BamlTyMetadata.toObject = function toObject(message, options, q) {
6033
+ if (!options)
6034
+ options = {};
6035
+ if (q === void 0)
6036
+ q = 0;
6037
+ if (q > $util.recursionLimit)
6038
+ throw Error("max depth exceeded");
6039
+ let object = {};
6040
+ if (options.objects || options.defaults)
6041
+ object.other = {};
6042
+ if (message.description != null && message.hasOwnProperty("description")) {
6043
+ object.description = message.description;
6044
+ if (options.oneofs)
6045
+ object._description = "description";
6046
+ }
6047
+ if (message.alias != null && message.hasOwnProperty("alias")) {
6048
+ object.alias = message.alias;
6049
+ if (options.oneofs)
6050
+ object._alias = "alias";
6051
+ }
6052
+ if (message.docstring != null && message.hasOwnProperty("docstring")) {
6053
+ object.docstring = message.docstring;
6054
+ if (options.oneofs)
6055
+ object._docstring = "docstring";
6056
+ }
6057
+ let keys2;
6058
+ if (message.other && (keys2 = Object.keys(message.other)).length) {
6059
+ object.other = {};
6060
+ for (let j = 0; j < keys2.length; ++j) {
6061
+ if (keys2[j] === "__proto__")
6062
+ $util.makeProp(object.other, keys2[j]);
6063
+ object.other[keys2[j]] = message.other[keys2[j]];
6064
+ }
6065
+ }
6066
+ return object;
6067
+ };
6068
+ BamlTyMetadata.prototype.toJSON = function toJSON() {
6069
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6070
+ };
6071
+ BamlTyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
6072
+ if (typeUrlPrefix === void 0) {
6073
+ typeUrlPrefix = "type.googleapis.com";
6074
+ }
6075
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlTyMetadata";
6076
+ };
6077
+ return BamlTyMetadata;
6078
+ })();
6079
+ v1.BamlClassDef = (function() {
6080
+ function BamlClassDef(properties) {
6081
+ this.fields = [];
6082
+ if (properties) {
6083
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6084
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
6085
+ this[keys[i]] = properties[keys[i]];
6086
+ }
6087
+ }
6088
+ BamlClassDef.prototype.name = "";
6089
+ BamlClassDef.prototype.fields = $util.emptyArray;
6090
+ BamlClassDef.prototype.metadata = null;
6091
+ BamlClassDef.prototype.genericParamCount = 0;
6092
+ BamlClassDef.create = function create(properties) {
6093
+ return new BamlClassDef(properties);
6094
+ };
6095
+ BamlClassDef.encode = function encode(message, writer, q) {
6096
+ if (!writer)
6097
+ writer = $Writer.create();
6098
+ if (q === void 0)
6099
+ q = 0;
6100
+ if (q > $util.recursionLimit)
6101
+ throw Error("max depth exceeded");
6102
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6103
+ writer.uint32(
6104
+ /* id 1, wireType 2 =*/
6105
+ 10
6106
+ ).string(message.name);
6107
+ if (message.fields != null && message.fields.length)
6108
+ for (let i = 0; i < message.fields.length; ++i)
6109
+ $root.baml_bridge.cffi.v1.BamlClassFieldDef.encode(message.fields[i], writer.uint32(
6110
+ /* id 2, wireType 2 =*/
6111
+ 18
6112
+ ).fork(), q + 1).ldelim();
6113
+ if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
6114
+ $root.baml_bridge.cffi.v1.BamlTyMetadata.encode(message.metadata, writer.uint32(
6115
+ /* id 3, wireType 2 =*/
6116
+ 26
6117
+ ).fork(), q + 1).ldelim();
6118
+ if (message.genericParamCount != null && Object.hasOwnProperty.call(message, "genericParamCount"))
6119
+ writer.uint32(
6120
+ /* id 4, wireType 0 =*/
6121
+ 32
6122
+ ).uint32(message.genericParamCount);
6123
+ return writer;
6124
+ };
6125
+ BamlClassDef.encodeDelimited = function encodeDelimited(message, writer) {
6126
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
6127
+ };
6128
+ BamlClassDef.decode = function decode(reader, length, error, long) {
6129
+ if (!(reader instanceof $Reader))
6130
+ reader = $Reader.create(reader);
6131
+ if (long === void 0)
6132
+ long = 0;
6133
+ if (long > $Reader.recursionLimit)
6134
+ throw Error("maximum nesting depth exceeded");
6135
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlClassDef();
6136
+ while (reader.pos < end) {
6137
+ let tag = reader.uint32();
6138
+ if (tag === error)
6139
+ break;
6140
+ switch (tag >>> 3) {
6141
+ case 1: {
6142
+ message.name = reader.string();
6143
+ break;
6144
+ }
6145
+ case 2: {
6146
+ if (!(message.fields && message.fields.length))
6147
+ message.fields = [];
6148
+ message.fields.push($root.baml_bridge.cffi.v1.BamlClassFieldDef.decode(reader, reader.uint32(), void 0, long + 1));
6149
+ break;
6150
+ }
6151
+ case 3: {
6152
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.decode(reader, reader.uint32(), void 0, long + 1);
6153
+ break;
6154
+ }
6155
+ case 4: {
6156
+ message.genericParamCount = reader.uint32();
6157
+ break;
6158
+ }
6159
+ default:
6160
+ reader.skipType(tag & 7, long);
6161
+ break;
6162
+ }
6163
+ }
6164
+ return message;
6165
+ };
6166
+ BamlClassDef.decodeDelimited = function decodeDelimited(reader) {
6167
+ if (!(reader instanceof $Reader))
6168
+ reader = new $Reader(reader);
6169
+ return this.decode(reader, reader.uint32());
6170
+ };
6171
+ BamlClassDef.verify = function verify(message, long) {
6172
+ if (typeof message !== "object" || message === null)
6173
+ return "object expected";
6174
+ if (long === void 0)
6175
+ long = 0;
6176
+ if (long > $util.recursionLimit)
6177
+ return "maximum nesting depth exceeded";
6178
+ if (message.name != null && message.hasOwnProperty("name")) {
6179
+ if (!$util.isString(message.name))
6180
+ return "name: string expected";
6181
+ }
6182
+ if (message.fields != null && message.hasOwnProperty("fields")) {
6183
+ if (!Array.isArray(message.fields))
6184
+ return "fields: array expected";
6185
+ for (let i = 0; i < message.fields.length; ++i) {
6186
+ let error = $root.baml_bridge.cffi.v1.BamlClassFieldDef.verify(message.fields[i], long + 1);
6187
+ if (error)
6188
+ return "fields." + error;
6189
+ }
6190
+ }
6191
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
6192
+ let error = $root.baml_bridge.cffi.v1.BamlTyMetadata.verify(message.metadata, long + 1);
6193
+ if (error)
6194
+ return "metadata." + error;
6195
+ }
6196
+ if (message.genericParamCount != null && message.hasOwnProperty("genericParamCount")) {
6197
+ if (!$util.isInteger(message.genericParamCount))
6198
+ return "genericParamCount: integer expected";
6199
+ }
6200
+ return null;
6201
+ };
6202
+ BamlClassDef.fromObject = function fromObject(object, long) {
6203
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlClassDef)
6204
+ return object;
6205
+ if (!$util.isObject(object))
6206
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassDef: object expected");
6207
+ if (long === void 0)
6208
+ long = 0;
6209
+ if (long > $util.recursionLimit)
6210
+ throw Error("maximum nesting depth exceeded");
6211
+ let message = new $root.baml_bridge.cffi.v1.BamlClassDef();
6212
+ if (object.name != null)
6213
+ message.name = String(object.name);
6214
+ if (object.fields) {
6215
+ if (!Array.isArray(object.fields))
6216
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassDef.fields: array expected");
6217
+ message.fields = [];
6218
+ for (let i = 0; i < object.fields.length; ++i) {
6219
+ if (!$util.isObject(object.fields[i]))
6220
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassDef.fields: object expected");
6221
+ message.fields[i] = $root.baml_bridge.cffi.v1.BamlClassFieldDef.fromObject(object.fields[i], long + 1);
6222
+ }
6223
+ }
6224
+ if (object.metadata != null) {
6225
+ if (!$util.isObject(object.metadata))
6226
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassDef.metadata: object expected");
6227
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.fromObject(object.metadata, long + 1);
6228
+ }
6229
+ if (object.genericParamCount != null)
6230
+ message.genericParamCount = object.genericParamCount >>> 0;
6231
+ return message;
6232
+ };
6233
+ BamlClassDef.toObject = function toObject(message, options, q) {
6234
+ if (!options)
6235
+ options = {};
6236
+ if (q === void 0)
6237
+ q = 0;
6238
+ if (q > $util.recursionLimit)
6239
+ throw Error("max depth exceeded");
6240
+ let object = {};
6241
+ if (options.arrays || options.defaults)
6242
+ object.fields = [];
6243
+ if (options.defaults) {
6244
+ object.name = "";
6245
+ object.metadata = null;
6246
+ object.genericParamCount = 0;
6247
+ }
6248
+ if (message.name != null && message.hasOwnProperty("name"))
6249
+ object.name = message.name;
6250
+ if (message.fields && message.fields.length) {
6251
+ object.fields = [];
6252
+ for (let j = 0; j < message.fields.length; ++j)
6253
+ object.fields[j] = $root.baml_bridge.cffi.v1.BamlClassFieldDef.toObject(message.fields[j], options, q + 1);
6254
+ }
6255
+ if (message.metadata != null && message.hasOwnProperty("metadata"))
6256
+ object.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.toObject(message.metadata, options, q + 1);
6257
+ if (message.genericParamCount != null && message.hasOwnProperty("genericParamCount"))
6258
+ object.genericParamCount = message.genericParamCount;
6259
+ return object;
6260
+ };
6261
+ BamlClassDef.prototype.toJSON = function toJSON() {
6262
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6263
+ };
6264
+ BamlClassDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
6265
+ if (typeUrlPrefix === void 0) {
6266
+ typeUrlPrefix = "type.googleapis.com";
6267
+ }
6268
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlClassDef";
6269
+ };
6270
+ return BamlClassDef;
6271
+ })();
6272
+ v1.BamlClassFieldDef = (function() {
6273
+ function BamlClassFieldDef(properties) {
6274
+ if (properties) {
6275
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6276
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
6277
+ this[keys[i]] = properties[keys[i]];
6278
+ }
6279
+ }
6280
+ BamlClassFieldDef.prototype.name = "";
6281
+ BamlClassFieldDef.prototype.ty = null;
6282
+ BamlClassFieldDef.prototype.metadata = null;
6283
+ BamlClassFieldDef.prototype.skip = false;
6284
+ BamlClassFieldDef.create = function create(properties) {
6285
+ return new BamlClassFieldDef(properties);
6286
+ };
6287
+ BamlClassFieldDef.encode = function encode(message, writer, q) {
6288
+ if (!writer)
6289
+ writer = $Writer.create();
6290
+ if (q === void 0)
6291
+ q = 0;
6292
+ if (q > $util.recursionLimit)
6293
+ throw Error("max depth exceeded");
6294
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6295
+ writer.uint32(
6296
+ /* id 1, wireType 2 =*/
6297
+ 10
6298
+ ).string(message.name);
6299
+ if (message.ty != null && Object.hasOwnProperty.call(message, "ty"))
6300
+ $root.baml_bridge.cffi.v1.BamlTy.encode(message.ty, writer.uint32(
6301
+ /* id 2, wireType 2 =*/
6302
+ 18
6303
+ ).fork(), q + 1).ldelim();
6304
+ if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
6305
+ $root.baml_bridge.cffi.v1.BamlTyMetadata.encode(message.metadata, writer.uint32(
6306
+ /* id 3, wireType 2 =*/
6307
+ 26
6308
+ ).fork(), q + 1).ldelim();
6309
+ if (message.skip != null && Object.hasOwnProperty.call(message, "skip"))
6310
+ writer.uint32(
6311
+ /* id 4, wireType 0 =*/
6312
+ 32
6313
+ ).bool(message.skip);
6314
+ return writer;
6315
+ };
6316
+ BamlClassFieldDef.encodeDelimited = function encodeDelimited(message, writer) {
6317
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
6318
+ };
6319
+ BamlClassFieldDef.decode = function decode(reader, length, error, long) {
6320
+ if (!(reader instanceof $Reader))
6321
+ reader = $Reader.create(reader);
6322
+ if (long === void 0)
6323
+ long = 0;
6324
+ if (long > $Reader.recursionLimit)
6325
+ throw Error("maximum nesting depth exceeded");
6326
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlClassFieldDef();
6327
+ while (reader.pos < end) {
6328
+ let tag = reader.uint32();
6329
+ if (tag === error)
6330
+ break;
6331
+ switch (tag >>> 3) {
6332
+ case 1: {
6333
+ message.name = reader.string();
6334
+ break;
6335
+ }
6336
+ case 2: {
6337
+ message.ty = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
6338
+ break;
6339
+ }
6340
+ case 3: {
6341
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.decode(reader, reader.uint32(), void 0, long + 1);
6342
+ break;
6343
+ }
6344
+ case 4: {
6345
+ message.skip = reader.bool();
6346
+ break;
6347
+ }
6348
+ default:
6349
+ reader.skipType(tag & 7, long);
6350
+ break;
6351
+ }
6352
+ }
6353
+ return message;
6354
+ };
6355
+ BamlClassFieldDef.decodeDelimited = function decodeDelimited(reader) {
6356
+ if (!(reader instanceof $Reader))
6357
+ reader = new $Reader(reader);
6358
+ return this.decode(reader, reader.uint32());
6359
+ };
6360
+ BamlClassFieldDef.verify = function verify(message, long) {
6361
+ if (typeof message !== "object" || message === null)
6362
+ return "object expected";
6363
+ if (long === void 0)
6364
+ long = 0;
6365
+ if (long > $util.recursionLimit)
6366
+ return "maximum nesting depth exceeded";
6367
+ if (message.name != null && message.hasOwnProperty("name")) {
6368
+ if (!$util.isString(message.name))
6369
+ return "name: string expected";
6370
+ }
6371
+ if (message.ty != null && message.hasOwnProperty("ty")) {
6372
+ let error = $root.baml_bridge.cffi.v1.BamlTy.verify(message.ty, long + 1);
6373
+ if (error)
6374
+ return "ty." + error;
6375
+ }
6376
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
6377
+ let error = $root.baml_bridge.cffi.v1.BamlTyMetadata.verify(message.metadata, long + 1);
6378
+ if (error)
6379
+ return "metadata." + error;
6380
+ }
6381
+ if (message.skip != null && message.hasOwnProperty("skip")) {
6382
+ if (typeof message.skip !== "boolean")
6383
+ return "skip: boolean expected";
6384
+ }
6385
+ return null;
6386
+ };
6387
+ BamlClassFieldDef.fromObject = function fromObject(object, long) {
6388
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlClassFieldDef)
6389
+ return object;
6390
+ if (!$util.isObject(object))
6391
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassFieldDef: object expected");
6392
+ if (long === void 0)
6393
+ long = 0;
6394
+ if (long > $util.recursionLimit)
6395
+ throw Error("maximum nesting depth exceeded");
6396
+ let message = new $root.baml_bridge.cffi.v1.BamlClassFieldDef();
6397
+ if (object.name != null)
6398
+ message.name = String(object.name);
6399
+ if (object.ty != null) {
6400
+ if (!$util.isObject(object.ty))
6401
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassFieldDef.ty: object expected");
6402
+ message.ty = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.ty, long + 1);
6403
+ }
6404
+ if (object.metadata != null) {
6405
+ if (!$util.isObject(object.metadata))
6406
+ throw TypeError(".baml_bridge.cffi.v1.BamlClassFieldDef.metadata: object expected");
6407
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.fromObject(object.metadata, long + 1);
6408
+ }
6409
+ if (object.skip != null)
6410
+ message.skip = Boolean(object.skip);
6411
+ return message;
6412
+ };
6413
+ BamlClassFieldDef.toObject = function toObject(message, options, q) {
6414
+ if (!options)
6415
+ options = {};
6416
+ if (q === void 0)
6417
+ q = 0;
6418
+ if (q > $util.recursionLimit)
6419
+ throw Error("max depth exceeded");
6420
+ let object = {};
6421
+ if (options.defaults) {
6422
+ object.name = "";
6423
+ object.ty = null;
6424
+ object.metadata = null;
6425
+ object.skip = false;
6426
+ }
6427
+ if (message.name != null && message.hasOwnProperty("name"))
6428
+ object.name = message.name;
6429
+ if (message.ty != null && message.hasOwnProperty("ty"))
6430
+ object.ty = $root.baml_bridge.cffi.v1.BamlTy.toObject(message.ty, options, q + 1);
6431
+ if (message.metadata != null && message.hasOwnProperty("metadata"))
6432
+ object.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.toObject(message.metadata, options, q + 1);
6433
+ if (message.skip != null && message.hasOwnProperty("skip"))
6434
+ object.skip = message.skip;
6435
+ return object;
6436
+ };
6437
+ BamlClassFieldDef.prototype.toJSON = function toJSON() {
6438
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6439
+ };
6440
+ BamlClassFieldDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
6441
+ if (typeUrlPrefix === void 0) {
6442
+ typeUrlPrefix = "type.googleapis.com";
6443
+ }
6444
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlClassFieldDef";
6445
+ };
6446
+ return BamlClassFieldDef;
6447
+ })();
6448
+ v1.BamlEnumDef = (function() {
6449
+ function BamlEnumDef(properties) {
6450
+ this.variants = [];
6451
+ if (properties) {
6452
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6453
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
6454
+ this[keys[i]] = properties[keys[i]];
6455
+ }
6456
+ }
6457
+ BamlEnumDef.prototype.name = "";
6458
+ BamlEnumDef.prototype.variants = $util.emptyArray;
6459
+ BamlEnumDef.prototype.metadata = null;
6460
+ BamlEnumDef.create = function create(properties) {
6461
+ return new BamlEnumDef(properties);
6462
+ };
6463
+ BamlEnumDef.encode = function encode(message, writer, q) {
6464
+ if (!writer)
6465
+ writer = $Writer.create();
6466
+ if (q === void 0)
6467
+ q = 0;
6468
+ if (q > $util.recursionLimit)
6469
+ throw Error("max depth exceeded");
6470
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6471
+ writer.uint32(
6472
+ /* id 1, wireType 2 =*/
6473
+ 10
6474
+ ).string(message.name);
6475
+ if (message.variants != null && message.variants.length)
6476
+ for (let i = 0; i < message.variants.length; ++i)
6477
+ $root.baml_bridge.cffi.v1.BamlEnumVariantDef.encode(message.variants[i], writer.uint32(
6478
+ /* id 2, wireType 2 =*/
6479
+ 18
6480
+ ).fork(), q + 1).ldelim();
6481
+ if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
6482
+ $root.baml_bridge.cffi.v1.BamlTyMetadata.encode(message.metadata, writer.uint32(
6483
+ /* id 3, wireType 2 =*/
6484
+ 26
6485
+ ).fork(), q + 1).ldelim();
6486
+ return writer;
6487
+ };
6488
+ BamlEnumDef.encodeDelimited = function encodeDelimited(message, writer) {
6489
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
6490
+ };
6491
+ BamlEnumDef.decode = function decode(reader, length, error, long) {
6492
+ if (!(reader instanceof $Reader))
6493
+ reader = $Reader.create(reader);
6494
+ if (long === void 0)
6495
+ long = 0;
6496
+ if (long > $Reader.recursionLimit)
6497
+ throw Error("maximum nesting depth exceeded");
6498
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlEnumDef();
6499
+ while (reader.pos < end) {
6500
+ let tag = reader.uint32();
6501
+ if (tag === error)
6502
+ break;
6503
+ switch (tag >>> 3) {
6504
+ case 1: {
6505
+ message.name = reader.string();
6506
+ break;
6507
+ }
6508
+ case 2: {
6509
+ if (!(message.variants && message.variants.length))
6510
+ message.variants = [];
6511
+ message.variants.push($root.baml_bridge.cffi.v1.BamlEnumVariantDef.decode(reader, reader.uint32(), void 0, long + 1));
6512
+ break;
6513
+ }
6514
+ case 3: {
6515
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.decode(reader, reader.uint32(), void 0, long + 1);
6516
+ break;
6517
+ }
6518
+ default:
6519
+ reader.skipType(tag & 7, long);
6520
+ break;
6521
+ }
6522
+ }
6523
+ return message;
6524
+ };
6525
+ BamlEnumDef.decodeDelimited = function decodeDelimited(reader) {
6526
+ if (!(reader instanceof $Reader))
6527
+ reader = new $Reader(reader);
6528
+ return this.decode(reader, reader.uint32());
6529
+ };
6530
+ BamlEnumDef.verify = function verify(message, long) {
6531
+ if (typeof message !== "object" || message === null)
6532
+ return "object expected";
6533
+ if (long === void 0)
6534
+ long = 0;
6535
+ if (long > $util.recursionLimit)
6536
+ return "maximum nesting depth exceeded";
6537
+ if (message.name != null && message.hasOwnProperty("name")) {
6538
+ if (!$util.isString(message.name))
6539
+ return "name: string expected";
6540
+ }
6541
+ if (message.variants != null && message.hasOwnProperty("variants")) {
6542
+ if (!Array.isArray(message.variants))
6543
+ return "variants: array expected";
6544
+ for (let i = 0; i < message.variants.length; ++i) {
6545
+ let error = $root.baml_bridge.cffi.v1.BamlEnumVariantDef.verify(message.variants[i], long + 1);
6546
+ if (error)
6547
+ return "variants." + error;
6548
+ }
6549
+ }
6550
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
6551
+ let error = $root.baml_bridge.cffi.v1.BamlTyMetadata.verify(message.metadata, long + 1);
6552
+ if (error)
6553
+ return "metadata." + error;
5047
6554
  }
5048
- if (object.associatedTypeProjection != null) {
5049
- if (!$util.isObject(object.associatedTypeProjection))
5050
- throw TypeError(".baml_bridge.cffi.v1.BamlTy.associatedTypeProjection: object expected");
5051
- message.associatedTypeProjection = $root.baml_bridge.cffi.v1.BamlTyAssociatedTypeProjection.fromObject(object.associatedTypeProjection, long + 1);
6555
+ return null;
6556
+ };
6557
+ BamlEnumDef.fromObject = function fromObject(object, long) {
6558
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlEnumDef)
6559
+ return object;
6560
+ if (!$util.isObject(object))
6561
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumDef: object expected");
6562
+ if (long === void 0)
6563
+ long = 0;
6564
+ if (long > $util.recursionLimit)
6565
+ throw Error("maximum nesting depth exceeded");
6566
+ let message = new $root.baml_bridge.cffi.v1.BamlEnumDef();
6567
+ if (object.name != null)
6568
+ message.name = String(object.name);
6569
+ if (object.variants) {
6570
+ if (!Array.isArray(object.variants))
6571
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumDef.variants: array expected");
6572
+ message.variants = [];
6573
+ for (let i = 0; i < object.variants.length; ++i) {
6574
+ if (!$util.isObject(object.variants[i]))
6575
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumDef.variants: object expected");
6576
+ message.variants[i] = $root.baml_bridge.cffi.v1.BamlEnumVariantDef.fromObject(object.variants[i], long + 1);
6577
+ }
5052
6578
  }
5053
- if (object.never != null) {
5054
- if (!$util.isObject(object.never))
5055
- throw TypeError(".baml_bridge.cffi.v1.BamlTy.never: object expected");
5056
- message.never = $root.baml_bridge.cffi.v1.BamlTyNever.fromObject(object.never, long + 1);
6579
+ if (object.metadata != null) {
6580
+ if (!$util.isObject(object.metadata))
6581
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumDef.metadata: object expected");
6582
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.fromObject(object.metadata, long + 1);
5057
6583
  }
5058
6584
  return message;
5059
6585
  };
5060
- BamlTy.toObject = function toObject(message, options, q) {
6586
+ BamlEnumDef.toObject = function toObject(message, options, q) {
5061
6587
  if (!options)
5062
6588
  options = {};
5063
6589
  if (q === void 0)
@@ -5065,133 +6591,186 @@ var baml_bridge = $root.baml_bridge = (() => {
5065
6591
  if (q > $util.recursionLimit)
5066
6592
  throw Error("max depth exceeded");
5067
6593
  let object = {};
5068
- if (message.primitive != null && message.hasOwnProperty("primitive")) {
5069
- object.primitive = $root.baml_bridge.cffi.v1.BamlTyPrimitive.toObject(message.primitive, options, q + 1);
5070
- if (options.oneofs)
5071
- object.ty = "primitive";
5072
- }
5073
- if (message.classTy != null && message.hasOwnProperty("classTy")) {
5074
- object.classTy = $root.baml_bridge.cffi.v1.BamlTyClass.toObject(message.classTy, options, q + 1);
5075
- if (options.oneofs)
5076
- object.ty = "classTy";
5077
- }
5078
- if (message["enum"] != null && message.hasOwnProperty("enum")) {
5079
- object["enum"] = $root.baml_bridge.cffi.v1.BamlTyEnum.toObject(message["enum"], options, q + 1);
5080
- if (options.oneofs)
5081
- object.ty = "enum";
5082
- }
5083
- if (message.list != null && message.hasOwnProperty("list")) {
5084
- object.list = $root.baml_bridge.cffi.v1.BamlTyList.toObject(message.list, options, q + 1);
5085
- if (options.oneofs)
5086
- object.ty = "list";
5087
- }
5088
- if (message.map != null && message.hasOwnProperty("map")) {
5089
- object.map = $root.baml_bridge.cffi.v1.BamlTyMap.toObject(message.map, options, q + 1);
5090
- if (options.oneofs)
5091
- object.ty = "map";
5092
- }
5093
- if (message.optional != null && message.hasOwnProperty("optional")) {
5094
- object.optional = $root.baml_bridge.cffi.v1.BamlTyOptional.toObject(message.optional, options, q + 1);
5095
- if (options.oneofs)
5096
- object.ty = "optional";
5097
- }
5098
- if (message.union != null && message.hasOwnProperty("union")) {
5099
- object.union = $root.baml_bridge.cffi.v1.BamlTyUnion.toObject(message.union, options, q + 1);
5100
- if (options.oneofs)
5101
- object.ty = "union";
5102
- }
5103
- if (message.literal != null && message.hasOwnProperty("literal")) {
5104
- object.literal = $root.baml_bridge.cffi.v1.BamlTyLiteral.toObject(message.literal, options, q + 1);
5105
- if (options.oneofs)
5106
- object.ty = "literal";
5107
- }
5108
- if (message.typeAlias != null && message.hasOwnProperty("typeAlias")) {
5109
- object.typeAlias = $root.baml_bridge.cffi.v1.BamlTyTypeAlias.toObject(message.typeAlias, options, q + 1);
5110
- if (options.oneofs)
5111
- object.ty = "typeAlias";
5112
- }
5113
- if (message.unknown != null && message.hasOwnProperty("unknown")) {
5114
- object.unknown = $root.baml_bridge.cffi.v1.BamlTyUnknown.toObject(message.unknown, options, q + 1);
5115
- if (options.oneofs)
5116
- object.ty = "unknown";
5117
- }
5118
- if (message.media != null && message.hasOwnProperty("media")) {
5119
- object.media = $root.baml_bridge.cffi.v1.BamlTyMedia.toObject(message.media, options, q + 1);
5120
- if (options.oneofs)
5121
- object.ty = "media";
5122
- }
5123
- if (message["interface"] != null && message.hasOwnProperty("interface")) {
5124
- object["interface"] = $root.baml_bridge.cffi.v1.BamlTyInterface.toObject(message["interface"], options, q + 1);
5125
- if (options.oneofs)
5126
- object.ty = "interface";
5127
- }
5128
- if (message.enumVariant != null && message.hasOwnProperty("enumVariant")) {
5129
- object.enumVariant = $root.baml_bridge.cffi.v1.BamlTyEnumVariant.toObject(message.enumVariant, options, q + 1);
5130
- if (options.oneofs)
5131
- object.ty = "enumVariant";
5132
- }
5133
- if (message["function"] != null && message.hasOwnProperty("function")) {
5134
- object["function"] = $root.baml_bridge.cffi.v1.BamlTyFunction.toObject(message["function"], options, q + 1);
5135
- if (options.oneofs)
5136
- object.ty = "function";
6594
+ if (options.arrays || options.defaults)
6595
+ object.variants = [];
6596
+ if (options.defaults) {
6597
+ object.name = "";
6598
+ object.metadata = null;
5137
6599
  }
5138
- if (message.future != null && message.hasOwnProperty("future")) {
5139
- object.future = $root.baml_bridge.cffi.v1.BamlTyFuture.toObject(message.future, options, q + 1);
5140
- if (options.oneofs)
5141
- object.ty = "future";
6600
+ if (message.name != null && message.hasOwnProperty("name"))
6601
+ object.name = message.name;
6602
+ if (message.variants && message.variants.length) {
6603
+ object.variants = [];
6604
+ for (let j = 0; j < message.variants.length; ++j)
6605
+ object.variants[j] = $root.baml_bridge.cffi.v1.BamlEnumVariantDef.toObject(message.variants[j], options, q + 1);
5142
6606
  }
5143
- if (message.rustType != null && message.hasOwnProperty("rustType")) {
5144
- object.rustType = $root.baml_bridge.cffi.v1.BamlTyRustType.toObject(message.rustType, options, q + 1);
5145
- if (options.oneofs)
5146
- object.ty = "rustType";
6607
+ if (message.metadata != null && message.hasOwnProperty("metadata"))
6608
+ object.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.toObject(message.metadata, options, q + 1);
6609
+ return object;
6610
+ };
6611
+ BamlEnumDef.prototype.toJSON = function toJSON() {
6612
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
6613
+ };
6614
+ BamlEnumDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
6615
+ if (typeUrlPrefix === void 0) {
6616
+ typeUrlPrefix = "type.googleapis.com";
5147
6617
  }
5148
- if (message.metaType != null && message.hasOwnProperty("metaType")) {
5149
- object.metaType = $root.baml_bridge.cffi.v1.BamlTyMetaType.toObject(message.metaType, options, q + 1);
5150
- if (options.oneofs)
5151
- object.ty = "metaType";
6618
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlEnumDef";
6619
+ };
6620
+ return BamlEnumDef;
6621
+ })();
6622
+ v1.BamlEnumVariantDef = (function() {
6623
+ function BamlEnumVariantDef(properties) {
6624
+ if (properties) {
6625
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6626
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
6627
+ this[keys[i]] = properties[keys[i]];
5152
6628
  }
5153
- if (message.resource != null && message.hasOwnProperty("resource")) {
5154
- object.resource = $root.baml_bridge.cffi.v1.BamlTyResource.toObject(message.resource, options, q + 1);
5155
- if (options.oneofs)
5156
- object.ty = "resource";
6629
+ }
6630
+ BamlEnumVariantDef.prototype.name = "";
6631
+ BamlEnumVariantDef.prototype.metadata = null;
6632
+ BamlEnumVariantDef.prototype.skip = false;
6633
+ BamlEnumVariantDef.create = function create(properties) {
6634
+ return new BamlEnumVariantDef(properties);
6635
+ };
6636
+ BamlEnumVariantDef.encode = function encode(message, writer, q) {
6637
+ if (!writer)
6638
+ writer = $Writer.create();
6639
+ if (q === void 0)
6640
+ q = 0;
6641
+ if (q > $util.recursionLimit)
6642
+ throw Error("max depth exceeded");
6643
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6644
+ writer.uint32(
6645
+ /* id 1, wireType 2 =*/
6646
+ 10
6647
+ ).string(message.name);
6648
+ if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
6649
+ $root.baml_bridge.cffi.v1.BamlTyMetadata.encode(message.metadata, writer.uint32(
6650
+ /* id 2, wireType 2 =*/
6651
+ 18
6652
+ ).fork(), q + 1).ldelim();
6653
+ if (message.skip != null && Object.hasOwnProperty.call(message, "skip"))
6654
+ writer.uint32(
6655
+ /* id 3, wireType 0 =*/
6656
+ 24
6657
+ ).bool(message.skip);
6658
+ return writer;
6659
+ };
6660
+ BamlEnumVariantDef.encodeDelimited = function encodeDelimited(message, writer) {
6661
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
6662
+ };
6663
+ BamlEnumVariantDef.decode = function decode(reader, length, error, long) {
6664
+ if (!(reader instanceof $Reader))
6665
+ reader = $Reader.create(reader);
6666
+ if (long === void 0)
6667
+ long = 0;
6668
+ if (long > $Reader.recursionLimit)
6669
+ throw Error("maximum nesting depth exceeded");
6670
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlEnumVariantDef();
6671
+ while (reader.pos < end) {
6672
+ let tag = reader.uint32();
6673
+ if (tag === error)
6674
+ break;
6675
+ switch (tag >>> 3) {
6676
+ case 1: {
6677
+ message.name = reader.string();
6678
+ break;
6679
+ }
6680
+ case 2: {
6681
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.decode(reader, reader.uint32(), void 0, long + 1);
6682
+ break;
6683
+ }
6684
+ case 3: {
6685
+ message.skip = reader.bool();
6686
+ break;
6687
+ }
6688
+ default:
6689
+ reader.skipType(tag & 7, long);
6690
+ break;
6691
+ }
5157
6692
  }
5158
- if (message.promptAst != null && message.hasOwnProperty("promptAst")) {
5159
- object.promptAst = $root.baml_bridge.cffi.v1.BamlTyPromptAst.toObject(message.promptAst, options, q + 1);
5160
- if (options.oneofs)
5161
- object.ty = "promptAst";
6693
+ return message;
6694
+ };
6695
+ BamlEnumVariantDef.decodeDelimited = function decodeDelimited(reader) {
6696
+ if (!(reader instanceof $Reader))
6697
+ reader = new $Reader(reader);
6698
+ return this.decode(reader, reader.uint32());
6699
+ };
6700
+ BamlEnumVariantDef.verify = function verify(message, long) {
6701
+ if (typeof message !== "object" || message === null)
6702
+ return "object expected";
6703
+ if (long === void 0)
6704
+ long = 0;
6705
+ if (long > $util.recursionLimit)
6706
+ return "maximum nesting depth exceeded";
6707
+ if (message.name != null && message.hasOwnProperty("name")) {
6708
+ if (!$util.isString(message.name))
6709
+ return "name: string expected";
5162
6710
  }
5163
- if (message["void"] != null && message.hasOwnProperty("void")) {
5164
- object["void"] = $root.baml_bridge.cffi.v1.BamlTyVoid.toObject(message["void"], options, q + 1);
5165
- if (options.oneofs)
5166
- object.ty = "void";
6711
+ if (message.metadata != null && message.hasOwnProperty("metadata")) {
6712
+ let error = $root.baml_bridge.cffi.v1.BamlTyMetadata.verify(message.metadata, long + 1);
6713
+ if (error)
6714
+ return "metadata." + error;
5167
6715
  }
5168
- if (message.typeVar != null && message.hasOwnProperty("typeVar")) {
5169
- object.typeVar = $root.baml_bridge.cffi.v1.BamlTyTypeVar.toObject(message.typeVar, options, q + 1);
5170
- if (options.oneofs)
5171
- object.ty = "typeVar";
6716
+ if (message.skip != null && message.hasOwnProperty("skip")) {
6717
+ if (typeof message.skip !== "boolean")
6718
+ return "skip: boolean expected";
5172
6719
  }
5173
- if (message.associatedTypeProjection != null && message.hasOwnProperty("associatedTypeProjection")) {
5174
- object.associatedTypeProjection = $root.baml_bridge.cffi.v1.BamlTyAssociatedTypeProjection.toObject(message.associatedTypeProjection, options, q + 1);
5175
- if (options.oneofs)
5176
- object.ty = "associatedTypeProjection";
6720
+ return null;
6721
+ };
6722
+ BamlEnumVariantDef.fromObject = function fromObject(object, long) {
6723
+ if (object instanceof $root.baml_bridge.cffi.v1.BamlEnumVariantDef)
6724
+ return object;
6725
+ if (!$util.isObject(object))
6726
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumVariantDef: object expected");
6727
+ if (long === void 0)
6728
+ long = 0;
6729
+ if (long > $util.recursionLimit)
6730
+ throw Error("maximum nesting depth exceeded");
6731
+ let message = new $root.baml_bridge.cffi.v1.BamlEnumVariantDef();
6732
+ if (object.name != null)
6733
+ message.name = String(object.name);
6734
+ if (object.metadata != null) {
6735
+ if (!$util.isObject(object.metadata))
6736
+ throw TypeError(".baml_bridge.cffi.v1.BamlEnumVariantDef.metadata: object expected");
6737
+ message.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.fromObject(object.metadata, long + 1);
5177
6738
  }
5178
- if (message.never != null && message.hasOwnProperty("never")) {
5179
- object.never = $root.baml_bridge.cffi.v1.BamlTyNever.toObject(message.never, options, q + 1);
5180
- if (options.oneofs)
5181
- object.ty = "never";
6739
+ if (object.skip != null)
6740
+ message.skip = Boolean(object.skip);
6741
+ return message;
6742
+ };
6743
+ BamlEnumVariantDef.toObject = function toObject(message, options, q) {
6744
+ if (!options)
6745
+ options = {};
6746
+ if (q === void 0)
6747
+ q = 0;
6748
+ if (q > $util.recursionLimit)
6749
+ throw Error("max depth exceeded");
6750
+ let object = {};
6751
+ if (options.defaults) {
6752
+ object.name = "";
6753
+ object.metadata = null;
6754
+ object.skip = false;
5182
6755
  }
6756
+ if (message.name != null && message.hasOwnProperty("name"))
6757
+ object.name = message.name;
6758
+ if (message.metadata != null && message.hasOwnProperty("metadata"))
6759
+ object.metadata = $root.baml_bridge.cffi.v1.BamlTyMetadata.toObject(message.metadata, options, q + 1);
6760
+ if (message.skip != null && message.hasOwnProperty("skip"))
6761
+ object.skip = message.skip;
5183
6762
  return object;
5184
6763
  };
5185
- BamlTy.prototype.toJSON = function toJSON() {
6764
+ BamlEnumVariantDef.prototype.toJSON = function toJSON() {
5186
6765
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
5187
6766
  };
5188
- BamlTy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
6767
+ BamlEnumVariantDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
5189
6768
  if (typeUrlPrefix === void 0) {
5190
6769
  typeUrlPrefix = "type.googleapis.com";
5191
6770
  }
5192
- return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlTy";
6771
+ return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlEnumVariantDef";
5193
6772
  };
5194
- return BamlTy;
6773
+ return BamlEnumVariantDef;
5195
6774
  })();
5196
6775
  v1.BamlTyPrimitiveKind = (function() {
5197
6776
  const valuesById = {}, values = Object.create(valuesById);
@@ -9075,9 +10654,10 @@ var baml_bridge = $root.baml_bridge = (() => {
9075
10654
  BamlOutboundValue.prototype.uint8arrayValue = null;
9076
10655
  BamlOutboundValue.prototype.bigintValue = null;
9077
10656
  BamlOutboundValue.prototype.tyValue = null;
10657
+ BamlOutboundValue.prototype.tyDefValue = null;
9078
10658
  let $oneOfFields;
9079
10659
  Object.defineProperty(BamlOutboundValue.prototype, "value", {
9080
- get: $util.oneOfGetter($oneOfFields = ["nullValue", "stringValue", "intValue", "floatValue", "boolValue", "classValue", "enumValue", "literalValue", "listValue", "mapValue", "unionVariantValue", "handleValue", "mediaValue", "promptAstValue", "uint8arrayValue", "bigintValue", "tyValue"]),
10660
+ get: $util.oneOfGetter($oneOfFields = ["nullValue", "stringValue", "intValue", "floatValue", "boolValue", "classValue", "enumValue", "literalValue", "listValue", "mapValue", "unionVariantValue", "handleValue", "mediaValue", "promptAstValue", "uint8arrayValue", "bigintValue", "tyValue", "tyDefValue"]),
9081
10661
  set: $util.oneOfSetter($oneOfFields)
9082
10662
  });
9083
10663
  BamlOutboundValue.create = function create(properties) {
@@ -9175,6 +10755,11 @@ var baml_bridge = $root.baml_bridge = (() => {
9175
10755
  /* id 21, wireType 2 =*/
9176
10756
  170
9177
10757
  ).fork(), q + 1).ldelim();
10758
+ if (message.tyDefValue != null && Object.hasOwnProperty.call(message, "tyDefValue"))
10759
+ $root.baml_bridge.cffi.v1.BamlTyDef.encode(message.tyDefValue, writer.uint32(
10760
+ /* id 22, wireType 2 =*/
10761
+ 178
10762
+ ).fork(), q + 1).ldelim();
9178
10763
  return writer;
9179
10764
  };
9180
10765
  BamlOutboundValue.encodeDelimited = function encodeDelimited(message, writer) {
@@ -9261,6 +10846,10 @@ var baml_bridge = $root.baml_bridge = (() => {
9261
10846
  message.tyValue = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
9262
10847
  break;
9263
10848
  }
10849
+ case 22: {
10850
+ message.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.decode(reader, reader.uint32(), void 0, long + 1);
10851
+ break;
10852
+ }
9264
10853
  default:
9265
10854
  reader.skipType(tag & 7, long);
9266
10855
  break;
@@ -9431,6 +11020,16 @@ var baml_bridge = $root.baml_bridge = (() => {
9431
11020
  return "tyValue." + error;
9432
11021
  }
9433
11022
  }
11023
+ if (message.tyDefValue != null && message.hasOwnProperty("tyDefValue")) {
11024
+ if (properties.value === 1)
11025
+ return "value: multiple values";
11026
+ properties.value = 1;
11027
+ {
11028
+ let error = $root.baml_bridge.cffi.v1.BamlTyDef.verify(message.tyDefValue, long + 1);
11029
+ if (error)
11030
+ return "tyDefValue." + error;
11031
+ }
11032
+ }
9434
11033
  return null;
9435
11034
  };
9436
11035
  BamlOutboundValue.fromObject = function fromObject(object, long) {
@@ -9522,6 +11121,11 @@ var baml_bridge = $root.baml_bridge = (() => {
9522
11121
  throw TypeError(".baml_bridge.cffi.v1.BamlOutboundValue.tyValue: object expected");
9523
11122
  message.tyValue = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.tyValue, long + 1);
9524
11123
  }
11124
+ if (object.tyDefValue != null) {
11125
+ if (!$util.isObject(object.tyDefValue))
11126
+ throw TypeError(".baml_bridge.cffi.v1.BamlOutboundValue.tyDefValue: object expected");
11127
+ message.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.fromObject(object.tyDefValue, long + 1);
11128
+ }
9525
11129
  return message;
9526
11130
  };
9527
11131
  BamlOutboundValue.toObject = function toObject(message, options, q) {
@@ -9622,6 +11226,11 @@ var baml_bridge = $root.baml_bridge = (() => {
9622
11226
  if (options.oneofs)
9623
11227
  object.value = "tyValue";
9624
11228
  }
11229
+ if (message.tyDefValue != null && message.hasOwnProperty("tyDefValue")) {
11230
+ object.tyDefValue = $root.baml_bridge.cffi.v1.BamlTyDef.toObject(message.tyDefValue, options, q + 1);
11231
+ if (options.oneofs)
11232
+ object.value = "tyDefValue";
11233
+ }
9625
11234
  return object;
9626
11235
  };
9627
11236
  BamlOutboundValue.prototype.toJSON = function toJSON() {