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
@@ -18,7 +18,7 @@ import {
18
18
  toByteSource,
19
19
  toFsError,
20
20
  validatePath
21
- } from "./chunk-X2BJ2VDZ.js";
21
+ } from "./chunk-LRWPYBOU.js";
22
22
 
23
23
  // packages/safe-fs/src/contracts/path.ts
24
24
  import { posix } from "node:path";
@@ -2685,4 +2685,4 @@ export {
2685
2685
  createFileSystem,
2686
2686
  createNodeFileSystemAdapterRegistry
2687
2687
  };
2688
- //# sourceMappingURL=chunk-47R6V3XW.js.map
2688
+ //# sourceMappingURL=chunk-OXQ2XP74.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-EGTPUJGO.js";
25
+ } from "./chunks/chunk-FOWKJRPH.js";
26
26
  import {
27
27
  Budget,
28
28
  SandboxError,
@@ -35,8 +35,8 @@ import {
35
35
  restore,
36
36
  run
37
37
  } from "./chunks/chunk-CSC4EXIV.js";
38
- import "./chunks/chunk-47R6V3XW.js";
39
- import "./chunks/chunk-X2BJ2VDZ.js";
38
+ import "./chunks/chunk-OXQ2XP74.js";
39
+ import "./chunks/chunk-LRWPYBOU.js";
40
40
  import "./chunks/chunk-4YIDX44G.js";
41
41
 
42
42
  // packages/safe-js/src/cli.ts
@@ -26,7 +26,7 @@ import {
26
26
  runWithSpawnUsageAccumulator,
27
27
  splitFrontmatter,
28
28
  supportsSpawnMode
29
- } from "./chunks/chunk-EGTPUJGO.js";
29
+ } from "./chunks/chunk-FOWKJRPH.js";
30
30
  import {
31
31
  Budget,
32
32
  FileSnapshotBackend,
@@ -51,8 +51,8 @@ import {
51
51
  restore,
52
52
  run
53
53
  } from "./chunks/chunk-CSC4EXIV.js";
54
- import "./chunks/chunk-47R6V3XW.js";
55
- import "./chunks/chunk-X2BJ2VDZ.js";
54
+ import "./chunks/chunk-OXQ2XP74.js";
55
+ import "./chunks/chunk-LRWPYBOU.js";
56
56
  import "./chunks/chunk-4YIDX44G.js";
57
57
 
58
58
  // packages/safe-js/src/parse.ts
@@ -28,7 +28,7 @@ import {
28
28
  toFsError,
29
29
  validatePath,
30
30
  withFileSystemQuota
31
- } from "./chunks/chunk-X2BJ2VDZ.js";
31
+ } from "./chunks/chunk-LRWPYBOU.js";
32
32
  import "./chunks/chunk-4YIDX44G.js";
33
33
 
34
34
  // packages/safe-fs/src/contracts/portable-path.ts
@@ -19,7 +19,7 @@ import {
19
19
  posixPath,
20
20
  readConfigRecord,
21
21
  validateFileSystemConfig
22
- } from "./chunks/chunk-47R6V3XW.js";
22
+ } from "./chunks/chunk-OXQ2XP74.js";
23
23
  import {
24
24
  ACCESS_MODES,
25
25
  FileSystemQuotaError,
@@ -46,7 +46,7 @@ import {
46
46
  toFsError,
47
47
  validatePath,
48
48
  withFileSystemQuota
49
- } from "./chunks/chunk-X2BJ2VDZ.js";
49
+ } from "./chunks/chunk-LRWPYBOU.js";
50
50
  import "./chunks/chunk-4YIDX44G.js";
51
51
  export {
52
52
  ACCESS_MODES,
@@ -19,7 +19,7 @@ import {
19
19
  posixPath,
20
20
  readConfigRecord,
21
21
  validateFileSystemConfig
22
- } from "./chunks/chunk-47R6V3XW.js";
22
+ } from "./chunks/chunk-OXQ2XP74.js";
23
23
  import {
24
24
  ACCESS_MODES,
25
25
  FileSystemQuotaError,
@@ -46,7 +46,7 @@ import {
46
46
  toFsError,
47
47
  validatePath,
48
48
  withFileSystemQuota
49
- } from "./chunks/chunk-X2BJ2VDZ.js";
49
+ } from "./chunks/chunk-LRWPYBOU.js";
50
50
  import "./chunks/chunk-4YIDX44G.js";
51
51
  export {
52
52
  ACCESS_MODES,
@@ -754,7 +754,7 @@ export class StreamableHttpTransport {
754
754
  const history = this.sseEventHistory.get(sessionId) ?? [];
755
755
  for (const event of history) {
756
756
  if (event.id > lastEventId && !res.writableEnded) {
757
- res.write(formatSseEvent({ id: String(event.id), data: event.data }));
757
+ this.writeToLiveGetStream(res, formatSseEvent({ id: String(event.id), data: event.data }));
758
758
  }
759
759
  }
760
760
  }
@@ -64,12 +64,19 @@ async function readStreamBody(req, maxBytes) {
64
64
  return Buffer.concat(chunks).toString("utf8");
65
65
  }
66
66
  async function readRawBody(req, preParsed, options) {
67
- if (preParsed !== undefined) {
68
- return preParsed;
69
- }
70
67
  const reqWithBody = req;
71
- if (reqWithBody.body !== undefined) {
72
- return reqWithBody.body;
68
+ const body = preParsed !== undefined ? preParsed : reqWithBody.body;
69
+ if (body !== undefined) {
70
+ if (options.maxBytes !== undefined) {
71
+ const serialized = JSON.stringify(body);
72
+ if (serialized === undefined) {
73
+ throw new Error("Invalid Request");
74
+ }
75
+ if (Buffer.byteLength(serialized, "utf8") > options.maxBytes) {
76
+ throw new Error("Payload too large");
77
+ }
78
+ }
79
+ return body;
73
80
  }
74
81
  const raw = await readStreamBody(req, options.maxBytes);
75
82
  try {