glasspane-mcp 1.31.3 → 1.31.5

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.
@@ -26,7 +26,7 @@ export declare const MCP_PROTOCOL_VERSION: "2025-06-18";
26
26
  export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
27
27
  export declare const SERVER_INFO: {
28
28
  readonly name: "glasspane-mcp";
29
- readonly version: "1.31.3";
29
+ readonly version: "1.31.5";
30
30
  };
31
31
  export declare const PARSE_ERROR = -32700;
32
32
  export declare const INVALID_REQUEST = -32600;
@@ -1716,7 +1716,8 @@ import { z as z3 } from "zod";
1716
1716
  // ../node_modules/iterate-kernel/dist/canonical-json.js
1717
1717
  var CANONICAL_JSON_CODES = {
1718
1718
  value: "KERNEL_E_CANONICAL_VALUE",
1719
- depth: "KERNEL_E_CANONICAL_DEPTH"
1719
+ depth: "KERNEL_E_CANONICAL_DEPTH",
1720
+ keyOrder: "KERNEL_E_CANONICAL_KEY_ORDER"
1720
1721
  };
1721
1722
  var KernelCanonicalJsonError = class extends Error {
1722
1723
  code;
@@ -1734,6 +1735,22 @@ var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
1734
1735
  function canonicalJson(value) {
1735
1736
  return write(value, 0);
1736
1737
  }
1738
+ function refuseUnpairedSurrogates(value) {
1739
+ for (let i = 0; i < value.length; i++) {
1740
+ const unit = value.charCodeAt(i);
1741
+ const isHigh = unit >= 55296 && unit <= 56319;
1742
+ const isLow = unit >= 56320 && unit <= 57343;
1743
+ if (isHigh) {
1744
+ const next = value.charCodeAt(i + 1);
1745
+ if (!(next >= 56320 && next <= 57343)) {
1746
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired high surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
1747
+ }
1748
+ i++;
1749
+ } else if (isLow) {
1750
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired low surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
1751
+ }
1752
+ }
1753
+ }
1737
1754
  function write(value, depth) {
1738
1755
  if (depth > CANONICAL_JSON_MAX_DEPTH) {
1739
1756
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
@@ -1743,6 +1760,8 @@ function write(value, depth) {
1743
1760
  switch (typeof value) {
1744
1761
  case "string":
1745
1762
  case "boolean":
1763
+ if (typeof value === "string")
1764
+ refuseUnpairedSurrogates(value);
1746
1765
  return JSON.stringify(value);
1747
1766
  case "number":
1748
1767
  if (!Number.isFinite(value)) {
@@ -1764,7 +1783,16 @@ function write(value, depth) {
1764
1783
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
1765
1784
  }
1766
1785
  const record = value;
1767
- const keys = Object.keys(record).sort();
1786
+ const keys = Object.keys(record);
1787
+ for (const key of keys) {
1788
+ refuseUnpairedSurrogates(key);
1789
+ for (const ch of key) {
1790
+ if (ch.codePointAt(0) > 65535) {
1791
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.keyOrder, `key ${JSON.stringify(key)} contains a character above U+FFFF, which the two implementations order differently`, "keep canonicalised keys inside the BMP, where UTF-16 code-unit order and code-point order are the same");
1792
+ }
1793
+ }
1794
+ }
1795
+ keys.sort();
1768
1796
  return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
1769
1797
  }
1770
1798
  default:
@@ -4142,7 +4170,7 @@ function mapAuditError(error, engineMethod = "last_evidence") {
4142
4170
  }
4143
4171
 
4144
4172
  // src/dispatch.ts
4145
- var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.3" };
4173
+ var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.5" };
4146
4174
 
4147
4175
  // src/http-gateway.ts
4148
4176
  var GLASSPANE_HTTP_TOKEN_ENV = "GLASSPANE_HTTP_TOKEN";
@@ -1664,7 +1664,8 @@ import { z as z3 } from "zod";
1664
1664
  // ../node_modules/iterate-kernel/dist/canonical-json.js
1665
1665
  var CANONICAL_JSON_CODES = {
1666
1666
  value: "KERNEL_E_CANONICAL_VALUE",
1667
- depth: "KERNEL_E_CANONICAL_DEPTH"
1667
+ depth: "KERNEL_E_CANONICAL_DEPTH",
1668
+ keyOrder: "KERNEL_E_CANONICAL_KEY_ORDER"
1668
1669
  };
1669
1670
  var KernelCanonicalJsonError = class extends Error {
1670
1671
  code;
@@ -1682,6 +1683,22 @@ var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
1682
1683
  function canonicalJson(value) {
1683
1684
  return write(value, 0);
1684
1685
  }
1686
+ function refuseUnpairedSurrogates(value) {
1687
+ for (let i = 0; i < value.length; i++) {
1688
+ const unit = value.charCodeAt(i);
1689
+ const isHigh = unit >= 55296 && unit <= 56319;
1690
+ const isLow = unit >= 56320 && unit <= 57343;
1691
+ if (isHigh) {
1692
+ const next = value.charCodeAt(i + 1);
1693
+ if (!(next >= 56320 && next <= 57343)) {
1694
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired high surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
1695
+ }
1696
+ i++;
1697
+ } else if (isLow) {
1698
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired low surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
1699
+ }
1700
+ }
1701
+ }
1685
1702
  function write(value, depth) {
1686
1703
  if (depth > CANONICAL_JSON_MAX_DEPTH) {
1687
1704
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
@@ -1691,6 +1708,8 @@ function write(value, depth) {
1691
1708
  switch (typeof value) {
1692
1709
  case "string":
1693
1710
  case "boolean":
1711
+ if (typeof value === "string")
1712
+ refuseUnpairedSurrogates(value);
1694
1713
  return JSON.stringify(value);
1695
1714
  case "number":
1696
1715
  if (!Number.isFinite(value)) {
@@ -1712,7 +1731,16 @@ function write(value, depth) {
1712
1731
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
1713
1732
  }
1714
1733
  const record = value;
1715
- const keys = Object.keys(record).sort();
1734
+ const keys = Object.keys(record);
1735
+ for (const key of keys) {
1736
+ refuseUnpairedSurrogates(key);
1737
+ for (const ch of key) {
1738
+ if (ch.codePointAt(0) > 65535) {
1739
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.keyOrder, `key ${JSON.stringify(key)} contains a character above U+FFFF, which the two implementations order differently`, "keep canonicalised keys inside the BMP, where UTF-16 code-unit order and code-point order are the same");
1740
+ }
1741
+ }
1742
+ }
1743
+ keys.sort();
1716
1744
  return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
1717
1745
  }
1718
1746
  default:
@@ -4090,7 +4118,7 @@ function mapAuditError(error, engineMethod = "last_evidence") {
4090
4118
  }
4091
4119
 
4092
4120
  // src/dispatch.ts
4093
- var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.3" };
4121
+ var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.5" };
4094
4122
 
4095
4123
  // src/http-gateway.ts
4096
4124
  var GLASSPANE_HTTP_TOKEN_ENV = "GLASSPANE_HTTP_TOKEN";
package/dist/index.js CHANGED
@@ -445,7 +445,8 @@ import { z as z3 } from "zod";
445
445
  // ../node_modules/iterate-kernel/dist/canonical-json.js
446
446
  var CANONICAL_JSON_CODES = {
447
447
  value: "KERNEL_E_CANONICAL_VALUE",
448
- depth: "KERNEL_E_CANONICAL_DEPTH"
448
+ depth: "KERNEL_E_CANONICAL_DEPTH",
449
+ keyOrder: "KERNEL_E_CANONICAL_KEY_ORDER"
449
450
  };
450
451
  var KernelCanonicalJsonError = class extends Error {
451
452
  code;
@@ -463,6 +464,22 @@ var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
463
464
  function canonicalJson2(value) {
464
465
  return write(value, 0);
465
466
  }
467
+ function refuseUnpairedSurrogates(value) {
468
+ for (let i = 0; i < value.length; i++) {
469
+ const unit = value.charCodeAt(i);
470
+ const isHigh = unit >= 55296 && unit <= 56319;
471
+ const isLow = unit >= 56320 && unit <= 57343;
472
+ if (isHigh) {
473
+ const next = value.charCodeAt(i + 1);
474
+ if (!(next >= 56320 && next <= 57343)) {
475
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired high surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
476
+ }
477
+ i++;
478
+ } else if (isLow) {
479
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired low surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
480
+ }
481
+ }
482
+ }
466
483
  function write(value, depth) {
467
484
  if (depth > CANONICAL_JSON_MAX_DEPTH) {
468
485
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
@@ -472,6 +489,8 @@ function write(value, depth) {
472
489
  switch (typeof value) {
473
490
  case "string":
474
491
  case "boolean":
492
+ if (typeof value === "string")
493
+ refuseUnpairedSurrogates(value);
475
494
  return JSON.stringify(value);
476
495
  case "number":
477
496
  if (!Number.isFinite(value)) {
@@ -493,7 +512,16 @@ function write(value, depth) {
493
512
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
494
513
  }
495
514
  const record = value;
496
- const keys = Object.keys(record).sort();
515
+ const keys = Object.keys(record);
516
+ for (const key of keys) {
517
+ refuseUnpairedSurrogates(key);
518
+ for (const ch of key) {
519
+ if (ch.codePointAt(0) > 65535) {
520
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.keyOrder, `key ${JSON.stringify(key)} contains a character above U+FFFF, which the two implementations order differently`, "keep canonicalised keys inside the BMP, where UTF-16 code-unit order and code-point order are the same");
521
+ }
522
+ }
523
+ }
524
+ keys.sort();
497
525
  return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
498
526
  }
499
527
  default:
@@ -5182,7 +5210,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
5182
5210
  "2025-03-26",
5183
5211
  MCP_PROTOCOL_VERSION
5184
5212
  ];
5185
- var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.3" };
5213
+ var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.5" };
5186
5214
  var PARSE_ERROR = -32700;
5187
5215
  var INVALID_REQUEST = -32600;
5188
5216
  var METHOD_NOT_FOUND = -32601;
@@ -440,7 +440,8 @@ import { z as z3 } from "zod";
440
440
  // ../node_modules/iterate-kernel/dist/canonical-json.js
441
441
  var CANONICAL_JSON_CODES = {
442
442
  value: "KERNEL_E_CANONICAL_VALUE",
443
- depth: "KERNEL_E_CANONICAL_DEPTH"
443
+ depth: "KERNEL_E_CANONICAL_DEPTH",
444
+ keyOrder: "KERNEL_E_CANONICAL_KEY_ORDER"
444
445
  };
445
446
  var KernelCanonicalJsonError = class extends Error {
446
447
  code;
@@ -458,6 +459,22 @@ var KERNEL_SAFE_INTEGER_MIN = -Number.MAX_SAFE_INTEGER;
458
459
  function canonicalJson2(value) {
459
460
  return write(value, 0);
460
461
  }
462
+ function refuseUnpairedSurrogates(value) {
463
+ for (let i = 0; i < value.length; i++) {
464
+ const unit = value.charCodeAt(i);
465
+ const isHigh = unit >= 55296 && unit <= 56319;
466
+ const isLow = unit >= 56320 && unit <= 57343;
467
+ if (isHigh) {
468
+ const next = value.charCodeAt(i + 1);
469
+ if (!(next >= 56320 && next <= 57343)) {
470
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired high surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
471
+ }
472
+ i++;
473
+ } else if (isLow) {
474
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `string contains an unpaired low surrogate at index ${i}, which has no UTF-8 representation and cannot be digested identically by every reader`, "record the text the producer actually has; a lone surrogate is not a character, and a digest over its escape bytes is one a Python or Swift reader cannot reproduce");
475
+ }
476
+ }
477
+ }
461
478
  function write(value, depth) {
462
479
  if (depth > CANONICAL_JSON_MAX_DEPTH) {
463
480
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.depth, `value is nested deeper than ${CANONICAL_JSON_MAX_DEPTH} levels`, "flatten what is being recorded: a digest over a structure this deep cannot be recomputed by a reader that streams the form, and no contract in this package describes nesting this deep");
@@ -467,6 +484,8 @@ function write(value, depth) {
467
484
  switch (typeof value) {
468
485
  case "string":
469
486
  case "boolean":
487
+ if (typeof value === "string")
488
+ refuseUnpairedSurrogates(value);
470
489
  return JSON.stringify(value);
471
490
  case "number":
472
491
  if (!Number.isFinite(value)) {
@@ -488,7 +507,16 @@ function write(value, depth) {
488
507
  throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.value, `a ${value instanceof Date ? "Date" : "value whose prototype is not Object.prototype"} has no place in the canonical form; JSON.stringify would print it as a string or as an empty object`, "convert it to the fields the contract states before digesting it \u2014 a class instance's own enumerable properties are not a documented shape, so two runtimes would print two different byte sequences for it");
489
508
  }
490
509
  const record = value;
491
- const keys = Object.keys(record).sort();
510
+ const keys = Object.keys(record);
511
+ for (const key of keys) {
512
+ refuseUnpairedSurrogates(key);
513
+ for (const ch of key) {
514
+ if (ch.codePointAt(0) > 65535) {
515
+ throw new KernelCanonicalJsonError(CANONICAL_JSON_CODES.keyOrder, `key ${JSON.stringify(key)} contains a character above U+FFFF, which the two implementations order differently`, "keep canonicalised keys inside the BMP, where UTF-16 code-unit order and code-point order are the same");
516
+ }
517
+ }
518
+ }
519
+ keys.sort();
492
520
  return "{" + keys.map((key) => JSON.stringify(key) + ":" + write(record[key], depth + 1)).join(",") + "}";
493
521
  }
494
522
  default:
@@ -5177,7 +5205,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
5177
5205
  "2025-03-26",
5178
5206
  MCP_PROTOCOL_VERSION
5179
5207
  ];
5180
- var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.3" };
5208
+ var SERVER_INFO = { name: "glasspane-mcp", version: "1.31.5" };
5181
5209
  var PARSE_ERROR = -32700;
5182
5210
  var INVALID_REQUEST = -32600;
5183
5211
  var METHOD_NOT_FOUND = -32601;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glasspane-mcp",
3
- "version": "1.31.3",
3
+ "version": "1.31.5",
4
4
  "description": "GlassPane MCP stdio shell: JSON-RPC 2.0 over stdio bridging an AI agent to the glasspane engine daemon",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "ai-agents"
59
59
  ],
60
60
  "dependencies": {
61
- "iterate-kernel": "0.1.13",
61
+ "iterate-kernel": "0.1.14",
62
62
  "zod": "4.6.7"
63
63
  },
64
64
  "devDependencies": {