@poe-platform/safe-bash 0.1.801 → 0.1.802

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 (83) hide show
  1. package/dist/image-ast/index.browser.js +3 -1
  2. package/dist/image-ast/index.js +3 -1
  3. package/dist/safe-bash/chunks/chunk-3HQU4OJO.js +13 -0
  4. package/dist/safe-bash/chunks/{chunk-SZH7EJLD.js → chunk-44ALJ4QG.js} +5461 -6495
  5. package/dist/safe-bash/chunks/chunk-4BSJLKNM.js +14 -0
  6. package/dist/safe-bash/chunks/chunk-4D4N7IU2.js +47 -0
  7. package/dist/safe-bash/chunks/chunk-55YJASTN.js +14 -0
  8. package/dist/safe-bash/chunks/chunk-7ZBU7KYV.js +14 -0
  9. package/dist/safe-bash/chunks/chunk-DQP3VHSB.js +15 -0
  10. package/dist/safe-bash/chunks/chunk-FZE4HW6G.js +11 -0
  11. package/dist/safe-bash/chunks/chunk-GEG3BWGE.js +14 -0
  12. package/dist/safe-bash/chunks/{chunk-45PK3NWI.js → chunk-GETUOD5D.js} +1 -1
  13. package/dist/safe-bash/chunks/chunk-HBCN24ZA.js +50 -0
  14. package/dist/safe-bash/chunks/chunk-HZ7BWKQ3.js +13 -0
  15. package/dist/safe-bash/chunks/{chunk-ICFDYV64.js → chunk-HZAMGT5I.js} +2 -2
  16. package/dist/safe-bash/chunks/chunk-KDNSPLII.js +83 -0
  17. package/dist/safe-bash/chunks/{chunk-PQRAK7HU.js → chunk-NQCM3TYR.js} +238 -462
  18. package/dist/safe-bash/chunks/{chunk-IVRQ4BXL.js → chunk-PH63PLPZ.js} +7 -7
  19. package/dist/safe-bash/chunks/chunk-QGUV42T5.js +44 -0
  20. package/dist/safe-bash/chunks/chunk-R3NAKOED.js +51 -0
  21. package/dist/safe-bash/chunks/chunk-RRR7AQ24.js +38 -0
  22. package/dist/safe-bash/chunks/{chunk-FNDNHAGE.js → chunk-RSTHLAF3.js} +1 -1
  23. package/dist/safe-bash/chunks/{chunk-7VNF5BFF.js → chunk-SHEMU2Z7.js} +83 -416
  24. package/dist/safe-bash/chunks/{chunk-NR3EM4LS.js → chunk-VKNVHEX3.js} +1 -6
  25. package/dist/safe-bash/chunks/chunk-VSAJ4OTM.js +962 -0
  26. package/dist/safe-bash/chunks/{chunk-VQDD3G76.js → chunk-WDLGKIHD.js} +19 -19
  27. package/dist/safe-bash/chunks/chunk-XAQMU6OY.js +14 -0
  28. package/dist/safe-bash/chunks/chunk-ZVD5IS4V.js +49 -0
  29. package/dist/safe-bash/command-chunks/{chunk-PCEFOYA3.js → chunk-6GWJUQAV.js} +3 -3
  30. package/dist/safe-bash/command-chunks/{chunk-EFANWIHL.js → chunk-GY3BWK7K.js} +1 -0
  31. package/dist/safe-bash/command-chunks/{chunk-WBNZ4PRE.js → chunk-NGG2XL56.js} +7 -4
  32. package/dist/safe-bash/command-chunks/{chunk-GLOZX57Y.js → chunk-OQKC5ZU2.js} +23 -114
  33. package/dist/safe-bash/command-chunks/{chunk-CZ7EN3JG.js → chunk-VT6MJBEI.js} +1 -1
  34. package/dist/safe-bash/command-chunks/{chunk-F6OYH562.js → chunk-X54L3DBL.js} +4 -9
  35. package/dist/safe-bash/command-chunks/{chunk-TNOA7FCQ.js → chunk-YVNGTIJO.js} +1 -1
  36. package/dist/safe-bash/commands/apply-patch/index.browser.js +14 -0
  37. package/dist/safe-bash/commands/archive/index.browser.js +36 -0
  38. package/dist/safe-bash/commands/column/index.browser.js +12 -0
  39. package/dist/safe-bash/commands/du/index.browser.js +14 -0
  40. package/dist/safe-bash/commands/expr/index.browser.js +12 -0
  41. package/dist/safe-bash/commands/file/index.browser.js +14 -0
  42. package/dist/safe-bash/commands/filesystem.js +9 -2
  43. package/dist/safe-bash/commands/grep-aliases/index.browser.js +14 -0
  44. package/dist/safe-bash/commands/html-to-markdown/index.browser.js +16 -0
  45. package/dist/safe-bash/commands/metadata/index.browser.js +21 -0
  46. package/dist/safe-bash/commands/network/index.browser.js +1 -1
  47. package/dist/safe-bash/commands/node/index.browser.js +3 -3
  48. package/dist/safe-bash/commands/python/index.browser.js +8 -8
  49. package/dist/safe-bash/commands/regex-execution/public.browser.js +5 -3
  50. package/dist/safe-bash/commands/split/index.browser.js +14 -0
  51. package/dist/safe-bash/commands/stream-format/index.browser.js +11 -0
  52. package/dist/safe-bash/commands/stream-inspection/index.browser.js +11 -0
  53. package/dist/safe-bash/commands/streams.js +5 -5
  54. package/dist/safe-bash/commands/table-text/index.browser.js +11 -0
  55. package/dist/safe-bash/commands/text.js +2 -133
  56. package/dist/safe-bash/commands/time-env/index.browser.js +15 -0
  57. package/dist/safe-bash/commands/tree/index.browser.js +14 -0
  58. package/dist/safe-bash/full-core.browser.js +227 -218
  59. package/dist/safe-bash/jobs.browser.js +2 -2
  60. package/dist/safe-bash/optional-host.browser.js +8 -8
  61. package/dist/safe-bash/plugins/index.browser.js +23 -9
  62. package/dist/safe-bash/registry-entry.browser.js +23 -9
  63. package/dist/safe-bash/search.browser.js +48 -0
  64. package/dist/safe-bash/shell/runtime.d.ts +0 -9
  65. package/dist/safe-bash/shell/runtime.js +43 -308
  66. package/dist/safe-bash/shell/shell.js +0 -23
  67. package/dist/safe-bash/shell-entry.browser.js +19 -10
  68. package/dist/safe-bash-command-nl/index.js +1 -1
  69. package/dist/safe-bash-command-nl/nl.js +1 -1
  70. package/dist/safe-bash-command-rg/index.js +1 -1
  71. package/dist/safe-bash-command-rg/rg-command.d.ts +0 -1
  72. package/dist/safe-bash-command-rg/rg-command.js +3 -5
  73. package/dist/safe-bash-command-unexpand/index.js +1 -1
  74. package/dist/safe-bash-command-unexpand/unexpand.js +1 -1
  75. package/dist/safe-bash-mcp/index.js +3 -1
  76. package/dist/safe-bash-regex-engine/index.js +4 -4
  77. package/dist/safe-bash-regex-engine/text/budget.d.ts +0 -1
  78. package/dist/safe-bash-regex-engine/text/budget.js +1 -1
  79. package/dist/safe-bash-regex-engine/text/regex.js +4 -4
  80. package/dist/safe-bash-regex-engine/text/replacement-buffer.js +2 -2
  81. package/dist/safe-bash-regex-engine/text/rust-syntax.js +2 -2
  82. package/package.json +65 -10
  83. package/dist/safe-bash/chunks/{chunk-A7XEHALN.js → chunk-BJA5XNP6.js} +3 -3
@@ -16,19 +16,19 @@ import {
16
16
  pythonCommands,
17
17
  pythonDocumentPackages,
18
18
  pythonHostFailureCode
19
- } from "../../chunks/chunk-VQDD3G76.js";
20
- import "../../chunks/chunk-I5HZ4FGE.js";
21
- import "../../chunks/chunk-ICFDYV64.js";
22
- import "../../chunks/chunk-VTH3MLDU.js";
23
- import "../../chunks/chunk-NZQXYWA3.js";
24
- import "../../chunks/chunk-74GHTNJA.js";
25
- import "../../chunks/chunk-7R5BDCG7.js";
19
+ } from "../../chunks/chunk-WDLGKIHD.js";
20
+ import "../../chunks/chunk-HZAMGT5I.js";
26
21
  import {
27
22
  PythonFailure,
28
23
  inspectPythonCapabilities
29
24
  } from "../../chunks/chunk-LVOBFF4D.js";
30
- import "../../chunks/chunk-IWDICZVK.js";
25
+ import "../../chunks/chunk-I5HZ4FGE.js";
26
+ import "../../chunks/chunk-7R5BDCG7.js";
27
+ import "../../chunks/chunk-VTH3MLDU.js";
28
+ import "../../chunks/chunk-NZQXYWA3.js";
29
+ import "../../chunks/chunk-74GHTNJA.js";
31
30
  import "../../chunks/chunk-E7OYNDGL.js";
31
+ import "../../chunks/chunk-IWDICZVK.js";
32
32
  import "../../chunks/chunk-B7TAL7S5.js";
33
33
  export {
34
34
  PythonFailure,
@@ -1,6 +1,10 @@
1
1
  import {
2
2
  RegexExecutionError
3
3
  } from "../../chunks/chunk-46Z5E5EV.js";
4
+ import {
5
+ RegexExecutor,
6
+ RegexSession
7
+ } from "../../chunks/chunk-VKNVHEX3.js";
4
8
  import {
5
9
  EreLedger,
6
10
  EreProfileLimitError,
@@ -11,10 +15,8 @@ import {
11
15
  matchEre
12
16
  } from "../../chunks/chunk-6O77NL2S.js";
13
17
  import {
14
- RegexExecutor,
15
- RegexSession,
16
18
  createBoundedRegexProvider
17
- } from "../../chunks/chunk-NR3EM4LS.js";
19
+ } from "../../chunks/chunk-FZE4HW6G.js";
18
20
  import "../../chunks/chunk-B7TAL7S5.js";
19
21
  export {
20
22
  EreLedger,
@@ -0,0 +1,14 @@
1
+ import {
2
+ createSplitCommand,
3
+ createSplitCommands,
4
+ evalSyncSplit,
5
+ splitCommands
6
+ } from "../../chunks/chunk-7ZBU7KYV.js";
7
+ import "../../chunks/chunk-IWDICZVK.js";
8
+ import "../../chunks/chunk-B7TAL7S5.js";
9
+ export {
10
+ createSplitCommand,
11
+ createSplitCommands,
12
+ evalSyncSplit,
13
+ splitCommands
14
+ };
@@ -0,0 +1,11 @@
1
+ import {
2
+ createStreamFormatCommands,
3
+ streamFormatCommands
4
+ } from "../../chunks/chunk-R3NAKOED.js";
5
+ import "../../chunks/chunk-E7OYNDGL.js";
6
+ import "../../chunks/chunk-IWDICZVK.js";
7
+ import "../../chunks/chunk-B7TAL7S5.js";
8
+ export {
9
+ createStreamFormatCommands,
10
+ streamFormatCommands
11
+ };
@@ -0,0 +1,11 @@
1
+ import {
2
+ createStreamInspectionCommands,
3
+ streamInspectionCommands
4
+ } from "../../chunks/chunk-HBCN24ZA.js";
5
+ import "../../chunks/chunk-E7OYNDGL.js";
6
+ import "../../chunks/chunk-IWDICZVK.js";
7
+ import "../../chunks/chunk-B7TAL7S5.js";
8
+ export {
9
+ createStreamInspectionCommands,
10
+ streamInspectionCommands
11
+ };
@@ -450,14 +450,14 @@ async function suffix(context, source, count, bytes, omit, delimiter) {
450
450
  const needed = line.bytes.length + (line.terminated ? 1 : 0);
451
451
  if (needed > batch.length) {
452
452
  if (batchUsed > 0) {
453
- await output(context, batch.subarray(0, batchUsed));
453
+ await outputRange(context, batch, batchUsed);
454
454
  batchUsed = 0;
455
455
  }
456
456
  await output(context, line.terminated ? concatenate([line.bytes, delimiterByte]) : line.bytes);
457
457
  continue;
458
458
  }
459
459
  if (batchUsed + needed > batch.length) {
460
- await output(context, batch.subarray(0, batchUsed));
460
+ await outputRange(context, batch, batchUsed);
461
461
  batchUsed = 0;
462
462
  }
463
463
  batch.set(line.bytes, batchUsed);
@@ -466,7 +466,7 @@ async function suffix(context, source, count, bytes, omit, delimiter) {
466
466
  batch[batchUsed++] = delimiter;
467
467
  }
468
468
  if (batchUsed > 0) {
469
- await output(context, batch.subarray(0, batchUsed));
469
+ await outputRange(context, batch, batchUsed);
470
470
  }
471
471
  }
472
472
  return;
@@ -1100,7 +1100,7 @@ async function executeTrAsync(context, iter, deleting, squeezing, mapping, remov
1100
1100
  if (!deleting && !squeezing) {
1101
1101
  for (let index = 0; index < chunk.length; index++)
1102
1102
  buf[index] = mapping[chunk[index]];
1103
- const p = output(context, useShared ? buf.subarray(0, chunk.length) : buf);
1103
+ const p = useShared ? outputRange(context, buf, chunk.length) : output(context, buf);
1104
1104
  if (!isSyncResolved(p))
1105
1105
  await p;
1106
1106
  continue;
@@ -1117,7 +1117,7 @@ async function executeTrAsync(context, iter, deleting, squeezing, mapping, remov
1117
1117
  previous = translated;
1118
1118
  }
1119
1119
  if (count) {
1120
- const p = output(context, buf.subarray(0, count));
1120
+ const p = outputRange(context, buf, count);
1121
1121
  if (!isSyncResolved(p))
1122
1122
  await p;
1123
1123
  }
@@ -0,0 +1,11 @@
1
+ import {
2
+ createTableTextCommands,
3
+ tableTextCommands
4
+ } from "../../chunks/chunk-4D4N7IU2.js";
5
+ import "../../chunks/chunk-E7OYNDGL.js";
6
+ import "../../chunks/chunk-IWDICZVK.js";
7
+ import "../../chunks/chunk-B7TAL7S5.js";
8
+ export {
9
+ createTableTextCommands,
10
+ tableTextCommands
11
+ };
@@ -1704,138 +1704,7 @@ async function executeSortGeneral(context, preReadChunks) {
1704
1704
  }
1705
1705
  if (checking)
1706
1706
  return { exitCode };
1707
- let ordered;
1708
- if (!parsed.flags.has("m") &&
1709
- !parsed.flags.has("u") &&
1710
- records.length >= 2 &&
1711
- records.length <= 65536 &&
1712
- (canMultiKeyFast || isSingleLexKeyFast)) {
1713
- const count = records.length;
1714
- const keySpecs = keys.map(k => {
1715
- const f = k.flags.size ? k.flags : parsed.flags;
1716
- const numeric = f.has("n") || f.has("h");
1717
- const human = f.has("h");
1718
- const blanks = f.has("b");
1719
- const revScale = f.has("r") ? -1 : 1;
1720
- if (numeric) {
1721
- const fastNums = new Float64Array(count);
1722
- const numVals = new Array(count);
1723
- return { numeric: true, human, blanks, revScale, key: k, fastNums, numVals };
1724
- }
1725
- const slices = new Array(count);
1726
- return { numeric: false, blanks, revScale, key: k, slices };
1727
- });
1728
- for (let i = 0; i < count; i++) {
1729
- const rec = records[i];
1730
- for (let ki = 0; ki < keySpecs.length; ki++) {
1731
- const ks = keySpecs[ki];
1732
- const sliceOrPromise = keyBytesSync(rec, ks.key, separator, ks.blanks, work);
1733
- const slice = sliceOrPromise instanceof Promise ? await sliceOrPromise : sliceOrPromise;
1734
- if (ks.numeric) {
1735
- const parsedOrPromise = parseNumeric(slice, work, ks.human);
1736
- const nv = parsedOrPromise instanceof Promise ? await parsedOrPromise : parsedOrPromise;
1737
- ks.numVals[i] = nv;
1738
- if (!ks.human && nv.fraction.length === 0 && nv.whole.length <= 15) {
1739
- const mag = nv.whole.length === 0 ? 0 : Number(nv.whole);
1740
- ks.fastNums[i] = nv.negative ? (mag === 0 ? 0 : -mag) : mag;
1741
- }
1742
- else {
1743
- ks.fastNums[i] = Number.NaN;
1744
- }
1745
- }
1746
- else {
1747
- ks.slices[i] = slice;
1748
- }
1749
- }
1750
- }
1751
- let srcIdx = new Int32Array(count);
1752
- let dstIdx = new Int32Array(count);
1753
- for (let i = 0; i < count; i++)
1754
- srcIdx[i] = i;
1755
- for (let width = 1; width < count; width *= 2) {
1756
- for (let begin = 0; begin < count; begin += width * 2) {
1757
- const middle = Math.min(begin + width, count);
1758
- const end = Math.min(begin + width * 2, count);
1759
- let left = begin;
1760
- let right = middle;
1761
- for (let index = begin; index < end; index++) {
1762
- const cp = work.charge(2);
1763
- if (cp)
1764
- await cp;
1765
- if (left < middle) {
1766
- if (right === end) {
1767
- dstIdx[index] = srcIdx[left++];
1768
- continue;
1769
- }
1770
- const a = srcIdx[left];
1771
- const b = srcIdx[right];
1772
- let cmp = 0;
1773
- for (let ki = 0; ki < keySpecs.length; ki++) {
1774
- const ks = keySpecs[ki];
1775
- if (ks.numeric) {
1776
- const fa = ks.fastNums[a];
1777
- const fb = ks.fastNums[b];
1778
- if (fa === fa && fb === fb) {
1779
- cmp = fa === fb ? 0 : (fa < fb ? -ks.revScale : ks.revScale);
1780
- }
1781
- else {
1782
- const r = compareNumericValues(ks.numVals[a], ks.numVals[b], work);
1783
- const resolved = typeof r === "number" ? r : await r;
1784
- cmp = resolved * ks.revScale;
1785
- }
1786
- }
1787
- else {
1788
- const sa = ks.slices[a];
1789
- const sb = ks.slices[b];
1790
- const lenA = sa.length;
1791
- const lenB = sb.length;
1792
- const minL = lenA < lenB ? lenA : lenB;
1793
- let d = 0;
1794
- for (let p = 0; p < minL; p++) {
1795
- d = sa[p] - sb[p];
1796
- if (d !== 0)
1797
- break;
1798
- }
1799
- if (d === 0)
1800
- d = lenA - lenB;
1801
- cmp = d * ks.revScale;
1802
- }
1803
- if (cmp !== 0)
1804
- break;
1805
- }
1806
- if (cmp === 0 && !skipTieFallback) {
1807
- const ra = records[a];
1808
- const rb = records[b];
1809
- const minL = ra.length < rb.length ? ra.length : rb.length;
1810
- let d = 0;
1811
- for (let p = 0; p < minL; p++) {
1812
- d = ra[p] - rb[p];
1813
- if (d !== 0)
1814
- break;
1815
- }
1816
- if (d === 0)
1817
- d = ra.length - rb.length;
1818
- cmp = d * direction;
1819
- }
1820
- if (cmp <= 0) {
1821
- dstIdx[index] = srcIdx[left++];
1822
- continue;
1823
- }
1824
- }
1825
- dstIdx[index] = srcIdx[right++];
1826
- }
1827
- }
1828
- const tmp = srcIdx;
1829
- srcIdx = dstIdx;
1830
- dstIdx = tmp;
1831
- }
1832
- ordered = new Array(count);
1833
- for (let i = 0; i < count; i++)
1834
- ordered[i] = records[srcIdx[i]];
1835
- }
1836
- else {
1837
- ordered = parsed.flags.has("m") ? await mergeSortRuns(runs, compare, work) : await sortRecords(records, compare, work);
1838
- }
1707
+ const ordered = parsed.flags.has("m") ? await mergeSortRuns(runs, compare, work) : await sortRecords(records, compare, work);
1839
1708
  let estBytes = 0;
1840
1709
  let allCounted = true;
1841
1710
  for (let i = 0; i < ordered.length; i++) {
@@ -2040,7 +1909,7 @@ async function executeCutGeneral(context) {
2040
1909
  const canFastSliceCut = (byteSelection || mode === "c") && !complement && ranges.length <= 16;
2041
1910
  const processFastSliceRange = (buf, lineStart, lineEnd) => {
2042
1911
  const lineLen = lineEnd - lineStart;
2043
- if (writer.remaining <= lineLen * (outDelimLen > 1 ? outDelimLen : 1) + 1) {
1912
+ if (writer.remaining <= lineLen + (outputDelimiter !== undefined ? Math.max(0, ranges.length - 1) * outDelimLen : 0) + 1) {
2044
1913
  return null;
2045
1914
  }
2046
1915
  if (!byteSelection) {
@@ -0,0 +1,15 @@
1
+ import {
2
+ createTimeEnvCommands,
3
+ evalSyncDate,
4
+ evalSyncPrintenv,
5
+ timeEnvCommands
6
+ } from "../../chunks/chunk-ZVD5IS4V.js";
7
+ import "../../chunks/chunk-E7OYNDGL.js";
8
+ import "../../chunks/chunk-IWDICZVK.js";
9
+ import "../../chunks/chunk-B7TAL7S5.js";
10
+ export {
11
+ createTimeEnvCommands,
12
+ evalSyncDate,
13
+ evalSyncPrintenv,
14
+ timeEnvCommands
15
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ createTreeCommand,
3
+ createTreeCommands,
4
+ evalSyncTree,
5
+ treeCommands
6
+ } from "../../chunks/chunk-55YJASTN.js";
7
+ import "../../chunks/chunk-IWDICZVK.js";
8
+ import "../../chunks/chunk-B7TAL7S5.js";
9
+ export {
10
+ createTreeCommand,
11
+ createTreeCommands,
12
+ evalSyncTree,
13
+ treeCommands
14
+ };