@boundaryml/baml-bridge-web 0.25.3-nightly.20261116.a → 0.26.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 (55) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/native.d.ts +16 -2
  6. package/dist/native.d.ts.map +1 -1
  7. package/dist/native.js +25 -7
  8. package/dist/native.js.map +1 -1
  9. package/dist/platform.js.map +1 -1
  10. package/dist/shared/define_function.js +1 -1
  11. package/dist/shared/define_function.js.map +1 -1
  12. package/dist/shared/host_marker.d.ts +2 -2
  13. package/dist/shared/host_marker.d.ts.map +1 -1
  14. package/dist/shared/host_value_registry.d.ts +9 -14
  15. package/dist/shared/host_value_registry.d.ts.map +1 -1
  16. package/dist/shared/host_value_registry.js +19 -23
  17. package/dist/shared/host_value_registry.js.map +1 -1
  18. package/dist/shared/platform.js.map +1 -1
  19. package/dist/shared/proto/baml_cffi.d.ts +10 -104
  20. package/dist/shared/proto/baml_cffi.js +48 -152
  21. package/dist/shared/proto.d.ts +27 -8
  22. package/dist/shared/proto.d.ts.map +1 -1
  23. package/dist/shared/proto.js +160 -45
  24. package/dist/shared/proto.js.map +1 -1
  25. package/dist/wasm/bridge_web_core.d.ts +28 -16
  26. package/dist/wasm/bridge_web_core.js +58 -32
  27. package/dist/wasm/bridge_web_core_bg.wasm +0 -0
  28. package/dist/wasm/bridge_web_core_bg.wasm.d.ts +9 -8
  29. package/dist/workerd/index.d.ts +1 -1
  30. package/dist/workerd/index.d.ts.map +1 -1
  31. package/dist/workerd/index.js +1 -1
  32. package/dist/workerd/index.js.map +1 -1
  33. package/dist/workerd/native.d.ts +16 -2
  34. package/dist/workerd/native.d.ts.map +1 -1
  35. package/dist/workerd/native.js +25 -7
  36. package/dist/workerd/shared/define_function.js +1 -1
  37. package/dist/workerd/shared/define_function.js.map +1 -1
  38. package/dist/workerd/shared/host_marker.d.ts +2 -2
  39. package/dist/workerd/shared/host_marker.d.ts.map +1 -1
  40. package/dist/workerd/shared/host_value_registry.d.ts +9 -14
  41. package/dist/workerd/shared/host_value_registry.d.ts.map +1 -1
  42. package/dist/workerd/shared/host_value_registry.js +19 -23
  43. package/dist/workerd/shared/host_value_registry.js.map +1 -1
  44. package/dist/workerd/shared/platform.js.map +1 -1
  45. package/dist/workerd/shared/proto/baml_cffi.d.ts +10 -104
  46. package/dist/workerd/shared/proto/baml_cffi.js +48 -152
  47. package/dist/workerd/shared/proto.d.ts +27 -8
  48. package/dist/workerd/shared/proto.d.ts.map +1 -1
  49. package/dist/workerd/shared/proto.js +160 -45
  50. package/dist/workerd/shared/proto.js.map +1 -1
  51. package/dist/workerd-wasm/bridge_web_core.d.ts +19 -8
  52. package/dist/workerd-wasm/bridge_web_core_bg.js +58 -32
  53. package/dist/workerd-wasm/bridge_web_core_bg.wasm +0 -0
  54. package/dist/workerd-wasm/bridge_web_core_bg.wasm.d.ts +9 -8
  55. package/package.json +1 -1
@@ -1791,23 +1791,21 @@ export namespace baml_bridge {
1791
1791
  /** BamlHandleType enum. */
1792
1792
  enum BamlHandleType {
1793
1793
  HANDLE_UNSPECIFIED = 0,
1794
- UNTAGGED_RUST_DATA = 1,
1795
1794
  UNTAGGED_BEX_HEAP = 2,
1796
1795
  FUNCTION_REF = 5,
1797
1796
  ADT_MEDIA_IMAGE = 6,
1798
1797
  ADT_MEDIA_AUDIO = 7,
1799
1798
  ADT_MEDIA_VIDEO = 8,
1800
1799
  ADT_MEDIA_PDF = 9,
1801
- ADT_MEDIA_GENERIC = 10,
1802
1800
  ADT_PROMPT_AST = 11,
1803
- ADT_TYPE = 13,
1804
1801
  ADT_TAGGED_HEAP_HANDLE = 14,
1805
1802
  HOST_VALUE_CALLABLE = 15,
1806
1803
  HOST_VALUE_OPAQUE = 16,
1807
1804
  ADT_FUNCTION_SPEC = 17,
1808
1805
  ADT_RUNTIME_VALUE = 18,
1809
1806
  INVOCATION_STATE = 19,
1810
- TRACE_RESERVATION = 20
1807
+ TRACE_RESERVATION = 20,
1808
+ HOST_VALUE_PIN = 21
1811
1809
  }
1812
1810
 
1813
1811
  /** Properties of a BamlHandle. */
@@ -1961,9 +1959,6 @@ export namespace baml_bridge {
1961
1959
  /** BamlTy future */
1962
1960
  future?: (baml_bridge.cffi.v1.IBamlTyFuture|null);
1963
1961
 
1964
- /** BamlTy rustType */
1965
- rustType?: (baml_bridge.cffi.v1.IBamlTyRustType|null);
1966
-
1967
1962
  /** BamlTy metaType */
1968
1963
  metaType?: (baml_bridge.cffi.v1.IBamlTyMetaType|null);
1969
1964
 
@@ -2040,9 +2035,6 @@ export namespace baml_bridge {
2040
2035
  /** BamlTy future. */
2041
2036
  public future?: (baml_bridge.cffi.v1.IBamlTyFuture|null);
2042
2037
 
2043
- /** BamlTy rustType. */
2044
- public rustType?: (baml_bridge.cffi.v1.IBamlTyRustType|null);
2045
-
2046
2038
  /** BamlTy metaType. */
2047
2039
  public metaType?: (baml_bridge.cffi.v1.IBamlTyMetaType|null);
2048
2040
 
@@ -2065,7 +2057,7 @@ export namespace baml_bridge {
2065
2057
  public tuple?: (baml_bridge.cffi.v1.IBamlTyTuple|null);
2066
2058
 
2067
2059
  /** BamlTy ty. */
2068
- public ty?: ("primitive"|"classTy"|"enum"|"list"|"map"|"optional"|"union"|"literal"|"typeAlias"|"unknown"|"media"|"interface"|"enumVariant"|"Function"|"future"|"rustType"|"metaType"|"resource"|"promptAst"|"typeVar"|"associatedTypeProjection"|"never"|"tuple");
2060
+ public ty?: ("primitive"|"classTy"|"enum"|"list"|"map"|"optional"|"union"|"literal"|"typeAlias"|"unknown"|"media"|"interface"|"enumVariant"|"Function"|"future"|"metaType"|"resource"|"promptAst"|"typeVar"|"associatedTypeProjection"|"never"|"tuple");
2069
2061
 
2070
2062
  /**
2071
2063
  * Creates a new BamlTy instance using the specified properties.
@@ -4094,97 +4086,6 @@ export namespace baml_bridge {
4094
4086
  public static getTypeUrl(typeUrlPrefix?: string): string;
4095
4087
  }
4096
4088
 
4097
- /** Properties of a BamlTyRustType. */
4098
- interface IBamlTyRustType {
4099
- }
4100
-
4101
- /** Represents a BamlTyRustType. */
4102
- class BamlTyRustType implements IBamlTyRustType {
4103
-
4104
- /**
4105
- * Constructs a new BamlTyRustType.
4106
- * @param [properties] Properties to set
4107
- */
4108
- constructor(properties?: baml_bridge.cffi.v1.IBamlTyRustType);
4109
-
4110
- /**
4111
- * Creates a new BamlTyRustType instance using the specified properties.
4112
- * @param [properties] Properties to set
4113
- * @returns BamlTyRustType instance
4114
- */
4115
- public static create(properties?: baml_bridge.cffi.v1.IBamlTyRustType): baml_bridge.cffi.v1.BamlTyRustType;
4116
-
4117
- /**
4118
- * Encodes the specified BamlTyRustType message. Does not implicitly {@link baml_bridge.cffi.v1.BamlTyRustType.verify|verify} messages.
4119
- * @param message BamlTyRustType message or plain object to encode
4120
- * @param [writer] Writer to encode to
4121
- * @returns Writer
4122
- */
4123
- public static encode(message: baml_bridge.cffi.v1.IBamlTyRustType, writer?: $protobuf.Writer): $protobuf.Writer;
4124
-
4125
- /**
4126
- * Encodes the specified BamlTyRustType message, length delimited. Does not implicitly {@link baml_bridge.cffi.v1.BamlTyRustType.verify|verify} messages.
4127
- * @param message BamlTyRustType message or plain object to encode
4128
- * @param [writer] Writer to encode to
4129
- * @returns Writer
4130
- */
4131
- public static encodeDelimited(message: baml_bridge.cffi.v1.IBamlTyRustType, writer?: $protobuf.Writer): $protobuf.Writer;
4132
-
4133
- /**
4134
- * Decodes a BamlTyRustType message from the specified reader or buffer.
4135
- * @param reader Reader or buffer to decode from
4136
- * @param [length] Message length if known beforehand
4137
- * @returns BamlTyRustType
4138
- * @throws {Error} If the payload is not a reader or valid buffer
4139
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
4140
- */
4141
- public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): baml_bridge.cffi.v1.BamlTyRustType;
4142
-
4143
- /**
4144
- * Decodes a BamlTyRustType message from the specified reader or buffer, length delimited.
4145
- * @param reader Reader or buffer to decode from
4146
- * @returns BamlTyRustType
4147
- * @throws {Error} If the payload is not a reader or valid buffer
4148
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
4149
- */
4150
- public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): baml_bridge.cffi.v1.BamlTyRustType;
4151
-
4152
- /**
4153
- * Verifies a BamlTyRustType message.
4154
- * @param message Plain object to verify
4155
- * @returns `null` if valid, otherwise the reason why it is not
4156
- */
4157
- public static verify(message: { [k: string]: any }): (string|null);
4158
-
4159
- /**
4160
- * Creates a BamlTyRustType message from a plain object. Also converts values to their respective internal types.
4161
- * @param object Plain object
4162
- * @returns BamlTyRustType
4163
- */
4164
- public static fromObject(object: { [k: string]: any }): baml_bridge.cffi.v1.BamlTyRustType;
4165
-
4166
- /**
4167
- * Creates a plain object from a BamlTyRustType message. Also converts values to other types if specified.
4168
- * @param message BamlTyRustType
4169
- * @param [options] Conversion options
4170
- * @returns Plain object
4171
- */
4172
- public static toObject(message: baml_bridge.cffi.v1.BamlTyRustType, options?: $protobuf.IConversionOptions): { [k: string]: any };
4173
-
4174
- /**
4175
- * Converts this BamlTyRustType to JSON.
4176
- * @returns JSON object
4177
- */
4178
- public toJSON(): { [k: string]: any };
4179
-
4180
- /**
4181
- * Gets the default type url for BamlTyRustType
4182
- * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
4183
- * @returns The default type url
4184
- */
4185
- public static getTypeUrl(typeUrlPrefix?: string): string;
4186
- }
4187
-
4188
4089
  /** Properties of a BamlTyMetaType. */
4189
4090
  interface IBamlTyMetaType {
4190
4091
  }
@@ -5304,6 +5205,9 @@ export namespace baml_bridge {
5304
5205
 
5305
5206
  /** BamlOutboundHandle ty */
5306
5207
  ty?: (baml_bridge.cffi.v1.IBamlTy|null);
5208
+
5209
+ /** BamlOutboundHandle pin */
5210
+ pin?: (number|Long|null);
5307
5211
  }
5308
5212
 
5309
5213
  /** Represents a BamlOutboundHandle. */
@@ -5324,6 +5228,9 @@ export namespace baml_bridge {
5324
5228
  /** BamlOutboundHandle ty. */
5325
5229
  public ty?: (baml_bridge.cffi.v1.IBamlTy|null);
5326
5230
 
5231
+ /** BamlOutboundHandle pin. */
5232
+ public pin: (number|Long);
5233
+
5327
5234
  /**
5328
5235
  * Creates a new BamlOutboundHandle instance using the specified properties.
5329
5236
  * @param [properties] Properties to set
@@ -6268,8 +6175,7 @@ export namespace baml_bridge {
6268
6175
  IMAGE = 1,
6269
6176
  AUDIO = 2,
6270
6177
  PDF = 3,
6271
- VIDEO = 4,
6272
- OTHER = 5
6178
+ VIDEO = 4
6273
6179
  }
6274
6180
 
6275
6181
  /** Properties of a BamlValueMedia. */
@@ -5686,16 +5686,13 @@ var baml_bridge = $root.baml_bridge = (() => {
5686
5686
  v1.BamlHandleType = (function() {
5687
5687
  const valuesById = {}, values = Object.create(valuesById);
5688
5688
  values[valuesById[0] = "HANDLE_UNSPECIFIED"] = 0;
5689
- values[valuesById[1] = "UNTAGGED_RUST_DATA"] = 1;
5690
5689
  values[valuesById[2] = "UNTAGGED_BEX_HEAP"] = 2;
5691
5690
  values[valuesById[5] = "FUNCTION_REF"] = 5;
5692
5691
  values[valuesById[6] = "ADT_MEDIA_IMAGE"] = 6;
5693
5692
  values[valuesById[7] = "ADT_MEDIA_AUDIO"] = 7;
5694
5693
  values[valuesById[8] = "ADT_MEDIA_VIDEO"] = 8;
5695
5694
  values[valuesById[9] = "ADT_MEDIA_PDF"] = 9;
5696
- values[valuesById[10] = "ADT_MEDIA_GENERIC"] = 10;
5697
5695
  values[valuesById[11] = "ADT_PROMPT_AST"] = 11;
5698
- values[valuesById[13] = "ADT_TYPE"] = 13;
5699
5696
  values[valuesById[14] = "ADT_TAGGED_HEAP_HANDLE"] = 14;
5700
5697
  values[valuesById[15] = "HOST_VALUE_CALLABLE"] = 15;
5701
5698
  values[valuesById[16] = "HOST_VALUE_OPAQUE"] = 16;
@@ -5703,6 +5700,7 @@ var baml_bridge = $root.baml_bridge = (() => {
5703
5700
  values[valuesById[18] = "ADT_RUNTIME_VALUE"] = 18;
5704
5701
  values[valuesById[19] = "INVOCATION_STATE"] = 19;
5705
5702
  values[valuesById[20] = "TRACE_RESERVATION"] = 20;
5703
+ values[valuesById[21] = "HOST_VALUE_PIN"] = 21;
5706
5704
  return values;
5707
5705
  })();
5708
5706
  v1.BamlHandle = (function() {
@@ -5789,16 +5787,13 @@ var baml_bridge = $root.baml_bridge = (() => {
5789
5787
  default:
5790
5788
  return "handleType: enum value expected";
5791
5789
  case 0:
5792
- case 1:
5793
5790
  case 2:
5794
5791
  case 5:
5795
5792
  case 6:
5796
5793
  case 7:
5797
5794
  case 8:
5798
5795
  case 9:
5799
- case 10:
5800
5796
  case 11:
5801
- case 13:
5802
5797
  case 14:
5803
5798
  case 15:
5804
5799
  case 16:
@@ -5806,6 +5801,7 @@ var baml_bridge = $root.baml_bridge = (() => {
5806
5801
  case 18:
5807
5802
  case 19:
5808
5803
  case 20:
5804
+ case 21:
5809
5805
  break;
5810
5806
  }
5811
5807
  return null;
@@ -5841,10 +5837,6 @@ var baml_bridge = $root.baml_bridge = (() => {
5841
5837
  case 0:
5842
5838
  message.handleType = 0;
5843
5839
  break;
5844
- case "UNTAGGED_RUST_DATA":
5845
- case 1:
5846
- message.handleType = 1;
5847
- break;
5848
5840
  case "UNTAGGED_BEX_HEAP":
5849
5841
  case 2:
5850
5842
  message.handleType = 2;
@@ -5869,18 +5861,10 @@ var baml_bridge = $root.baml_bridge = (() => {
5869
5861
  case 9:
5870
5862
  message.handleType = 9;
5871
5863
  break;
5872
- case "ADT_MEDIA_GENERIC":
5873
- case 10:
5874
- message.handleType = 10;
5875
- break;
5876
5864
  case "ADT_PROMPT_AST":
5877
5865
  case 11:
5878
5866
  message.handleType = 11;
5879
5867
  break;
5880
- case "ADT_TYPE":
5881
- case 13:
5882
- message.handleType = 13;
5883
- break;
5884
5868
  case "ADT_TAGGED_HEAP_HANDLE":
5885
5869
  case 14:
5886
5870
  message.handleType = 14;
@@ -5909,6 +5893,10 @@ var baml_bridge = $root.baml_bridge = (() => {
5909
5893
  case 20:
5910
5894
  message.handleType = 20;
5911
5895
  break;
5896
+ case "HOST_VALUE_PIN":
5897
+ case 21:
5898
+ message.handleType = 21;
5899
+ break;
5912
5900
  }
5913
5901
  return message;
5914
5902
  };
@@ -5973,7 +5961,6 @@ var baml_bridge = $root.baml_bridge = (() => {
5973
5961
  BamlTy.prototype.enumVariant = null;
5974
5962
  BamlTy.prototype["function"] = null;
5975
5963
  BamlTy.prototype.future = null;
5976
- BamlTy.prototype.rustType = null;
5977
5964
  BamlTy.prototype.metaType = null;
5978
5965
  BamlTy.prototype.resource = null;
5979
5966
  BamlTy.prototype.promptAst = null;
@@ -5983,7 +5970,7 @@ var baml_bridge = $root.baml_bridge = (() => {
5983
5970
  BamlTy.prototype.tuple = null;
5984
5971
  let $oneOfFields;
5985
5972
  Object.defineProperty(BamlTy.prototype, "ty", {
5986
- get: $util.oneOfGetter($oneOfFields = ["primitive", "classTy", "enum", "list", "map", "optional", "union", "literal", "typeAlias", "unknown", "media", "interface", "enumVariant", "function", "future", "rustType", "metaType", "resource", "promptAst", "typeVar", "associatedTypeProjection", "never", "tuple"]),
5973
+ get: $util.oneOfGetter($oneOfFields = ["primitive", "classTy", "enum", "list", "map", "optional", "union", "literal", "typeAlias", "unknown", "media", "interface", "enumVariant", "function", "future", "metaType", "resource", "promptAst", "typeVar", "associatedTypeProjection", "never", "tuple"]),
5987
5974
  set: $util.oneOfSetter($oneOfFields)
5988
5975
  });
5989
5976
  BamlTy.create = function create(properties) {
@@ -6071,11 +6058,6 @@ var baml_bridge = $root.baml_bridge = (() => {
6071
6058
  /* id 15, wireType 2 =*/
6072
6059
  122
6073
6060
  ).fork(), q + 1).ldelim();
6074
- if (message.rustType != null && Object.hasOwnProperty.call(message, "rustType"))
6075
- $root.baml_bridge.cffi.v1.BamlTyRustType.encode(message.rustType, writer.uint32(
6076
- /* id 16, wireType 2 =*/
6077
- 130
6078
- ).fork(), q + 1).ldelim();
6079
6061
  if (message.metaType != null && Object.hasOwnProperty.call(message, "metaType"))
6080
6062
  $root.baml_bridge.cffi.v1.BamlTyMetaType.encode(message.metaType, writer.uint32(
6081
6063
  /* id 17, wireType 2 =*/
@@ -6189,10 +6171,6 @@ var baml_bridge = $root.baml_bridge = (() => {
6189
6171
  message.future = $root.baml_bridge.cffi.v1.BamlTyFuture.decode(reader, reader.uint32(), void 0, long + 1);
6190
6172
  break;
6191
6173
  }
6192
- case 16: {
6193
- message.rustType = $root.baml_bridge.cffi.v1.BamlTyRustType.decode(reader, reader.uint32(), void 0, long + 1);
6194
- break;
6195
- }
6196
6174
  case 17: {
6197
6175
  message.metaType = $root.baml_bridge.cffi.v1.BamlTyMetaType.decode(reader, reader.uint32(), void 0, long + 1);
6198
6176
  break;
@@ -6389,16 +6367,6 @@ var baml_bridge = $root.baml_bridge = (() => {
6389
6367
  return "future." + error;
6390
6368
  }
6391
6369
  }
6392
- if (message.rustType != null && message.hasOwnProperty("rustType")) {
6393
- if (properties.ty === 1)
6394
- return "ty: multiple values";
6395
- properties.ty = 1;
6396
- {
6397
- let error = $root.baml_bridge.cffi.v1.BamlTyRustType.verify(message.rustType, long + 1);
6398
- if (error)
6399
- return "rustType." + error;
6400
- }
6401
- }
6402
6370
  if (message.metaType != null && message.hasOwnProperty("metaType")) {
6403
6371
  if (properties.ty === 1)
6404
6372
  return "ty: multiple values";
@@ -6556,11 +6524,6 @@ var baml_bridge = $root.baml_bridge = (() => {
6556
6524
  throw TypeError(".baml_bridge.cffi.v1.BamlTy.future: object expected");
6557
6525
  message.future = $root.baml_bridge.cffi.v1.BamlTyFuture.fromObject(object.future, long + 1);
6558
6526
  }
6559
- if (object.rustType != null) {
6560
- if (!$util.isObject(object.rustType))
6561
- throw TypeError(".baml_bridge.cffi.v1.BamlTy.rustType: object expected");
6562
- message.rustType = $root.baml_bridge.cffi.v1.BamlTyRustType.fromObject(object.rustType, long + 1);
6563
- }
6564
6527
  if (object.metaType != null) {
6565
6528
  if (!$util.isObject(object.metaType))
6566
6529
  throw TypeError(".baml_bridge.cffi.v1.BamlTy.metaType: object expected");
@@ -6681,11 +6644,6 @@ var baml_bridge = $root.baml_bridge = (() => {
6681
6644
  if (options.oneofs)
6682
6645
  object.ty = "future";
6683
6646
  }
6684
- if (message.rustType != null && message.hasOwnProperty("rustType")) {
6685
- object.rustType = $root.baml_bridge.cffi.v1.BamlTyRustType.toObject(message.rustType, options, q + 1);
6686
- if (options.oneofs)
6687
- object.ty = "rustType";
6688
- }
6689
6647
  if (message.metaType != null && message.hasOwnProperty("metaType")) {
6690
6648
  object.metaType = $root.baml_bridge.cffi.v1.BamlTyMetaType.toObject(message.metaType, options, q + 1);
6691
6649
  if (options.oneofs)
@@ -9749,88 +9707,6 @@ var baml_bridge = $root.baml_bridge = (() => {
9749
9707
  };
9750
9708
  return BamlTyFuture;
9751
9709
  })();
9752
- v1.BamlTyRustType = (function() {
9753
- function BamlTyRustType(properties) {
9754
- if (properties) {
9755
- for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
9756
- if (properties[keys[i]] != null && keys[i] !== "__proto__")
9757
- this[keys[i]] = properties[keys[i]];
9758
- }
9759
- }
9760
- BamlTyRustType.create = function create(properties) {
9761
- return new BamlTyRustType(properties);
9762
- };
9763
- BamlTyRustType.encode = function encode(message, writer, q) {
9764
- if (!writer)
9765
- writer = $Writer.create();
9766
- if (q === void 0)
9767
- q = 0;
9768
- if (q > $util.recursionLimit)
9769
- throw Error("max depth exceeded");
9770
- return writer;
9771
- };
9772
- BamlTyRustType.encodeDelimited = function encodeDelimited(message, writer) {
9773
- return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
9774
- };
9775
- BamlTyRustType.decode = function decode(reader, length, error, long) {
9776
- if (!(reader instanceof $Reader))
9777
- reader = $Reader.create(reader);
9778
- if (long === void 0)
9779
- long = 0;
9780
- if (long > $Reader.recursionLimit)
9781
- throw Error("maximum nesting depth exceeded");
9782
- let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.baml_bridge.cffi.v1.BamlTyRustType();
9783
- while (reader.pos < end) {
9784
- let tag = reader.uint32();
9785
- if (tag === error)
9786
- break;
9787
- switch (tag >>> 3) {
9788
- default:
9789
- reader.skipType(tag & 7, long);
9790
- break;
9791
- }
9792
- }
9793
- return message;
9794
- };
9795
- BamlTyRustType.decodeDelimited = function decodeDelimited(reader) {
9796
- if (!(reader instanceof $Reader))
9797
- reader = new $Reader(reader);
9798
- return this.decode(reader, reader.uint32());
9799
- };
9800
- BamlTyRustType.verify = function verify(message, long) {
9801
- if (typeof message !== "object" || message === null)
9802
- return "object expected";
9803
- if (long === void 0)
9804
- long = 0;
9805
- if (long > $util.recursionLimit)
9806
- return "maximum nesting depth exceeded";
9807
- return null;
9808
- };
9809
- BamlTyRustType.fromObject = function fromObject(object, long) {
9810
- if (object instanceof $root.baml_bridge.cffi.v1.BamlTyRustType)
9811
- return object;
9812
- if (!$util.isObject(object))
9813
- throw TypeError(".baml_bridge.cffi.v1.BamlTyRustType: object expected");
9814
- if (long === void 0)
9815
- long = 0;
9816
- if (long > $util.recursionLimit)
9817
- throw Error("maximum nesting depth exceeded");
9818
- return new $root.baml_bridge.cffi.v1.BamlTyRustType();
9819
- };
9820
- BamlTyRustType.toObject = function toObject() {
9821
- return {};
9822
- };
9823
- BamlTyRustType.prototype.toJSON = function toJSON() {
9824
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
9825
- };
9826
- BamlTyRustType.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
9827
- if (typeUrlPrefix === void 0) {
9828
- typeUrlPrefix = "type.googleapis.com";
9829
- }
9830
- return typeUrlPrefix + "/baml_bridge.cffi.v1.BamlTyRustType";
9831
- };
9832
- return BamlTyRustType;
9833
- })();
9834
9710
  v1.BamlTyMetaType = (function() {
9835
9711
  function BamlTyMetaType(properties) {
9836
9712
  if (properties) {
@@ -11610,6 +11486,7 @@ var baml_bridge = $root.baml_bridge = (() => {
11610
11486
  BamlOutboundHandle.prototype.key = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
11611
11487
  BamlOutboundHandle.prototype.handleType = 0;
11612
11488
  BamlOutboundHandle.prototype.ty = null;
11489
+ BamlOutboundHandle.prototype.pin = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;
11613
11490
  BamlOutboundHandle.create = function create(properties) {
11614
11491
  return new BamlOutboundHandle(properties);
11615
11492
  };
@@ -11635,6 +11512,11 @@ var baml_bridge = $root.baml_bridge = (() => {
11635
11512
  /* id 3, wireType 2 =*/
11636
11513
  26
11637
11514
  ).fork(), q + 1).ldelim();
11515
+ if (message.pin != null && Object.hasOwnProperty.call(message, "pin"))
11516
+ writer.uint32(
11517
+ /* id 4, wireType 0 =*/
11518
+ 32
11519
+ ).uint64(message.pin);
11638
11520
  return writer;
11639
11521
  };
11640
11522
  BamlOutboundHandle.encodeDelimited = function encodeDelimited(message, writer) {
@@ -11665,6 +11547,10 @@ var baml_bridge = $root.baml_bridge = (() => {
11665
11547
  message.ty = $root.baml_bridge.cffi.v1.BamlTy.decode(reader, reader.uint32(), void 0, long + 1);
11666
11548
  break;
11667
11549
  }
11550
+ case 4: {
11551
+ message.pin = reader.uint64();
11552
+ break;
11553
+ }
11668
11554
  default:
11669
11555
  reader.skipType(tag & 7, long);
11670
11556
  break;
@@ -11693,16 +11579,13 @@ var baml_bridge = $root.baml_bridge = (() => {
11693
11579
  default:
11694
11580
  return "handleType: enum value expected";
11695
11581
  case 0:
11696
- case 1:
11697
11582
  case 2:
11698
11583
  case 5:
11699
11584
  case 6:
11700
11585
  case 7:
11701
11586
  case 8:
11702
11587
  case 9:
11703
- case 10:
11704
11588
  case 11:
11705
- case 13:
11706
11589
  case 14:
11707
11590
  case 15:
11708
11591
  case 16:
@@ -11710,6 +11593,7 @@ var baml_bridge = $root.baml_bridge = (() => {
11710
11593
  case 18:
11711
11594
  case 19:
11712
11595
  case 20:
11596
+ case 21:
11713
11597
  break;
11714
11598
  }
11715
11599
  if (message.ty != null && message.hasOwnProperty("ty")) {
@@ -11717,6 +11601,10 @@ var baml_bridge = $root.baml_bridge = (() => {
11717
11601
  if (error)
11718
11602
  return "ty." + error;
11719
11603
  }
11604
+ if (message.pin != null && message.hasOwnProperty("pin")) {
11605
+ if (!$util.isInteger(message.pin) && !(message.pin && $util.isInteger(message.pin.low) && $util.isInteger(message.pin.high)))
11606
+ return "pin: integer|Long expected";
11607
+ }
11720
11608
  return null;
11721
11609
  };
11722
11610
  BamlOutboundHandle.fromObject = function fromObject(object, long) {
@@ -11750,10 +11638,6 @@ var baml_bridge = $root.baml_bridge = (() => {
11750
11638
  case 0:
11751
11639
  message.handleType = 0;
11752
11640
  break;
11753
- case "UNTAGGED_RUST_DATA":
11754
- case 1:
11755
- message.handleType = 1;
11756
- break;
11757
11641
  case "UNTAGGED_BEX_HEAP":
11758
11642
  case 2:
11759
11643
  message.handleType = 2;
@@ -11778,18 +11662,10 @@ var baml_bridge = $root.baml_bridge = (() => {
11778
11662
  case 9:
11779
11663
  message.handleType = 9;
11780
11664
  break;
11781
- case "ADT_MEDIA_GENERIC":
11782
- case 10:
11783
- message.handleType = 10;
11784
- break;
11785
11665
  case "ADT_PROMPT_AST":
11786
11666
  case 11:
11787
11667
  message.handleType = 11;
11788
11668
  break;
11789
- case "ADT_TYPE":
11790
- case 13:
11791
- message.handleType = 13;
11792
- break;
11793
11669
  case "ADT_TAGGED_HEAP_HANDLE":
11794
11670
  case 14:
11795
11671
  message.handleType = 14;
@@ -11818,12 +11694,26 @@ var baml_bridge = $root.baml_bridge = (() => {
11818
11694
  case 20:
11819
11695
  message.handleType = 20;
11820
11696
  break;
11697
+ case "HOST_VALUE_PIN":
11698
+ case 21:
11699
+ message.handleType = 21;
11700
+ break;
11821
11701
  }
11822
11702
  if (object.ty != null) {
11823
11703
  if (!$util.isObject(object.ty))
11824
11704
  throw TypeError(".baml_bridge.cffi.v1.BamlOutboundHandle.ty: object expected");
11825
11705
  message.ty = $root.baml_bridge.cffi.v1.BamlTy.fromObject(object.ty, long + 1);
11826
11706
  }
11707
+ if (object.pin != null) {
11708
+ if ($util.Long)
11709
+ message.pin = $util.Long.fromValue(object.pin, true);
11710
+ else if (typeof object.pin === "string")
11711
+ message.pin = parseInt(object.pin, 10);
11712
+ else if (typeof object.pin === "number")
11713
+ message.pin = object.pin;
11714
+ else if (typeof object.pin === "object")
11715
+ message.pin = new $util.LongBits(object.pin.low >>> 0, object.pin.high >>> 0).toNumber(true);
11716
+ }
11827
11717
  return message;
11828
11718
  };
11829
11719
  BamlOutboundHandle.toObject = function toObject(message, options, q) {
@@ -11842,6 +11732,11 @@ var baml_bridge = $root.baml_bridge = (() => {
11842
11732
  object.key = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
11843
11733
  object.handleType = options.enums === String ? "HANDLE_UNSPECIFIED" : 0;
11844
11734
  object.ty = null;
11735
+ if ($util.Long) {
11736
+ let long = new $util.Long(0, 0, true);
11737
+ object.pin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long;
11738
+ } else
11739
+ object.pin = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
11845
11740
  }
11846
11741
  if (message.key != null && message.hasOwnProperty("key"))
11847
11742
  if (typeof BigInt !== "undefined" && options.longs === BigInt)
@@ -11854,6 +11749,13 @@ var baml_bridge = $root.baml_bridge = (() => {
11854
11749
  object.handleType = options.enums === String ? $root.baml_bridge.cffi.v1.BamlHandleType[message.handleType] === void 0 ? message.handleType : $root.baml_bridge.cffi.v1.BamlHandleType[message.handleType] : message.handleType;
11855
11750
  if (message.ty != null && message.hasOwnProperty("ty"))
11856
11751
  object.ty = $root.baml_bridge.cffi.v1.BamlTy.toObject(message.ty, options, q + 1);
11752
+ if (message.pin != null && message.hasOwnProperty("pin"))
11753
+ if (typeof BigInt !== "undefined" && options.longs === BigInt)
11754
+ object.pin = typeof message.pin === "number" ? BigInt(message.pin) : $util.Long.fromBits(message.pin.low >>> 0, message.pin.high >>> 0, true).toBigInt();
11755
+ else if (typeof message.pin === "number")
11756
+ object.pin = options.longs === String ? String(message.pin) : message.pin;
11757
+ else
11758
+ object.pin = options.longs === String ? $util.Long.prototype.toString.call(message.pin) : options.longs === Number ? new $util.LongBits(message.pin.low >>> 0, message.pin.high >>> 0).toNumber(true) : message.pin;
11857
11759
  return object;
11858
11760
  };
11859
11761
  BamlOutboundHandle.prototype.toJSON = function toJSON() {
@@ -13157,7 +13059,6 @@ var baml_bridge = $root.baml_bridge = (() => {
13157
13059
  values[valuesById[2] = "AUDIO"] = 2;
13158
13060
  values[valuesById[3] = "PDF"] = 3;
13159
13061
  values[valuesById[4] = "VIDEO"] = 4;
13160
- values[valuesById[5] = "OTHER"] = 5;
13161
13062
  return values;
13162
13063
  })();
13163
13064
  v1.BamlValueMedia = (function() {
@@ -13284,7 +13185,6 @@ var baml_bridge = $root.baml_bridge = (() => {
13284
13185
  case 2:
13285
13186
  case 3:
13286
13187
  case 4:
13287
- case 5:
13288
13188
  break;
13289
13189
  }
13290
13190
  if (message.mimeType != null && message.hasOwnProperty("mimeType")) {
@@ -13353,10 +13253,6 @@ var baml_bridge = $root.baml_bridge = (() => {
13353
13253
  case 4:
13354
13254
  message.media = 4;
13355
13255
  break;
13356
- case "OTHER":
13357
- case 5:
13358
- message.media = 5;
13359
- break;
13360
13256
  }
13361
13257
  if (object.mimeType != null)
13362
13258
  message.mimeType = String(object.mimeType);
@@ -63,14 +63,21 @@ declare const REFERENCE_TOKEN: unique symbol;
63
63
  * generated class extends this one with the class's methods alone, and the
64
64
  * decoder makes it from the reference the instance crosses as.
65
65
  *
66
- * Each instance owns its reference outright, so two are the same instance
67
- * exactly when they are the same object.
66
+ * One engine instance is one wrapper for as long as the wrapper lives (the
67
+ * decoder reuses it), so two are the same instance exactly when they are the
68
+ * same object.
68
69
  */
69
70
  export declare class BamlReference {
70
71
  private readonly _handle;
71
- constructor(token: typeof REFERENCE_TOKEN, handle: BamlHandle);
72
+ /**
73
+ * The class's type arguments, by parameter name, for an instance of a
74
+ * generic class: what the engine says the instance is, which an instance
75
+ * method binds the class's parameters from.
76
+ */
77
+ readonly $types: Readonly<Record<string, BamlType>> | undefined;
78
+ constructor(token: typeof REFERENCE_TOKEN, handle: BamlHandle, types?: Readonly<Record<string, BamlType>>);
72
79
  /** Internal: wrap a decoded `ADT_RUNTIME_VALUE` handle. Used by proto decode. */
73
- static _fromHandle(handle: BamlHandle): BamlReference;
80
+ static _fromHandle(handle: BamlHandle, types?: Readonly<Record<string, BamlType>>): BamlReference;
74
81
  /** Internal: expose the inner handle for inbound encoding. */
75
82
  _toHandle(): BamlHandle;
76
83
  }
@@ -96,12 +103,24 @@ export interface EncodedCall {
96
103
  * path blocks the event loop the callback would need.
97
104
  */
98
105
  export declare function encodeCallArgs(kwargs: Record<string, unknown>, options: EncodeCallArgsOptions): EncodedCall;
99
- /** A leaf's payload as the bridge takes it from {@link hostAdapter.leafOf}: an `InboundValue`. */
100
- interface HostLeaf {
106
+ /**
107
+ * A leaf's payload as the bridge takes it from {@link hostAdapter.leafOf}: an
108
+ * `InboundValue`, and what its wire occurrence took, so the bridge can give it
109
+ * back if the call never goes out.
110
+ */
111
+ type HostLeaf = {
101
112
  bytes: Uint8Array;
102
- /** The handle key cloned for the wire, as a decimal string, so the bridge can release it if the call never goes out. */
103
- cloned?: string;
104
113
  }
114
+ /** The engine handle key cloned for the wire, as a decimal string. */
115
+ | {
116
+ bytes: Uint8Array;
117
+ cloned: string;
118
+ }
119
+ /** The host-value key sent again, which took one of its references, as a decimal string. */
120
+ | {
121
+ bytes: Uint8Array;
122
+ sentAgain: string;
123
+ };
105
124
  export declare const hostAdapter: {
106
125
  /**
107
126
  * Is `value` a plain object: one whose prototype is `Object.prototype` or