supercompat 3.16.0 → 3.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4251,6 +4251,9 @@ var MODEL_QUIRKS = {
4251
4251
  },
4252
4252
  "qwen/": {
4253
4253
  fuzzyFallback: true
4254
+ },
4255
+ "google/": {
4256
+ normalizedCoords: true
4254
4257
  }
4255
4258
  };
4256
4259
  var getQuirks = function(model) {
@@ -4873,7 +4876,7 @@ var post10 = function(param) {
4873
4876
  stream = new ReadableStream({
4874
4877
  start: function start(controller) {
4875
4878
  return _async_to_generator(function() {
4876
- var computerCallIndices, argumentBuffers, emittedIndices, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices, _choice_delta, choices, choice, passThrough, _iteratorNormalCompletion, _didIteratorError1, _iteratorError1, _iterator1, _step1, tc, _tc_function, _argumentBuffers_get, _ref, _tc_function1, buf, denormalized, modifiedChunk, err1, _iteratorNormalCompletion1, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, index, buf1, denormalized1, flushChunk;
4879
+ var computerCallIndices, argumentBuffers, emittedIndices, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices, _choice_delta, choices, choice, passThrough, _iteratorNormalCompletion, _didIteratorError1, _iteratorError1, _iterator1, _step1, tc, _tc_function, _ref, _tc_function1, initialArgs, denormalized, _argumentBuffers_get, _ref1, _tc_function2, buf, denormalized1, modifiedChunk, err1, _iteratorNormalCompletion1, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, index, buf1, denormalized2, flushChunk;
4877
4880
  return _ts_generator(this, function(_state) {
4878
4881
  switch(_state.label){
4879
4882
  case 0:
@@ -4919,8 +4922,29 @@ var post10 = function(param) {
4919
4922
  tc = _step1.value;
4920
4923
  ;
4921
4924
  if (((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) === "computer_call") {
4925
+ ;
4926
+ ;
4922
4927
  computerCallIndices.add(tc.index);
4923
- argumentBuffers.set(tc.index, "");
4928
+ initialArgs = (_ref = (_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) !== null && _ref !== void 0 ? _ref : "";
4929
+ argumentBuffers.set(tc.index, initialArgs);
4930
+ if (initialArgs) {
4931
+ try {
4932
+ JSON.parse(initialArgs);
4933
+ denormalized = denormalizeComputerCallArguments({
4934
+ argumentsText: initialArgs,
4935
+ displayWidth: displayWidth,
4936
+ displayHeight: displayHeight,
4937
+ model: model
4938
+ });
4939
+ passThrough.push(_object_spread_props(_object_spread({}, tc), {
4940
+ function: _object_spread_props(_object_spread({}, tc.function), {
4941
+ arguments: denormalized
4942
+ })
4943
+ }));
4944
+ emittedIndices.add(tc.index);
4945
+ continue;
4946
+ } catch (unused) {}
4947
+ }
4924
4948
  passThrough.push(_object_spread_props(_object_spread({}, tc), {
4925
4949
  function: _object_spread_props(_object_spread({}, tc.function), {
4926
4950
  arguments: ""
@@ -4931,12 +4955,12 @@ var post10 = function(param) {
4931
4955
  if (computerCallIndices.has(tc.index)) {
4932
4956
  ;
4933
4957
  ;
4934
- buf = ((_argumentBuffers_get = argumentBuffers.get(tc.index)) !== null && _argumentBuffers_get !== void 0 ? _argumentBuffers_get : "") + ((_ref = (_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) !== null && _ref !== void 0 ? _ref : "");
4958
+ buf = ((_argumentBuffers_get = argumentBuffers.get(tc.index)) !== null && _argumentBuffers_get !== void 0 ? _argumentBuffers_get : "") + ((_ref1 = (_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.arguments) !== null && _ref1 !== void 0 ? _ref1 : "");
4935
4959
  argumentBuffers.set(tc.index, buf);
4936
4960
  if (!emittedIndices.has(tc.index)) {
4937
4961
  try {
4938
4962
  JSON.parse(buf);
4939
- denormalized = denormalizeComputerCallArguments({
4963
+ denormalized1 = denormalizeComputerCallArguments({
4940
4964
  argumentsText: buf,
4941
4965
  displayWidth: displayWidth,
4942
4966
  displayHeight: displayHeight,
@@ -4945,7 +4969,7 @@ var post10 = function(param) {
4945
4969
  passThrough.push({
4946
4970
  index: tc.index,
4947
4971
  function: {
4948
- arguments: denormalized
4972
+ arguments: denormalized1
4949
4973
  }
4950
4974
  });
4951
4975
  emittedIndices.add(tc.index);
@@ -5041,7 +5065,7 @@ var post10 = function(param) {
5041
5065
  for(_iterator2 = Array.from(argumentBuffers)[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion1 = true){
5042
5066
  _step_value = _sliced_to_array(_step2.value, 2), index = _step_value[0], buf1 = _step_value[1];
5043
5067
  if (!emittedIndices.has(index) && buf1) {
5044
- denormalized1 = denormalizeComputerCallArguments({
5068
+ denormalized2 = denormalizeComputerCallArguments({
5045
5069
  argumentsText: buf1,
5046
5070
  displayWidth: displayWidth,
5047
5071
  displayHeight: displayHeight,
@@ -5057,7 +5081,7 @@ var post10 = function(param) {
5057
5081
  {
5058
5082
  index: index,
5059
5083
  function: {
5060
- arguments: denormalized1
5084
+ arguments: denormalized2
5061
5085
  }
5062
5086
  }
5063
5087
  ]