@poe-platform/safe-bash 0.1.679 → 0.1.681

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 (178) hide show
  1. package/README.md +1 -1
  2. package/dist/safe-bash/commands/playwright/index.d.ts.map +1 -1
  3. package/dist/safe-bash/commands/playwright/index.js +77 -4
  4. package/dist/safe-bash/commands/playwright/index.js.map +1 -1
  5. package/dist/safe-bash/commands/text-programs/awk-runtime.d.ts.map +1 -1
  6. package/dist/safe-bash/commands/text-programs/awk-runtime.js +1 -3
  7. package/dist/safe-bash/commands/text-programs/awk-runtime.js.map +1 -1
  8. package/dist/safe-bash/commands/text-programs/regex.d.ts +3 -1
  9. package/dist/safe-bash/commands/text-programs/regex.d.ts.map +1 -1
  10. package/dist/safe-bash/commands/text-programs/regex.js +13 -7
  11. package/dist/safe-bash/commands/text-programs/regex.js.map +1 -1
  12. package/dist/safe-bash/core.browser.js +12 -9
  13. package/dist/safe-bash/core.browser.js.map +2 -2
  14. package/dist/safe-bash/playwright/abilities.d.ts +24 -5
  15. package/dist/safe-bash/playwright/abilities.d.ts.map +1 -1
  16. package/dist/safe-bash/playwright/abilities.js +9 -4
  17. package/dist/safe-bash/playwright/abilities.js.map +1 -1
  18. package/dist/safe-bash/playwright/ability-execution.d.ts +6 -1
  19. package/dist/safe-bash/playwright/ability-execution.d.ts.map +1 -1
  20. package/dist/safe-bash/playwright/ability-execution.js +77 -5
  21. package/dist/safe-bash/playwright/ability-execution.js.map +1 -1
  22. package/dist/safe-bash/playwright/adapter.d.ts +467 -11
  23. package/dist/safe-bash/playwright/adapter.d.ts.map +1 -1
  24. package/dist/safe-bash/playwright/adapter.js +213 -4
  25. package/dist/safe-bash/playwright/adapter.js.map +1 -1
  26. package/dist/safe-bash/playwright/builtins.d.ts +44 -4
  27. package/dist/safe-bash/playwright/builtins.d.ts.map +1 -1
  28. package/dist/safe-bash/playwright/builtins.js +14 -9
  29. package/dist/safe-bash/playwright/builtins.js.map +1 -1
  30. package/dist/safe-bash/playwright/canonical-locator-parser.d.ts +5 -0
  31. package/dist/safe-bash/playwright/canonical-locator-parser.d.ts.map +1 -0
  32. package/dist/safe-bash/playwright/canonical-locator-parser.js +146 -0
  33. package/dist/safe-bash/playwright/canonical-locator-parser.js.map +1 -0
  34. package/dist/safe-bash/playwright/capability-events.d.ts +15 -0
  35. package/dist/safe-bash/playwright/capability-events.d.ts.map +1 -0
  36. package/dist/safe-bash/playwright/capability-events.js +265 -0
  37. package/dist/safe-bash/playwright/capability-events.js.map +1 -0
  38. package/dist/safe-bash/playwright/capability-result.d.ts +33 -0
  39. package/dist/safe-bash/playwright/capability-result.d.ts.map +1 -0
  40. package/dist/safe-bash/playwright/capability-result.js +72 -0
  41. package/dist/safe-bash/playwright/capability-result.js.map +1 -0
  42. package/dist/safe-bash/playwright/config-ini.d.ts +3 -0
  43. package/dist/safe-bash/playwright/config-ini.d.ts.map +1 -0
  44. package/dist/safe-bash/playwright/config-ini.js +161 -0
  45. package/dist/safe-bash/playwright/config-ini.js.map +1 -0
  46. package/dist/safe-bash/playwright/controller.d.ts +39 -1
  47. package/dist/safe-bash/playwright/controller.d.ts.map +1 -1
  48. package/dist/safe-bash/playwright/controller.js +913 -77
  49. package/dist/safe-bash/playwright/controller.js.map +1 -1
  50. package/dist/safe-bash/playwright/devices.d.ts +229 -0
  51. package/dist/safe-bash/playwright/devices.d.ts.map +1 -0
  52. package/dist/safe-bash/playwright/devices.js +2740 -0
  53. package/dist/safe-bash/playwright/devices.js.map +1 -0
  54. package/dist/safe-bash/playwright/download-capabilities.d.ts +15 -0
  55. package/dist/safe-bash/playwright/download-capabilities.d.ts.map +1 -0
  56. package/dist/safe-bash/playwright/download-capabilities.js +161 -0
  57. package/dist/safe-bash/playwright/download-capabilities.js.map +1 -0
  58. package/dist/safe-bash/playwright/drop-capability.d.ts +3 -0
  59. package/dist/safe-bash/playwright/drop-capability.d.ts.map +1 -0
  60. package/dist/safe-bash/playwright/drop-capability.js +50 -0
  61. package/dist/safe-bash/playwright/drop-capability.js.map +1 -0
  62. package/dist/safe-bash/playwright/find.d.ts +8 -0
  63. package/dist/safe-bash/playwright/find.d.ts.map +1 -0
  64. package/dist/safe-bash/playwright/find.js +68 -0
  65. package/dist/safe-bash/playwright/find.js.map +1 -0
  66. package/dist/safe-bash/playwright/generated-locator.d.ts +4 -0
  67. package/dist/safe-bash/playwright/generated-locator.d.ts.map +1 -0
  68. package/dist/safe-bash/playwright/generated-locator.js +22 -0
  69. package/dist/safe-bash/playwright/generated-locator.js.map +1 -0
  70. package/dist/safe-bash/playwright/help.d.ts +4 -3
  71. package/dist/safe-bash/playwright/help.d.ts.map +1 -1
  72. package/dist/safe-bash/playwright/help.js +7 -52
  73. package/dist/safe-bash/playwright/help.js.map +1 -1
  74. package/dist/safe-bash/playwright/highlight.d.ts +8 -0
  75. package/dist/safe-bash/playwright/highlight.d.ts.map +1 -0
  76. package/dist/safe-bash/playwright/highlight.js +82 -0
  77. package/dist/safe-bash/playwright/highlight.js.map +1 -0
  78. package/dist/safe-bash/playwright/index.d.ts +5 -0
  79. package/dist/safe-bash/playwright/index.d.ts.map +1 -1
  80. package/dist/safe-bash/playwright/index.js +4 -0
  81. package/dist/safe-bash/playwright/index.js.map +1 -1
  82. package/dist/safe-bash/playwright/invocation.d.ts +24 -0
  83. package/dist/safe-bash/playwright/invocation.d.ts.map +1 -1
  84. package/dist/safe-bash/playwright/invocation.js +42 -10
  85. package/dist/safe-bash/playwright/invocation.js.map +1 -1
  86. package/dist/safe-bash/playwright/locator-selector.d.ts +5 -0
  87. package/dist/safe-bash/playwright/locator-selector.d.ts.map +1 -0
  88. package/dist/safe-bash/playwright/locator-selector.js +70 -0
  89. package/dist/safe-bash/playwright/locator-selector.js.map +1 -0
  90. package/dist/safe-bash/playwright/modal-capabilities.d.ts +20 -0
  91. package/dist/safe-bash/playwright/modal-capabilities.d.ts.map +1 -0
  92. package/dist/safe-bash/playwright/modal-capabilities.js +137 -0
  93. package/dist/safe-bash/playwright/modal-capabilities.js.map +1 -0
  94. package/dist/safe-bash/playwright/native-json-snapshot.d.ts +17 -0
  95. package/dist/safe-bash/playwright/native-json-snapshot.d.ts.map +1 -0
  96. package/dist/safe-bash/playwright/native-json-snapshot.js +94 -0
  97. package/dist/safe-bash/playwright/native-json-snapshot.js.map +1 -0
  98. package/dist/safe-bash/playwright/native-snapshot.d.ts +17 -0
  99. package/dist/safe-bash/playwright/native-snapshot.d.ts.map +1 -0
  100. package/dist/safe-bash/playwright/native-snapshot.js +164 -0
  101. package/dist/safe-bash/playwright/native-snapshot.js.map +1 -0
  102. package/dist/safe-bash/playwright/network-policy.d.ts +2 -0
  103. package/dist/safe-bash/playwright/network-policy.d.ts.map +1 -1
  104. package/dist/safe-bash/playwright/network-policy.js +1 -1
  105. package/dist/safe-bash/playwright/network-policy.js.map +1 -1
  106. package/dist/safe-bash/playwright/open-options.d.ts +14 -0
  107. package/dist/safe-bash/playwright/open-options.d.ts.map +1 -0
  108. package/dist/safe-bash/playwright/open-options.js +279 -0
  109. package/dist/safe-bash/playwright/open-options.js.map +1 -0
  110. package/dist/safe-bash/playwright/recording-capabilities.d.ts +6 -0
  111. package/dist/safe-bash/playwright/recording-capabilities.d.ts.map +1 -0
  112. package/dist/safe-bash/playwright/recording-capabilities.js +83 -0
  113. package/dist/safe-bash/playwright/recording-capabilities.js.map +1 -0
  114. package/dist/safe-bash/playwright/resource-limit.d.ts +6 -0
  115. package/dist/safe-bash/playwright/resource-limit.d.ts.map +1 -0
  116. package/dist/safe-bash/playwright/resource-limit.js +8 -0
  117. package/dist/safe-bash/playwright/resource-limit.js.map +1 -0
  118. package/dist/safe-bash/playwright/response.d.ts +22 -0
  119. package/dist/safe-bash/playwright/response.d.ts.map +1 -0
  120. package/dist/safe-bash/playwright/response.js +43 -0
  121. package/dist/safe-bash/playwright/response.js.map +1 -0
  122. package/dist/safe-bash/playwright/route-capabilities.d.ts +25 -0
  123. package/dist/safe-bash/playwright/route-capabilities.d.ts.map +1 -0
  124. package/dist/safe-bash/playwright/route-capabilities.js +138 -0
  125. package/dist/safe-bash/playwright/route-capabilities.js.map +1 -0
  126. package/dist/safe-bash/playwright/screenshot.d.ts +3 -1
  127. package/dist/safe-bash/playwright/screenshot.d.ts.map +1 -1
  128. package/dist/safe-bash/playwright/screenshot.js +15 -12
  129. package/dist/safe-bash/playwright/screenshot.js.map +1 -1
  130. package/dist/safe-bash/playwright/session-configuration.d.ts +35 -0
  131. package/dist/safe-bash/playwright/session-configuration.d.ts.map +1 -0
  132. package/dist/safe-bash/playwright/session-configuration.js +50 -0
  133. package/dist/safe-bash/playwright/session-configuration.js.map +1 -0
  134. package/dist/safe-bash/playwright/session-runtime.d.ts +8 -0
  135. package/dist/safe-bash/playwright/session-runtime.d.ts.map +1 -0
  136. package/dist/safe-bash/playwright/session-runtime.js +96 -0
  137. package/dist/safe-bash/playwright/session-runtime.js.map +1 -0
  138. package/dist/safe-bash/playwright/snapshot.d.ts +15 -2
  139. package/dist/safe-bash/playwright/snapshot.d.ts.map +1 -1
  140. package/dist/safe-bash/playwright/snapshot.js +66 -7
  141. package/dist/safe-bash/playwright/snapshot.js.map +1 -1
  142. package/dist/safe-bash/playwright/standard-capabilities.d.ts +4 -0
  143. package/dist/safe-bash/playwright/standard-capabilities.d.ts.map +1 -0
  144. package/dist/safe-bash/playwright/standard-capabilities.js +248 -0
  145. package/dist/safe-bash/playwright/standard-capabilities.js.map +1 -0
  146. package/dist/safe-bash/playwright/storage-capabilities.d.ts +4 -0
  147. package/dist/safe-bash/playwright/storage-capabilities.d.ts.map +1 -0
  148. package/dist/safe-bash/playwright/storage-capabilities.js +120 -0
  149. package/dist/safe-bash/playwright/storage-capabilities.js.map +1 -0
  150. package/dist/safe-bash/playwright/storage-state.d.ts +8 -0
  151. package/dist/safe-bash/playwright/storage-state.d.ts.map +1 -0
  152. package/dist/safe-bash/playwright/storage-state.js +122 -0
  153. package/dist/safe-bash/playwright/storage-state.js.map +1 -0
  154. package/dist/safe-bash/playwright/target-screenshot.d.ts +9 -0
  155. package/dist/safe-bash/playwright/target-screenshot.d.ts.map +1 -0
  156. package/dist/safe-bash/playwright/target-screenshot.js +28 -0
  157. package/dist/safe-bash/playwright/target-screenshot.js.map +1 -0
  158. package/dist/safe-bash/playwright/targets.d.ts +12 -0
  159. package/dist/safe-bash/playwright/targets.d.ts.map +1 -0
  160. package/dist/safe-bash/playwright/targets.js +36 -0
  161. package/dist/safe-bash/playwright/targets.js.map +1 -0
  162. package/dist/safe-bash/playwright/tracing-capabilities.d.ts +12 -0
  163. package/dist/safe-bash/playwright/tracing-capabilities.d.ts.map +1 -0
  164. package/dist/safe-bash/playwright/tracing-capabilities.js +100 -0
  165. package/dist/safe-bash/playwright/tracing-capabilities.js.map +1 -0
  166. package/dist/safe-bash/playwright/webmcp-capabilities.d.ts +6 -0
  167. package/dist/safe-bash/playwright/webmcp-capabilities.d.ts.map +1 -0
  168. package/dist/safe-bash/playwright/webmcp-capabilities.js +122 -0
  169. package/dist/safe-bash/playwright/webmcp-capabilities.js.map +1 -0
  170. package/dist/safe-bash/playwright/workspace-assets.d.ts +5 -0
  171. package/dist/safe-bash/playwright/workspace-assets.d.ts.map +1 -0
  172. package/dist/safe-bash/playwright/workspace-assets.js +17 -0
  173. package/dist/safe-bash/playwright/workspace-assets.js.map +1 -0
  174. package/dist/safe-bash/playwright/workspace.d.ts +3 -0
  175. package/dist/safe-bash/playwright/workspace.d.ts.map +1 -0
  176. package/dist/safe-bash/playwright/workspace.js +48 -0
  177. package/dist/safe-bash/playwright/workspace.js.map +1 -0
  178. package/package.json +2 -2
@@ -11713,7 +11713,7 @@ var Pattern = class {
11713
11713
  }
11714
11714
  }
11715
11715
  };
11716
- async function replacementLength(replacement, match, budget, available2) {
11716
+ async function replacementLength(replacement, match, budget, available2, syntax) {
11717
11717
  let length = 0;
11718
11718
  let tokens2 = 0;
11719
11719
  for (let index = 0; index < replacement.length; index++) {
@@ -11727,7 +11727,9 @@ async function replacementLength(replacement, match, budget, available2) {
11727
11727
  } else if (character === "\\" && index + 1 < replacement.length) {
11728
11728
  budget.step();
11729
11729
  const next = replacement[++index];
11730
- if (next >= "1" && next <= "9") {
11730
+ if (syntax === "awk") {
11731
+ size = next === "&" || next === "\\" ? 1 : 2;
11732
+ } else if (next >= "1" && next <= "9") {
11731
11733
  budget.step();
11732
11734
  size = match.groups[Number(next)]?.length ?? 0;
11733
11735
  }
@@ -11737,7 +11739,7 @@ async function replacementLength(replacement, match, budget, available2) {
11737
11739
  }
11738
11740
  return length;
11739
11741
  }
11740
- async function replacementText(replacement, match, buffer, budget) {
11742
+ async function replacementText(replacement, match, buffer, budget, syntax) {
11741
11743
  let literal = 0;
11742
11744
  let tokens2 = 0;
11743
11745
  for (let index = 0; index < replacement.length; index++) {
@@ -11752,7 +11754,9 @@ async function replacementText(replacement, match, buffer, budget) {
11752
11754
  } else {
11753
11755
  budget.step();
11754
11756
  const next = replacement[++index];
11755
- if (next >= "1" && next <= "9") {
11757
+ if (syntax === "awk") {
11758
+ await buffer.append(replacement, next === "&" || next === "\\" ? index : index - 1, index + 1);
11759
+ } else if (next >= "1" && next <= "9") {
11756
11760
  budget.step();
11757
11761
  await buffer.append(match.groups[Number(next)] ?? "");
11758
11762
  } else await buffer.append(next === "n" ? "\n" : next === "t" ? " " : next);
@@ -11761,7 +11765,7 @@ async function replacementText(replacement, match, buffer, budget) {
11761
11765
  }
11762
11766
  await buffer.append(replacement, literal);
11763
11767
  }
11764
- async function substitute(text3, pattern, replacement, budget, global, occurrence = 1) {
11768
+ async function substitute(text3, pattern, replacement, budget, global, occurrence = 1, syntax = "sed") {
11765
11769
  let search = 0;
11766
11770
  let consumed = 0;
11767
11771
  let previousEnd = -1;
@@ -11782,10 +11786,10 @@ async function substitute(text3, pattern, replacement, budget, global, occurrenc
11782
11786
  if (encountered >= occurrence) {
11783
11787
  const prefix3 = match.start - consumed;
11784
11788
  result.admit(prefix3);
11785
- const length = await replacementLength(replacement, match, budget, result.remaining - prefix3);
11789
+ const length = await replacementLength(replacement, match, budget, result.remaining - prefix3, syntax);
11786
11790
  result.admit(prefix3 + length);
11787
11791
  await result.append(text3, consumed, match.start);
11788
- await replacementText(replacement, match, result, budget);
11792
+ await replacementText(replacement, match, result, budget, syntax);
11789
11793
  consumed = match.end;
11790
11794
  count2++;
11791
11795
  if (!global) break;
@@ -13727,9 +13731,8 @@ var AwkRuntime = class {
13727
13731
  if (name2 === "sub" || name2 === "gsub") {
13728
13732
  const pattern = await this.regex(args[0]);
13729
13733
  const replacement = this.asText(await this.scalarExpression(args[1]));
13730
- if (/\\[1-9]/u.test(replacement)) throw new ProgramError("awk replacement backreference escapes are not supported");
13731
13734
  const target = await this.reference(args[2] ?? { kind: "field", index: { kind: "number", value: 0 } });
13732
- const result2 = await substitute(this.asText(scalar(target.get())), pattern, replacement, this.budget, name2 === "gsub");
13735
+ const result2 = await substitute(this.asText(scalar(target.get())), pattern, replacement, this.budget, name2 === "gsub", 1, "awk");
13733
13736
  if (result2.count) await target.set(string(result2.text));
13734
13737
  return numeric(result2.count);
13735
13738
  }