@shell-shock/core 0.17.8 → 0.17.11

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 (272) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/api.cjs +36 -1
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +2 -77
  5. package/dist/api.d.cts.map +1 -1
  6. package/dist/api.d.mts +2 -76
  7. package/dist/api.d.mts.map +1 -1
  8. package/dist/api.mjs +35 -1
  9. package/dist/api.mjs.map +1 -1
  10. package/dist/components/command-validation-logic.cjs +291 -1
  11. package/dist/components/command-validation-logic.cjs.map +1 -0
  12. package/dist/components/command-validation-logic.d.cts +1 -3
  13. package/dist/components/command-validation-logic.d.cts.map +1 -1
  14. package/dist/components/command-validation-logic.d.mts +1 -3
  15. package/dist/components/command-validation-logic.d.mts.map +1 -1
  16. package/dist/components/command-validation-logic.mjs +288 -1
  17. package/dist/components/command-validation-logic.mjs.map +1 -1
  18. package/dist/components/docs.cjs +265 -1
  19. package/dist/components/docs.cjs.map +1 -0
  20. package/dist/components/docs.d.cts +4 -5
  21. package/dist/components/docs.d.cts.map +1 -1
  22. package/dist/components/docs.d.mts +4 -5
  23. package/dist/components/docs.d.mts.map +1 -1
  24. package/dist/components/docs.mjs +256 -1
  25. package/dist/components/docs.mjs.map +1 -1
  26. package/dist/components/exec-builtin.cjs +429 -15
  27. package/dist/components/exec-builtin.cjs.map +1 -0
  28. package/dist/components/exec-builtin.d.cts +1 -2
  29. package/dist/components/exec-builtin.d.cts.map +1 -1
  30. package/dist/components/exec-builtin.d.mts +1 -2
  31. package/dist/components/exec-builtin.d.mts.map +1 -1
  32. package/dist/components/exec-builtin.mjs +424 -15
  33. package/dist/components/exec-builtin.mjs.map +1 -1
  34. package/dist/components/helpers.cjs +119 -1
  35. package/dist/components/helpers.cjs.map +1 -0
  36. package/dist/components/helpers.d.cts +6 -8
  37. package/dist/components/helpers.d.cts.map +1 -1
  38. package/dist/components/helpers.d.mts +6 -8
  39. package/dist/components/helpers.d.mts.map +1 -1
  40. package/dist/components/helpers.mjs +111 -1
  41. package/dist/components/helpers.mjs.map +1 -1
  42. package/dist/components/index.cjs +58 -1
  43. package/dist/components/index.mjs +10 -1
  44. package/dist/components/options-parser-logic.cjs +959 -5
  45. package/dist/components/options-parser-logic.cjs.map +1 -0
  46. package/dist/components/options-parser-logic.d.cts +8 -9
  47. package/dist/components/options-parser-logic.d.cts.map +1 -1
  48. package/dist/components/options-parser-logic.d.mts +8 -9
  49. package/dist/components/options-parser-logic.d.mts.map +1 -1
  50. package/dist/components/options-parser-logic.mjs +944 -5
  51. package/dist/components/options-parser-logic.mjs.map +1 -1
  52. package/dist/components/state-builtin.cjs +630 -8
  53. package/dist/components/state-builtin.cjs.map +1 -0
  54. package/dist/components/state-builtin.d.cts +4 -5
  55. package/dist/components/state-builtin.d.cts.map +1 -1
  56. package/dist/components/state-builtin.d.mts +4 -5
  57. package/dist/components/state-builtin.d.mts.map +1 -1
  58. package/dist/components/state-builtin.mjs +622 -8
  59. package/dist/components/state-builtin.mjs.map +1 -1
  60. package/dist/components/usage.cjs +116 -1
  61. package/dist/components/usage.cjs.map +1 -0
  62. package/dist/components/usage.d.cts +1 -2
  63. package/dist/components/usage.d.cts.map +1 -1
  64. package/dist/components/usage.d.mts +1 -2
  65. package/dist/components/usage.d.mts.map +1 -1
  66. package/dist/components/usage.mjs +113 -1
  67. package/dist/components/usage.mjs.map +1 -1
  68. package/dist/components/utils-builtin.cjs +839 -33
  69. package/dist/components/utils-builtin.cjs.map +1 -0
  70. package/dist/components/utils-builtin.d.cts +7 -8
  71. package/dist/components/utils-builtin.d.cts.map +1 -1
  72. package/dist/components/utils-builtin.d.mts +7 -8
  73. package/dist/components/utils-builtin.d.mts.map +1 -1
  74. package/dist/components/utils-builtin.mjs +828 -33
  75. package/dist/components/utils-builtin.mjs.map +1 -1
  76. package/dist/config.cjs +65 -1
  77. package/dist/config.cjs.map +1 -0
  78. package/dist/config.d.cts +29 -8
  79. package/dist/config.d.cts.map +1 -1
  80. package/dist/config.d.mts +29 -8
  81. package/dist/config.d.mts.map +1 -1
  82. package/dist/config.mjs +62 -1
  83. package/dist/config.mjs.map +1 -1
  84. package/dist/contexts/command.cjs +26 -1
  85. package/dist/contexts/command.cjs.map +1 -0
  86. package/dist/contexts/command.d.cts.map +1 -1
  87. package/dist/contexts/command.d.mts.map +1 -1
  88. package/dist/contexts/command.mjs +23 -1
  89. package/dist/contexts/command.mjs.map +1 -1
  90. package/dist/contexts/index.cjs +9 -1
  91. package/dist/contexts/index.mjs +4 -1
  92. package/dist/contexts/options.cjs +63 -1
  93. package/dist/contexts/options.cjs.map +1 -0
  94. package/dist/contexts/options.d.cts.map +1 -1
  95. package/dist/contexts/options.d.mts.map +1 -1
  96. package/dist/contexts/options.mjs +57 -1
  97. package/dist/contexts/options.mjs.map +1 -1
  98. package/dist/engine.cjs +138 -0
  99. package/dist/engine.cjs.map +1 -0
  100. package/dist/engine.d.cts +79 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +79 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +136 -0
  105. package/dist/engine.mjs.map +1 -0
  106. package/dist/helpers/automd.cjs +70 -1
  107. package/dist/helpers/automd.cjs.map +1 -0
  108. package/dist/helpers/automd.mjs +69 -1
  109. package/dist/helpers/automd.mjs.map +1 -1
  110. package/dist/helpers/docs-helpers.cjs +23 -1
  111. package/dist/helpers/docs-helpers.cjs.map +1 -0
  112. package/dist/helpers/docs-helpers.mjs +22 -1
  113. package/dist/helpers/docs-helpers.mjs.map +1 -1
  114. package/dist/helpers/get-framework.cjs +24 -0
  115. package/dist/helpers/get-framework.cjs.map +1 -0
  116. package/dist/helpers/get-framework.mjs +24 -0
  117. package/dist/helpers/get-framework.mjs.map +1 -0
  118. package/dist/helpers/paths.cjs +137 -1
  119. package/dist/helpers/paths.cjs.map +1 -0
  120. package/dist/helpers/paths.mjs +133 -1
  121. package/dist/helpers/paths.mjs.map +1 -1
  122. package/dist/helpers/persistence.cjs +113 -1
  123. package/dist/helpers/persistence.cjs.map +1 -0
  124. package/dist/helpers/persistence.mjs +112 -1
  125. package/dist/helpers/persistence.mjs.map +1 -1
  126. package/dist/helpers/update-package-json.cjs +65 -1
  127. package/dist/helpers/update-package-json.cjs.map +1 -0
  128. package/dist/helpers/update-package-json.mjs +63 -1
  129. package/dist/helpers/update-package-json.mjs.map +1 -1
  130. package/dist/helpers/utilities.cjs +95 -1
  131. package/dist/helpers/utilities.cjs.map +1 -0
  132. package/dist/helpers/utilities.mjs +93 -1
  133. package/dist/helpers/utilities.mjs.map +1 -1
  134. package/dist/helpers/validations.cjs +71 -1
  135. package/dist/helpers/validations.cjs.map +1 -0
  136. package/dist/helpers/validations.mjs +69 -1
  137. package/dist/helpers/validations.mjs.map +1 -1
  138. package/dist/index.cjs +123 -1
  139. package/dist/index.cjs.map +1 -0
  140. package/dist/index.d.cts +80 -5
  141. package/dist/index.d.cts.map +1 -0
  142. package/dist/index.d.mts +80 -5
  143. package/dist/index.d.mts.map +1 -0
  144. package/dist/index.mjs +119 -1
  145. package/dist/index.mjs.map +1 -0
  146. package/dist/package.cjs +12 -0
  147. package/dist/package.cjs.map +1 -0
  148. package/dist/package.mjs +6 -0
  149. package/dist/package.mjs.map +1 -0
  150. package/dist/plugin-utils/compute-bin.cjs +48 -1
  151. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  152. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  153. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  154. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  155. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  156. package/dist/plugin-utils/compute-bin.mjs +47 -1
  157. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  158. package/dist/plugin-utils/context-helpers.cjs +224 -1
  159. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  160. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  161. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  162. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  163. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  164. package/dist/plugin-utils/context-helpers.mjs +214 -1
  165. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  166. package/dist/plugin-utils/deepkit.cjs +70 -1
  167. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  168. package/dist/plugin-utils/deepkit.d.cts +5 -5
  169. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  170. package/dist/plugin-utils/deepkit.d.mts +5 -5
  171. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  172. package/dist/plugin-utils/deepkit.mjs +68 -1
  173. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  174. package/dist/plugin-utils/description-helpers.cjs +112 -2
  175. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  176. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  177. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  178. package/dist/plugin-utils/description-helpers.mjs +107 -2
  179. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  180. package/dist/plugin-utils/get-command-tree.cjs +118 -1
  181. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  182. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  183. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  184. package/dist/plugin-utils/get-command-tree.mjs +114 -1
  185. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  186. package/dist/plugin-utils/index.cjs +39 -1
  187. package/dist/plugin-utils/index.d.cts +2 -2
  188. package/dist/plugin-utils/index.d.mts +2 -2
  189. package/dist/plugin-utils/index.mjs +10 -1
  190. package/dist/plugin-utils/reflect.cjs +52 -1
  191. package/dist/plugin-utils/reflect.cjs.map +1 -0
  192. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  193. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  194. package/dist/plugin-utils/reflect.mjs +50 -1
  195. package/dist/plugin-utils/reflect.mjs.map +1 -1
  196. package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
  197. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  198. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  199. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  200. package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
  201. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  202. package/dist/plugin-utils/type-checks.cjs +222 -1
  203. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  204. package/dist/plugin-utils/type-checks.d.cts +5 -5
  205. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  206. package/dist/plugin-utils/type-checks.d.mts +5 -5
  207. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  208. package/dist/plugin-utils/type-checks.mjs +217 -1
  209. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  210. package/dist/plugin.cjs +495 -4
  211. package/dist/plugin.cjs.map +1 -0
  212. package/dist/plugin.d.cts.map +1 -1
  213. package/dist/plugin.d.mts.map +1 -1
  214. package/dist/plugin.mjs +488 -4
  215. package/dist/plugin.mjs.map +1 -1
  216. package/dist/resolver/helpers.cjs +182 -1
  217. package/dist/resolver/helpers.cjs.map +1 -0
  218. package/dist/resolver/helpers.mjs +178 -1
  219. package/dist/resolver/helpers.mjs.map +1 -1
  220. package/dist/resolver/resolve.cjs +479 -1
  221. package/dist/resolver/resolve.cjs.map +1 -0
  222. package/dist/resolver/resolve.mjs +478 -1
  223. package/dist/resolver/resolve.mjs.map +1 -1
  224. package/dist/types/command.cjs +402 -1
  225. package/dist/types/command.cjs.map +1 -0
  226. package/dist/types/command.d.cts +61 -119
  227. package/dist/types/command.d.cts.map +1 -1
  228. package/dist/types/command.d.mts +61 -119
  229. package/dist/types/command.d.mts.map +1 -1
  230. package/dist/types/command.mjs +367 -1
  231. package/dist/types/command.mjs.map +1 -1
  232. package/dist/types/config.cjs +175 -1
  233. package/dist/types/config.cjs.map +1 -0
  234. package/dist/types/config.d.cts +19 -12
  235. package/dist/types/config.d.cts.map +1 -1
  236. package/dist/types/config.d.mts +19 -12
  237. package/dist/types/config.d.mts.map +1 -1
  238. package/dist/types/config.mjs +163 -1
  239. package/dist/types/config.mjs.map +1 -1
  240. package/dist/types/context.cjs +45 -1
  241. package/dist/types/context.cjs.map +1 -0
  242. package/dist/types/context.d.cts +3 -2
  243. package/dist/types/context.d.cts.map +1 -1
  244. package/dist/types/context.d.mts +3 -2
  245. package/dist/types/context.d.mts.map +1 -1
  246. package/dist/types/context.mjs +40 -1
  247. package/dist/types/context.mjs.map +1 -1
  248. package/dist/types/env.cjs +53 -1
  249. package/dist/types/env.cjs.map +1 -0
  250. package/dist/types/env.d.cts +1 -1
  251. package/dist/types/env.d.cts.map +1 -1
  252. package/dist/types/env.d.mts +1 -1
  253. package/dist/types/env.d.mts.map +1 -1
  254. package/dist/types/env.mjs +50 -1
  255. package/dist/types/env.mjs.map +1 -1
  256. package/dist/types/index.cjs +53 -1
  257. package/dist/types/index.d.cts +4 -4
  258. package/dist/types/index.d.mts +4 -4
  259. package/dist/types/index.mjs +6 -1
  260. package/dist/types/options.cjs +13 -1
  261. package/dist/types/options.cjs.map +1 -0
  262. package/dist/types/options.d.cts.map +1 -1
  263. package/dist/types/options.d.mts.map +1 -1
  264. package/dist/types/options.mjs +10 -1
  265. package/dist/types/options.mjs.map +1 -1
  266. package/package.json +43 -34
  267. package/dist/resolver/deepkit.cjs +0 -1
  268. package/dist/resolver/deepkit.mjs +0 -2
  269. package/dist/resolver/deepkit.mjs.map +0 -1
  270. package/dist/resolver/module.cjs +0 -1
  271. package/dist/resolver/module.mjs +0 -2
  272. package/dist/resolver/module.mjs.map +0 -1
@@ -1,4 +1,81 @@
1
- import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{ReflectionKind as n}from"@powerlines/deepkit/vendor/type";import r from"defu";import{Show as i,code as a,splitProps as o}from"@alloy-js/core";import{Spacing as s}from"@powerlines/plugin-alloy/core/components/spacing";import{FunctionDeclaration as c,InterfaceDeclaration as l,InterfaceMember as u,VarDeclaration as d}from"@alloy-js/typescript";import{BuiltinFile as f}from"@powerlines/plugin-alloy/typescript/components/builtin-file";import{TSDoc as p,TSDocDefaultValue as m,TSDocParam as h,TSDocReturns as g}from"@powerlines/plugin-alloy/typescript/components/tsdoc";const _=[`T`,`K`,()=>v,()=>y,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],v=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],y=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`],b=[()=>_,`id`,`description`,`ExecBuiltinProps`,`P!P.".#Jo!#Mw$y`];function x(_){let[{children:v},y]=o(_,[`children`]);return e(f,t({id:`exec`,description:`A module to handle command execution in a Shell Shock application.`},y,{get imports(){return r(y.imports??{},{"node:path":[`basename`,`extname`,`dirname`,`join`],"node:fs":[`existsSync`],"node:child_process":[{name:`spawn`,alias:`_spawn`},`execFileSync`],"node:stream":[{name:`Stream`,default:!0,type:!0}]})},get builtinImports(){return r(y.builtinImports??{},{env:[`isWindows`,`env`]})},get children(){return[e(c,{name:`resolveCommandEnv`,parameters:[{name:`params`,type:`{ argv: string[]; env?: NodeJS.ProcessEnv; }`}],returnType:`NodeJS.ProcessEnv`,children:a`const argv = params.argv;
1
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
2
+ import { Show, code, splitProps } from "@alloy-js/core";
3
+ import defu$1 from "defu";
4
+ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
5
+ import { FunctionDeclaration, InterfaceDeclaration, InterfaceMember, VarDeclaration } from "@alloy-js/typescript";
6
+ import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
7
+ import { TSDoc, TSDocDefaultValue, TSDocParam, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
8
+
9
+ //#region src/components/exec-builtin.tsx
10
+ const __ΩOmit = [
11
+ "T",
12
+ "K",
13
+ () => __ΩPick,
14
+ () => __ΩExclude,
15
+ "Omit",
16
+ "b!b\"e!!e!!ge!\"o$#o##w%y"
17
+ ];
18
+ const __ΩPick = [
19
+ "T",
20
+ "K",
21
+ "Pick",
22
+ "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
23
+ ];
24
+ const __ΩExclude = [
25
+ "T",
26
+ "U",
27
+ "Exclude",
28
+ "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
29
+ ];
30
+ const __ΩExecBuiltinProps = [
31
+ () => __ΩOmit,
32
+ "id",
33
+ "description",
34
+ "ExecBuiltinProps",
35
+ "P!P.\".#Jo!#Mw$y"
36
+ ];
37
+ /**
38
+ * A built-in module for handling command execution in Shell Shock.
39
+ */
40
+ function ExecBuiltin(props) {
41
+ const [{ children }, rest] = splitProps(props, ["children"]);
42
+ return createComponent(BuiltinFile, mergeProps({
43
+ id: "exec",
44
+ description: "A module to handle command execution in a Shell Shock application."
45
+ }, rest, {
46
+ get imports() {
47
+ return defu$1(rest.imports ?? {}, {
48
+ "node:path": [
49
+ "basename",
50
+ "extname",
51
+ "dirname",
52
+ "join"
53
+ ],
54
+ "node:fs": ["existsSync"],
55
+ "node:child_process": [{
56
+ name: "spawn",
57
+ alias: "_spawn"
58
+ }, "execFileSync"],
59
+ "node:stream": [{
60
+ name: "Stream",
61
+ default: true,
62
+ type: true
63
+ }]
64
+ });
65
+ },
66
+ get builtinImports() {
67
+ return defu$1(rest.builtinImports ?? {}, { env: ["isWindows", "env"] });
68
+ },
69
+ get children() {
70
+ return [
71
+ createComponent(FunctionDeclaration, {
72
+ name: "resolveCommandEnv",
73
+ parameters: [{
74
+ name: "params",
75
+ type: "{ argv: string[]; env?: NodeJS.ProcessEnv; }"
76
+ }],
77
+ returnType: "NodeJS.ProcessEnv",
78
+ children: code`const argv = params.argv;
2
79
  const shouldSuppressNpmFund = (() => {
3
80
  const cmd = basename(argv[0] ?? "");
4
81
  if (cmd === "npm" || cmd === "npm.cmd" || cmd === "npm.exe") {
@@ -24,12 +101,32 @@ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";imp
24
101
  result.NPM_CONFIG_FUND ??= "false";
25
102
  result.npm_config_fund ??= "false";
26
103
  }
27
- return result; `}),e(s,{}),e(c,{name:`isWindowsBatchCommand`,parameters:[{name:`resolvedCommand`,type:`string`}],returnType:`boolean`,children:a`if (!isWindows) {
104
+ return result; `
105
+ }),
106
+ createComponent(Spacing, {}),
107
+ createComponent(FunctionDeclaration, {
108
+ name: "isWindowsBatchCommand",
109
+ parameters: [{
110
+ name: "resolvedCommand",
111
+ type: "string"
112
+ }],
113
+ returnType: "boolean",
114
+ children: code`if (!isWindows) {
28
115
  return false;
29
116
  }
30
117
  const ext = extname(resolvedCommand).toLowerCase();
31
118
 
32
- return ext === ".cmd" || ext === ".bat"; `}),e(s,{}),e(c,{name:`escapeForCmdExe`,parameters:[{name:`arg`,type:`string`}],returnType:`string`,children:a`if (/[&|<>^%\\\\r\\\\n]/.test(arg)) {
119
+ return ext === ".cmd" || ext === ".bat"; `
120
+ }),
121
+ createComponent(Spacing, {}),
122
+ createComponent(FunctionDeclaration, {
123
+ name: "escapeForCmdExe",
124
+ parameters: [{
125
+ name: "arg",
126
+ type: "string"
127
+ }],
128
+ returnType: "string",
129
+ children: code`if (/[&|<>^%\\\\r\\\\n]/.test(arg)) {
33
130
  throw new Error(
34
131
  \`Unsafe Windows cmd.exe argument detected: \${JSON.stringify(arg)}. \` +
35
132
  "Pass an explicit shell-wrapper argv at the call site instead."
@@ -38,9 +135,33 @@ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";imp
38
135
  if (!arg.includes(" ") && !arg.includes('"')) {
39
136
  return arg;
40
137
  }
41
- return \`"\${arg.replace(/"/g, '""')}"\`; `}),e(s,{}),e(c,{name:`buildCmdExeCommandLine`,parameters:[{name:`resolvedCommand`,type:`string`},{name:`args`,type:`string[]`}],returnType:`string`,children:a`return [escapeForCmdExe(resolvedCommand), ...args.map(escapeForCmdExe)].join(
138
+ return \`"\${arg.replace(/"/g, '""')}"\`; `
139
+ }),
140
+ createComponent(Spacing, {}),
141
+ createComponent(FunctionDeclaration, {
142
+ name: "buildCmdExeCommandLine",
143
+ parameters: [{
144
+ name: "resolvedCommand",
145
+ type: "string"
146
+ }, {
147
+ name: "args",
148
+ type: "string[]"
149
+ }],
150
+ returnType: "string",
151
+ children: code`return [escapeForCmdExe(resolvedCommand), ...args.map(escapeForCmdExe)].join(
42
152
  " "
43
- ); `}),e(s,{}),e(c,{name:`resolveNpmArgvForWindows`,doc:`On Windows, Node 18.20.2+ (CVE-2024-27980) rejects spawning .cmd/.bat directly without shell, causing EINVAL. Resolve npm/npx to node + cli script so we spawn node.exe instead of npm.cmd.`,parameters:[{name:`argv`,type:`string[]`}],returnType:`string[] | null`,children:a`if (!isWindows || argv.length === 0) {
153
+ ); `
154
+ }),
155
+ createComponent(Spacing, {}),
156
+ createComponent(FunctionDeclaration, {
157
+ name: "resolveNpmArgvForWindows",
158
+ doc: "On Windows, Node 18.20.2+ (CVE-2024-27980) rejects spawning .cmd/.bat directly without shell, causing EINVAL. Resolve npm/npx to node + cli script so we spawn node.exe instead of npm.cmd.",
159
+ parameters: [{
160
+ name: "argv",
161
+ type: "string[]"
162
+ }],
163
+ returnType: "string[] | null",
164
+ children: code`if (!isWindows || argv.length === 0) {
44
165
  return null;
45
166
  }
46
167
  const base = basename(argv[0] ?? "")
@@ -60,7 +181,18 @@ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";imp
60
181
 
61
182
  return [shimmedCommand, ...argv.slice(1)];
62
183
  }
63
- return [process.execPath, cliPath, ...argv.slice(1)]; `}),e(s,{}),e(c,{name:`resolveCommand`,doc:`Resolves a command for Windows compatibility. On Windows, non-.exe commands (like pnpm, yarn) are resolved to .cmd; npm/npx are handled by resolveNpmArgvForWindows to avoid spawn EINVAL (no direct .cmd).`,parameters:[{name:`command`,type:`string`}],returnType:`string`,children:a`if (!isWindows) {
184
+ return [process.execPath, cliPath, ...argv.slice(1)]; `
185
+ }),
186
+ createComponent(Spacing, {}),
187
+ createComponent(FunctionDeclaration, {
188
+ name: "resolveCommand",
189
+ doc: "Resolves a command for Windows compatibility. On Windows, non-.exe commands (like pnpm, yarn) are resolved to .cmd; npm/npx are handled by resolveNpmArgvForWindows to avoid spawn EINVAL (no direct .cmd).",
190
+ parameters: [{
191
+ name: "command",
192
+ type: "string"
193
+ }],
194
+ returnType: "string",
195
+ children: code`if (!isWindows) {
64
196
  return command;
65
197
  }
66
198
  const base = basename(command).toLowerCase();
@@ -70,13 +202,33 @@ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";imp
70
202
  if (["pnpm", "yarn"].includes(base)) {
71
203
  return \`\${command}.cmd\`;
72
204
  }
73
- return command; `}),e(s,{}),e(c,{name:`resolveCommandStdio`,parameters:[{name:`params`,type:`{ hasInput: boolean; preferInherit: boolean; }`}],returnType:`["pipe" | "inherit" | "ignore", "pipe", "pipe"]`,children:a`const stdin = params.hasInput
205
+ return command; `
206
+ }),
207
+ createComponent(Spacing, {}),
208
+ createComponent(FunctionDeclaration, {
209
+ name: "resolveCommandStdio",
210
+ parameters: [{
211
+ name: "params",
212
+ type: "{ hasInput: boolean; preferInherit: boolean; }"
213
+ }],
214
+ returnType: "[\"pipe\" | \"inherit\" | \"ignore\", \"pipe\", \"pipe\"]",
215
+ children: code`const stdin = params.hasInput
74
216
  ? "pipe"
75
217
  : params.preferInherit
76
218
  ? "inherit"
77
219
  : "pipe";
78
220
 
79
- return [stdin, "pipe", "pipe"]; `}),e(s,{}),e(c,{name:`resolveProcessExitCode`,parameters:[{name:`params`,type:`{ explicitCode: number | null | undefined; childExitCode: number | null | undefined; resolvedSignal: NodeJS.Signals | null; usesWindowsExitCodeShim: boolean; timedOut: boolean; noOutputTimedOut: boolean; killIssuedByTimeout: boolean; }`}],returnType:`number | null`,children:a`return (
221
+ return [stdin, "pipe", "pipe"]; `
222
+ }),
223
+ createComponent(Spacing, {}),
224
+ createComponent(FunctionDeclaration, {
225
+ name: "resolveProcessExitCode",
226
+ parameters: [{
227
+ name: "params",
228
+ type: "{ explicitCode: number | null | undefined; childExitCode: number | null | undefined; resolvedSignal: NodeJS.Signals | null; usesWindowsExitCodeShim: boolean; timedOut: boolean; noOutputTimedOut: boolean; killIssuedByTimeout: boolean; }"
229
+ }],
230
+ returnType: "number | null",
231
+ children: code`return (
80
232
  params.explicitCode ??
81
233
  params.childExitCode ??
82
234
  (params.usesWindowsExitCodeShim &&
@@ -86,17 +238,189 @@ import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";imp
86
238
  !params.killIssuedByTimeout
87
239
  ? 0
88
240
  : null)
89
- ); `}),e(s,{}),e(c,{name:`shouldSpawnWithShell`,parameters:[{name:`params`,type:`{ resolvedCommand: string; platform: NodeJS.Platform; }`}],returnType:`boolean`,children:a`// SECURITY: never enable \`shell\` for argv-based execution.
241
+ ); `
242
+ }),
243
+ createComponent(Spacing, {}),
244
+ createComponent(FunctionDeclaration, {
245
+ name: "shouldSpawnWithShell",
246
+ parameters: [{
247
+ name: "params",
248
+ type: "{ resolvedCommand: string; platform: NodeJS.Platform; }"
249
+ }],
250
+ returnType: "boolean",
251
+ children: code`// SECURITY: never enable \`shell\` for argv-based execution.
90
252
  // \`shell\` routes through cmd.exe on Windows, which turns untrusted argv values
91
253
  // (like chat prompts passed as CLI args) into command-injection primitives.
92
254
  // If you need a shell, use an explicit shell-wrapper argv (e.g. \`cmd.exe /c ...\`)
93
255
  // and validate/escape at the call site.
94
256
  void params;
95
- return false; `}),e(s,{}),e(p,{heading:`The result of a spawn operation.`}),e(l,{export:!0,name:`SpawnResult`,get children(){return[e(p,{heading:`The PID of the spawned child process, if available.`}),e(u,{name:`pid`,optional:!0,type:`number`}),e(s,{}),e(p,{heading:`The standard output produced by the child process.`}),e(u,{name:`stdout`,type:`string`}),e(s,{}),e(p,{heading:`The standard error produced by the child process.`}),e(u,{name:`stderr`,type:`string`}),e(s,{}),e(p,{heading:`The exit code of the child process, if available.`}),e(u,{name:`code`,type:`number | null`}),e(s,{}),e(p,{heading:`The signal that caused the child process to terminate, if it was killed by a signal.`}),e(u,{name:`signal`,type:`NodeJS.Signals | null`}),e(s,{}),e(p,{heading:`Whether the child process was killed.`}),e(u,{name:`killed`,type:`boolean`}),e(s,{}),e(p,{heading:`The reason for the child process termination.`}),e(u,{name:`termination`,type:a`"exit" | "timeout" | "no-output-timeout" | "signal"`}),e(s,{}),e(p,{heading:`Whether the child process timed out due to no output.`}),e(u,{name:`noOutputTimedOut`,optional:!0,type:`boolean`})]}}),e(s,{}),e(p,{heading:`Options for spawning a child process.`}),e(l,{export:!0,name:`SpawnOptions`,get children(){return[e(p,{heading:"The timeout in milliseconds for the spawn operation. If the process runs longer than this, it will be killed and the spawn promise will reject. This can also be provided as a number directly to the spawn function for convenience. Providing \\`-1\\` will disable the timeout.",get children(){return e(m,{get type(){return n.number},defaultValue:`300000`})}}),e(u,{name:`timeoutMs`,optional:!0,type:`number`}),e(s,{}),e(p,{heading:`The current working directory of the child process.`}),e(u,{name:`cwd`,optional:!0,type:`string`}),e(s,{}),e(p,{heading:`The input to be passed to the child process.`}),e(u,{name:`input`,optional:!0,type:`string`}),e(s,{}),e(p,{heading:`The environment variables for the child process.`}),e(u,{name:`env`,optional:!0,type:`NodeJS.ProcessEnv`}),e(s,{}),e(p,{heading:`Whether to pass arguments to the child process verbatim on Windows.`}),e(u,{name:`windowsVerbatimArguments`,optional:!0,type:`boolean`}),e(s,{}),e(p,{heading:`The timeout in milliseconds for the child process to produce output on stdout or stderr. If the process produces no output for this duration, it will be killed and the spawn promise will reject with a no-output-timeout termination reason.`}),e(u,{name:`noOutputTimeoutMs`,optional:!0,type:`number`})]}}),e(s,{}),e(d,{const:!0,name:`WINDOWS_CLOSE_STATE_SETTLE_TIMEOUT_MS`,initializer:a`250`}),e(s,{}),e(d,{const:!0,name:`WINDOWS_CLOSE_STATE_POLL_MS`,initializer:a`10`}),e(s,{}),e(p,{heading:`Spawns a child process with the given arguments and options, returning a promise that resolves with the result of the spawn operation.`,get children(){return[e(h,{name:`argv`,children:`The command and its arguments to spawn.`}),e(h,{name:`optionsOrTimeoutMs`,children:"The options for spawning the command, or a number representing the timeout in milliseconds. This allows for a convenient shorthand when only a timeout is needed. Providing `-1` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used."}),e(g,{children:`A promise that resolves with the result of the spawn operation, including stdout, stderr, exit code, signal, and termination reason.`})]}}),e(c,{export:!0,async:!0,name:`spawn`,parameters:[{name:`argv`,type:`string[]`},{name:`optionsOrTimeoutMs`,type:`number | SpawnOptions`,default:`300000`}],returnType:`Promise<SpawnResult>`,children:a`const options: SpawnOptions =
257
+ return false; `
258
+ }),
259
+ createComponent(Spacing, {}),
260
+ createComponent(TSDoc, { heading: "The result of a spawn operation." }),
261
+ createComponent(InterfaceDeclaration, {
262
+ "export": true,
263
+ name: "SpawnResult",
264
+ get children() {
265
+ return [
266
+ createComponent(TSDoc, { heading: "The PID of the spawned child process, if available." }),
267
+ createComponent(InterfaceMember, {
268
+ name: "pid",
269
+ optional: true,
270
+ type: "number"
271
+ }),
272
+ createComponent(Spacing, {}),
273
+ createComponent(TSDoc, { heading: "The standard output produced by the child process." }),
274
+ createComponent(InterfaceMember, {
275
+ name: "stdout",
276
+ type: "string"
277
+ }),
278
+ createComponent(Spacing, {}),
279
+ createComponent(TSDoc, { heading: "The standard error produced by the child process." }),
280
+ createComponent(InterfaceMember, {
281
+ name: "stderr",
282
+ type: "string"
283
+ }),
284
+ createComponent(Spacing, {}),
285
+ createComponent(TSDoc, { heading: "The exit code of the child process, if available." }),
286
+ createComponent(InterfaceMember, {
287
+ name: "code",
288
+ type: "number | null"
289
+ }),
290
+ createComponent(Spacing, {}),
291
+ createComponent(TSDoc, { heading: "The signal that caused the child process to terminate, if it was killed by a signal." }),
292
+ createComponent(InterfaceMember, {
293
+ name: "signal",
294
+ type: "NodeJS.Signals | null"
295
+ }),
296
+ createComponent(Spacing, {}),
297
+ createComponent(TSDoc, { heading: "Whether the child process was killed." }),
298
+ createComponent(InterfaceMember, {
299
+ name: "killed",
300
+ type: "boolean"
301
+ }),
302
+ createComponent(Spacing, {}),
303
+ createComponent(TSDoc, { heading: "The reason for the child process termination." }),
304
+ createComponent(InterfaceMember, {
305
+ name: "termination",
306
+ type: code`"exit" | "timeout" | "no-output-timeout" | "signal"`
307
+ }),
308
+ createComponent(Spacing, {}),
309
+ createComponent(TSDoc, { heading: "Whether the child process timed out due to no output." }),
310
+ createComponent(InterfaceMember, {
311
+ name: "noOutputTimedOut",
312
+ optional: true,
313
+ type: "boolean"
314
+ })
315
+ ];
316
+ }
317
+ }),
318
+ createComponent(Spacing, {}),
319
+ createComponent(TSDoc, { heading: "Options for spawning a child process." }),
320
+ createComponent(InterfaceDeclaration, {
321
+ "export": true,
322
+ name: "SpawnOptions",
323
+ get children() {
324
+ return [
325
+ createComponent(TSDoc, {
326
+ heading: "The timeout in milliseconds for the spawn operation. If the process runs longer than this, it will be killed and the spawn promise will reject. This can also be provided as a number directly to the spawn function for convenience. Providing \\`-1\\` will disable the timeout.",
327
+ get children() {
328
+ return createComponent(TSDocDefaultValue, {
329
+ type: "number",
330
+ defaultValue: "300_000"
331
+ });
332
+ }
333
+ }),
334
+ createComponent(InterfaceMember, {
335
+ name: "timeoutMs",
336
+ optional: true,
337
+ type: "number"
338
+ }),
339
+ createComponent(Spacing, {}),
340
+ createComponent(TSDoc, { heading: "The current working directory of the child process." }),
341
+ createComponent(InterfaceMember, {
342
+ name: "cwd",
343
+ optional: true,
344
+ type: "string"
345
+ }),
346
+ createComponent(Spacing, {}),
347
+ createComponent(TSDoc, { heading: "The input to be passed to the child process." }),
348
+ createComponent(InterfaceMember, {
349
+ name: "input",
350
+ optional: true,
351
+ type: "string"
352
+ }),
353
+ createComponent(Spacing, {}),
354
+ createComponent(TSDoc, { heading: "The environment variables for the child process." }),
355
+ createComponent(InterfaceMember, {
356
+ name: "env",
357
+ optional: true,
358
+ type: "NodeJS.ProcessEnv"
359
+ }),
360
+ createComponent(Spacing, {}),
361
+ createComponent(TSDoc, { heading: "Whether to pass arguments to the child process verbatim on Windows." }),
362
+ createComponent(InterfaceMember, {
363
+ name: "windowsVerbatimArguments",
364
+ optional: true,
365
+ type: "boolean"
366
+ }),
367
+ createComponent(Spacing, {}),
368
+ createComponent(TSDoc, { heading: "The timeout in milliseconds for the child process to produce output on stdout or stderr. If the process produces no output for this duration, it will be killed and the spawn promise will reject with a no-output-timeout termination reason." }),
369
+ createComponent(InterfaceMember, {
370
+ name: "noOutputTimeoutMs",
371
+ optional: true,
372
+ type: "number"
373
+ })
374
+ ];
375
+ }
376
+ }),
377
+ createComponent(Spacing, {}),
378
+ createComponent(VarDeclaration, {
379
+ "const": true,
380
+ name: "WINDOWS_CLOSE_STATE_SETTLE_TIMEOUT_MS",
381
+ initializer: code`250`
382
+ }),
383
+ createComponent(Spacing, {}),
384
+ createComponent(VarDeclaration, {
385
+ "const": true,
386
+ name: "WINDOWS_CLOSE_STATE_POLL_MS",
387
+ initializer: code`10`
388
+ }),
389
+ createComponent(Spacing, {}),
390
+ createComponent(TSDoc, {
391
+ heading: "Spawns a child process with the given arguments and options, returning a promise that resolves with the result of the spawn operation.",
392
+ get children() {
393
+ return [
394
+ createComponent(TSDocParam, {
395
+ name: "argv",
396
+ children: "The command and its arguments to spawn."
397
+ }),
398
+ createComponent(TSDocParam, {
399
+ name: "optionsOrTimeoutMs",
400
+ children: `The options for spawning the command, or a number representing the timeout in milliseconds. This allows for a convenient shorthand when only a timeout is needed. Providing \`-1\` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used.`
401
+ }),
402
+ createComponent(TSDocReturns, { children: "A promise that resolves with the result of the spawn operation, including stdout, stderr, exit code, signal, and termination reason." })
403
+ ];
404
+ }
405
+ }),
406
+ createComponent(FunctionDeclaration, {
407
+ "export": true,
408
+ async: true,
409
+ name: "spawn",
410
+ parameters: [{
411
+ name: "argv",
412
+ type: "string[]"
413
+ }, {
414
+ name: "optionsOrTimeoutMs",
415
+ type: "number | SpawnOptions",
416
+ default: "300_000"
417
+ }],
418
+ returnType: "Promise<SpawnResult>",
419
+ children: code`const options: SpawnOptions =
96
420
  typeof optionsOrTimeoutMs === "number"
97
421
  ? { timeoutMs: optionsOrTimeoutMs }
98
422
  : optionsOrTimeoutMs;
99
- const { timeoutMs = 300000, cwd, input, noOutputTimeoutMs } = options;
423
+ const { timeoutMs = 300_000, cwd, input, noOutputTimeoutMs } = options;
100
424
 
101
425
  const resolvedArgv =
102
426
  isWindows
@@ -315,19 +639,104 @@ return new Promise((resolve, reject) => {
315
639
  };
316
640
  waitForExitState();
317
641
  });
318
- });`}),e(s,{}),e(p,{heading:`A helper function that executes a command and returns its stdout.`,get children(){return[e(h,{name:`argv`,children:"The command and its arguments to spawn. This is passed directly to the spawn function. Remember that on Windows, commands like `npm` or `pnpm` will be resolved to their .cmd shims, so you can just pass `npm` without worrying about the extension."}),e(h,{name:`optionsOrTimeoutMs`,children:"The options for spawning the command, or a number representing the timeout in milliseconds. This is passed directly to the spawn function. Providing `-1` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used."}),e(g,{children:`A promise that resolves with the result of the spawn operation if the command exits with code 0, or rejects with an error if the command exits with a non-zero code or if there is a problem spawning the process.`})]}}),e(c,{export:!0,async:!0,name:`exec`,parameters:[{name:`argv`,type:`string[]`},{name:`optionsOrTimeoutMs`,type:`number | SpawnOptions`,default:`300000`}],returnType:`Promise<string>`,children:a`const spawnResult = await spawn(argv, optionsOrTimeoutMs);
642
+ });`
643
+ }),
644
+ createComponent(Spacing, {}),
645
+ createComponent(TSDoc, {
646
+ heading: "A helper function that executes a command and returns its stdout.",
647
+ get children() {
648
+ return [
649
+ createComponent(TSDocParam, {
650
+ name: "argv",
651
+ children: `The command and its arguments to spawn. This is passed directly to the spawn function. Remember that on Windows, commands like \`npm\` or \`pnpm\` will be resolved to their .cmd shims, so you can just pass \`npm\` without worrying about the extension.`
652
+ }),
653
+ createComponent(TSDocParam, {
654
+ name: "optionsOrTimeoutMs",
655
+ children: `The options for spawning the command, or a number representing the timeout in milliseconds. This is passed directly to the spawn function. Providing \`-1\` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used.`
656
+ }),
657
+ createComponent(TSDocReturns, { children: "A promise that resolves with the result of the spawn operation if the command exits with code 0, or rejects with an error if the command exits with a non-zero code or if there is a problem spawning the process." })
658
+ ];
659
+ }
660
+ }),
661
+ createComponent(FunctionDeclaration, {
662
+ "export": true,
663
+ async: true,
664
+ name: "exec",
665
+ parameters: [{
666
+ name: "argv",
667
+ type: "string[]"
668
+ }, {
669
+ name: "optionsOrTimeoutMs",
670
+ type: "number | SpawnOptions",
671
+ default: "300_000"
672
+ }],
673
+ returnType: "Promise<string>",
674
+ children: code`const spawnResult = await spawn(argv, optionsOrTimeoutMs);
319
675
  if (spawnResult.code !== 0) {
320
676
  throw Object.assign(new Error(
321
677
  \`Command "\${argv.join(" ")}" exited with code \${spawnResult.code} and signal \${spawnResult.signal}\`
322
678
  ), spawnResult);
323
679
  }
324
680
 
325
- return spawnResult.stdout.trim(); `}),e(s,{}),e(p,{heading:"A helper function that executes a command synchronously and returns its stdout. This is a thin wrapper around \\`child_process.execFileSync\\` with some added Windows compatibility handling.",get children(){return[e(h,{name:`argv`,children:"The command and its arguments to spawn. This is passed directly to `execFileSync` after Windows-specific resolution. Remember that on Windows, commands like `npm` or `pnpm` will be resolved to their .cmd shims, so you can just pass `npm` without worrying about the extension."}),e(h,{name:`options`,children:"The options for spawning the command. This is passed directly to `execFileSync` after some processing. The timeout option is supported, but note that it will throw an error if the process runs longer than the specified timeout. If no options are provided, a default timeout of 5 minutes will be used."}),e(g,{children:`The standard output produced by the command if it exits with code 0. If the command exits with a non-zero code or if there is a problem spawning the process, an error will be thrown.`})]}}),e(c,{export:!0,name:`execSync`,parameters:[{name:`argv`,type:`string[]`},{name:`options`,type:`SpawnOptions`,default:`{}`}],returnType:`string`,children:a`return execFileSync(argv.length > 0 ? argv[0] : "", argv.slice(1), {
681
+ return spawnResult.stdout.trim(); `
682
+ }),
683
+ createComponent(Spacing, {}),
684
+ createComponent(TSDoc, {
685
+ heading: "A helper function that executes a command synchronously and returns its stdout. This is a thin wrapper around \\`child_process.execFileSync\\` with some added Windows compatibility handling.",
686
+ get children() {
687
+ return [
688
+ createComponent(TSDocParam, {
689
+ name: "argv",
690
+ children: `The command and its arguments to spawn. This is passed directly to \`execFileSync\` after Windows-specific resolution. Remember that on Windows, commands like \`npm\` or \`pnpm\` will be resolved to their .cmd shims, so you can just pass \`npm\` without worrying about the extension.`
691
+ }),
692
+ createComponent(TSDocParam, {
693
+ name: "options",
694
+ children: `The options for spawning the command. This is passed directly to \`execFileSync\` after some processing. The timeout option is supported, but note that it will throw an error if the process runs longer than the specified timeout. If no options are provided, a default timeout of 5 minutes will be used.`
695
+ }),
696
+ createComponent(TSDocReturns, { children: "The standard output produced by the command if it exits with code 0. If the command exits with a non-zero code or if there is a problem spawning the process, an error will be thrown." })
697
+ ];
698
+ }
699
+ }),
700
+ createComponent(FunctionDeclaration, {
701
+ "export": true,
702
+ name: "execSync",
703
+ parameters: [{
704
+ name: "argv",
705
+ type: "string[]"
706
+ }, {
707
+ name: "options",
708
+ type: "SpawnOptions",
709
+ default: "{}"
710
+ }],
711
+ returnType: "string",
712
+ children: code`return execFileSync(argv.length > 0 ? argv[0] : "", argv.slice(1), {
326
713
  encoding: "utf8",
327
714
  stdio: ["ignore", "pipe", "ignore"],
328
- timeout: options.timeoutMs ?? 300000,
715
+ timeout: options.timeoutMs ?? 300_000,
329
716
  env: resolveCommandEnv({ argv, env: options.env }),
330
717
  cwd: options.cwd || process.cwd(),
331
718
  windowsHide: true
332
- }).trim(); `}),e(s,{}),e(i,{get when(){return!!v},children:v})]}}))}x.__type=[()=>b,`props`,`ExecBuiltin`,`A built-in module for handling command execution in Shell Shock.`,`Pn!2""/#?$`];export{x as ExecBuiltin,b as __ΩExecBuiltinProps};
719
+ }).trim(); `
720
+ }),
721
+ createComponent(Spacing, {}),
722
+ createComponent(Show, {
723
+ get when() {
724
+ return Boolean(children);
725
+ },
726
+ children
727
+ })
728
+ ];
729
+ }
730
+ }));
731
+ }
732
+ ExecBuiltin.__type = [
733
+ () => __ΩExecBuiltinProps,
734
+ "props",
735
+ "ExecBuiltin",
736
+ "A built-in module for handling command execution in Shell Shock.",
737
+ "Pn!2\"\"/#?$"
738
+ ];
739
+
740
+ //#endregion
741
+ export { ExecBuiltin, __ΩExecBuiltinProps };
333
742
  //# sourceMappingURL=exec-builtin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec-builtin.mjs","names":[],"sources":["../../src/components/exec-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration,\n InterfaceMember,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocParam,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport interface ExecBuiltinProps extends Omit<\n BuiltinFileProps,\n \"id\" | \"description\"\n> {}\n\n/**\n * A built-in module for handling command execution in Shell Shock.\n */\nexport function ExecBuiltin(props: ExecBuiltinProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <BuiltinFile\n id=\"exec\"\n description=\"A module to handle command execution in a Shell Shock application.\"\n {...rest}\n imports={defu(rest.imports ?? {}, {\n \"node:path\": [\"basename\", \"extname\", \"dirname\", \"join\"],\n \"node:fs\": [\"existsSync\"],\n \"node:child_process\": [\n { name: \"spawn\", alias: \"_spawn\" },\n \"execFileSync\"\n ],\n \"node:stream\": [{ name: \"Stream\", default: true, type: true }]\n })}\n builtinImports={defu(rest.builtinImports ?? {}, {\n env: [\"isWindows\", \"env\"]\n })}>\n <FunctionDeclaration\n name=\"resolveCommandEnv\"\n parameters={[\n {\n name: \"params\",\n type: \"{ argv: string[]; env?: NodeJS.ProcessEnv; }\"\n }\n ]}\n returnType=\"NodeJS.ProcessEnv\">\n {code`const argv = params.argv;\n const shouldSuppressNpmFund = (() => {\n const cmd = basename(argv[0] ?? \"\");\n if (cmd === \"npm\" || cmd === \"npm.cmd\" || cmd === \"npm.exe\") {\n return true;\n }\n if (cmd === \"node\" || cmd === \"node.exe\") {\n const script = argv[1] ?? \"\";\n\n return script.includes(\"npm-cli.js\");\n }\n return false;\n })();\n\n const result = Object.fromEntries(\n Object.entries({\n ...env,\n ...(params.env ?? {})\n })\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => [key, String(value)])\n );\n if (shouldSuppressNpmFund) {\n result.NPM_CONFIG_FUND ??= \"false\";\n result.npm_config_fund ??= \"false\";\n }\n return result; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"isWindowsBatchCommand\"\n parameters={[{ name: \"resolvedCommand\", type: \"string\" }]}\n returnType=\"boolean\">\n {code`if (!isWindows) {\n return false;\n }\n const ext = extname(resolvedCommand).toLowerCase();\n\n return ext === \".cmd\" || ext === \".bat\"; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"escapeForCmdExe\"\n parameters={[{ name: \"arg\", type: \"string\" }]}\n returnType=\"string\">\n {code`if (/[&|<>^%\\\\\\\\r\\\\\\\\n]/.test(arg)) {\n throw new Error(\n \\`Unsafe Windows cmd.exe argument detected: \\${JSON.stringify(arg)}. \\` +\n \"Pass an explicit shell-wrapper argv at the call site instead.\"\n );\n }\n if (!arg.includes(\" \") && !arg.includes('\"')) {\n return arg;\n }\n return \\`\"\\${arg.replace(/\"/g, '\"\"')}\"\\`; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"buildCmdExeCommandLine\"\n parameters={[\n { name: \"resolvedCommand\", type: \"string\" },\n { name: \"args\", type: \"string[]\" }\n ]}\n returnType=\"string\">\n {code`return [escapeForCmdExe(resolvedCommand), ...args.map(escapeForCmdExe)].join(\n \" \"\n ); `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"resolveNpmArgvForWindows\"\n doc=\"On Windows, Node 18.20.2+ (CVE-2024-27980) rejects spawning .cmd/.bat directly without shell, causing EINVAL. Resolve npm/npx to node + cli script so we spawn node.exe instead of npm.cmd.\"\n parameters={[{ name: \"argv\", type: \"string[]\" }]}\n returnType=\"string[] | null\">\n {code`if (!isWindows || argv.length === 0) {\n return null;\n }\n const base = basename(argv[0] ?? \"\")\n .toLowerCase()\n .replace(/\\.(?:cmd|exe|bat)$/, \"\");\n const cliName =\n base === \"npx\" ? \"npx-cli.js\" : base === \"npm\" ? \"npm-cli.js\" : null;\n if (!cliName) {\n return null;\n }\n const nodeDir = dirname(process.execPath);\n const cliPath = join(nodeDir, \"node_modules\", \"npm\", \"bin\", cliName);\n if (!existsSync(cliPath)) {\n const command = argv[0] ?? \"\";\n const ext = extname(command).toLowerCase();\n const shimmedCommand = ext ? command : \\`\\${command}.cmd\\`;\n\n return [shimmedCommand, ...argv.slice(1)];\n }\n return [process.execPath, cliPath, ...argv.slice(1)]; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"resolveCommand\"\n doc=\"Resolves a command for Windows compatibility. On Windows, non-.exe commands (like pnpm, yarn) are resolved to .cmd; npm/npx are handled by resolveNpmArgvForWindows to avoid spawn EINVAL (no direct .cmd).\"\n parameters={[{ name: \"command\", type: \"string\" }]}\n returnType=\"string\">\n {code`if (!isWindows) {\n return command;\n }\n const base = basename(command).toLowerCase();\n if (extname(base)) {\n return command;\n }\n if ([\"pnpm\", \"yarn\"].includes(base)) {\n return \\`\\${command}.cmd\\`;\n }\n return command; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"resolveCommandStdio\"\n parameters={[\n {\n name: \"params\",\n type: \"{ hasInput: boolean; preferInherit: boolean; }\"\n }\n ]}\n returnType='[\"pipe\" | \"inherit\" | \"ignore\", \"pipe\", \"pipe\"]'>\n {code`const stdin = params.hasInput\n ? \"pipe\"\n : params.preferInherit\n ? \"inherit\"\n : \"pipe\";\n\n return [stdin, \"pipe\", \"pipe\"]; `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"resolveProcessExitCode\"\n parameters={[\n {\n name: \"params\",\n type: \"{ explicitCode: number | null | undefined; childExitCode: number | null | undefined; resolvedSignal: NodeJS.Signals | null; usesWindowsExitCodeShim: boolean; timedOut: boolean; noOutputTimedOut: boolean; killIssuedByTimeout: boolean; }\"\n }\n ]}\n returnType=\"number | null\">\n {code`return (\n params.explicitCode ??\n params.childExitCode ??\n (params.usesWindowsExitCodeShim &&\n params.resolvedSignal == null &&\n !params.timedOut &&\n !params.noOutputTimedOut &&\n !params.killIssuedByTimeout\n ? 0\n : null)\n ); `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"shouldSpawnWithShell\"\n parameters={[\n {\n name: \"params\",\n type: \"{ resolvedCommand: string; platform: NodeJS.Platform; }\"\n }\n ]}\n returnType=\"boolean\">\n {code`// SECURITY: never enable \\`shell\\` for argv-based execution.\n // \\`shell\\` routes through cmd.exe on Windows, which turns untrusted argv values\n // (like chat prompts passed as CLI args) into command-injection primitives.\n // If you need a shell, use an explicit shell-wrapper argv (e.g. \\`cmd.exe /c ...\\`)\n // and validate/escape at the call site.\n void params;\n return false; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"The result of a spawn operation.\" />\n <InterfaceDeclaration export name=\"SpawnResult\">\n <TSDoc heading=\"The PID of the spawned child process, if available.\" />\n <InterfaceMember name=\"pid\" optional type=\"number\" />\n <Spacing />\n <TSDoc heading=\"The standard output produced by the child process.\" />\n <InterfaceMember name=\"stdout\" type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The standard error produced by the child process.\" />\n <InterfaceMember name=\"stderr\" type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The exit code of the child process, if available.\" />\n <InterfaceMember name=\"code\" type=\"number | null\" />\n <Spacing />\n <TSDoc heading=\"The signal that caused the child process to terminate, if it was killed by a signal.\" />\n <InterfaceMember name=\"signal\" type=\"NodeJS.Signals | null\" />\n <Spacing />\n <TSDoc heading=\"Whether the child process was killed.\" />\n <InterfaceMember name=\"killed\" type=\"boolean\" />\n <Spacing />\n <TSDoc heading=\"The reason for the child process termination.\" />\n <InterfaceMember\n name=\"termination\"\n type={code`\"exit\" | \"timeout\" | \"no-output-timeout\" | \"signal\"`}\n />\n <Spacing />\n <TSDoc heading=\"Whether the child process timed out due to no output.\" />\n <InterfaceMember name=\"noOutputTimedOut\" optional type=\"boolean\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Options for spawning a child process.\" />\n <InterfaceDeclaration export name=\"SpawnOptions\">\n <TSDoc heading=\"The timeout in milliseconds for the spawn operation. If the process runs longer than this, it will be killed and the spawn promise will reject. This can also be provided as a number directly to the spawn function for convenience. Providing \\`-1\\` will disable the timeout.\">\n <TSDocDefaultValue\n type={ReflectionKind.number}\n defaultValue=\"300000\"\n />\n </TSDoc>\n <InterfaceMember name=\"timeoutMs\" optional type=\"number\" />\n <Spacing />\n <TSDoc heading=\"The current working directory of the child process.\" />\n <InterfaceMember name=\"cwd\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The input to be passed to the child process.\" />\n <InterfaceMember name=\"input\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"The environment variables for the child process.\" />\n <InterfaceMember name=\"env\" optional type=\"NodeJS.ProcessEnv\" />\n <Spacing />\n <TSDoc heading=\"Whether to pass arguments to the child process verbatim on Windows.\" />\n <InterfaceMember\n name=\"windowsVerbatimArguments\"\n optional\n type=\"boolean\"\n />\n <Spacing />\n <TSDoc heading=\"The timeout in milliseconds for the child process to produce output on stdout or stderr. If the process produces no output for this duration, it will be killed and the spawn promise will reject with a no-output-timeout termination reason.\" />\n <InterfaceMember name=\"noOutputTimeoutMs\" optional type=\"number\" />\n </InterfaceDeclaration>\n <Spacing />\n <VarDeclaration\n const\n name=\"WINDOWS_CLOSE_STATE_SETTLE_TIMEOUT_MS\"\n initializer={code`250`}\n />\n <Spacing />\n <VarDeclaration\n const\n name=\"WINDOWS_CLOSE_STATE_POLL_MS\"\n initializer={code`10`}\n />\n <Spacing />\n <TSDoc heading=\"Spawns a child process with the given arguments and options, returning a promise that resolves with the result of the spawn operation.\">\n <TSDocParam name=\"argv\">\n {\"The command and its arguments to spawn.\"}\n </TSDocParam>\n <TSDocParam name=\"optionsOrTimeoutMs\">\n {`The options for spawning the command, or a number representing the timeout in milliseconds. This allows for a convenient shorthand when only a timeout is needed. Providing \\`-1\\` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used.`}\n </TSDocParam>\n <TSDocReturns>\n {\n \"A promise that resolves with the result of the spawn operation, including stdout, stderr, exit code, signal, and termination reason.\"\n }\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"spawn\"\n parameters={[\n { name: \"argv\", type: \"string[]\" },\n {\n name: \"optionsOrTimeoutMs\",\n type: \"number | SpawnOptions\",\n default: \"300000\"\n }\n ]}\n returnType=\"Promise<SpawnResult>\">\n {code`const options: SpawnOptions =\n typeof optionsOrTimeoutMs === \"number\"\n ? { timeoutMs: optionsOrTimeoutMs }\n : optionsOrTimeoutMs;\nconst { timeoutMs = 300000, cwd, input, noOutputTimeoutMs } = options;\n\nconst resolvedArgv =\n isWindows\n ? (resolveNpmArgvForWindows(argv) ?? argv)\n : argv;\nconst resolvedCommand =\n resolvedArgv !== argv\n ? (resolvedArgv[0] ?? \"\")\n : resolveCommand(argv[0] ?? \"\");\nconst useCmdWrapper = isWindowsBatchCommand(resolvedCommand);\n\nconst child = _spawn(\n useCmdWrapper\n ? (env.COMSPEC ?? \"cmd.exe\")\n : resolvedCommand,\n useCmdWrapper\n ? [\n \"/d\",\n \"/s\",\n \"/c\",\n buildCmdExeCommandLine(resolvedCommand, resolvedArgv.slice(1))\n ]\n : resolvedArgv.slice(1), {\n stdio: resolveCommandStdio({ hasInput: input !== undefined, preferInherit: true }),\n cwd,\n env: resolveCommandEnv({ argv, env: options.env }),\n windowsHide: true,\n windowsVerbatimArguments: useCmdWrapper\n ? true\n : options.windowsVerbatimArguments,\n ...(shouldSpawnWithShell({\n resolvedCommand: useCmdWrapper\n ? (env.COMSPEC ?? \"cmd.exe\")\n : resolvedCommand,\n platform: process.platform\n })\n ? { shell: true }\n : {})\n});\n\nreturn new Promise((resolve, reject) => {\n let stdout = \"\";\n let stderr = \"\";\n let settled = false;\n let timedOut = false;\n let noOutputTimedOut = false;\n let killIssuedByTimeout = false;\n let childExitState: {\n code: number | null;\n signal: NodeJS.Signals | null;\n } | null = null;\n let closeFallbackTimer: NodeJS.Timeout | null = null;\n let noOutputTimer: NodeJS.Timeout | null = null;\n const shouldTrackOutputTimeout =\n typeof noOutputTimeoutMs === \"number\" &&\n Number.isFinite(noOutputTimeoutMs) &&\n noOutputTimeoutMs > 0;\n\n const clearNoOutputTimer = () => {\n if (!noOutputTimer) {\n return;\n }\n clearTimeout(noOutputTimer);\n noOutputTimer = null;\n };\n\n const clearCloseFallbackTimer = () => {\n if (!closeFallbackTimer) {\n return;\n }\n clearTimeout(closeFallbackTimer);\n closeFallbackTimer = null;\n };\n\n const killChild = () => {\n if (settled || typeof child?.kill !== \"function\") {\n return;\n }\n killIssuedByTimeout = true;\n child.kill(\"SIGKILL\");\n };\n\n const armNoOutputTimer = () => {\n if (!shouldTrackOutputTimeout || settled) {\n return;\n }\n clearNoOutputTimer();\n noOutputTimer = setTimeout(() => {\n if (settled) {\n return;\n }\n noOutputTimedOut = true;\n killChild();\n }, Math.floor(noOutputTimeoutMs));\n };\n\n const timer = setTimeout(() => {\n timedOut = true;\n killChild();\n }, timeoutMs >= 0 ? timeoutMs : Number.POSITIVE_INFINITY);\n armNoOutputTimer();\n\n if (input !== undefined && child.stdin) {\n child.stdin.write(input ?? \"\");\n child.stdin.end();\n }\n\n child.stdout?.on(\"data\", (d: Stream) => {\n stdout += d.toString();\n armNoOutputTimer();\n });\n child.stderr?.on(\"data\", (d: Stream) => {\n stderr += d.toString();\n armNoOutputTimer();\n });\n child.on(\"error\", err => {\n if (settled) {\n return;\n }\n settled = true;\n clearTimeout(timer);\n clearNoOutputTimer();\n clearCloseFallbackTimer();\n reject(err);\n });\n child.on(\"exit\", (code, signal) => {\n childExitState = { code, signal };\n if (settled || closeFallbackTimer) {\n return;\n }\n closeFallbackTimer = setTimeout(() => {\n if (settled) {\n return;\n }\n child.stdout?.destroy();\n child.stderr?.destroy();\n }, 250);\n });\n const resolveFromClose = (\n code: number | null,\n signal: NodeJS.Signals | null\n ) => {\n if (settled) {\n return;\n }\n settled = true;\n clearTimeout(timer);\n clearNoOutputTimer();\n clearCloseFallbackTimer();\n const resolvedSignal =\n childExitState?.signal ?? signal ?? child.signalCode ?? null;\n const resolvedCode = resolveProcessExitCode({\n explicitCode: childExitState?.code ?? code,\n childExitCode: child.exitCode,\n resolvedSignal,\n usesWindowsExitCodeShim: isWindows && (useCmdWrapper || resolvedArgv !== argv),\n timedOut,\n noOutputTimedOut,\n killIssuedByTimeout\n });\n const termination = noOutputTimedOut\n ? \"no-output-timeout\"\n : timedOut\n ? \"timeout\"\n : resolvedSignal != null\n ? \"signal\"\n : \"exit\";\n const normalizedCode =\n termination === \"timeout\" || termination === \"no-output-timeout\"\n ? resolvedCode === 0\n ? 124\n : resolvedCode\n : resolvedCode;\n resolve({\n pid: child.pid ?? undefined,\n stdout,\n stderr,\n code: normalizedCode,\n signal: resolvedSignal,\n killed: child.killed,\n termination,\n noOutputTimedOut\n });\n };\n child.on(\"close\", (code, signal) => {\n if (\n !isWindows ||\n childExitState != null ||\n code != null ||\n signal != null ||\n child.exitCode != null ||\n child.signalCode != null\n ) {\n resolveFromClose(code, signal);\n return;\n }\n\n const startedAt = Date.now();\n const waitForExitState = () => {\n if (settled) {\n return;\n }\n if (\n childExitState != null ||\n child.exitCode != null ||\n child.signalCode != null\n ) {\n resolveFromClose(code, signal);\n return;\n }\n if (Date.now() - startedAt >= WINDOWS_CLOSE_STATE_SETTLE_TIMEOUT_MS) {\n resolveFromClose(code, signal);\n return;\n }\n setTimeout(waitForExitState, WINDOWS_CLOSE_STATE_POLL_MS);\n };\n waitForExitState();\n });\n});`}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"A helper function that executes a command and returns its stdout.\">\n <TSDocParam name=\"argv\">\n {`The command and its arguments to spawn. This is passed directly to the spawn function. Remember that on Windows, commands like \\`npm\\` or \\`pnpm\\` will be resolved to their .cmd shims, so you can just pass \\`npm\\` without worrying about the extension.`}\n </TSDocParam>\n <TSDocParam name=\"optionsOrTimeoutMs\">\n {`The options for spawning the command, or a number representing the timeout in milliseconds. This is passed directly to the spawn function. Providing \\`-1\\` will disable the timeout. If no options or timeout are provided, a default timeout of 5 minutes will be used.`}\n </TSDocParam>\n <TSDocReturns>\n {\n \"A promise that resolves with the result of the spawn operation if the command exits with code 0, or rejects with an error if the command exits with a non-zero code or if there is a problem spawning the process.\"\n }\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n async\n name=\"exec\"\n parameters={[\n { name: \"argv\", type: \"string[]\" },\n {\n name: \"optionsOrTimeoutMs\",\n type: \"number | SpawnOptions\",\n default: \"300000\"\n }\n ]}\n returnType=\"Promise<string>\">\n {code`const spawnResult = await spawn(argv, optionsOrTimeoutMs);\n if (spawnResult.code !== 0) {\n throw Object.assign(new Error(\n \\`Command \"\\${argv.join(\" \")}\" exited with code \\${spawnResult.code} and signal \\${spawnResult.signal}\\`\n ), spawnResult);\n }\n\n return spawnResult.stdout.trim(); `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"A helper function that executes a command synchronously and returns its stdout. This is a thin wrapper around \\`child_process.execFileSync\\` with some added Windows compatibility handling.\">\n <TSDocParam name=\"argv\">\n {`The command and its arguments to spawn. This is passed directly to \\`execFileSync\\` after Windows-specific resolution. Remember that on Windows, commands like \\`npm\\` or \\`pnpm\\` will be resolved to their .cmd shims, so you can just pass \\`npm\\` without worrying about the extension.`}\n </TSDocParam>\n <TSDocParam name=\"options\">\n {`The options for spawning the command. This is passed directly to \\`execFileSync\\` after some processing. The timeout option is supported, but note that it will throw an error if the process runs longer than the specified timeout. If no options are provided, a default timeout of 5 minutes will be used.`}\n </TSDocParam>\n <TSDocReturns>\n {\n \"The standard output produced by the command if it exits with code 0. If the command exits with a non-zero code or if there is a problem spawning the process, an error will be thrown.\"\n }\n </TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"execSync\"\n parameters={[\n { name: \"argv\", type: \"string[]\" },\n { name: \"options\", type: \"SpawnOptions\", default: \"{}\" }\n ]}\n returnType=\"string\">\n {code`return execFileSync(argv.length > 0 ? argv[0] : \"\", argv.slice(1), {\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n timeout: options.timeoutMs ?? 300000,\n env: resolveCommandEnv({ argv, env: options.env }),\n cwd: options.cwd || process.cwd(),\n windowsHide: true\n }).trim(); `}\n </FunctionDeclaration>\n <Spacing />\n\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":"0sBAEM,EAAU,CAAC,IAAG,IAAM,OAAS,4BAAQ,6DA0BrC,EAAsB,KAAE,EAAW,KAAO,cAAiB,mBAAmB,kBAAK,CAKzF,SAAE,EAAA,EAAA,CACA,GAAM,CAAC,CACT,YAAA,GAAA,EAAA,EAAA,CAAA,WAAA,CAAA,CAEA,OAAO,EAAU,EAAiB,EAAY,CAC5C,GAAA,OACC,YAAO,qEACP,CAAA,EAAA,eAED,OAAA,EAAA,EAAA,SAAA,EAAA,CAAA,CACG,YAAgB,CAAA,WAAa,UAAQ,UAAa,OAAM,CAC3D,UAAA,CAAA,aAAA,CACK,qBAAqB,CAAA,CAClB,KAAC,uBAEF,CAAA,eAAA,CACJ,cAAA,CAAA,CACK,KAAI,SACR,QAAa,GACT,KAAI,GACR,CAAA,CACC,CAAC,EAEJ,IAAI,gBAAM,CACR,OAAM,EAAM,EAAC,gBAAsB,EAAE,CAAC,CACpC,IAAG,CAAA,YAAY,MAAA,CAChB,CAAC,EAEJ,IAAI,UAAA,CACF,MAAA,CAAA,EAA0B,EAAqB,CAC7C,KAAM,oBACN,WAAC,CAAA,CACF,KAAA,SACC,KAAM,+CACN,CAAA,CACA,WAAE,oBACF,SAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;2BA2BZ,CAAC,CAAE,EAAI,EAAuB,EAAA,CAAA,CAAA,EAAA,EAAA,CAC7B,KAAI,wBACJ,WAAW,CAAA,CACT,KAAA,kBACA,KAAM,SACR,CAAA,CACD,WAAS,UACT,SAAA,CAAA;;;;;qDAMA,CAAC,CAAE,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACF,KAAE,+BAEA,KAAM,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