poe-code 14.0.29 → 14.0.30

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 (68) hide show
  1. package/dist/metafile.json +1 -1
  2. package/package.json +1 -1
  3. package/packages/safe-bash/dist/browser.js +435 -176
  4. package/packages/safe-bash/dist/browser.js.map +4 -4
  5. package/packages/safe-bash/dist/commands/structured/limits.js +3 -1
  6. package/packages/safe-bash/dist/commands/structured/limits.js.map +1 -1
  7. package/packages/safe-bash/dist/commands/structured/split.d.ts.map +1 -1
  8. package/packages/safe-bash/dist/commands/structured/split.js +7 -2
  9. package/packages/safe-bash/dist/commands/structured/split.js.map +1 -1
  10. package/packages/safe-bash/dist/commands/structured/values.d.ts.map +1 -1
  11. package/packages/safe-bash/dist/commands/structured/values.js +4 -2
  12. package/packages/safe-bash/dist/commands/structured/values.js.map +1 -1
  13. package/packages/safe-bash/dist/commands/text.d.ts.map +1 -1
  14. package/packages/safe-bash/dist/commands/text.js +194 -52
  15. package/packages/safe-bash/dist/commands/text.js.map +1 -1
  16. package/packages/safe-bash/dist/shell/arithmetic-parameters.d.ts +2 -0
  17. package/packages/safe-bash/dist/shell/arithmetic-parameters.d.ts.map +1 -1
  18. package/packages/safe-bash/dist/shell/arithmetic-parameters.js +1 -1
  19. package/packages/safe-bash/dist/shell/arithmetic-parameters.js.map +1 -1
  20. package/packages/safe-bash/dist/shell/arithmetic.d.ts +4 -3
  21. package/packages/safe-bash/dist/shell/arithmetic.d.ts.map +1 -1
  22. package/packages/safe-bash/dist/shell/arithmetic.js +19 -7
  23. package/packages/safe-bash/dist/shell/arithmetic.js.map +1 -1
  24. package/packages/safe-bash/dist/shell/arrays/syntax.d.ts +6 -5
  25. package/packages/safe-bash/dist/shell/arrays/syntax.d.ts.map +1 -1
  26. package/packages/safe-bash/dist/shell/arrays/syntax.js +22 -12
  27. package/packages/safe-bash/dist/shell/arrays/syntax.js.map +1 -1
  28. package/packages/safe-bash/dist/shell/index.d.ts +1 -1
  29. package/packages/safe-bash/dist/shell/index.d.ts.map +1 -1
  30. package/packages/safe-bash/dist/shell/parse-budget.d.ts +10 -0
  31. package/packages/safe-bash/dist/shell/parse-budget.d.ts.map +1 -0
  32. package/packages/safe-bash/dist/shell/parse-budget.js +29 -0
  33. package/packages/safe-bash/dist/shell/parse-budget.js.map +1 -0
  34. package/packages/safe-bash/dist/shell/parser.d.ts +6 -4
  35. package/packages/safe-bash/dist/shell/parser.d.ts.map +1 -1
  36. package/packages/safe-bash/dist/shell/parser.js +80 -29
  37. package/packages/safe-bash/dist/shell/parser.js.map +1 -1
  38. package/packages/safe-bash/dist/shell/runtime.d.ts +3 -0
  39. package/packages/safe-bash/dist/shell/runtime.d.ts.map +1 -1
  40. package/packages/safe-bash/dist/shell/runtime.js +136 -78
  41. package/packages/safe-bash/dist/shell/runtime.js.map +1 -1
  42. package/packages/safe-bash/dist/shell/shell.js +2 -2
  43. package/packages/safe-bash/dist/shell/shell.js.map +1 -1
  44. package/packages/safe-bash/dist/shell/types.d.ts +4 -0
  45. package/packages/safe-bash/dist/shell/types.d.ts.map +1 -1
  46. package/packages/safe-bash/dist/shell/types.js.map +1 -1
  47. package/packages/safe-bash/dist/shell/worker-limits.d.ts.map +1 -1
  48. package/packages/safe-bash/dist/shell/worker-limits.js +1 -0
  49. package/packages/safe-bash/dist/shell/worker-limits.js.map +1 -1
  50. package/packages/safe-fs/dist/fs/webdav/xml.d.ts +3 -0
  51. package/packages/safe-js/dist/browser/chunks/{chunk-FX3SOWQN.js → chunk-BB4KTS26.js} +19 -9
  52. package/packages/safe-js/dist/browser/chunks/{chunk-FX3SOWQN.js.map → chunk-BB4KTS26.js.map} +3 -3
  53. package/packages/safe-js/dist/browser/safe-fs-core.js +1 -1
  54. package/packages/safe-js/dist/browser/safe-fs.js +1 -1
  55. package/packages/safe-js/dist/chunks/{chunk-EGTPUJGO.js → chunk-FOWKJRPH.js} +3 -3
  56. package/packages/safe-js/dist/chunks/{chunk-X2BJ2VDZ.js → chunk-LRWPYBOU.js} +19 -9
  57. package/packages/safe-js/dist/chunks/chunk-LRWPYBOU.js.map +7 -0
  58. package/packages/safe-js/dist/chunks/{chunk-47R6V3XW.js → chunk-OXQ2XP74.js} +2 -2
  59. package/packages/safe-js/dist/cli.js +3 -3
  60. package/packages/safe-js/dist/index.js +3 -3
  61. package/packages/safe-js/dist/safe-fs-core.js +1 -1
  62. package/packages/safe-js/dist/safe-fs-node.js +2 -2
  63. package/packages/safe-js/dist/safe-fs.js +2 -2
  64. package/packages/tiny-http-mcp-server/dist/http-transport.js +1 -1
  65. package/packages/tiny-http-mcp-server/dist/parse-body.js +12 -5
  66. package/packages/safe-js/dist/chunks/chunk-X2BJ2VDZ.js.map +0 -7
  67. /package/packages/safe-js/dist/chunks/{chunk-EGTPUJGO.js.map → chunk-FOWKJRPH.js.map} +0 -0
  68. /package/packages/safe-js/dist/chunks/{chunk-47R6V3XW.js.map → chunk-OXQ2XP74.js.map} +0 -0
@@ -32,7 +32,7 @@ import {
32
32
  toFsError,
33
33
  validatePath,
34
34
  withFileSystemQuota
35
- } from "./chunks/chunk-FX3SOWQN.js";
35
+ } from "./chunks/chunk-BB4KTS26.js";
36
36
  export {
37
37
  ACCESS_MODES,
38
38
  FileSystemQuotaError,
@@ -32,7 +32,7 @@ import {
32
32
  toFsError,
33
33
  validatePath,
34
34
  withFileSystemQuota
35
- } from "./chunks/chunk-FX3SOWQN.js";
35
+ } from "./chunks/chunk-BB4KTS26.js";
36
36
  export {
37
37
  ACCESS_MODES,
38
38
  FileSystemQuotaError,
@@ -34,11 +34,11 @@ import {
34
34
  createNodeFsBridge,
35
35
  readConfigRecord,
36
36
  validateFileSystemConfig
37
- } from "./chunk-47R6V3XW.js";
37
+ } from "./chunk-OXQ2XP74.js";
38
38
  import {
39
39
  FsError,
40
40
  isPathWithin
41
- } from "./chunk-X2BJ2VDZ.js";
41
+ } from "./chunk-LRWPYBOU.js";
42
42
 
43
43
  // packages/safe-js/src/migrate.ts
44
44
  import { createHash } from "node:crypto";
@@ -8245,4 +8245,4 @@ export {
8245
8245
  parseMcpConfig,
8246
8246
  makeMcpModule
8247
8247
  };
8248
- //# sourceMappingURL=chunk-EGTPUJGO.js.map
8248
+ //# sourceMappingURL=chunk-FOWKJRPH.js.map
@@ -1054,6 +1054,8 @@ function composeAbortSignals(signals) {
1054
1054
  }
1055
1055
 
1056
1056
  // packages/safe-fs/src/fs/webdav/xml.ts
1057
+ var XmlResponseLimitError = class extends SyntaxError {
1058
+ };
1057
1059
  var xmlNamespace = "http://www.w3.org/XML/1998/namespace";
1058
1060
  var xmlnsNamespace = "http://www.w3.org/2000/xmlns/";
1059
1061
  function invalid(message) {
@@ -1106,7 +1108,7 @@ function parseXml(input, limits = {}) {
1106
1108
  const maxDepth = limits.maxDepth ?? 64;
1107
1109
  const maxNodes = limits.maxNodes ?? 1e5;
1108
1110
  const maxAttributes = limits.maxAttributes ?? 1e4;
1109
- for (const limit of [maxDepth, maxNodes, maxAttributes]) {
1111
+ for (const limit of [maxDepth, maxNodes, maxAttributes, ...limits.maxResponses === void 0 ? [] : [limits.maxResponses]]) {
1110
1112
  if (!Number.isSafeInteger(limit) || limit < 1) throw new RangeError("XML limits must be positive integers");
1111
1113
  }
1112
1114
  for (const character of input) {
@@ -1118,6 +1120,7 @@ function parseXml(input, limits = {}) {
1118
1120
  let offset = 0;
1119
1121
  let nodes = 0;
1120
1122
  let attributeCount = 0;
1123
+ let responses2 = 0;
1121
1124
  const whitespace = () => {
1122
1125
  while (offset < source.length && " \n\r".includes(source[offset])) offset++;
1123
1126
  };
@@ -1215,8 +1218,12 @@ function parseXml(input, limits = {}) {
1215
1218
  }
1216
1219
  const [prefix, localName] = qualifiedName(name);
1217
1220
  if (prefix === "xmlns" || prefix && !namespaces.has(prefix)) invalid("unbound element prefix");
1218
- const element = { namespace: namespaces.get(prefix) ?? "", localName, children: [], text: "" };
1219
1221
  if (++nodes > maxNodes || stack.length + 1 > maxDepth) invalid("XML resource limit exceeded");
1222
+ const namespace = namespaces.get(prefix) ?? "";
1223
+ if (limits.maxResponses !== void 0 && stack.length === 1 && root?.namespace === "DAV:" && root.localName === "multistatus" && namespace === "DAV:" && localName === "response" && ++responses2 > limits.maxResponses) {
1224
+ throw new XmlResponseLimitError("WebDAV XML response limit exceeded");
1225
+ }
1226
+ const element = { namespace, localName, children: [], text: "" };
1220
1227
  const parent = stack.at(-1);
1221
1228
  if (parent) parent.element.children.push(element);
1222
1229
  else if (root) invalid("multiple root elements");
@@ -1719,20 +1726,23 @@ var WebDavFileSystem = class {
1719
1726
  reader.releaseLock();
1720
1727
  }
1721
1728
  }
1722
- async xml(response, signal) {
1729
+ async xml(response, signal, maxResponses) {
1723
1730
  const data = await this.bytes(response, this.maxXmlBytes, signal);
1724
1731
  const encoding = data[0] === 255 && data[1] === 254 || data[0] === 60 && data[1] === 0 ? "utf-16le" : data[0] === 254 && data[1] === 255 || data[0] === 0 && data[1] === 60 ? "utf-16be" : "utf-8";
1725
- return parseXml(new TextDecoder(encoding, { fatal: true }).decode(data), {
1726
- maxNodes: this.maxXmlBytes,
1727
- maxAttributes: this.maxXmlBytes
1728
- });
1732
+ return parseXml(new TextDecoder(encoding, { fatal: true }).decode(data), maxResponses === void 0 ? void 0 : { maxResponses });
1729
1733
  }
1730
1734
  async multistatus(response, signal, method = "PROPFIND", path = "") {
1731
1735
  const link = response.headers.get("link");
1732
1736
  if (link && /\brel\s*=\s*(?:"[^"]*\bnext\b[^"]*"|'[^']*\bnext\b[^']*'|next\b)/i.test(link)) {
1733
1737
  fail("ENOTSUP", method, path, "paginated WebDAV responses are unsupported");
1734
1738
  }
1735
- const root = await this.xml(response, signal);
1739
+ let root;
1740
+ try {
1741
+ root = await this.xml(response, signal, this.maxEntries);
1742
+ } catch (error) {
1743
+ if (error instanceof XmlResponseLimitError) fail("EFBIG", method, path, "response exceeds entry limit");
1744
+ throw error;
1745
+ }
1736
1746
  if (root.namespace !== "DAV:" || root.localName !== "multistatus") throw new Error("expected DAV:multistatus");
1737
1747
  const responses2 = davChildren(root, "response");
1738
1748
  if (responses2.length > this.maxEntries) fail("EFBIG", method, path, "response exceeds entry limit");
@@ -4694,4 +4704,4 @@ export {
4694
4704
  withFileSystemQuota,
4695
4705
  FileSystemBridge
4696
4706
  };
4697
- //# sourceMappingURL=chunk-X2BJ2VDZ.js.map
4707
+ //# sourceMappingURL=chunk-LRWPYBOU.js.map