newcraw 1.0.2 → 1.0.3

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 (220) hide show
  1. package/dist/REPL-CTTH53A7.js +50 -0
  2. package/dist/{acp-J4WDYGRX.js → acp-25PIN25O.js} +69 -40
  3. package/dist/acp-25PIN25O.js.map +7 -0
  4. package/dist/{agentsValidate-UBOER2IN.js → agentsValidate-BXDD54YP.js} +13 -10
  5. package/dist/{agentsValidate-UBOER2IN.js.map → agentsValidate-BXDD54YP.js.map} +1 -1
  6. package/dist/{ask-MGUO3L35.js → ask-EL4XAA5P.js} +62 -52
  7. package/dist/ask-EL4XAA5P.js.map +7 -0
  8. package/dist/{autoUpdater-2GS6LRPK.js → autoUpdater-DKMSJXWW.js} +5 -4
  9. package/dist/{chunk-2C43OXE7.js → chunk-2OVXJBJV.js} +38 -59
  10. package/dist/chunk-2OVXJBJV.js.map +7 -0
  11. package/dist/{chunk-53A4JHFW.js → chunk-3D3C7MRI.js} +23 -4
  12. package/dist/chunk-3D3C7MRI.js.map +7 -0
  13. package/dist/{chunk-VKI7ORIO.js → chunk-3ZQRACCP.js} +37 -18
  14. package/dist/{chunk-VKI7ORIO.js.map → chunk-3ZQRACCP.js.map} +1 -1
  15. package/dist/chunk-4A6CDBDH.js +822 -0
  16. package/dist/chunk-4A6CDBDH.js.map +7 -0
  17. package/dist/{chunk-VQSCECTS.js → chunk-53VETVCP.js} +6 -4
  18. package/dist/{chunk-VQSCECTS.js.map → chunk-53VETVCP.js.map} +1 -1
  19. package/dist/{chunk-WWDVA4NV.js → chunk-6WT3ZRYF.js} +22 -6
  20. package/dist/{chunk-WWDVA4NV.js.map → chunk-6WT3ZRYF.js.map} +1 -1
  21. package/dist/{chunk-RUXIBQ3B.js → chunk-7E2L7EH2.js} +4 -4
  22. package/dist/{chunk-VHS2MZQS.js → chunk-7PWVUHQ2.js} +9 -6
  23. package/dist/{chunk-VHS2MZQS.js.map → chunk-7PWVUHQ2.js.map} +1 -1
  24. package/dist/{chunk-2EFL22PV.js → chunk-ADJ4YEII.js} +7 -3
  25. package/dist/chunk-ADJ4YEII.js.map +7 -0
  26. package/dist/chunk-AKNZJBBU.js +372 -0
  27. package/dist/chunk-AKNZJBBU.js.map +7 -0
  28. package/dist/chunk-ALQSPHXV.js +135 -0
  29. package/dist/chunk-ALQSPHXV.js.map +7 -0
  30. package/dist/{chunk-XS6PU75S.js → chunk-APSIF3YK.js} +1 -1
  31. package/dist/{chunk-IM33F5CM.js → chunk-BMJ5XGFR.js} +1668 -1623
  32. package/dist/chunk-BMJ5XGFR.js.map +7 -0
  33. package/dist/chunk-BQCOSNM3.js +93 -0
  34. package/dist/chunk-BQCOSNM3.js.map +7 -0
  35. package/dist/{chunk-OJIMOLIC.js → chunk-BTCASL4X.js} +3621 -7413
  36. package/dist/chunk-BTCASL4X.js.map +7 -0
  37. package/dist/chunk-CHB5K4GI.js +107 -0
  38. package/dist/chunk-CHB5K4GI.js.map +7 -0
  39. package/dist/{chunk-QH2M65BR.js → chunk-D2FSAFMO.js} +7 -3
  40. package/dist/{chunk-QH2M65BR.js.map → chunk-D2FSAFMO.js.map} +1 -1
  41. package/dist/chunk-D4OZACS2.js +35 -0
  42. package/dist/{chunk-IIFUDVGS.js → chunk-ENLHVQCX.js} +310 -177
  43. package/dist/chunk-ENLHVQCX.js.map +7 -0
  44. package/dist/{chunk-A7X6OCZE.js → chunk-ERKWSZ3K.js} +1 -1
  45. package/dist/{chunk-UYRR6F5S.js → chunk-FSSZHQEJ.js} +9 -3
  46. package/dist/{chunk-UYRR6F5S.js.map → chunk-FSSZHQEJ.js.map} +1 -1
  47. package/dist/chunk-GV73HKJO.js +5473 -0
  48. package/dist/chunk-GV73HKJO.js.map +7 -0
  49. package/dist/{chunk-GZTCXXSS.js → chunk-GZ4BEVMZ.js} +57 -46
  50. package/dist/{chunk-GZTCXXSS.js.map → chunk-GZ4BEVMZ.js.map} +1 -1
  51. package/dist/chunk-HLBLZKZH.js +45 -0
  52. package/dist/chunk-HLBLZKZH.js.map +7 -0
  53. package/dist/chunk-JLVECHVJ.js +36 -0
  54. package/dist/chunk-JLVECHVJ.js.map +7 -0
  55. package/dist/chunk-KNSAVNMD.js +683 -0
  56. package/dist/{chunk-F3COCCAE.js.map → chunk-KNSAVNMD.js.map} +1 -1
  57. package/dist/{chunk-V5U6BHT2.js → chunk-KRN3WHHL.js} +7 -3
  58. package/dist/{chunk-V5U6BHT2.js.map → chunk-KRN3WHHL.js.map} +1 -1
  59. package/dist/{chunk-3LMXSKZ7.js → chunk-NFYAVT54.js} +1 -1
  60. package/dist/chunk-NT7RDVDA.js +33 -0
  61. package/dist/{chunk-KQSHIOZK.js.map → chunk-NT7RDVDA.js.map} +1 -1
  62. package/dist/chunk-NW7WSLD5.js +166 -0
  63. package/dist/{chunk-ZYSVG4X3.js.map → chunk-NW7WSLD5.js.map} +2 -2
  64. package/dist/{chunk-HSJ6HYAO.js → chunk-P52SGBC4.js} +18 -10
  65. package/dist/chunk-P52SGBC4.js.map +7 -0
  66. package/dist/{chunk-XXU2NVOE.js → chunk-PC6QOCGI.js} +30 -6
  67. package/dist/chunk-PC6QOCGI.js.map +7 -0
  68. package/dist/{chunk-N5OHRWG2.js → chunk-QSRXXZO7.js} +4 -2
  69. package/dist/{chunk-N5OHRWG2.js.map → chunk-QSRXXZO7.js.map} +1 -1
  70. package/dist/{chunk-DEF3KFP7.js → chunk-QZFKONA3.js} +4 -2
  71. package/dist/{chunk-DEF3KFP7.js.map → chunk-QZFKONA3.js.map} +1 -1
  72. package/dist/{chunk-JWXQNBBA.js → chunk-RE226X4F.js} +7 -1
  73. package/dist/{chunk-JWXQNBBA.js.map → chunk-RE226X4F.js.map} +1 -1
  74. package/dist/chunk-RF57YWGW.js +88 -0
  75. package/dist/chunk-RF57YWGW.js.map +7 -0
  76. package/dist/chunk-UGBECBIR.js +62 -0
  77. package/dist/chunk-UGBECBIR.js.map +7 -0
  78. package/dist/chunk-UYWZQVH5.js +35 -0
  79. package/dist/chunk-UYWZQVH5.js.map +7 -0
  80. package/dist/{chunk-LOIZNQOU.js → chunk-VHZRJ7RI.js} +9 -3
  81. package/dist/{chunk-LOIZNQOU.js.map → chunk-VHZRJ7RI.js.map} +1 -1
  82. package/dist/{chunk-XMGUQHMF.js → chunk-VSSVN6WG.js} +11 -1
  83. package/dist/chunk-VSSVN6WG.js.map +7 -0
  84. package/dist/{chunk-OZHBEG7U.js → chunk-XV7LPJNT.js} +15 -5
  85. package/dist/{chunk-OZHBEG7U.js.map → chunk-XV7LPJNT.js.map} +1 -1
  86. package/dist/chunk-Y7MDOB3N.js +65 -0
  87. package/dist/chunk-Y7MDOB3N.js.map +7 -0
  88. package/dist/{chunk-BWYKUDJR.js → chunk-ZLAB3Z4G.js} +14 -8
  89. package/dist/{chunk-BWYKUDJR.js.map → chunk-ZLAB3Z4G.js.map} +1 -1
  90. package/dist/{chunk-755HIAI3.js → chunk-ZMO4E7IW.js} +3 -42
  91. package/dist/chunk-ZMO4E7IW.js.map +7 -0
  92. package/dist/{cli-KZGF3FV5.js → cli-Z2BNJWHT.js} +251 -485
  93. package/dist/cli-Z2BNJWHT.js.map +7 -0
  94. package/dist/commands-3Y3OQOXT.js +54 -0
  95. package/dist/{config-GTJWCNPF.js → config-5RS7HDIK.js} +9 -6
  96. package/dist/{context-WF3TTXQU.js → context-XZXRRYKS.js} +8 -7
  97. package/dist/{costTracker-2G3ZI2JF.js → costTracker-VSWW7SRT.js} +3 -2
  98. package/dist/{customCommands-QOWK57EX.js → customCommands-6KDAODFQ.js} +6 -5
  99. package/dist/{env-37BAP7QF.js → env-WIM2DQ4L.js} +10 -7
  100. package/dist/{gateway-IZYO6YFJ.js → gateway-DKHC7H3K.js} +542 -96
  101. package/dist/gateway-DKHC7H3K.js.map +7 -0
  102. package/dist/identity-3KZQQVBG.js +16 -0
  103. package/dist/index.js +8 -6
  104. package/dist/index.js.map +1 -1
  105. package/dist/{kodeAgentSessionId-KTGFX2BE.js → kodeAgentSessionId-4SH24DVH.js} +1 -1
  106. package/dist/{kodeAgentSessionLoad-6F7SJXBC.js → kodeAgentSessionLoad-4S452GGD.js} +6 -5
  107. package/dist/{kodeAgentSessionResume-UEEDRJ3N.js → kodeAgentSessionResume-MSMG4QUR.js} +6 -5
  108. package/dist/{kodeAgentStreamJson-VIXFTYL5.js → kodeAgentStreamJson-4ZKIWKS3.js} +4 -2
  109. package/dist/{kodeAgentStreamJsonSession-XC3IPREZ.js → kodeAgentStreamJsonSession-CYG6MLKP.js} +15 -4
  110. package/dist/kodeAgentStreamJsonSession-CYG6MLKP.js.map +7 -0
  111. package/dist/{kodeAgentStructuredStdio-SI5C7AAD.js → kodeAgentStructuredStdio-5DCUC6V6.js} +3 -3
  112. package/dist/{kodeHooks-V36SHCTC.js → kodeHooks-WX3N6CL6.js} +6 -5
  113. package/dist/{llm-CYUDKJNR.js → llm-V2W4KJIA.js} +239 -57
  114. package/dist/llm-V2W4KJIA.js.map +7 -0
  115. package/dist/{llmLazy-IXVVBRTN.js → llmLazy-I7SO67YA.js} +2 -2
  116. package/dist/{loader-OEJ6C3TN.js → loader-YJGRGJNH.js} +6 -5
  117. package/dist/{mcp-KE3SILMX.js → mcp-WG3RQQCZ.js} +10 -9
  118. package/dist/{mentionProcessor-GAU2WAYB.js → mentionProcessor-PKWDUKTN.js} +14 -7
  119. package/dist/{mentionProcessor-GAU2WAYB.js.map → mentionProcessor-PKWDUKTN.js.map} +1 -1
  120. package/dist/{messages-WCSGGSEU.js → messages-RXHQ6VKL.js} +2 -2
  121. package/dist/{model-4TQIV5J2.js → model-JNWAZGT7.js} +10 -7
  122. package/dist/{openai-KTZV6F7N.js → openai-6NL5UXO7.js} +8 -7
  123. package/dist/{outputStyles-WX5RYQOA.js → outputStyles-BVPXT3MW.js} +6 -5
  124. package/dist/{pluginRuntime-JXMJZ2LC.js → pluginRuntime-XHI3TCRJ.js} +11 -8
  125. package/dist/{pluginRuntime-JXMJZ2LC.js.map → pluginRuntime-XHI3TCRJ.js.map} +1 -1
  126. package/dist/{pluginValidation-JNQZYLUP.js → pluginValidation-WDFL352C.js} +8 -7
  127. package/dist/prompts-C4RUFGX2.js +58 -0
  128. package/dist/query-IA3UKMGR.js +58 -0
  129. package/dist/{responsesStreaming-2AIT6GHG.js → responsesStreaming-JORGEFQC.js} +1 -1
  130. package/dist/{ripgrep-KDPQAMB2.js → ripgrep-BHDXRABJ.js} +5 -4
  131. package/dist/sandbox-QOXESHL4.js +63 -0
  132. package/dist/{skillMarketplace-IXAGP3Q2.js → skillMarketplace-RIAMO2YA.js} +5 -4
  133. package/dist/{state-MSCYLB6Y.js → state-TM2XZQE2.js} +6 -3
  134. package/dist/structuredOutput-KAVFUV2Z.js +9 -0
  135. package/dist/theme-BXUQNXSD.js +15 -0
  136. package/dist/thinking-BCZ4WDT6.js +18 -0
  137. package/dist/{toolPermissionContext-I3IXPVED.js → toolPermissionContext-JCQ5MFUT.js} +1 -1
  138. package/dist/toolPermissionContext-JCQ5MFUT.js.map +7 -0
  139. package/dist/toolPermissionContextState-ILRPUITK.js +24 -0
  140. package/dist/toolPermissionContextState-ILRPUITK.js.map +7 -0
  141. package/dist/{toolPermissionSettings-EUZKGZU2.js → toolPermissionSettings-LNYZ6XFE.js} +9 -8
  142. package/dist/toolPermissionSettings-LNYZ6XFE.js.map +7 -0
  143. package/dist/tools-HIPUGTF5.js +55 -0
  144. package/dist/tools-HIPUGTF5.js.map +7 -0
  145. package/dist/{userInput-LJL4CVOB.js → userInput-I33T2RX2.js} +49 -34
  146. package/dist/{userInput-LJL4CVOB.js.map → userInput-I33T2RX2.js.map} +1 -1
  147. package/dist/{uuid-VA3KVASX.js → uuid-RQH3OZ3W.js} +1 -1
  148. package/dist/uuid-RQH3OZ3W.js.map +7 -0
  149. package/dist/workspace-EP63OB5S.js +21 -0
  150. package/dist/workspace-EP63OB5S.js.map +7 -0
  151. package/package.json +1 -1
  152. package/web/dist/assets/index-XuLVvSQF.js +251 -0
  153. package/web/dist/assets/index-pSid9IlY.css +10 -0
  154. package/web/dist/index.html +2 -2
  155. package/dist/REPL-IAK7ZN2Z.js +0 -42
  156. package/dist/acp-J4WDYGRX.js.map +0 -7
  157. package/dist/ask-MGUO3L35.js.map +0 -7
  158. package/dist/chunk-2C43OXE7.js.map +0 -7
  159. package/dist/chunk-2EFL22PV.js.map +0 -7
  160. package/dist/chunk-53A4JHFW.js.map +0 -7
  161. package/dist/chunk-755HIAI3.js.map +0 -7
  162. package/dist/chunk-AXWJI6N5.js +0 -11
  163. package/dist/chunk-F3COCCAE.js +0 -654
  164. package/dist/chunk-HSJ6HYAO.js.map +0 -7
  165. package/dist/chunk-IIFUDVGS.js.map +0 -7
  166. package/dist/chunk-IM33F5CM.js.map +0 -7
  167. package/dist/chunk-KQSHIOZK.js +0 -24
  168. package/dist/chunk-OJIMOLIC.js.map +0 -7
  169. package/dist/chunk-XMGUQHMF.js.map +0 -7
  170. package/dist/chunk-XXU2NVOE.js.map +0 -7
  171. package/dist/chunk-ZYSVG4X3.js +0 -151
  172. package/dist/cli-KZGF3FV5.js.map +0 -7
  173. package/dist/commands-AVEBLFVS.js +0 -46
  174. package/dist/gateway-IZYO6YFJ.js.map +0 -7
  175. package/dist/kodeAgentStreamJsonSession-XC3IPREZ.js.map +0 -7
  176. package/dist/llm-CYUDKJNR.js.map +0 -7
  177. package/dist/prompts-LE6GK75N.js +0 -48
  178. package/dist/query-GGIP6PWG.js +0 -50
  179. package/dist/theme-GAMFOLBW.js +0 -14
  180. package/dist/tools-3HOUIDM3.js +0 -47
  181. package/web/dist/assets/index-COAJqX1Z.css +0 -1
  182. package/web/dist/assets/index-CzS_4LmC.js +0 -179
  183. /package/dist/{REPL-IAK7ZN2Z.js.map → REPL-CTTH53A7.js.map} +0 -0
  184. /package/dist/{autoUpdater-2GS6LRPK.js.map → autoUpdater-DKMSJXWW.js.map} +0 -0
  185. /package/dist/{chunk-RUXIBQ3B.js.map → chunk-7E2L7EH2.js.map} +0 -0
  186. /package/dist/{chunk-XS6PU75S.js.map → chunk-APSIF3YK.js.map} +0 -0
  187. /package/dist/{chunk-AXWJI6N5.js.map → chunk-D4OZACS2.js.map} +0 -0
  188. /package/dist/{chunk-A7X6OCZE.js.map → chunk-ERKWSZ3K.js.map} +0 -0
  189. /package/dist/{chunk-3LMXSKZ7.js.map → chunk-NFYAVT54.js.map} +0 -0
  190. /package/dist/{commands-AVEBLFVS.js.map → commands-3Y3OQOXT.js.map} +0 -0
  191. /package/dist/{config-GTJWCNPF.js.map → config-5RS7HDIK.js.map} +0 -0
  192. /package/dist/{context-WF3TTXQU.js.map → context-XZXRRYKS.js.map} +0 -0
  193. /package/dist/{costTracker-2G3ZI2JF.js.map → costTracker-VSWW7SRT.js.map} +0 -0
  194. /package/dist/{customCommands-QOWK57EX.js.map → customCommands-6KDAODFQ.js.map} +0 -0
  195. /package/dist/{env-37BAP7QF.js.map → env-WIM2DQ4L.js.map} +0 -0
  196. /package/dist/{kodeAgentSessionId-KTGFX2BE.js.map → identity-3KZQQVBG.js.map} +0 -0
  197. /package/dist/{kodeAgentSessionLoad-6F7SJXBC.js.map → kodeAgentSessionId-4SH24DVH.js.map} +0 -0
  198. /package/dist/{kodeAgentSessionResume-UEEDRJ3N.js.map → kodeAgentSessionLoad-4S452GGD.js.map} +0 -0
  199. /package/dist/{kodeAgentStreamJson-VIXFTYL5.js.map → kodeAgentSessionResume-MSMG4QUR.js.map} +0 -0
  200. /package/dist/{kodeAgentStructuredStdio-SI5C7AAD.js.map → kodeAgentStreamJson-4ZKIWKS3.js.map} +0 -0
  201. /package/dist/{kodeHooks-V36SHCTC.js.map → kodeAgentStructuredStdio-5DCUC6V6.js.map} +0 -0
  202. /package/dist/{llmLazy-IXVVBRTN.js.map → kodeHooks-WX3N6CL6.js.map} +0 -0
  203. /package/dist/{loader-OEJ6C3TN.js.map → llmLazy-I7SO67YA.js.map} +0 -0
  204. /package/dist/{mcp-KE3SILMX.js.map → loader-YJGRGJNH.js.map} +0 -0
  205. /package/dist/{messages-WCSGGSEU.js.map → mcp-WG3RQQCZ.js.map} +0 -0
  206. /package/dist/{model-4TQIV5J2.js.map → messages-RXHQ6VKL.js.map} +0 -0
  207. /package/dist/{openai-KTZV6F7N.js.map → model-JNWAZGT7.js.map} +0 -0
  208. /package/dist/{outputStyles-WX5RYQOA.js.map → openai-6NL5UXO7.js.map} +0 -0
  209. /package/dist/{pluginValidation-JNQZYLUP.js.map → outputStyles-BVPXT3MW.js.map} +0 -0
  210. /package/dist/{prompts-LE6GK75N.js.map → pluginValidation-WDFL352C.js.map} +0 -0
  211. /package/dist/{query-GGIP6PWG.js.map → prompts-C4RUFGX2.js.map} +0 -0
  212. /package/dist/{responsesStreaming-2AIT6GHG.js.map → query-IA3UKMGR.js.map} +0 -0
  213. /package/dist/{ripgrep-KDPQAMB2.js.map → responsesStreaming-JORGEFQC.js.map} +0 -0
  214. /package/dist/{skillMarketplace-IXAGP3Q2.js.map → ripgrep-BHDXRABJ.js.map} +0 -0
  215. /package/dist/{state-MSCYLB6Y.js.map → sandbox-QOXESHL4.js.map} +0 -0
  216. /package/dist/{theme-GAMFOLBW.js.map → skillMarketplace-RIAMO2YA.js.map} +0 -0
  217. /package/dist/{toolPermissionContext-I3IXPVED.js.map → state-TM2XZQE2.js.map} +0 -0
  218. /package/dist/{toolPermissionSettings-EUZKGZU2.js.map → structuredOutput-KAVFUV2Z.js.map} +0 -0
  219. /package/dist/{tools-3HOUIDM3.js.map → theme-BXUQNXSD.js.map} +0 -0
  220. /package/dist/{uuid-VA3KVASX.js.map → thinking-BCZ4WDT6.js.map} +0 -0
@@ -0,0 +1,822 @@
1
+ import { createRequire as __newcrawCreateRequire } from "node:module";
2
+ const require = __newcrawCreateRequire(import.meta.url);
3
+ import {
4
+ debug,
5
+ init_debugLogger
6
+ } from "./chunk-GZ4BEVMZ.js";
7
+ import {
8
+ init_log,
9
+ logError
10
+ } from "./chunk-BMJ5XGFR.js";
11
+ import {
12
+ __esm,
13
+ __export
14
+ } from "./chunk-D4OZACS2.js";
15
+
16
+ // src/services/sandbox/types.ts
17
+ var DEFAULT_SANDBOX_CONFIG;
18
+ var init_types = __esm({
19
+ "src/services/sandbox/types.ts"() {
20
+ DEFAULT_SANDBOX_CONFIG = {
21
+ engine: "podman",
22
+ fallbackEngine: "docker",
23
+ poolSize: 2,
24
+ poolIdleTimeoutMs: 3e5,
25
+ defaultTimeoutMs: 6e4,
26
+ defaultMemoryLimitMb: 512,
27
+ defaultCpuLimit: 1,
28
+ networkEnabled: false
29
+ };
30
+ }
31
+ });
32
+
33
+ // src/services/sandbox/runtimeImages.ts
34
+ function getRuntimeImage(runtime) {
35
+ return RUNTIME_IMAGES[runtime];
36
+ }
37
+ function getImageFullName(runtime) {
38
+ return RUNTIME_IMAGES[runtime].fullName;
39
+ }
40
+ function getAllRuntimeImages() {
41
+ return Object.values(RUNTIME_IMAGES);
42
+ }
43
+ function resolveImage(runtime, customImage) {
44
+ if (customImage) return customImage;
45
+ return getImageFullName(runtime);
46
+ }
47
+ var RUNTIME_IMAGES;
48
+ var init_runtimeImages = __esm({
49
+ "src/services/sandbox/runtimeImages.ts"() {
50
+ RUNTIME_IMAGES = {
51
+ python: {
52
+ runtime: "python",
53
+ image: "python",
54
+ tag: "3.11-alpine",
55
+ fullName: "python:3.11-alpine",
56
+ preInstallCommands: ["pip install --no-cache-dir --upgrade pip"]
57
+ },
58
+ node: {
59
+ runtime: "node",
60
+ image: "node",
61
+ tag: "20-alpine",
62
+ fullName: "node:20-alpine"
63
+ },
64
+ bash: {
65
+ runtime: "bash",
66
+ image: "alpine",
67
+ tag: "3.19",
68
+ fullName: "alpine:3.19",
69
+ preInstallCommands: ["apk add --no-cache bash curl jq"]
70
+ },
71
+ custom: {
72
+ runtime: "custom",
73
+ image: "alpine",
74
+ tag: "3.19",
75
+ fullName: "alpine:3.19"
76
+ }
77
+ };
78
+ }
79
+ });
80
+
81
+ // src/services/sandbox/podmanEngine.ts
82
+ import { spawn } from "child_process";
83
+ import { randomUUID } from "crypto";
84
+ import which from "which";
85
+ function whichSync(bin) {
86
+ try {
87
+ return which.sync(bin, { nothrow: true }) ?? null;
88
+ } catch {
89
+ return null;
90
+ }
91
+ }
92
+ async function detectContainerEngine() {
93
+ for (const engine of ["podman", "docker"]) {
94
+ const binary = whichSync(engine);
95
+ if (!binary) continue;
96
+ try {
97
+ const version = await execSimple([binary, "--version"]);
98
+ const rootless = engine === "podman" ? await checkPodmanRootless(binary) : false;
99
+ detectedEngine = engine;
100
+ detectedBinary = binary;
101
+ return {
102
+ name: engine,
103
+ available: true,
104
+ rootless,
105
+ version: version.trim()
106
+ };
107
+ } catch {
108
+ continue;
109
+ }
110
+ }
111
+ detectedEngine = "none";
112
+ detectedBinary = null;
113
+ return { name: "none", available: false, rootless: false };
114
+ }
115
+ async function checkPodmanRootless(binary) {
116
+ try {
117
+ const info = await execSimple([binary, "info", "--format", "{{.Host.Security.Rootless}}"]);
118
+ return info.trim().toLowerCase() === "true";
119
+ } catch {
120
+ return process.getuid?.() !== 0;
121
+ }
122
+ }
123
+ function getEngineBinary() {
124
+ if (detectedBinary) return detectedBinary;
125
+ const podman = whichSync("podman");
126
+ if (podman) {
127
+ detectedEngine = "podman";
128
+ detectedBinary = podman;
129
+ return podman;
130
+ }
131
+ const docker = whichSync("docker");
132
+ if (docker) {
133
+ detectedEngine = "docker";
134
+ detectedBinary = docker;
135
+ return docker;
136
+ }
137
+ throw new Error(
138
+ "No container engine found. Install Podman (preferred) or Docker."
139
+ );
140
+ }
141
+ function getEngineType() {
142
+ if (detectedEngine) return detectedEngine;
143
+ getEngineBinary();
144
+ return detectedEngine;
145
+ }
146
+ function execSimple(cmd) {
147
+ return new Promise((resolve, reject) => {
148
+ const child = spawn(cmd[0], cmd.slice(1), {
149
+ stdio: ["ignore", "pipe", "pipe"],
150
+ windowsHide: true
151
+ });
152
+ let stdout = "";
153
+ let stderr = "";
154
+ child.stdout?.on("data", (d) => {
155
+ stdout += d.toString();
156
+ });
157
+ child.stderr?.on("data", (d) => {
158
+ stderr += d.toString();
159
+ });
160
+ child.on("close", (code) => {
161
+ if (code === 0) resolve(stdout);
162
+ else reject(new Error(`Command failed (${code}): ${stderr}`));
163
+ });
164
+ child.on("error", reject);
165
+ });
166
+ }
167
+ function buildRunArgs(config) {
168
+ const binary = getEngineBinary();
169
+ const image = resolveImage(config.runtime, config.image);
170
+ const name = `kode-sandbox-${randomUUID().slice(0, 8)}`;
171
+ const args = [
172
+ binary,
173
+ "run",
174
+ "--name",
175
+ name,
176
+ "--detach",
177
+ "--init"
178
+ ];
179
+ if (!config.networkEnabled) {
180
+ args.push("--network", "none");
181
+ }
182
+ if (config.memoryLimitMb) {
183
+ args.push("--memory", `${config.memoryLimitMb}m`);
184
+ }
185
+ if (config.cpuLimit) {
186
+ args.push("--cpus", String(config.cpuLimit));
187
+ }
188
+ if (config.workDir) {
189
+ args.push("--workdir", config.workDir);
190
+ }
191
+ for (const mount of config.mountPaths ?? []) {
192
+ const opt = mount.readOnly ? `${mount.hostPath}:${mount.containerPath}:ro` : `${mount.hostPath}:${mount.containerPath}`;
193
+ args.push("-v", opt);
194
+ }
195
+ for (const [key, value] of Object.entries(config.env ?? {})) {
196
+ args.push("-e", `${key}=${value}`);
197
+ }
198
+ args.push(image, "sleep", "infinity");
199
+ return args;
200
+ }
201
+ async function createContainer(config) {
202
+ const args = buildRunArgs(config);
203
+ const binary = args[0];
204
+ const runArgs = args.slice(1);
205
+ const output = await execSimple([binary, ...runArgs]);
206
+ const containerId = output.trim().slice(0, 12);
207
+ const name = runArgs[runArgs.indexOf("--name") + 1];
208
+ return {
209
+ id: containerId,
210
+ name,
211
+ image: resolveImage(config.runtime, config.image),
212
+ status: "ready",
213
+ runtime: config.runtime,
214
+ createdAt: Date.now(),
215
+ lastUsedAt: Date.now()
216
+ };
217
+ }
218
+ async function execInContainer(containerId, options) {
219
+ const binary = getEngineBinary();
220
+ const startTime = Date.now();
221
+ const args = [binary, "exec"];
222
+ if (options.cwd) {
223
+ args.push("--workdir", options.cwd);
224
+ }
225
+ for (const [key, value] of Object.entries(options.env ?? {})) {
226
+ args.push("-e", `${key}=${value}`);
227
+ }
228
+ args.push(containerId, ...options.command);
229
+ return new Promise((resolve, reject) => {
230
+ const child = spawn(args[0], args.slice(1), {
231
+ stdio: ["pipe", "pipe", "pipe"],
232
+ windowsHide: true
233
+ });
234
+ let stdout = "";
235
+ let stderr = "";
236
+ let timedOut = false;
237
+ let timer;
238
+ if (options.timeoutMs) {
239
+ timer = setTimeout(() => {
240
+ timedOut = true;
241
+ child.kill("SIGKILL");
242
+ }, options.timeoutMs);
243
+ }
244
+ child.stdout?.on("data", (d) => {
245
+ stdout += d.toString();
246
+ });
247
+ child.stderr?.on("data", (d) => {
248
+ stderr += d.toString();
249
+ });
250
+ if (options.stdin) {
251
+ child.stdin?.write(options.stdin);
252
+ child.stdin?.end();
253
+ } else {
254
+ child.stdin?.end();
255
+ }
256
+ child.on("close", (code) => {
257
+ if (timer) clearTimeout(timer);
258
+ resolve({
259
+ stdout,
260
+ stderr,
261
+ exitCode: code ?? (timedOut ? 137 : 1),
262
+ durationMs: Date.now() - startTime,
263
+ timedOut
264
+ });
265
+ });
266
+ child.on("error", (err) => {
267
+ if (timer) clearTimeout(timer);
268
+ reject(err);
269
+ });
270
+ });
271
+ }
272
+ async function removeContainer(containerId) {
273
+ const binary = getEngineBinary();
274
+ try {
275
+ await execSimple([binary, "rm", "-f", containerId]);
276
+ } catch (err) {
277
+ logError(err);
278
+ }
279
+ }
280
+ async function stopContainer(containerId) {
281
+ const binary = getEngineBinary();
282
+ try {
283
+ await execSimple([binary, "stop", "-t", "3", containerId]);
284
+ } catch (err) {
285
+ logError(err);
286
+ }
287
+ }
288
+ async function getContainerStatus(containerId) {
289
+ const binary = getEngineBinary();
290
+ try {
291
+ const output = await execSimple([
292
+ binary,
293
+ "inspect",
294
+ "--format",
295
+ "{{.State.Status}}",
296
+ containerId
297
+ ]);
298
+ const status = output.trim().toLowerCase();
299
+ switch (status) {
300
+ case "running":
301
+ return "running";
302
+ case "created":
303
+ return "creating";
304
+ case "exited":
305
+ case "stopped":
306
+ return "stopped";
307
+ default:
308
+ return "error";
309
+ }
310
+ } catch {
311
+ return "destroyed";
312
+ }
313
+ }
314
+ async function pullImage(image) {
315
+ const binary = getEngineBinary();
316
+ await execSimple([binary, "pull", image]);
317
+ }
318
+ async function imageExists(image) {
319
+ const binary = getEngineBinary();
320
+ try {
321
+ await execSimple([binary, "image", "inspect", image]);
322
+ return true;
323
+ } catch {
324
+ return false;
325
+ }
326
+ }
327
+ var detectedEngine, detectedBinary;
328
+ var init_podmanEngine = __esm({
329
+ "src/services/sandbox/podmanEngine.ts"() {
330
+ init_log();
331
+ init_runtimeImages();
332
+ detectedEngine = null;
333
+ detectedBinary = null;
334
+ }
335
+ });
336
+
337
+ // src/services/sandbox/containerLifecycle.ts
338
+ function getContainerLifecycleManager() {
339
+ if (!globalLifecycleManager) {
340
+ globalLifecycleManager = new ContainerLifecycleManager();
341
+ }
342
+ return globalLifecycleManager;
343
+ }
344
+ var ContainerLifecycleManager, globalLifecycleManager;
345
+ var init_containerLifecycle = __esm({
346
+ "src/services/sandbox/containerLifecycle.ts"() {
347
+ init_log();
348
+ init_podmanEngine();
349
+ init_runtimeImages();
350
+ init_types();
351
+ ContainerLifecycleManager = class {
352
+ activeContainers = /* @__PURE__ */ new Map();
353
+ async ensureImage(runtime, customImage) {
354
+ const image = resolveImage(runtime, customImage);
355
+ const exists = await imageExists(image);
356
+ if (!exists) {
357
+ await pullImage(image);
358
+ }
359
+ }
360
+ async spawn(config) {
361
+ const mergedConfig = {
362
+ timeoutMs: DEFAULT_SANDBOX_CONFIG.defaultTimeoutMs,
363
+ memoryLimitMb: DEFAULT_SANDBOX_CONFIG.defaultMemoryLimitMb,
364
+ cpuLimit: DEFAULT_SANDBOX_CONFIG.defaultCpuLimit,
365
+ networkEnabled: DEFAULT_SANDBOX_CONFIG.networkEnabled,
366
+ ...config
367
+ };
368
+ await this.ensureImage(mergedConfig.runtime, mergedConfig.image);
369
+ const info = await createContainer(mergedConfig);
370
+ this.activeContainers.set(info.id, info);
371
+ return info;
372
+ }
373
+ async exec(containerId, options) {
374
+ const info = this.activeContainers.get(containerId);
375
+ if (info) {
376
+ info.lastUsedAt = Date.now();
377
+ info.status = "running";
378
+ }
379
+ const result = await execInContainer(containerId, {
380
+ timeoutMs: DEFAULT_SANDBOX_CONFIG.defaultTimeoutMs,
381
+ ...options
382
+ });
383
+ if (info) {
384
+ info.status = "ready";
385
+ }
386
+ return result;
387
+ }
388
+ async destroy(containerId) {
389
+ try {
390
+ await stopContainer(containerId);
391
+ await removeContainer(containerId);
392
+ } catch (err) {
393
+ logError(err);
394
+ } finally {
395
+ this.activeContainers.delete(containerId);
396
+ }
397
+ }
398
+ async destroyAll() {
399
+ const ids = Array.from(this.activeContainers.keys());
400
+ await Promise.allSettled(ids.map((id) => this.destroy(id)));
401
+ }
402
+ getActive() {
403
+ return Array.from(this.activeContainers.values());
404
+ }
405
+ getContainer(containerId) {
406
+ return this.activeContainers.get(containerId);
407
+ }
408
+ get activeCount() {
409
+ return this.activeContainers.size;
410
+ }
411
+ };
412
+ globalLifecycleManager = null;
413
+ }
414
+ });
415
+
416
+ // src/services/sandbox/containerPool.ts
417
+ var ContainerPool;
418
+ var init_containerPool = __esm({
419
+ "src/services/sandbox/containerPool.ts"() {
420
+ init_log();
421
+ init_types();
422
+ ContainerPool = class {
423
+ pool = /* @__PURE__ */ new Map();
424
+ lifecycle;
425
+ config;
426
+ constructor(lifecycle, config = {}) {
427
+ this.lifecycle = lifecycle;
428
+ this.config = { ...DEFAULT_SANDBOX_CONFIG, ...config };
429
+ }
430
+ async warmup(runtime, count) {
431
+ const n = count ?? this.config.poolSize;
432
+ const existing = this.getIdleByRuntime(runtime);
433
+ const needed = Math.max(0, n - existing.length);
434
+ const promises = [];
435
+ for (let i = 0; i < needed; i++) {
436
+ promises.push(this.spawnPoolEntry(runtime));
437
+ }
438
+ await Promise.allSettled(promises);
439
+ }
440
+ async acquire(runtime, config) {
441
+ const idle = this.getIdleByRuntime(runtime);
442
+ if (idle.length > 0) {
443
+ const entry = idle[0];
444
+ entry.inUse = true;
445
+ if (entry.idleTimer) {
446
+ clearTimeout(entry.idleTimer);
447
+ entry.idleTimer = void 0;
448
+ }
449
+ entry.container.lastUsedAt = Date.now();
450
+ return entry.container;
451
+ }
452
+ const containerConfig = {
453
+ runtime,
454
+ networkEnabled: this.config.networkEnabled,
455
+ memoryLimitMb: this.config.defaultMemoryLimitMb,
456
+ cpuLimit: this.config.defaultCpuLimit,
457
+ timeoutMs: this.config.defaultTimeoutMs,
458
+ ...config
459
+ };
460
+ const info = await this.lifecycle.spawn(containerConfig);
461
+ this.pool.set(info.id, {
462
+ container: info,
463
+ runtime,
464
+ inUse: true
465
+ });
466
+ return info;
467
+ }
468
+ release(containerId) {
469
+ const entry = this.pool.get(containerId);
470
+ if (!entry) return;
471
+ entry.inUse = false;
472
+ entry.container.lastUsedAt = Date.now();
473
+ const idleCount = this.getIdleByRuntime(entry.runtime).length;
474
+ if (idleCount > this.config.poolSize) {
475
+ void this.evict(containerId);
476
+ return;
477
+ }
478
+ entry.idleTimer = setTimeout(() => {
479
+ void this.evict(containerId);
480
+ }, this.config.poolIdleTimeoutMs);
481
+ }
482
+ async exec(containerId, options) {
483
+ return this.lifecycle.exec(containerId, options);
484
+ }
485
+ async evict(containerId) {
486
+ const entry = this.pool.get(containerId);
487
+ if (!entry) return;
488
+ if (entry.inUse) return;
489
+ if (entry.idleTimer) {
490
+ clearTimeout(entry.idleTimer);
491
+ }
492
+ this.pool.delete(containerId);
493
+ try {
494
+ await this.lifecycle.destroy(containerId);
495
+ } catch (err) {
496
+ logError(err);
497
+ }
498
+ }
499
+ async spawnPoolEntry(runtime) {
500
+ try {
501
+ const info = await this.lifecycle.spawn({
502
+ runtime,
503
+ networkEnabled: this.config.networkEnabled,
504
+ memoryLimitMb: this.config.defaultMemoryLimitMb,
505
+ cpuLimit: this.config.defaultCpuLimit,
506
+ timeoutMs: this.config.defaultTimeoutMs
507
+ });
508
+ const entry = {
509
+ container: info,
510
+ runtime,
511
+ inUse: false
512
+ };
513
+ entry.idleTimer = setTimeout(() => {
514
+ void this.evict(info.id);
515
+ }, this.config.poolIdleTimeoutMs);
516
+ this.pool.set(info.id, entry);
517
+ } catch (err) {
518
+ logError(err);
519
+ }
520
+ }
521
+ getIdleByRuntime(runtime) {
522
+ return Array.from(this.pool.values()).filter(
523
+ (e) => e.runtime === runtime && !e.inUse
524
+ );
525
+ }
526
+ async shutdown() {
527
+ for (const entry of this.pool.values()) {
528
+ if (entry.idleTimer) clearTimeout(entry.idleTimer);
529
+ }
530
+ const ids = Array.from(this.pool.keys());
531
+ await Promise.allSettled(ids.map((id) => this.lifecycle.destroy(id)));
532
+ this.pool.clear();
533
+ }
534
+ get stats() {
535
+ const entries = Array.from(this.pool.values());
536
+ return {
537
+ total: entries.length,
538
+ idle: entries.filter((e) => !e.inUse).length,
539
+ inUse: entries.filter((e) => e.inUse).length,
540
+ byRuntime: Object.fromEntries(
541
+ ["python", "node", "bash"].map((rt) => [
542
+ rt,
543
+ {
544
+ total: entries.filter((e) => e.runtime === rt).length,
545
+ idle: entries.filter((e) => e.runtime === rt && !e.inUse).length,
546
+ inUse: entries.filter((e) => e.runtime === rt && e.inUse).length
547
+ }
548
+ ])
549
+ )
550
+ };
551
+ }
552
+ };
553
+ }
554
+ });
555
+
556
+ // src/services/sandbox/skillExecutor.ts
557
+ async function executeSkillInSandbox(request) {
558
+ const pool = getSandboxPool();
559
+ if (!pool) {
560
+ debug.warn("SKILL_SANDBOX_NOT_AVAILABLE", {
561
+ skillDir: request.skillDir,
562
+ runtime: request.runtime
563
+ });
564
+ throw new Error(
565
+ "Sandbox pool not initialized. Ensure container engine (Podman/Docker) is available."
566
+ );
567
+ }
568
+ const containerConfig = {
569
+ runtime: request.runtime,
570
+ workDir: "/workspace",
571
+ mountPaths: [
572
+ {
573
+ hostPath: request.skillDir,
574
+ containerPath: "/workspace/skill",
575
+ readOnly: true
576
+ },
577
+ ...request.workDir ? [{
578
+ hostPath: request.workDir,
579
+ containerPath: "/workspace/project",
580
+ readOnly: false
581
+ }] : []
582
+ ],
583
+ env: request.env,
584
+ timeoutMs: request.timeoutMs ?? 12e4
585
+ };
586
+ const container = await pool.acquire(request.runtime, containerConfig);
587
+ try {
588
+ if (request.dependencies) {
589
+ const installResult = await installDependencies(
590
+ container.id,
591
+ request.runtime,
592
+ request.dependencies,
593
+ request.skillDir
594
+ );
595
+ if (installResult.exitCode !== 0) {
596
+ debug.warn("SKILL_DEPENDENCY_INSTALL_FAILED", {
597
+ stderr: installResult.stderr.slice(0, 500)
598
+ });
599
+ }
600
+ }
601
+ const command = buildExecCommand(request);
602
+ const result = await pool.exec(container.id, {
603
+ command,
604
+ cwd: "/workspace",
605
+ env: request.env,
606
+ timeoutMs: request.timeoutMs ?? 12e4
607
+ });
608
+ const outputFiles = await collectOutputFiles(pool, container.id);
609
+ return {
610
+ stdout: result.stdout,
611
+ stderr: result.stderr,
612
+ exitCode: result.exitCode,
613
+ durationMs: result.durationMs,
614
+ outputFiles
615
+ };
616
+ } catch (err) {
617
+ logError(err);
618
+ throw err;
619
+ } finally {
620
+ pool.release(container.id);
621
+ }
622
+ }
623
+ async function installDependencies(containerId, runtime, dependenciesFile, skillDir) {
624
+ const lifecycle = getContainerLifecycleManager();
625
+ const depsPath = `/workspace/skill/${dependenciesFile}`;
626
+ let command;
627
+ switch (runtime) {
628
+ case "python":
629
+ command = ["pip", "install", "--no-cache-dir", "-r", depsPath];
630
+ break;
631
+ case "node":
632
+ command = ["npm", "install", "--prefix", "/workspace/skill"];
633
+ break;
634
+ default:
635
+ return { stdout: "", stderr: "", exitCode: 0, durationMs: 0, timedOut: false };
636
+ }
637
+ return lifecycle.exec(containerId, {
638
+ command,
639
+ cwd: "/workspace",
640
+ timeoutMs: 6e4
641
+ });
642
+ }
643
+ function buildExecCommand(request) {
644
+ const scriptPath = `/workspace/skill/${request.executionScript}`;
645
+ switch (request.runtime) {
646
+ case "python":
647
+ return ["python", scriptPath, ...request.args ? [request.args] : []];
648
+ case "node":
649
+ return ["node", scriptPath, ...request.args ? [request.args] : []];
650
+ case "bash":
651
+ return ["bash", scriptPath, ...request.args ? [request.args] : []];
652
+ default:
653
+ return ["sh", scriptPath, ...request.args ? [request.args] : []];
654
+ }
655
+ }
656
+ async function collectOutputFiles(pool, containerId) {
657
+ try {
658
+ const lsResult = await pool.exec(containerId, {
659
+ command: ["find", "/workspace/project", "-maxdepth", "2", "-type", "f", "-newer", "/workspace/skill", "-name", "*.*"],
660
+ cwd: "/workspace",
661
+ timeoutMs: 5e3
662
+ });
663
+ if (lsResult.exitCode !== 0 || !lsResult.stdout.trim()) return [];
664
+ return lsResult.stdout.trim().split("\n").filter((f) => {
665
+ const ext = f.slice(f.lastIndexOf(".")).toLowerCase();
666
+ return OUTPUT_EXTENSIONS.has(ext);
667
+ });
668
+ } catch {
669
+ return [];
670
+ }
671
+ }
672
+ function canExecuteInSandbox(skill) {
673
+ return !!(skill.runtime && skill.executionScript);
674
+ }
675
+ var OUTPUT_EXTENSIONS;
676
+ var init_skillExecutor = __esm({
677
+ "src/services/sandbox/skillExecutor.ts"() {
678
+ init_log();
679
+ init_debugLogger();
680
+ init_sandbox();
681
+ init_containerLifecycle();
682
+ OUTPUT_EXTENSIONS = /* @__PURE__ */ new Set([
683
+ ".png",
684
+ ".jpg",
685
+ ".jpeg",
686
+ ".gif",
687
+ ".svg",
688
+ ".webp",
689
+ ".html",
690
+ ".htm",
691
+ ".csv",
692
+ ".json",
693
+ ".xml",
694
+ ".md",
695
+ ".txt",
696
+ ".py",
697
+ ".js",
698
+ ".ts"
699
+ ]);
700
+ }
701
+ });
702
+
703
+ // src/services/sandbox/index.ts
704
+ var sandbox_exports = {};
705
+ __export(sandbox_exports, {
706
+ ContainerLifecycleManager: () => ContainerLifecycleManager,
707
+ ContainerPool: () => ContainerPool,
708
+ DEFAULT_SANDBOX_CONFIG: () => DEFAULT_SANDBOX_CONFIG,
709
+ canExecuteInSandbox: () => canExecuteInSandbox,
710
+ createContainer: () => createContainer,
711
+ detectContainerEngine: () => detectContainerEngine,
712
+ execInContainer: () => execInContainer,
713
+ executeSkillInSandbox: () => executeSkillInSandbox,
714
+ getAllRuntimeImages: () => getAllRuntimeImages,
715
+ getContainerLifecycleManager: () => getContainerLifecycleManager,
716
+ getContainerStatus: () => getContainerStatus,
717
+ getEngineBinary: () => getEngineBinary,
718
+ getEngineType: () => getEngineType,
719
+ getImageFullName: () => getImageFullName,
720
+ getRuntimeImage: () => getRuntimeImage,
721
+ getSandboxCapabilities: () => getSandboxCapabilities,
722
+ getSandboxPool: () => getSandboxPool,
723
+ imageExists: () => imageExists,
724
+ initSandboxPool: () => initSandboxPool,
725
+ pullImage: () => pullImage,
726
+ removeContainer: () => removeContainer,
727
+ resolveImage: () => resolveImage,
728
+ shutdownSandboxPool: () => shutdownSandboxPool,
729
+ stopContainer: () => stopContainer,
730
+ tryInitSandboxPool: () => tryInitSandboxPool
731
+ });
732
+ async function initSandboxPool(config) {
733
+ const capabilities = await detectContainerEngine();
734
+ detectedCapabilities = capabilities;
735
+ if (!capabilities.available) {
736
+ throw new Error(
737
+ `No container engine available. Install Podman (rootless preferred) or Docker.
738
+ Podman: https://podman.io/docs/installation
739
+ Docker: https://docs.docker.com/get-docker/`
740
+ );
741
+ }
742
+ const lifecycle = getContainerLifecycleManager();
743
+ globalPool = new ContainerPool(lifecycle, config);
744
+ return globalPool;
745
+ }
746
+ async function tryInitSandboxPool(config) {
747
+ try {
748
+ const capabilities = await detectContainerEngine();
749
+ detectedCapabilities = capabilities;
750
+ if (!capabilities.available) {
751
+ return { pool: null, capabilities };
752
+ }
753
+ const lifecycle = getContainerLifecycleManager();
754
+ globalPool = new ContainerPool(lifecycle, config);
755
+ return { pool: globalPool, capabilities };
756
+ } catch {
757
+ return {
758
+ pool: null,
759
+ capabilities: { name: "none", available: false, rootless: false }
760
+ };
761
+ }
762
+ }
763
+ function getSandboxPool() {
764
+ return globalPool;
765
+ }
766
+ function getSandboxCapabilities() {
767
+ return detectedCapabilities;
768
+ }
769
+ async function shutdownSandboxPool() {
770
+ if (globalPool) {
771
+ await globalPool.shutdown();
772
+ globalPool = null;
773
+ }
774
+ const lifecycle = getContainerLifecycleManager();
775
+ await lifecycle.destroyAll();
776
+ }
777
+ var globalPool, detectedCapabilities;
778
+ var init_sandbox = __esm({
779
+ "src/services/sandbox/index.ts"() {
780
+ init_types();
781
+ init_podmanEngine();
782
+ init_runtimeImages();
783
+ init_containerLifecycle();
784
+ init_containerPool();
785
+ init_skillExecutor();
786
+ init_containerPool();
787
+ init_containerLifecycle();
788
+ init_podmanEngine();
789
+ globalPool = null;
790
+ detectedCapabilities = null;
791
+ }
792
+ });
793
+
794
+ export {
795
+ DEFAULT_SANDBOX_CONFIG,
796
+ getRuntimeImage,
797
+ getImageFullName,
798
+ getAllRuntimeImages,
799
+ resolveImage,
800
+ detectContainerEngine,
801
+ getEngineBinary,
802
+ getEngineType,
803
+ createContainer,
804
+ execInContainer,
805
+ removeContainer,
806
+ stopContainer,
807
+ getContainerStatus,
808
+ pullImage,
809
+ imageExists,
810
+ ContainerLifecycleManager,
811
+ getContainerLifecycleManager,
812
+ ContainerPool,
813
+ executeSkillInSandbox,
814
+ canExecuteInSandbox,
815
+ initSandboxPool,
816
+ tryInitSandboxPool,
817
+ getSandboxPool,
818
+ getSandboxCapabilities,
819
+ shutdownSandboxPool,
820
+ sandbox_exports,
821
+ init_sandbox
822
+ };