@rebon/cli-darwin-x64 1.1.4 → 1.2.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.
@@ -89,8 +89,20 @@ class JsonParser {
89
89
  } else result += String.fromCharCode(first);
90
90
  continue;
91
91
  }
92
- if (c.charCodeAt(0) < 0x20) this.#error('malformed_json', 'unescaped control character in JSON string');
93
- if (c.charCodeAt(0) >= 0xd800 && c.charCodeAt(0) <= 0xdfff) this.#error('invalid_surrogate', 'lone surrogate in JSON string');
92
+ const unit = c.charCodeAt(0);
93
+ if (unit < 0x20) this.#error('malformed_json', 'unescaped control character in JSON string');
94
+ // The text is UTF-16, so a raw character outside the BMP (an emoji, as
95
+ // serde_json writes it unescaped) is two units here: a high surrogate
96
+ // followed by a low one. Only a half without its partner is invalid.
97
+ if (unit >= 0xd800 && unit <= 0xdbff) {
98
+ const next = this.text.charCodeAt(this.index);
99
+ if (next >= 0xdc00 && next <= 0xdfff) {
100
+ result += c + this.text[this.index++];
101
+ continue;
102
+ }
103
+ this.#error('invalid_surrogate', 'lone surrogate in JSON string');
104
+ }
105
+ if (unit >= 0xdc00 && unit <= 0xdfff) this.#error('invalid_surrogate', 'lone surrogate in JSON string');
94
106
  result += c;
95
107
  }
96
108
  }
package/bin/rebon CHANGED
Binary file
Binary file
Binary file
Binary file
package/bin/rebon-lsp-mcp CHANGED
Binary file
package/bin/sandbox-win CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebon/cli-darwin-x64",
3
- "version": "1.1.4",
3
+ "version": "1.2.0",
4
4
  "description": "Agent cli for coding and more.",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {