@tickernelz/paperclip-pro-adapter-utils 2026.925.0

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 (1826) hide show
  1. package/README.md +37 -0
  2. package/dist/acpx-engine/cli.d.ts +2 -0
  3. package/dist/acpx-engine/cli.d.ts.map +1 -0
  4. package/dist/acpx-engine/cli.js +128 -0
  5. package/dist/acpx-engine/cli.js.map +1 -0
  6. package/dist/acpx-engine/composed-run-characterization.test.d.ts +2 -0
  7. package/dist/acpx-engine/composed-run-characterization.test.d.ts.map +1 -0
  8. package/dist/acpx-engine/composed-run-characterization.test.js +739 -0
  9. package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -0
  10. package/dist/acpx-engine/constants.d.ts +20 -0
  11. package/dist/acpx-engine/constants.d.ts.map +1 -0
  12. package/dist/acpx-engine/constants.js +37 -0
  13. package/dist/acpx-engine/constants.js.map +1 -0
  14. package/dist/acpx-engine/execute-identity.test.d.ts +2 -0
  15. package/dist/acpx-engine/execute-identity.test.d.ts.map +1 -0
  16. package/dist/acpx-engine/execute-identity.test.js +218 -0
  17. package/dist/acpx-engine/execute-identity.test.js.map +1 -0
  18. package/dist/acpx-engine/execute.d.ts +325 -0
  19. package/dist/acpx-engine/execute.d.ts.map +1 -0
  20. package/dist/acpx-engine/execute.js +4448 -0
  21. package/dist/acpx-engine/execute.js.map +1 -0
  22. package/dist/acpx-engine/execute.test.d.ts +2 -0
  23. package/dist/acpx-engine/execute.test.d.ts.map +1 -0
  24. package/dist/acpx-engine/execute.test.js +6694 -0
  25. package/dist/acpx-engine/execute.test.js.map +1 -0
  26. package/dist/acpx-engine/index.d.ts +6 -0
  27. package/dist/acpx-engine/index.d.ts.map +1 -0
  28. package/dist/acpx-engine/index.js +6 -0
  29. package/dist/acpx-engine/index.js.map +1 -0
  30. package/dist/acpx-engine/local-process-control.d.ts +5 -0
  31. package/dist/acpx-engine/local-process-control.d.ts.map +1 -0
  32. package/dist/acpx-engine/local-process-control.js +39 -0
  33. package/dist/acpx-engine/local-process-control.js.map +1 -0
  34. package/dist/acpx-engine/local-process-control.test.d.ts +2 -0
  35. package/dist/acpx-engine/local-process-control.test.d.ts.map +1 -0
  36. package/dist/acpx-engine/local-process-control.test.js +38 -0
  37. package/dist/acpx-engine/local-process-control.test.js.map +1 -0
  38. package/dist/acpx-engine/operator-stop.test.d.ts +2 -0
  39. package/dist/acpx-engine/operator-stop.test.d.ts.map +1 -0
  40. package/dist/acpx-engine/operator-stop.test.js +107 -0
  41. package/dist/acpx-engine/operator-stop.test.js.map +1 -0
  42. package/dist/acpx-engine/remote-spawn-smoke.test.d.ts +2 -0
  43. package/dist/acpx-engine/remote-spawn-smoke.test.d.ts.map +1 -0
  44. package/dist/acpx-engine/remote-spawn-smoke.test.js +151 -0
  45. package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -0
  46. package/dist/acpx-engine/run-contracts.d.ts +413 -0
  47. package/dist/acpx-engine/run-contracts.d.ts.map +1 -0
  48. package/dist/acpx-engine/run-contracts.js +20 -0
  49. package/dist/acpx-engine/run-contracts.js.map +1 -0
  50. package/dist/acpx-engine/run-contracts.test.d.ts +2 -0
  51. package/dist/acpx-engine/run-contracts.test.d.ts.map +1 -0
  52. package/dist/acpx-engine/run-contracts.test.js +57 -0
  53. package/dist/acpx-engine/run-contracts.test.js.map +1 -0
  54. package/dist/acpx-engine/run-coordinator.d.ts +57 -0
  55. package/dist/acpx-engine/run-coordinator.d.ts.map +1 -0
  56. package/dist/acpx-engine/run-coordinator.js +63 -0
  57. package/dist/acpx-engine/run-coordinator.js.map +1 -0
  58. package/dist/acpx-engine/run-coordinator.test.d.ts +2 -0
  59. package/dist/acpx-engine/run-coordinator.test.d.ts.map +1 -0
  60. package/dist/acpx-engine/run-coordinator.test.js +160 -0
  61. package/dist/acpx-engine/run-coordinator.test.js.map +1 -0
  62. package/dist/acpx-engine/run-fault-matrix.test.d.ts +2 -0
  63. package/dist/acpx-engine/run-fault-matrix.test.d.ts.map +1 -0
  64. package/dist/acpx-engine/run-fault-matrix.test.js +829 -0
  65. package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -0
  66. package/dist/acpx-engine/run-resource-ledger.d.ts +30 -0
  67. package/dist/acpx-engine/run-resource-ledger.d.ts.map +1 -0
  68. package/dist/acpx-engine/run-resource-ledger.js +148 -0
  69. package/dist/acpx-engine/run-resource-ledger.js.map +1 -0
  70. package/dist/acpx-engine/run-resource-ledger.test.d.ts +2 -0
  71. package/dist/acpx-engine/run-resource-ledger.test.d.ts.map +1 -0
  72. package/dist/acpx-engine/run-resource-ledger.test.js +154 -0
  73. package/dist/acpx-engine/run-resource-ledger.test.js.map +1 -0
  74. package/dist/acpx-engine/run-site-host.d.ts +73 -0
  75. package/dist/acpx-engine/run-site-host.d.ts.map +1 -0
  76. package/dist/acpx-engine/run-site-host.js +65 -0
  77. package/dist/acpx-engine/run-site-host.js.map +1 -0
  78. package/dist/acpx-engine/run-site-host.test.d.ts +2 -0
  79. package/dist/acpx-engine/run-site-host.test.d.ts.map +1 -0
  80. package/dist/acpx-engine/run-site-host.test.js +98 -0
  81. package/dist/acpx-engine/run-site-host.test.js.map +1 -0
  82. package/dist/acpx-engine/run-site-sandbox.d.ts +142 -0
  83. package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -0
  84. package/dist/acpx-engine/run-site-sandbox.js +278 -0
  85. package/dist/acpx-engine/run-site-sandbox.js.map +1 -0
  86. package/dist/acpx-engine/run-site-sandbox.test.d.ts +2 -0
  87. package/dist/acpx-engine/run-site-sandbox.test.d.ts.map +1 -0
  88. package/dist/acpx-engine/run-site-sandbox.test.js +275 -0
  89. package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -0
  90. package/dist/acpx-engine/session-codec.d.ts +3 -0
  91. package/dist/acpx-engine/session-codec.d.ts.map +1 -0
  92. package/dist/acpx-engine/session-codec.js +49 -0
  93. package/dist/acpx-engine/session-codec.js.map +1 -0
  94. package/dist/acpx-engine/session-reuse-store.d.ts +62 -0
  95. package/dist/acpx-engine/session-reuse-store.d.ts.map +1 -0
  96. package/dist/acpx-engine/session-reuse-store.js +134 -0
  97. package/dist/acpx-engine/session-reuse-store.js.map +1 -0
  98. package/dist/acpx-engine/session-reuse-store.test.d.ts +2 -0
  99. package/dist/acpx-engine/session-reuse-store.test.d.ts.map +1 -0
  100. package/dist/acpx-engine/session-reuse-store.test.js +134 -0
  101. package/dist/acpx-engine/session-reuse-store.test.js.map +1 -0
  102. package/dist/acpx-engine/settlement-characterization.test.d.ts +2 -0
  103. package/dist/acpx-engine/settlement-characterization.test.d.ts.map +1 -0
  104. package/dist/acpx-engine/settlement-characterization.test.js +880 -0
  105. package/dist/acpx-engine/settlement-characterization.test.js.map +1 -0
  106. package/dist/acpx-engine/settlement-sequence.d.ts +77 -0
  107. package/dist/acpx-engine/settlement-sequence.d.ts.map +1 -0
  108. package/dist/acpx-engine/settlement-sequence.js +119 -0
  109. package/dist/acpx-engine/settlement-sequence.js.map +1 -0
  110. package/dist/acpx-engine/settlement-sequence.test.d.ts +2 -0
  111. package/dist/acpx-engine/settlement-sequence.test.d.ts.map +1 -0
  112. package/dist/acpx-engine/settlement-sequence.test.js +272 -0
  113. package/dist/acpx-engine/settlement-sequence.test.js.map +1 -0
  114. package/dist/acpx-engine/spawn-smoke.test.d.ts +2 -0
  115. package/dist/acpx-engine/spawn-smoke.test.d.ts.map +1 -0
  116. package/dist/acpx-engine/spawn-smoke.test.js +184 -0
  117. package/dist/acpx-engine/spawn-smoke.test.js.map +1 -0
  118. package/dist/acpx-engine/startup-cancellation.d.ts +8 -0
  119. package/dist/acpx-engine/startup-cancellation.d.ts.map +1 -0
  120. package/dist/acpx-engine/startup-cancellation.js +92 -0
  121. package/dist/acpx-engine/startup-cancellation.js.map +1 -0
  122. package/dist/acpx-engine/startup-cancellation.test.d.ts +2 -0
  123. package/dist/acpx-engine/startup-cancellation.test.d.ts.map +1 -0
  124. package/dist/acpx-engine/startup-cancellation.test.js +115 -0
  125. package/dist/acpx-engine/startup-cancellation.test.js.map +1 -0
  126. package/dist/acpx-engine/startup-characterization.test.d.ts +2 -0
  127. package/dist/acpx-engine/startup-characterization.test.d.ts.map +1 -0
  128. package/dist/acpx-engine/startup-characterization.test.js +742 -0
  129. package/dist/acpx-engine/startup-characterization.test.js.map +1 -0
  130. package/dist/acpx-engine/startup-timing.d.ts +419 -0
  131. package/dist/acpx-engine/startup-timing.d.ts.map +1 -0
  132. package/dist/acpx-engine/startup-timing.js +616 -0
  133. package/dist/acpx-engine/startup-timing.js.map +1 -0
  134. package/dist/acpx-engine/startup-timing.test.d.ts +2 -0
  135. package/dist/acpx-engine/startup-timing.test.d.ts.map +1 -0
  136. package/dist/acpx-engine/startup-timing.test.js +619 -0
  137. package/dist/acpx-engine/startup-timing.test.js.map +1 -0
  138. package/dist/acpx-engine/turn-characterization.test.d.ts +2 -0
  139. package/dist/acpx-engine/turn-characterization.test.d.ts.map +1 -0
  140. package/dist/acpx-engine/turn-characterization.test.js +566 -0
  141. package/dist/acpx-engine/turn-characterization.test.js.map +1 -0
  142. package/dist/acpx-engine/turn-sequence.d.ts +54 -0
  143. package/dist/acpx-engine/turn-sequence.d.ts.map +1 -0
  144. package/dist/acpx-engine/turn-sequence.js +75 -0
  145. package/dist/acpx-engine/turn-sequence.js.map +1 -0
  146. package/dist/acpx-engine/turn-sequence.test.d.ts +2 -0
  147. package/dist/acpx-engine/turn-sequence.test.d.ts.map +1 -0
  148. package/dist/acpx-engine/turn-sequence.test.js +177 -0
  149. package/dist/acpx-engine/turn-sequence.test.js.map +1 -0
  150. package/dist/acpx-engine/ui.d.ts +3 -0
  151. package/dist/acpx-engine/ui.d.ts.map +1 -0
  152. package/dist/acpx-engine/ui.js +162 -0
  153. package/dist/acpx-engine/ui.js.map +1 -0
  154. package/dist/billing.d.ts +2 -0
  155. package/dist/billing.d.ts.map +1 -0
  156. package/dist/billing.js +16 -0
  157. package/dist/billing.js.map +1 -0
  158. package/dist/billing.test.d.ts +2 -0
  159. package/dist/billing.test.d.ts.map +1 -0
  160. package/dist/billing.test.js +14 -0
  161. package/dist/billing.test.js.map +1 -0
  162. package/dist/bridge-transport-contract.d.ts +43 -0
  163. package/dist/bridge-transport-contract.d.ts.map +1 -0
  164. package/dist/bridge-transport-contract.js +33 -0
  165. package/dist/bridge-transport-contract.js.map +1 -0
  166. package/dist/chat-file-delivery.d.ts +10 -0
  167. package/dist/chat-file-delivery.d.ts.map +1 -0
  168. package/dist/chat-file-delivery.js +38 -0
  169. package/dist/chat-file-delivery.js.map +1 -0
  170. package/dist/chat-file-delivery.test.d.ts +2 -0
  171. package/dist/chat-file-delivery.test.d.ts.map +1 -0
  172. package/dist/chat-file-delivery.test.js +92 -0
  173. package/dist/chat-file-delivery.test.js.map +1 -0
  174. package/dist/command-managed-runtime.d.ts +162 -0
  175. package/dist/command-managed-runtime.d.ts.map +1 -0
  176. package/dist/command-managed-runtime.js +456 -0
  177. package/dist/command-managed-runtime.js.map +1 -0
  178. package/dist/command-managed-runtime.test.d.ts +2 -0
  179. package/dist/command-managed-runtime.test.d.ts.map +1 -0
  180. package/dist/command-managed-runtime.test.js +908 -0
  181. package/dist/command-managed-runtime.test.js.map +1 -0
  182. package/dist/command-redaction.d.ts +15 -0
  183. package/dist/command-redaction.d.ts.map +1 -0
  184. package/dist/command-redaction.js +97 -0
  185. package/dist/command-redaction.js.map +1 -0
  186. package/dist/command-redaction.test.d.ts +2 -0
  187. package/dist/command-redaction.test.d.ts.map +1 -0
  188. package/dist/command-redaction.test.js +80 -0
  189. package/dist/command-redaction.test.js.map +1 -0
  190. package/dist/duplex-frame-codec.d.ts +124 -0
  191. package/dist/duplex-frame-codec.d.ts.map +1 -0
  192. package/dist/duplex-frame-codec.js +134 -0
  193. package/dist/duplex-frame-codec.js.map +1 -0
  194. package/dist/duplex-frame-codec.test.d.ts +2 -0
  195. package/dist/duplex-frame-codec.test.d.ts.map +1 -0
  196. package/dist/duplex-frame-codec.test.js +172 -0
  197. package/dist/duplex-frame-codec.test.js.map +1 -0
  198. package/dist/duplex-observability.d.ts +220 -0
  199. package/dist/duplex-observability.d.ts.map +1 -0
  200. package/dist/duplex-observability.js +248 -0
  201. package/dist/duplex-observability.js.map +1 -0
  202. package/dist/duplex-observability.test.d.ts +2 -0
  203. package/dist/duplex-observability.test.d.ts.map +1 -0
  204. package/dist/duplex-observability.test.js +55 -0
  205. package/dist/duplex-observability.test.js.map +1 -0
  206. package/dist/env-bindings.d.ts +17 -0
  207. package/dist/env-bindings.d.ts.map +1 -0
  208. package/dist/env-bindings.js +98 -0
  209. package/dist/env-bindings.js.map +1 -0
  210. package/dist/env-bindings.test.d.ts +2 -0
  211. package/dist/env-bindings.test.d.ts.map +1 -0
  212. package/dist/env-bindings.test.js +66 -0
  213. package/dist/env-bindings.test.js.map +1 -0
  214. package/dist/exclude-patterns.d.ts +4 -0
  215. package/dist/exclude-patterns.d.ts.map +1 -0
  216. package/dist/exclude-patterns.js +26 -0
  217. package/dist/exclude-patterns.js.map +1 -0
  218. package/dist/execution-target-sandbox.test.d.ts +2 -0
  219. package/dist/execution-target-sandbox.test.d.ts.map +1 -0
  220. package/dist/execution-target-sandbox.test.js +6522 -0
  221. package/dist/execution-target-sandbox.test.js.map +1 -0
  222. package/dist/execution-target-stdin-race.test.d.ts +2 -0
  223. package/dist/execution-target-stdin-race.test.d.ts.map +1 -0
  224. package/dist/execution-target-stdin-race.test.js +1842 -0
  225. package/dist/execution-target-stdin-race.test.js.map +1 -0
  226. package/dist/execution-target.d.ts +537 -0
  227. package/dist/execution-target.d.ts.map +1 -0
  228. package/dist/execution-target.js +3877 -0
  229. package/dist/execution-target.js.map +1 -0
  230. package/dist/execution-target.test.d.ts +2 -0
  231. package/dist/execution-target.test.d.ts.map +1 -0
  232. package/dist/execution-target.test.js +346 -0
  233. package/dist/execution-target.test.js.map +1 -0
  234. package/dist/git-workspace-sync.d.ts +193 -0
  235. package/dist/git-workspace-sync.d.ts.map +1 -0
  236. package/dist/git-workspace-sync.js +786 -0
  237. package/dist/git-workspace-sync.js.map +1 -0
  238. package/dist/git-workspace-sync.test.d.ts +2 -0
  239. package/dist/git-workspace-sync.test.d.ts.map +1 -0
  240. package/dist/git-workspace-sync.test.js +830 -0
  241. package/dist/git-workspace-sync.test.js.map +1 -0
  242. package/dist/github-launcher-environment.test.d.ts +2 -0
  243. package/dist/github-launcher-environment.test.d.ts.map +1 -0
  244. package/dist/github-launcher-environment.test.js +285 -0
  245. package/dist/github-launcher-environment.test.js.map +1 -0
  246. package/dist/github-launcher.d.ts +8 -0
  247. package/dist/github-launcher.d.ts.map +1 -0
  248. package/dist/github-launcher.js +127 -0
  249. package/dist/github-launcher.js.map +1 -0
  250. package/dist/github-launcher.test.d.ts +2 -0
  251. package/dist/github-launcher.test.d.ts.map +1 -0
  252. package/dist/github-launcher.test.js +166 -0
  253. package/dist/github-launcher.test.js.map +1 -0
  254. package/dist/http2-bridge-server.d.ts +465 -0
  255. package/dist/http2-bridge-server.d.ts.map +1 -0
  256. package/dist/http2-bridge-server.js +1087 -0
  257. package/dist/http2-bridge-server.js.map +1 -0
  258. package/dist/http2-bridge-server.test.d.ts +2 -0
  259. package/dist/http2-bridge-server.test.d.ts.map +1 -0
  260. package/dist/http2-bridge-server.test.js +2129 -0
  261. package/dist/http2-bridge-server.test.js.map +1 -0
  262. package/dist/index.d.ts +20 -0
  263. package/dist/index.d.ts.map +1 -0
  264. package/dist/index.js +12 -0
  265. package/dist/index.js.map +1 -0
  266. package/dist/local-process-sandbox.d.ts +41 -0
  267. package/dist/local-process-sandbox.d.ts.map +1 -0
  268. package/dist/local-process-sandbox.js +432 -0
  269. package/dist/local-process-sandbox.js.map +1 -0
  270. package/dist/local-process-sandbox.test.d.ts +2 -0
  271. package/dist/local-process-sandbox.test.d.ts.map +1 -0
  272. package/dist/local-process-sandbox.test.js +399 -0
  273. package/dist/local-process-sandbox.test.js.map +1 -0
  274. package/dist/log-redaction.d.ts +9 -0
  275. package/dist/log-redaction.d.ts.map +1 -0
  276. package/dist/log-redaction.js +88 -0
  277. package/dist/log-redaction.js.map +1 -0
  278. package/dist/login-capability.d.ts +88 -0
  279. package/dist/login-capability.d.ts.map +1 -0
  280. package/dist/login-capability.js +78 -0
  281. package/dist/login-capability.js.map +1 -0
  282. package/dist/login-capability.test.d.ts +2 -0
  283. package/dist/login-capability.test.d.ts.map +1 -0
  284. package/dist/login-capability.test.js +78 -0
  285. package/dist/login-capability.test.js.map +1 -0
  286. package/dist/login-pty-transport.d.ts +80 -0
  287. package/dist/login-pty-transport.d.ts.map +1 -0
  288. package/dist/login-pty-transport.js +75 -0
  289. package/dist/login-pty-transport.js.map +1 -0
  290. package/dist/login-pty-transport.test.d.ts +2 -0
  291. package/dist/login-pty-transport.test.d.ts.map +1 -0
  292. package/dist/login-pty-transport.test.js +185 -0
  293. package/dist/login-pty-transport.test.js.map +1 -0
  294. package/dist/login-runner-lifecycle.d.ts +70 -0
  295. package/dist/login-runner-lifecycle.d.ts.map +1 -0
  296. package/dist/login-runner-lifecycle.js +52 -0
  297. package/dist/login-runner-lifecycle.js.map +1 -0
  298. package/dist/login-runner-lifecycle.test.d.ts +2 -0
  299. package/dist/login-runner-lifecycle.test.d.ts.map +1 -0
  300. package/dist/login-runner-lifecycle.test.js +122 -0
  301. package/dist/login-runner-lifecycle.test.js.map +1 -0
  302. package/dist/mcp-isolation.integration.test.d.ts +2 -0
  303. package/dist/mcp-isolation.integration.test.d.ts.map +1 -0
  304. package/dist/mcp-isolation.integration.test.js +202 -0
  305. package/dist/mcp-isolation.integration.test.js.map +1 -0
  306. package/dist/paperclip-runner-permissions.d.ts +110 -0
  307. package/dist/paperclip-runner-permissions.d.ts.map +1 -0
  308. package/dist/paperclip-runner-permissions.js +150 -0
  309. package/dist/paperclip-runner-permissions.js.map +1 -0
  310. package/dist/paperclip-runner-permissions.test.d.ts +2 -0
  311. package/dist/paperclip-runner-permissions.test.d.ts.map +1 -0
  312. package/dist/paperclip-runner-permissions.test.js +47 -0
  313. package/dist/paperclip-runner-permissions.test.js.map +1 -0
  314. package/dist/published-exports.test.d.ts +2 -0
  315. package/dist/published-exports.test.d.ts.map +1 -0
  316. package/dist/published-exports.test.js +17 -0
  317. package/dist/published-exports.test.js.map +1 -0
  318. package/dist/remote-execution-env.d.ts +2 -0
  319. package/dist/remote-execution-env.d.ts.map +1 -0
  320. package/dist/remote-execution-env.js +46 -0
  321. package/dist/remote-execution-env.js.map +1 -0
  322. package/dist/remote-managed-runtime.d.ts +45 -0
  323. package/dist/remote-managed-runtime.d.ts.map +1 -0
  324. package/dist/remote-managed-runtime.js +183 -0
  325. package/dist/remote-managed-runtime.js.map +1 -0
  326. package/dist/remote-managed-runtime.test.d.ts +2 -0
  327. package/dist/remote-managed-runtime.test.d.ts.map +1 -0
  328. package/dist/remote-managed-runtime.test.js +294 -0
  329. package/dist/remote-managed-runtime.test.js.map +1 -0
  330. package/dist/runner-connectivity.d.ts +61 -0
  331. package/dist/runner-connectivity.d.ts.map +1 -0
  332. package/dist/runner-connectivity.js +81 -0
  333. package/dist/runner-connectivity.js.map +1 -0
  334. package/dist/runner-connectivity.test.d.ts +2 -0
  335. package/dist/runner-connectivity.test.d.ts.map +1 -0
  336. package/dist/runner-connectivity.test.js +183 -0
  337. package/dist/runner-connectivity.test.js.map +1 -0
  338. package/dist/runtime-progress.d.ts +48 -0
  339. package/dist/runtime-progress.d.ts.map +1 -0
  340. package/dist/runtime-progress.js +99 -0
  341. package/dist/runtime-progress.js.map +1 -0
  342. package/dist/runtime-progress.test.d.ts +2 -0
  343. package/dist/runtime-progress.test.d.ts.map +1 -0
  344. package/dist/runtime-progress.test.js +240 -0
  345. package/dist/runtime-progress.test.js.map +1 -0
  346. package/dist/sandbox-callback-bridge-body.d.ts +12 -0
  347. package/dist/sandbox-callback-bridge-body.d.ts.map +1 -0
  348. package/dist/sandbox-callback-bridge-body.js +39 -0
  349. package/dist/sandbox-callback-bridge-body.js.map +1 -0
  350. package/dist/sandbox-callback-bridge-body.test.d.ts +2 -0
  351. package/dist/sandbox-callback-bridge-body.test.d.ts.map +1 -0
  352. package/dist/sandbox-callback-bridge-body.test.js +31 -0
  353. package/dist/sandbox-callback-bridge-body.test.js.map +1 -0
  354. package/dist/sandbox-callback-bridge.d.ts +268 -0
  355. package/dist/sandbox-callback-bridge.d.ts.map +1 -0
  356. package/dist/sandbox-callback-bridge.js +2357 -0
  357. package/dist/sandbox-callback-bridge.js.map +1 -0
  358. package/dist/sandbox-callback-bridge.test.d.ts +2 -0
  359. package/dist/sandbox-callback-bridge.test.d.ts.map +1 -0
  360. package/dist/sandbox-callback-bridge.test.js +3253 -0
  361. package/dist/sandbox-callback-bridge.test.js.map +1 -0
  362. package/dist/sandbox-file-sync.test.d.ts +2 -0
  363. package/dist/sandbox-file-sync.test.d.ts.map +1 -0
  364. package/dist/sandbox-file-sync.test.js +419 -0
  365. package/dist/sandbox-file-sync.test.js.map +1 -0
  366. package/dist/sandbox-install-command.d.ts +2 -0
  367. package/dist/sandbox-install-command.d.ts.map +1 -0
  368. package/dist/sandbox-install-command.js +47 -0
  369. package/dist/sandbox-install-command.js.map +1 -0
  370. package/dist/sandbox-install-command.test.d.ts +2 -0
  371. package/dist/sandbox-install-command.test.d.ts.map +1 -0
  372. package/dist/sandbox-install-command.test.js +22 -0
  373. package/dist/sandbox-install-command.test.js.map +1 -0
  374. package/dist/sandbox-managed-runtime.d.ts +417 -0
  375. package/dist/sandbox-managed-runtime.d.ts.map +1 -0
  376. package/dist/sandbox-managed-runtime.js +1337 -0
  377. package/dist/sandbox-managed-runtime.js.map +1 -0
  378. package/dist/sandbox-managed-runtime.test.d.ts +2 -0
  379. package/dist/sandbox-managed-runtime.test.d.ts.map +1 -0
  380. package/dist/sandbox-managed-runtime.test.js +3746 -0
  381. package/dist/sandbox-managed-runtime.test.js.map +1 -0
  382. package/dist/sandbox-run-log-stream.d.ts +44 -0
  383. package/dist/sandbox-run-log-stream.d.ts.map +1 -0
  384. package/dist/sandbox-run-log-stream.js +203 -0
  385. package/dist/sandbox-run-log-stream.js.map +1 -0
  386. package/dist/sandbox-shell.d.ts +3 -0
  387. package/dist/sandbox-shell.d.ts.map +1 -0
  388. package/dist/sandbox-shell.js +7 -0
  389. package/dist/sandbox-shell.js.map +1 -0
  390. package/dist/server-utils-env.test.d.ts +2 -0
  391. package/dist/server-utils-env.test.d.ts.map +1 -0
  392. package/dist/server-utils-env.test.js +15 -0
  393. package/dist/server-utils-env.test.js.map +1 -0
  394. package/dist/server-utils.d.ts +617 -0
  395. package/dist/server-utils.d.ts.map +1 -0
  396. package/dist/server-utils.js +3258 -0
  397. package/dist/server-utils.js.map +1 -0
  398. package/dist/server-utils.test.d.ts +2 -0
  399. package/dist/server-utils.test.d.ts.map +1 -0
  400. package/dist/server-utils.test.js +3047 -0
  401. package/dist/server-utils.test.js.map +1 -0
  402. package/dist/session-compaction.d.ts +25 -0
  403. package/dist/session-compaction.d.ts.map +1 -0
  404. package/dist/session-compaction.js +165 -0
  405. package/dist/session-compaction.js.map +1 -0
  406. package/dist/skill-library-manifest.d.ts +6 -0
  407. package/dist/skill-library-manifest.d.ts.map +1 -0
  408. package/dist/skill-library-manifest.js +53 -0
  409. package/dist/skill-library-manifest.js.map +1 -0
  410. package/dist/skill-library-manifest.test.d.ts +2 -0
  411. package/dist/skill-library-manifest.test.d.ts.map +1 -0
  412. package/dist/skill-library-manifest.test.js +84 -0
  413. package/dist/skill-library-manifest.test.js.map +1 -0
  414. package/dist/skills-staging-follow-symlinks.test.d.ts +2 -0
  415. package/dist/skills-staging-follow-symlinks.test.d.ts.map +1 -0
  416. package/dist/skills-staging-follow-symlinks.test.js +126 -0
  417. package/dist/skills-staging-follow-symlinks.test.js.map +1 -0
  418. package/dist/ssh-fixture.test.d.ts +2 -0
  419. package/dist/ssh-fixture.test.d.ts.map +1 -0
  420. package/dist/ssh-fixture.test.js +832 -0
  421. package/dist/ssh-fixture.test.js.map +1 -0
  422. package/dist/ssh.d.ts +124 -0
  423. package/dist/ssh.d.ts.map +1 -0
  424. package/dist/ssh.js +1667 -0
  425. package/dist/ssh.js.map +1 -0
  426. package/dist/sync-operation-schedule.d.ts +17 -0
  427. package/dist/sync-operation-schedule.d.ts.map +1 -0
  428. package/dist/sync-operation-schedule.js +66 -0
  429. package/dist/sync-operation-schedule.js.map +1 -0
  430. package/dist/sync-operation-schedule.test.d.ts +2 -0
  431. package/dist/sync-operation-schedule.test.d.ts.map +1 -0
  432. package/dist/sync-operation-schedule.test.js +130 -0
  433. package/dist/sync-operation-schedule.test.js.map +1 -0
  434. package/dist/test-support/mcp-isolation-harness.d.ts +23 -0
  435. package/dist/test-support/mcp-isolation-harness.d.ts.map +1 -0
  436. package/dist/test-support/mcp-isolation-harness.js +67 -0
  437. package/dist/test-support/mcp-isolation-harness.js.map +1 -0
  438. package/dist/types.d.ts +780 -0
  439. package/dist/types.d.ts.map +1 -0
  440. package/dist/types.js +5 -0
  441. package/dist/types.js.map +1 -0
  442. package/dist/workspace-restore-merge.d.ts +77 -0
  443. package/dist/workspace-restore-merge.d.ts.map +1 -0
  444. package/dist/workspace-restore-merge.js +396 -0
  445. package/dist/workspace-restore-merge.js.map +1 -0
  446. package/dist/workspace-restore-merge.test.d.ts +2 -0
  447. package/dist/workspace-restore-merge.test.d.ts.map +1 -0
  448. package/dist/workspace-restore-merge.test.js +438 -0
  449. package/dist/workspace-restore-merge.test.js.map +1 -0
  450. package/dist/workspace-restore-teardown.d.ts +29 -0
  451. package/dist/workspace-restore-teardown.d.ts.map +1 -0
  452. package/dist/workspace-restore-teardown.js +34 -0
  453. package/dist/workspace-restore-teardown.js.map +1 -0
  454. package/dist/workspace-restore-teardown.test.d.ts +2 -0
  455. package/dist/workspace-restore-teardown.test.d.ts.map +1 -0
  456. package/dist/workspace-restore-teardown.test.js +71 -0
  457. package/dist/workspace-restore-teardown.test.js.map +1 -0
  458. package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
  459. package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
  460. package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1803 -0
  461. package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1869 -0
  462. package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  463. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
  464. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
  465. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
  466. package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +89 -0
  467. package/node_modules/@agentclientprotocol/sdk/dist/connection.js +490 -0
  468. package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
  469. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
  470. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +507 -0
  471. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
  472. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
  473. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
  474. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
  475. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
  476. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
  477. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
  478. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
  479. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
  480. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
  481. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
  482. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
  483. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
  484. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
  485. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +221 -0
  486. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
  487. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
  488. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
  489. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
  490. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
  491. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +112 -0
  492. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
  493. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
  494. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
  495. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
  496. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
  497. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -0
  498. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
  499. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
  500. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
  501. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
  502. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
  503. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1076 -0
  504. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
  505. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
  506. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +917 -0
  507. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
  508. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
  509. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -0
  510. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
  511. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
  512. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
  513. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
  514. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
  515. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -0
  516. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
  517. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
  518. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
  519. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
  520. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
  521. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -0
  522. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
  523. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
  524. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
  525. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
  526. package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
  527. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +69 -0
  528. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
  529. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
  530. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +82 -0
  531. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
  532. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +183 -0
  533. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +207 -0
  534. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
  535. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
  536. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
  537. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
  538. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6219 -0
  539. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
  540. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
  541. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +15215 -0
  542. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3084 -0
  543. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
  544. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
  545. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -0
  546. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
  547. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
  548. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
  549. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
  550. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
  551. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
  552. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
  553. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
  554. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +536 -0
  555. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
  556. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
  557. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +88 -0
  558. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
  559. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
  560. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +53 -0
  561. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
  562. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
  563. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +992 -0
  564. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
  565. package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
  566. package/node_modules/@agentclientprotocol/sdk/dist/server.js +386 -0
  567. package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
  568. package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
  569. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1116 -0
  570. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
  571. package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
  572. package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -0
  573. package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
  574. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
  575. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
  576. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
  577. package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
  578. package/node_modules/@agentclientprotocol/sdk/dist/stream.js +115 -0
  579. package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  580. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
  581. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +195 -0
  582. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
  583. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
  584. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
  585. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
  586. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
  587. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
  588. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
  589. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
  590. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
  591. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
  592. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +957 -0
  593. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1484 -0
  594. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
  595. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
  596. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +1287 -0
  597. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
  598. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +946 -0
  599. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1046 -0
  600. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
  601. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
  602. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -0
  603. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
  604. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6208 -0
  605. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
  606. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
  607. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +33267 -0
  608. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3199 -0
  609. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
  610. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
  611. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +357 -0
  612. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
  613. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
  614. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +253 -0
  615. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
  616. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
  617. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +836 -0
  618. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
  619. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
  620. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
  621. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
  622. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
  623. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
  624. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
  625. package/node_modules/@agentclientprotocol/sdk/package.json +104 -0
  626. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8967 -0
  627. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10242 -0
  628. package/node_modules/@clack/core/LICENSE +9 -0
  629. package/node_modules/@clack/core/README.md +22 -0
  630. package/node_modules/@clack/core/dist/index.d.mts +503 -0
  631. package/node_modules/@clack/core/dist/index.mjs +1003 -0
  632. package/node_modules/@clack/core/package.json +63 -0
  633. package/node_modules/@clack/prompts/LICENSE +9 -0
  634. package/node_modules/@clack/prompts/README.md +396 -0
  635. package/node_modules/@clack/prompts/dist/index.d.mts +949 -0
  636. package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
  637. package/node_modules/@clack/prompts/package.json +67 -0
  638. package/node_modules/@esbuild/linux-x64/README.md +3 -0
  639. package/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  640. package/node_modules/@esbuild/linux-x64/package.json +20 -0
  641. package/node_modules/acpx/LICENSE +21 -0
  642. package/node_modules/acpx/README.md +424 -0
  643. package/node_modules/acpx/dist/cli-CxsS1XQp.js +197 -0
  644. package/node_modules/acpx/dist/cli-CxsS1XQp.js.map +1 -0
  645. package/node_modules/acpx/dist/cli.d.ts +14 -0
  646. package/node_modules/acpx/dist/cli.d.ts.map +1 -0
  647. package/node_modules/acpx/dist/cli.js +2683 -0
  648. package/node_modules/acpx/dist/cli.js.map +1 -0
  649. package/node_modules/acpx/dist/client-DwNyFauq.d.ts +192 -0
  650. package/node_modules/acpx/dist/client-DwNyFauq.d.ts.map +1 -0
  651. package/node_modules/acpx/dist/flags-Bjq_XQ4-.js +260 -0
  652. package/node_modules/acpx/dist/flags-Bjq_XQ4-.js.map +1 -0
  653. package/node_modules/acpx/dist/flows-Db_LZKu9.js +1920 -0
  654. package/node_modules/acpx/dist/flows-Db_LZKu9.js.map +1 -0
  655. package/node_modules/acpx/dist/flows.d.ts +318 -0
  656. package/node_modules/acpx/dist/flows.d.ts.map +1 -0
  657. package/node_modules/acpx/dist/flows.js +2 -0
  658. package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js +6210 -0
  659. package/node_modules/acpx/dist/live-checkpoint-ClPCSdrW.js.map +1 -0
  660. package/node_modules/acpx/dist/output-CjdF5rHk.js +4593 -0
  661. package/node_modules/acpx/dist/output-CjdF5rHk.js.map +1 -0
  662. package/node_modules/acpx/dist/runtime.d.ts +472 -0
  663. package/node_modules/acpx/dist/runtime.d.ts.map +1 -0
  664. package/node_modules/acpx/dist/runtime.js +1711 -0
  665. package/node_modules/acpx/dist/runtime.js.map +1 -0
  666. package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts +278 -0
  667. package/node_modules/acpx/dist/session-options-jkYbBxGE.d.ts.map +1 -0
  668. package/node_modules/acpx/package.json +129 -0
  669. package/node_modules/acpx/skills/acpx/SKILL.md +617 -0
  670. package/node_modules/b4a/LICENSE +201 -0
  671. package/node_modules/b4a/README.md +153 -0
  672. package/node_modules/b4a/browser.js +546 -0
  673. package/node_modules/b4a/index.d.ts +144 -0
  674. package/node_modules/b4a/index.js +193 -0
  675. package/node_modules/b4a/lib/ascii.js +31 -0
  676. package/node_modules/b4a/lib/base64.js +64 -0
  677. package/node_modules/b4a/lib/hex.js +51 -0
  678. package/node_modules/b4a/lib/latin1.js +31 -0
  679. package/node_modules/b4a/lib/utf16le.js +40 -0
  680. package/node_modules/b4a/lib/utf8.js +144 -0
  681. package/node_modules/b4a/package.json +54 -0
  682. package/node_modules/b4a/react-native.js +5 -0
  683. package/node_modules/b4a/runtime.d.ts +14 -0
  684. package/node_modules/bare-events/LICENSE +201 -0
  685. package/node_modules/bare-events/README.md +25 -0
  686. package/node_modules/bare-events/global.d.ts +15 -0
  687. package/node_modules/bare-events/global.js +5 -0
  688. package/node_modules/bare-events/index.d.ts +89 -0
  689. package/node_modules/bare-events/index.js +397 -0
  690. package/node_modules/bare-events/lib/errors.js +23 -0
  691. package/node_modules/bare-events/package.json +63 -0
  692. package/node_modules/bare-events/web.d.ts +79 -0
  693. package/node_modules/bare-events/web.js +417 -0
  694. package/node_modules/bare-fs/CMakeLists.txt +13 -0
  695. package/node_modules/bare-fs/LICENSE +201 -0
  696. package/node_modules/bare-fs/README.md +33 -0
  697. package/node_modules/bare-fs/binding.c +2913 -0
  698. package/node_modules/bare-fs/binding.js +1 -0
  699. package/node_modules/bare-fs/index.d.ts +1502 -0
  700. package/node_modules/bare-fs/index.js +2855 -0
  701. package/node_modules/bare-fs/lib/constants.d.ts +50 -0
  702. package/node_modules/bare-fs/lib/constants.js +49 -0
  703. package/node_modules/bare-fs/lib/errors.d.ts +13 -0
  704. package/node_modules/bare-fs/lib/errors.js +55 -0
  705. package/node_modules/bare-fs/package.json +74 -0
  706. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  707. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  708. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  709. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  710. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  711. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  712. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  713. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  714. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  715. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  716. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  717. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  718. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  719. package/node_modules/bare-fs/promises.d.ts +480 -0
  720. package/node_modules/bare-fs/promises.js +119 -0
  721. package/node_modules/bare-path/CMakeLists.txt +13 -0
  722. package/node_modules/bare-path/LICENSE +201 -0
  723. package/node_modules/bare-path/NOTICE +28 -0
  724. package/node_modules/bare-path/README.md +19 -0
  725. package/node_modules/bare-path/binding.c +106 -0
  726. package/node_modules/bare-path/binding.js +1 -0
  727. package/node_modules/bare-path/index.d.ts +27 -0
  728. package/node_modules/bare-path/index.js +9 -0
  729. package/node_modules/bare-path/lib/constants.js +11 -0
  730. package/node_modules/bare-path/lib/posix.js +263 -0
  731. package/node_modules/bare-path/lib/shared.js +81 -0
  732. package/node_modules/bare-path/lib/win32.js +564 -0
  733. package/node_modules/bare-path/package.json +47 -0
  734. package/node_modules/bare-path/prebuilds/android-arm/bare-path.bare +0 -0
  735. package/node_modules/bare-path/prebuilds/android-arm64/bare-path.bare +0 -0
  736. package/node_modules/bare-path/prebuilds/android-ia32/bare-path.bare +0 -0
  737. package/node_modules/bare-path/prebuilds/android-x64/bare-path.bare +0 -0
  738. package/node_modules/bare-path/prebuilds/darwin-arm64/bare-path.bare +0 -0
  739. package/node_modules/bare-path/prebuilds/darwin-x64/bare-path.bare +0 -0
  740. package/node_modules/bare-path/prebuilds/ios-arm64/bare-path.bare +0 -0
  741. package/node_modules/bare-path/prebuilds/ios-arm64-simulator/bare-path.bare +0 -0
  742. package/node_modules/bare-path/prebuilds/ios-x64-simulator/bare-path.bare +0 -0
  743. package/node_modules/bare-path/prebuilds/linux-arm64/bare-path.bare +0 -0
  744. package/node_modules/bare-path/prebuilds/linux-x64/bare-path.bare +0 -0
  745. package/node_modules/bare-path/prebuilds/win32-arm64/bare-path.bare +0 -0
  746. package/node_modules/bare-path/prebuilds/win32-x64/bare-path.bare +0 -0
  747. package/node_modules/bare-stream/LICENSE +201 -0
  748. package/node_modules/bare-stream/README.md +354 -0
  749. package/node_modules/bare-stream/global.d.ts +31 -0
  750. package/node_modules/bare-stream/global.js +15 -0
  751. package/node_modules/bare-stream/index.d.ts +235 -0
  752. package/node_modules/bare-stream/index.js +493 -0
  753. package/node_modules/bare-stream/package.json +75 -0
  754. package/node_modules/bare-stream/promises.js +3 -0
  755. package/node_modules/bare-stream/web.d.ts +152 -0
  756. package/node_modules/bare-stream/web.js +607 -0
  757. package/node_modules/bare-url/CMakeLists.txt +36 -0
  758. package/node_modules/bare-url/LICENSE +201 -0
  759. package/node_modules/bare-url/README.md +33 -0
  760. package/node_modules/bare-url/binding.c +422 -0
  761. package/node_modules/bare-url/binding.js +1 -0
  762. package/node_modules/bare-url/global.d.ts +24 -0
  763. package/node_modules/bare-url/global.js +2 -0
  764. package/node_modules/bare-url/index.d.ts +96 -0
  765. package/node_modules/bare-url/index.js +676 -0
  766. package/node_modules/bare-url/lib/errors.d.ts +10 -0
  767. package/node_modules/bare-url/lib/errors.js +33 -0
  768. package/node_modules/bare-url/lib/url-search-params.d.ts +66 -0
  769. package/node_modules/bare-url/lib/url-search-params.js +276 -0
  770. package/node_modules/bare-url/package.json +54 -0
  771. package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
  772. package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
  773. package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
  774. package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
  775. package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
  776. package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
  777. package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
  778. package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
  779. package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
  780. package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
  781. package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
  782. package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
  783. package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
  784. package/node_modules/commander/LICENSE +22 -0
  785. package/node_modules/commander/Readme.md +1172 -0
  786. package/node_modules/commander/index.js +21 -0
  787. package/node_modules/commander/lib/argument.js +147 -0
  788. package/node_modules/commander/lib/command.js +2790 -0
  789. package/node_modules/commander/lib/error.js +36 -0
  790. package/node_modules/commander/lib/help.js +731 -0
  791. package/node_modules/commander/lib/option.js +377 -0
  792. package/node_modules/commander/lib/suggestSimilar.js +99 -0
  793. package/node_modules/commander/package-support.json +19 -0
  794. package/node_modules/commander/package.json +64 -0
  795. package/node_modules/commander/typings/index.d.ts +1113 -0
  796. package/node_modules/esbuild/LICENSE.md +21 -0
  797. package/node_modules/esbuild/README.md +3 -0
  798. package/node_modules/esbuild/bin/esbuild +223 -0
  799. package/node_modules/esbuild/install.js +300 -0
  800. package/node_modules/esbuild/lib/main.d.ts +720 -0
  801. package/node_modules/esbuild/lib/main.js +2536 -0
  802. package/node_modules/esbuild/package.json +74 -0
  803. package/node_modules/events-universal/LICENSE +201 -0
  804. package/node_modules/events-universal/README.md +17 -0
  805. package/node_modules/events-universal/bare.js +1 -0
  806. package/node_modules/events-universal/default.js +1 -0
  807. package/node_modules/events-universal/index.js +1 -0
  808. package/node_modules/events-universal/package.json +39 -0
  809. package/node_modules/events-universal/react-native.js +1 -0
  810. package/node_modules/fast-fifo/LICENSE +21 -0
  811. package/node_modules/fast-fifo/README.md +78 -0
  812. package/node_modules/fast-fifo/fixed-size.js +39 -0
  813. package/node_modules/fast-fifo/index.js +48 -0
  814. package/node_modules/fast-fifo/package.json +28 -0
  815. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  816. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  817. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  818. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  819. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  820. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  821. package/node_modules/fast-string-truncated-width/license +21 -0
  822. package/node_modules/fast-string-truncated-width/package.json +35 -0
  823. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  824. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  825. package/node_modules/fast-string-width/dist/index.js +14 -0
  826. package/node_modules/fast-string-width/license +21 -0
  827. package/node_modules/fast-string-width/package.json +34 -0
  828. package/node_modules/fast-string-width/readme.md +42 -0
  829. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  830. package/node_modules/fast-wrap-ansi/README.md +26 -0
  831. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  832. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  833. package/node_modules/fast-wrap-ansi/package.json +51 -0
  834. package/node_modules/sisteransi/license +21 -0
  835. package/node_modules/sisteransi/package.json +34 -0
  836. package/node_modules/sisteransi/readme.md +113 -0
  837. package/node_modules/sisteransi/src/index.js +58 -0
  838. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  839. package/node_modules/skillflag/LICENSE +21 -0
  840. package/node_modules/skillflag/README.md +44 -0
  841. package/node_modules/skillflag/dist/bin/skill-install.d.ts +3 -0
  842. package/node_modules/skillflag/dist/bin/skill-install.d.ts.map +1 -0
  843. package/node_modules/skillflag/dist/bin/skill-install.js +6 -0
  844. package/node_modules/skillflag/dist/bin/skill-install.js.map +1 -0
  845. package/node_modules/skillflag/dist/bin/skillflag.d.ts +3 -0
  846. package/node_modules/skillflag/dist/bin/skillflag.d.ts.map +1 -0
  847. package/node_modules/skillflag/dist/bin/skillflag.js +25 -0
  848. package/node_modules/skillflag/dist/bin/skillflag.js.map +1 -0
  849. package/node_modules/skillflag/dist/core/digest.d.ts +2 -0
  850. package/node_modules/skillflag/dist/core/digest.d.ts.map +1 -0
  851. package/node_modules/skillflag/dist/core/digest.js +15 -0
  852. package/node_modules/skillflag/dist/core/digest.js.map +1 -0
  853. package/node_modules/skillflag/dist/core/errors.d.ts +6 -0
  854. package/node_modules/skillflag/dist/core/errors.d.ts.map +1 -0
  855. package/node_modules/skillflag/dist/core/errors.js +13 -0
  856. package/node_modules/skillflag/dist/core/errors.js.map +1 -0
  857. package/node_modules/skillflag/dist/core/export.d.ts +2 -0
  858. package/node_modules/skillflag/dist/core/export.d.ts.map +1 -0
  859. package/node_modules/skillflag/dist/core/export.js +28 -0
  860. package/node_modules/skillflag/dist/core/export.js.map +1 -0
  861. package/node_modules/skillflag/dist/core/list.d.ts +21 -0
  862. package/node_modules/skillflag/dist/core/list.d.ts.map +1 -0
  863. package/node_modules/skillflag/dist/core/list.js +71 -0
  864. package/node_modules/skillflag/dist/core/list.js.map +1 -0
  865. package/node_modules/skillflag/dist/core/paths.d.ts +15 -0
  866. package/node_modules/skillflag/dist/core/paths.d.ts.map +1 -0
  867. package/node_modules/skillflag/dist/core/paths.js +149 -0
  868. package/node_modules/skillflag/dist/core/paths.js.map +1 -0
  869. package/node_modules/skillflag/dist/core/show.d.ts +2 -0
  870. package/node_modules/skillflag/dist/core/show.d.ts.map +1 -0
  871. package/node_modules/skillflag/dist/core/show.js +8 -0
  872. package/node_modules/skillflag/dist/core/show.js.map +1 -0
  873. package/node_modules/skillflag/dist/core/skillflag.d.ts +3 -0
  874. package/node_modules/skillflag/dist/core/skillflag.d.ts.map +1 -0
  875. package/node_modules/skillflag/dist/core/skillflag.js +2 -0
  876. package/node_modules/skillflag/dist/core/skillflag.js.map +1 -0
  877. package/node_modules/skillflag/dist/core/tar.d.ts +16 -0
  878. package/node_modules/skillflag/dist/core/tar.d.ts.map +1 -0
  879. package/node_modules/skillflag/dist/core/tar.js +140 -0
  880. package/node_modules/skillflag/dist/core/tar.js.map +1 -0
  881. package/node_modules/skillflag/dist/index.d.ts +5 -0
  882. package/node_modules/skillflag/dist/index.d.ts.map +1 -0
  883. package/node_modules/skillflag/dist/index.js +3 -0
  884. package/node_modules/skillflag/dist/index.js.map +1 -0
  885. package/node_modules/skillflag/dist/install/cli.d.ts +57 -0
  886. package/node_modules/skillflag/dist/install/cli.d.ts.map +1 -0
  887. package/node_modules/skillflag/dist/install/cli.js +653 -0
  888. package/node_modules/skillflag/dist/install/cli.js.map +1 -0
  889. package/node_modules/skillflag/dist/install/copy.d.ts +2 -0
  890. package/node_modules/skillflag/dist/install/copy.d.ts.map +1 -0
  891. package/node_modules/skillflag/dist/install/copy.js +19 -0
  892. package/node_modules/skillflag/dist/install/copy.js.map +1 -0
  893. package/node_modules/skillflag/dist/install/errors.d.ts +6 -0
  894. package/node_modules/skillflag/dist/install/errors.d.ts.map +1 -0
  895. package/node_modules/skillflag/dist/install/errors.js +13 -0
  896. package/node_modules/skillflag/dist/install/errors.js.map +1 -0
  897. package/node_modules/skillflag/dist/install/extract.d.ts +3 -0
  898. package/node_modules/skillflag/dist/install/extract.d.ts.map +1 -0
  899. package/node_modules/skillflag/dist/install/extract.js +76 -0
  900. package/node_modules/skillflag/dist/install/extract.js.map +1 -0
  901. package/node_modules/skillflag/dist/install/install.d.ts +21 -0
  902. package/node_modules/skillflag/dist/install/install.d.ts.map +1 -0
  903. package/node_modules/skillflag/dist/install/install.js +35 -0
  904. package/node_modules/skillflag/dist/install/install.js.map +1 -0
  905. package/node_modules/skillflag/dist/install/resolve.d.ts +12 -0
  906. package/node_modules/skillflag/dist/install/resolve.d.ts.map +1 -0
  907. package/node_modules/skillflag/dist/install/resolve.js +119 -0
  908. package/node_modules/skillflag/dist/install/resolve.js.map +1 -0
  909. package/node_modules/skillflag/dist/install/validate.d.ts +7 -0
  910. package/node_modules/skillflag/dist/install/validate.d.ts.map +1 -0
  911. package/node_modules/skillflag/dist/install/validate.js +28 -0
  912. package/node_modules/skillflag/dist/install/validate.js.map +1 -0
  913. package/node_modules/skillflag/dist/shared/frontmatter.d.ts +2 -0
  914. package/node_modules/skillflag/dist/shared/frontmatter.d.ts.map +1 -0
  915. package/node_modules/skillflag/dist/shared/frontmatter.js +28 -0
  916. package/node_modules/skillflag/dist/shared/frontmatter.js.map +1 -0
  917. package/node_modules/skillflag/dist/skillflag.d.ts +29 -0
  918. package/node_modules/skillflag/dist/skillflag.d.ts.map +1 -0
  919. package/node_modules/skillflag/dist/skillflag.js +230 -0
  920. package/node_modules/skillflag/dist/skillflag.js.map +1 -0
  921. package/node_modules/skillflag/dist/utils/collections.d.ts +3 -0
  922. package/node_modules/skillflag/dist/utils/collections.d.ts.map +1 -0
  923. package/node_modules/skillflag/dist/utils/collections.js +18 -0
  924. package/node_modules/skillflag/dist/utils/collections.js.map +1 -0
  925. package/node_modules/skillflag/package.json +78 -0
  926. package/node_modules/skillflag/skills/skillflag/SKILL.md +144 -0
  927. package/node_modules/streamx/LICENSE +21 -0
  928. package/node_modules/streamx/README.md +550 -0
  929. package/node_modules/streamx/index.d.ts +198 -0
  930. package/node_modules/streamx/index.js +1314 -0
  931. package/node_modules/streamx/lib/errors.d.ts +13 -0
  932. package/node_modules/streamx/lib/errors.js +47 -0
  933. package/node_modules/streamx/package.json +51 -0
  934. package/node_modules/streamx/runtime.d.ts +55 -0
  935. package/node_modules/tar-stream/LICENSE +21 -0
  936. package/node_modules/tar-stream/README.md +183 -0
  937. package/node_modules/tar-stream/constants.js +14 -0
  938. package/node_modules/tar-stream/extract.js +418 -0
  939. package/node_modules/tar-stream/headers.js +322 -0
  940. package/node_modules/tar-stream/index.d.ts +60 -0
  941. package/node_modules/tar-stream/index.js +2 -0
  942. package/node_modules/tar-stream/pack.js +287 -0
  943. package/node_modules/tar-stream/package.json +50 -0
  944. package/node_modules/teex/LICENSE +21 -0
  945. package/node_modules/teex/README.md +31 -0
  946. package/node_modules/teex/example.js +16 -0
  947. package/node_modules/teex/index.js +52 -0
  948. package/node_modules/teex/package.json +26 -0
  949. package/node_modules/teex/test.js +68 -0
  950. package/node_modules/text-decoder/LICENSE +201 -0
  951. package/node_modules/text-decoder/README.md +36 -0
  952. package/node_modules/text-decoder/index.js +64 -0
  953. package/node_modules/text-decoder/lib/pass-through-decoder.js +19 -0
  954. package/node_modules/text-decoder/lib/utf8-decoder.js +185 -0
  955. package/node_modules/text-decoder/package.json +39 -0
  956. package/node_modules/tsx/LICENSE +21 -0
  957. package/node_modules/tsx/README.md +32 -0
  958. package/node_modules/tsx/dist/cjs/api/index.cjs +2 -0
  959. package/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
  960. package/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
  961. package/node_modules/tsx/dist/cjs/api/index.mjs +2 -0
  962. package/node_modules/tsx/dist/cjs/index.cjs +1 -0
  963. package/node_modules/tsx/dist/cli.mjs +55 -0
  964. package/node_modules/tsx/dist/client-XItNFmsq.cjs +1 -0
  965. package/node_modules/tsx/dist/esm/api/index.cjs +2 -0
  966. package/node_modules/tsx/dist/esm/api/index.d.cts +37 -0
  967. package/node_modules/tsx/dist/esm/api/index.d.mts +37 -0
  968. package/node_modules/tsx/dist/esm/api/index.mjs +2 -0
  969. package/node_modules/tsx/dist/esm/index.mjs +2 -0
  970. package/node_modules/tsx/dist/index-Bqjv9TxC.mjs +1 -0
  971. package/node_modules/tsx/dist/index-DE3OBZuV.mjs +14 -0
  972. package/node_modules/tsx/dist/lexer-CGfpMDSb.cjs +3 -0
  973. package/node_modules/tsx/dist/lexer-CanA6ArK.mjs +3 -0
  974. package/node_modules/tsx/dist/loader.mjs +2 -0
  975. package/node_modules/tsx/dist/package-Dj0mHsMt.mjs +1 -0
  976. package/node_modules/tsx/dist/patch-repl.cjs +1 -0
  977. package/node_modules/tsx/dist/preflight.cjs +1 -0
  978. package/node_modules/tsx/dist/register-B1c7OH6V.cjs +23 -0
  979. package/node_modules/tsx/dist/register-nyXW-TH3.mjs +2 -0
  980. package/node_modules/tsx/dist/repl.mjs +4 -0
  981. package/node_modules/tsx/dist/require-CBjy4Foe.mjs +10 -0
  982. package/node_modules/tsx/dist/require-CVaYn9z3.cjs +1 -0
  983. package/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
  984. package/node_modules/tsx/dist/temporary-directory-Du7LpLp9.mjs +1 -0
  985. package/node_modules/tsx/package.json +70 -0
  986. package/node_modules/zod/LICENSE +21 -0
  987. package/node_modules/zod/README.md +218 -0
  988. package/node_modules/zod/compile.cjs +96 -0
  989. package/node_modules/zod/compile.d.cts +1 -0
  990. package/node_modules/zod/compile.d.ts +1 -0
  991. package/node_modules/zod/compile.js +52 -0
  992. package/node_modules/zod/index.cjs +52 -0
  993. package/node_modules/zod/index.d.cts +3 -0
  994. package/node_modules/zod/index.d.ts +3 -0
  995. package/node_modules/zod/index.js +7 -0
  996. package/node_modules/zod/locales/index.cjs +36 -0
  997. package/node_modules/zod/locales/index.d.cts +1 -0
  998. package/node_modules/zod/locales/index.d.ts +1 -0
  999. package/node_modules/zod/locales/index.js +1 -0
  1000. package/node_modules/zod/locales/package.json +7 -0
  1001. package/node_modules/zod/mini/index.cjs +51 -0
  1002. package/node_modules/zod/mini/index.d.cts +3 -0
  1003. package/node_modules/zod/mini/index.d.ts +3 -0
  1004. package/node_modules/zod/mini/index.js +3 -0
  1005. package/node_modules/zod/mini/package.json +7 -0
  1006. package/node_modules/zod/package.json +147 -0
  1007. package/node_modules/zod/src/compile.ts +56 -0
  1008. package/node_modules/zod/src/index.ts +7 -0
  1009. package/node_modules/zod/src/locales/index.ts +1 -0
  1010. package/node_modules/zod/src/mini/index.ts +3 -0
  1011. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  1012. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  1013. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  1014. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  1015. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  1016. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  1017. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  1018. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  1019. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  1020. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  1021. package/node_modules/zod/src/v3/errors.ts +13 -0
  1022. package/node_modules/zod/src/v3/external.ts +6 -0
  1023. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  1024. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  1025. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  1026. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  1027. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  1028. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  1029. package/node_modules/zod/src/v3/index.ts +4 -0
  1030. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  1031. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  1032. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  1033. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  1034. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  1035. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  1036. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  1037. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  1038. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  1039. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  1040. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  1041. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  1042. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  1043. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  1044. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  1045. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  1046. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  1047. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  1048. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  1049. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  1050. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  1051. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  1052. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  1053. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  1054. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  1055. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  1056. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  1057. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  1058. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  1059. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  1060. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  1061. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  1062. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  1063. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  1064. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  1065. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  1066. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  1067. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  1068. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  1069. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  1070. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  1071. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  1072. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  1073. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  1074. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  1075. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  1076. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  1077. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  1078. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  1079. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  1080. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  1081. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  1082. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  1083. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  1084. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  1085. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  1086. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  1087. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  1088. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  1089. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  1090. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  1091. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  1092. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  1093. package/node_modules/zod/src/v3/types.ts +5138 -0
  1094. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  1095. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  1096. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  1097. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  1098. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  1099. package/node_modules/zod/src/v4/classic/external.ts +57 -0
  1100. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  1101. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  1102. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  1103. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  1104. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  1105. package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
  1106. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  1107. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  1108. package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  1109. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
  1110. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  1111. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  1112. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  1113. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
  1114. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  1115. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  1116. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  1117. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  1118. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  1119. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  1120. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  1121. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  1122. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  1123. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  1124. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  1125. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  1126. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  1127. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  1128. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  1129. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  1130. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  1131. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  1132. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
  1133. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
  1134. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  1135. package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
  1136. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  1137. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  1138. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  1139. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  1140. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  1141. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  1142. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  1143. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  1144. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  1145. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  1146. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  1147. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  1148. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
  1149. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  1150. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  1151. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  1152. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  1153. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  1154. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  1155. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  1156. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  1157. package/node_modules/zod/src/v4/classic/tests/map.test.ts +342 -0
  1158. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  1159. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  1160. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  1161. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  1162. package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
  1163. package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
  1164. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  1165. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  1166. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  1167. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  1168. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  1169. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
  1170. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  1171. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  1172. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  1173. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  1174. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  1175. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  1176. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  1177. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  1178. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
  1179. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  1180. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  1181. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  1182. package/node_modules/zod/src/v4/classic/tests/set.test.ts +190 -0
  1183. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
  1184. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  1185. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
  1186. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  1187. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
  1188. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  1189. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
  1190. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  1191. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  1192. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  1193. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  1194. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  1195. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  1196. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  1197. package/node_modules/zod/src/v4/core/api.ts +1875 -0
  1198. package/node_modules/zod/src/v4/core/checks.ts +1266 -0
  1199. package/node_modules/zod/src/v4/core/compile.ts +2313 -0
  1200. package/node_modules/zod/src/v4/core/core.ts +230 -0
  1201. package/node_modules/zod/src/v4/core/doc.ts +52 -0
  1202. package/node_modules/zod/src/v4/core/errors.ts +543 -0
  1203. package/node_modules/zod/src/v4/core/index.ts +19 -0
  1204. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  1205. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  1206. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  1207. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  1208. package/node_modules/zod/src/v4/core/parse.ts +309 -0
  1209. package/node_modules/zod/src/v4/core/regexes.ts +217 -0
  1210. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  1211. package/node_modules/zod/src/v4/core/schemas.ts +5192 -0
  1212. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  1213. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  1214. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  1215. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  1216. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  1217. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  1218. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  1219. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  1220. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  1221. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  1222. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  1223. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  1224. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  1225. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  1226. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  1227. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  1228. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  1229. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  1230. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  1231. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  1232. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  1233. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  1234. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  1235. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  1236. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  1237. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  1238. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  1239. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  1240. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  1241. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  1242. package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
  1243. package/node_modules/zod/src/v4/core/util.ts +1280 -0
  1244. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  1245. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  1246. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  1247. package/node_modules/zod/src/v4/index.ts +4 -0
  1248. package/node_modules/zod/src/v4/locales/ar.ts +120 -0
  1249. package/node_modules/zod/src/v4/locales/az.ts +116 -0
  1250. package/node_modules/zod/src/v4/locales/be.ts +188 -0
  1251. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  1252. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  1253. package/node_modules/zod/src/v4/locales/ca.ts +121 -0
  1254. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  1255. package/node_modules/zod/src/v4/locales/cs.ts +123 -0
  1256. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  1257. package/node_modules/zod/src/v4/locales/de.ts +121 -0
  1258. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  1259. package/node_modules/zod/src/v4/locales/en.ts +136 -0
  1260. package/node_modules/zod/src/v4/locales/eo.ts +123 -0
  1261. package/node_modules/zod/src/v4/locales/es.ts +145 -0
  1262. package/node_modules/zod/src/v4/locales/fa.ts +131 -0
  1263. package/node_modules/zod/src/v4/locales/fi.ts +126 -0
  1264. package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
  1265. package/node_modules/zod/src/v4/locales/fr.ts +139 -0
  1266. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  1267. package/node_modules/zod/src/v4/locales/he.ts +253 -0
  1268. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  1269. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  1270. package/node_modules/zod/src/v4/locales/hu.ts +122 -0
  1271. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  1272. package/node_modules/zod/src/v4/locales/id.ts +120 -0
  1273. package/node_modules/zod/src/v4/locales/index.ts +63 -0
  1274. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  1275. package/node_modules/zod/src/v4/locales/it.ts +121 -0
  1276. package/node_modules/zod/src/v4/locales/ja.ts +119 -0
  1277. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  1278. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  1279. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  1280. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  1281. package/node_modules/zod/src/v4/locales/ko.ts +126 -0
  1282. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  1283. package/node_modules/zod/src/v4/locales/mk.ts +123 -0
  1284. package/node_modules/zod/src/v4/locales/ms.ts +120 -0
  1285. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  1286. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  1287. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  1288. package/node_modules/zod/src/v4/locales/no.ts +121 -0
  1289. package/node_modules/zod/src/v4/locales/ota.ts +122 -0
  1290. package/node_modules/zod/src/v4/locales/pl.ts +123 -0
  1291. package/node_modules/zod/src/v4/locales/ps.ts +131 -0
  1292. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  1293. package/node_modules/zod/src/v4/locales/pt.ts +159 -0
  1294. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  1295. package/node_modules/zod/src/v4/locales/ru.ts +188 -0
  1296. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  1297. package/node_modules/zod/src/v4/locales/sl.ts +123 -0
  1298. package/node_modules/zod/src/v4/locales/sv.ts +124 -0
  1299. package/node_modules/zod/src/v4/locales/ta.ts +123 -0
  1300. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  1301. package/node_modules/zod/src/v4/locales/th.ts +124 -0
  1302. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  1303. package/node_modules/zod/src/v4/locales/tr.ts +116 -0
  1304. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  1305. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  1306. package/node_modules/zod/src/v4/locales/ur.ts +124 -0
  1307. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  1308. package/node_modules/zod/src/v4/locales/vi.ts +122 -0
  1309. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  1310. package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
  1311. package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
  1312. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  1313. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  1314. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  1315. package/node_modules/zod/src/v4/mini/external.ts +52 -0
  1316. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  1317. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  1318. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  1319. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  1320. package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
  1321. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  1322. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  1323. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  1324. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  1325. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  1326. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
  1327. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  1328. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  1329. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  1330. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  1331. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
  1332. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  1333. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  1334. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  1335. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
  1336. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  1337. package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
  1338. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  1339. package/node_modules/zod/v3/ZodError.cjs +167 -0
  1340. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  1341. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  1342. package/node_modules/zod/v3/ZodError.js +143 -0
  1343. package/node_modules/zod/v3/errors.cjs +36 -0
  1344. package/node_modules/zod/v3/errors.d.cts +5 -0
  1345. package/node_modules/zod/v3/errors.d.ts +5 -0
  1346. package/node_modules/zod/v3/errors.js +9 -0
  1347. package/node_modules/zod/v3/external.cjs +41 -0
  1348. package/node_modules/zod/v3/external.d.cts +6 -0
  1349. package/node_modules/zod/v3/external.d.ts +6 -0
  1350. package/node_modules/zod/v3/external.js +6 -0
  1351. package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
  1352. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  1353. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  1354. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  1355. package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
  1356. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  1357. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  1358. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  1359. package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
  1360. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  1361. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  1362. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  1363. package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
  1364. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  1365. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  1366. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  1367. package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
  1368. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  1369. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  1370. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  1371. package/node_modules/zod/v3/helpers/util.cjs +156 -0
  1372. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  1373. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  1374. package/node_modules/zod/v3/helpers/util.js +133 -0
  1375. package/node_modules/zod/v3/index.cjs +52 -0
  1376. package/node_modules/zod/v3/index.d.cts +4 -0
  1377. package/node_modules/zod/v3/index.d.ts +4 -0
  1378. package/node_modules/zod/v3/index.js +4 -0
  1379. package/node_modules/zod/v3/locales/en.cjs +112 -0
  1380. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  1381. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  1382. package/node_modules/zod/v3/locales/en.js +109 -0
  1383. package/node_modules/zod/v3/package.json +7 -0
  1384. package/node_modules/zod/v3/standard-schema.cjs +21 -0
  1385. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  1386. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  1387. package/node_modules/zod/v3/standard-schema.js +1 -0
  1388. package/node_modules/zod/v3/types.cjs +3798 -0
  1389. package/node_modules/zod/v3/types.d.cts +1034 -0
  1390. package/node_modules/zod/v3/types.d.ts +1034 -0
  1391. package/node_modules/zod/v3/types.js +3697 -0
  1392. package/node_modules/zod/v4/classic/checks.cjs +53 -0
  1393. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  1394. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  1395. package/node_modules/zod/v4/classic/checks.js +1 -0
  1396. package/node_modules/zod/v4/classic/coerce.cjs +66 -0
  1397. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  1398. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  1399. package/node_modules/zod/v4/classic/coerce.js +17 -0
  1400. package/node_modules/zod/v4/classic/compat.cjs +80 -0
  1401. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  1402. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  1403. package/node_modules/zod/v4/classic/compat.js +31 -0
  1404. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  1405. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  1406. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  1407. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  1408. package/node_modules/zod/v4/classic/errors.cjs +102 -0
  1409. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  1410. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  1411. package/node_modules/zod/v4/classic/errors.js +57 -0
  1412. package/node_modules/zod/v4/classic/external.cjs +97 -0
  1413. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  1414. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  1415. package/node_modules/zod/v4/classic/external.js +17 -0
  1416. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  1417. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  1418. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  1419. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  1420. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  1421. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  1422. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  1423. package/node_modules/zod/v4/classic/in-out.js +36 -0
  1424. package/node_modules/zod/v4/classic/index.cjs +52 -0
  1425. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  1426. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  1427. package/node_modules/zod/v4/classic/index.js +4 -0
  1428. package/node_modules/zod/v4/classic/iso.cjs +68 -0
  1429. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  1430. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  1431. package/node_modules/zod/v4/classic/iso.js +15 -0
  1432. package/node_modules/zod/v4/classic/package.json +7 -0
  1433. package/node_modules/zod/v4/classic/parse.cjs +63 -0
  1434. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  1435. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  1436. package/node_modules/zod/v4/classic/parse.js +16 -0
  1437. package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
  1438. package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
  1439. package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
  1440. package/node_modules/zod/v4/classic/schemas.js +1535 -0
  1441. package/node_modules/zod/v4/core/api.cjs +1269 -0
  1442. package/node_modules/zod/v4/core/api.d.cts +335 -0
  1443. package/node_modules/zod/v4/core/api.d.ts +335 -0
  1444. package/node_modules/zod/v4/core/api.js +1107 -0
  1445. package/node_modules/zod/v4/core/checks.cjs +561 -0
  1446. package/node_modules/zod/v4/core/checks.d.cts +294 -0
  1447. package/node_modules/zod/v4/core/checks.d.ts +294 -0
  1448. package/node_modules/zod/v4/core/checks.js +516 -0
  1449. package/node_modules/zod/v4/core/compile.cjs +1908 -0
  1450. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  1451. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  1452. package/node_modules/zod/v4/core/compile.js +1858 -0
  1453. package/node_modules/zod/v4/core/core.cjs +167 -0
  1454. package/node_modules/zod/v4/core/core.d.cts +82 -0
  1455. package/node_modules/zod/v4/core/core.d.ts +82 -0
  1456. package/node_modules/zod/v4/core/core.js +141 -0
  1457. package/node_modules/zod/v4/core/doc.cjs +61 -0
  1458. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  1459. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  1460. package/node_modules/zod/v4/core/doc.js +38 -0
  1461. package/node_modules/zod/v4/core/errors.cjs +317 -0
  1462. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  1463. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  1464. package/node_modules/zod/v4/core/errors.js +267 -0
  1465. package/node_modules/zod/v4/core/index.cjs +70 -0
  1466. package/node_modules/zod/v4/core/index.d.cts +19 -0
  1467. package/node_modules/zod/v4/core/index.d.ts +19 -0
  1468. package/node_modules/zod/v4/core/index.js +19 -0
  1469. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  1470. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  1471. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  1472. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  1473. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  1474. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  1475. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  1476. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  1477. package/node_modules/zod/v4/core/json-schema.cjs +21 -0
  1478. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  1479. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  1480. package/node_modules/zod/v4/core/json-schema.js +1 -0
  1481. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  1482. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  1483. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  1484. package/node_modules/zod/v4/core/memoizer.js +311 -0
  1485. package/node_modules/zod/v4/core/package.json +7 -0
  1486. package/node_modules/zod/v4/core/parse.cjs +233 -0
  1487. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  1488. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  1489. package/node_modules/zod/v4/core/parse.js +175 -0
  1490. package/node_modules/zod/v4/core/regexes.cjs +209 -0
  1491. package/node_modules/zod/v4/core/regexes.d.cts +90 -0
  1492. package/node_modules/zod/v4/core/regexes.d.ts +90 -0
  1493. package/node_modules/zod/v4/core/regexes.js +156 -0
  1494. package/node_modules/zod/v4/core/registries.cjs +75 -0
  1495. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  1496. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  1497. package/node_modules/zod/v4/core/registries.js +51 -0
  1498. package/node_modules/zod/v4/core/schemas.cjs +2669 -0
  1499. package/node_modules/zod/v4/core/schemas.d.cts +1273 -0
  1500. package/node_modules/zod/v4/core/schemas.d.ts +1273 -0
  1501. package/node_modules/zod/v4/core/schemas.js +2606 -0
  1502. package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
  1503. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  1504. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  1505. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  1506. package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
  1507. package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
  1508. package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
  1509. package/node_modules/zod/v4/core/to-json-schema.js +651 -0
  1510. package/node_modules/zod/v4/core/util.cjs +949 -0
  1511. package/node_modules/zod/v4/core/util.d.cts +278 -0
  1512. package/node_modules/zod/v4/core/util.d.ts +278 -0
  1513. package/node_modules/zod/v4/core/util.js +859 -0
  1514. package/node_modules/zod/v4/core/versions.cjs +27 -0
  1515. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  1516. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  1517. package/node_modules/zod/v4/core/versions.js +5 -0
  1518. package/node_modules/zod/v4/core/visit.cjs +214 -0
  1519. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  1520. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  1521. package/node_modules/zod/v4/core/visit.js +169 -0
  1522. package/node_modules/zod/v4/index.cjs +51 -0
  1523. package/node_modules/zod/v4/index.d.cts +3 -0
  1524. package/node_modules/zod/v4/index.d.ts +3 -0
  1525. package/node_modules/zod/v4/index.js +4 -0
  1526. package/node_modules/zod/v4/locales/ar.cjs +138 -0
  1527. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  1528. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  1529. package/node_modules/zod/v4/locales/ar.js +111 -0
  1530. package/node_modules/zod/v4/locales/az.cjs +137 -0
  1531. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  1532. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  1533. package/node_modules/zod/v4/locales/az.js +110 -0
  1534. package/node_modules/zod/v4/locales/be.cjs +195 -0
  1535. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  1536. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  1537. package/node_modules/zod/v4/locales/be.js +168 -0
  1538. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  1539. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  1540. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  1541. package/node_modules/zod/v4/locales/bg.js +125 -0
  1542. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  1543. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  1544. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  1545. package/node_modules/zod/v4/locales/bn.js +113 -0
  1546. package/node_modules/zod/v4/locales/ca.cjs +139 -0
  1547. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  1548. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  1549. package/node_modules/zod/v4/locales/ca.js +112 -0
  1550. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  1551. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  1552. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  1553. package/node_modules/zod/v4/locales/ckb.js +133 -0
  1554. package/node_modules/zod/v4/locales/cs.cjs +143 -0
  1555. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  1556. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  1557. package/node_modules/zod/v4/locales/cs.js +116 -0
  1558. package/node_modules/zod/v4/locales/da.cjs +147 -0
  1559. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  1560. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  1561. package/node_modules/zod/v4/locales/da.js +120 -0
  1562. package/node_modules/zod/v4/locales/de.cjs +140 -0
  1563. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  1564. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  1565. package/node_modules/zod/v4/locales/de.js +113 -0
  1566. package/node_modules/zod/v4/locales/el.cjs +139 -0
  1567. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  1568. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  1569. package/node_modules/zod/v4/locales/el.js +112 -0
  1570. package/node_modules/zod/v4/locales/en.cjs +152 -0
  1571. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  1572. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  1573. package/node_modules/zod/v4/locales/en.js +125 -0
  1574. package/node_modules/zod/v4/locales/eo.cjs +141 -0
  1575. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  1576. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  1577. package/node_modules/zod/v4/locales/eo.js +114 -0
  1578. package/node_modules/zod/v4/locales/es.cjs +163 -0
  1579. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  1580. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  1581. package/node_modules/zod/v4/locales/es.js +136 -0
  1582. package/node_modules/zod/v4/locales/fa.cjs +146 -0
  1583. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  1584. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  1585. package/node_modules/zod/v4/locales/fa.js +119 -0
  1586. package/node_modules/zod/v4/locales/fi.cjs +144 -0
  1587. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  1588. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  1589. package/node_modules/zod/v4/locales/fi.js +117 -0
  1590. package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
  1591. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  1592. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  1593. package/node_modules/zod/v4/locales/fr-CA.js +112 -0
  1594. package/node_modules/zod/v4/locales/fr.cjs +156 -0
  1595. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  1596. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  1597. package/node_modules/zod/v4/locales/fr.js +129 -0
  1598. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  1599. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  1600. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  1601. package/node_modules/zod/v4/locales/gu.js +113 -0
  1602. package/node_modules/zod/v4/locales/he.cjs +248 -0
  1603. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  1604. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  1605. package/node_modules/zod/v4/locales/he.js +221 -0
  1606. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  1607. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  1608. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  1609. package/node_modules/zod/v4/locales/hi.js +111 -0
  1610. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  1611. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  1612. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  1613. package/node_modules/zod/v4/locales/hr.js +126 -0
  1614. package/node_modules/zod/v4/locales/hu.cjs +140 -0
  1615. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  1616. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  1617. package/node_modules/zod/v4/locales/hu.js +113 -0
  1618. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  1619. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  1620. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  1621. package/node_modules/zod/v4/locales/hy.js +158 -0
  1622. package/node_modules/zod/v4/locales/id.cjs +138 -0
  1623. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  1624. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  1625. package/node_modules/zod/v4/locales/id.js +111 -0
  1626. package/node_modules/zod/v4/locales/index.cjs +152 -0
  1627. package/node_modules/zod/v4/locales/index.d.cts +63 -0
  1628. package/node_modules/zod/v4/locales/index.d.ts +63 -0
  1629. package/node_modules/zod/v4/locales/index.js +63 -0
  1630. package/node_modules/zod/v4/locales/is.cjs +141 -0
  1631. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  1632. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  1633. package/node_modules/zod/v4/locales/is.js +114 -0
  1634. package/node_modules/zod/v4/locales/it.cjs +140 -0
  1635. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  1636. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  1637. package/node_modules/zod/v4/locales/it.js +113 -0
  1638. package/node_modules/zod/v4/locales/ja.cjs +139 -0
  1639. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  1640. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  1641. package/node_modules/zod/v4/locales/ja.js +112 -0
  1642. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  1643. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  1644. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  1645. package/node_modules/zod/v4/locales/ka.js +117 -0
  1646. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  1647. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  1648. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  1649. package/node_modules/zod/v4/locales/kh.js +5 -0
  1650. package/node_modules/zod/v4/locales/km.cjs +142 -0
  1651. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  1652. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  1653. package/node_modules/zod/v4/locales/km.js +115 -0
  1654. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  1655. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  1656. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  1657. package/node_modules/zod/v4/locales/kn.js +116 -0
  1658. package/node_modules/zod/v4/locales/ko.cjs +143 -0
  1659. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  1660. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  1661. package/node_modules/zod/v4/locales/ko.js +116 -0
  1662. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  1663. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  1664. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  1665. package/node_modules/zod/v4/locales/lt.js +207 -0
  1666. package/node_modules/zod/v4/locales/mk.cjs +141 -0
  1667. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  1668. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  1669. package/node_modules/zod/v4/locales/mk.js +114 -0
  1670. package/node_modules/zod/v4/locales/ms.cjs +139 -0
  1671. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  1672. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  1673. package/node_modules/zod/v4/locales/ms.js +112 -0
  1674. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  1675. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  1676. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  1677. package/node_modules/zod/v4/locales/ne.js +111 -0
  1678. package/node_modules/zod/v4/locales/nl.cjs +142 -0
  1679. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  1680. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  1681. package/node_modules/zod/v4/locales/nl.js +115 -0
  1682. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  1683. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  1684. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  1685. package/node_modules/zod/v4/locales/nn.js +113 -0
  1686. package/node_modules/zod/v4/locales/no.cjs +140 -0
  1687. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  1688. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  1689. package/node_modules/zod/v4/locales/no.js +113 -0
  1690. package/node_modules/zod/v4/locales/ota.cjs +141 -0
  1691. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  1692. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  1693. package/node_modules/zod/v4/locales/ota.js +114 -0
  1694. package/node_modules/zod/v4/locales/package.json +7 -0
  1695. package/node_modules/zod/v4/locales/pl.cjs +141 -0
  1696. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  1697. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  1698. package/node_modules/zod/v4/locales/pl.js +114 -0
  1699. package/node_modules/zod/v4/locales/ps.cjs +146 -0
  1700. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  1701. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  1702. package/node_modules/zod/v4/locales/ps.js +119 -0
  1703. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  1704. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  1705. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  1706. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  1707. package/node_modules/zod/v4/locales/pt.cjs +169 -0
  1708. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  1709. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  1710. package/node_modules/zod/v4/locales/pt.js +142 -0
  1711. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  1712. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  1713. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  1714. package/node_modules/zod/v4/locales/ro.js +122 -0
  1715. package/node_modules/zod/v4/locales/ru.cjs +195 -0
  1716. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  1717. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  1718. package/node_modules/zod/v4/locales/ru.js +168 -0
  1719. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  1720. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  1721. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  1722. package/node_modules/zod/v4/locales/sk.js +116 -0
  1723. package/node_modules/zod/v4/locales/sl.cjs +141 -0
  1724. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  1725. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  1726. package/node_modules/zod/v4/locales/sl.js +114 -0
  1727. package/node_modules/zod/v4/locales/sv.cjs +142 -0
  1728. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  1729. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  1730. package/node_modules/zod/v4/locales/sv.js +115 -0
  1731. package/node_modules/zod/v4/locales/ta.cjs +142 -0
  1732. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  1733. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  1734. package/node_modules/zod/v4/locales/ta.js +115 -0
  1735. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  1736. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  1737. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  1738. package/node_modules/zod/v4/locales/tg.js +117 -0
  1739. package/node_modules/zod/v4/locales/th.cjs +142 -0
  1740. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  1741. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  1742. package/node_modules/zod/v4/locales/th.js +115 -0
  1743. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  1744. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  1745. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  1746. package/node_modules/zod/v4/locales/tk.js +107 -0
  1747. package/node_modules/zod/v4/locales/tr.cjs +137 -0
  1748. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  1749. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  1750. package/node_modules/zod/v4/locales/tr.js +110 -0
  1751. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  1752. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  1753. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  1754. package/node_modules/zod/v4/locales/ua.js +5 -0
  1755. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  1756. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  1757. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  1758. package/node_modules/zod/v4/locales/uk.js +113 -0
  1759. package/node_modules/zod/v4/locales/ur.cjs +142 -0
  1760. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  1761. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  1762. package/node_modules/zod/v4/locales/ur.js +115 -0
  1763. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  1764. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  1765. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  1766. package/node_modules/zod/v4/locales/uz.js +113 -0
  1767. package/node_modules/zod/v4/locales/vi.cjs +140 -0
  1768. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  1769. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  1770. package/node_modules/zod/v4/locales/vi.js +113 -0
  1771. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  1772. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  1773. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  1774. package/node_modules/zod/v4/locales/yo.js +112 -0
  1775. package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
  1776. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  1777. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  1778. package/node_modules/zod/v4/locales/zh-CN.js +114 -0
  1779. package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
  1780. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  1781. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  1782. package/node_modules/zod/v4/locales/zh-TW.js +112 -0
  1783. package/node_modules/zod/v4/mini/checks.cjs +54 -0
  1784. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  1785. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  1786. package/node_modules/zod/v4/mini/checks.js +1 -0
  1787. package/node_modules/zod/v4/mini/coerce.cjs +71 -0
  1788. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  1789. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  1790. package/node_modules/zod/v4/mini/coerce.js +22 -0
  1791. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  1792. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  1793. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  1794. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  1795. package/node_modules/zod/v4/mini/external.cjs +95 -0
  1796. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  1797. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  1798. package/node_modules/zod/v4/mini/external.js +16 -0
  1799. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  1800. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  1801. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  1802. package/node_modules/zod/v4/mini/in-out.js +36 -0
  1803. package/node_modules/zod/v4/mini/index.cjs +51 -0
  1804. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  1805. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  1806. package/node_modules/zod/v4/mini/index.js +3 -0
  1807. package/node_modules/zod/v4/mini/iso.cjs +83 -0
  1808. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  1809. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  1810. package/node_modules/zod/v4/mini/iso.js +34 -0
  1811. package/node_modules/zod/v4/mini/package.json +7 -0
  1812. package/node_modules/zod/v4/mini/parse.cjs +37 -0
  1813. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  1814. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  1815. package/node_modules/zod/v4/mini/parse.js +1 -0
  1816. package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
  1817. package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
  1818. package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
  1819. package/node_modules/zod/v4/mini/schemas.js +1002 -0
  1820. package/node_modules/zod/v4/package.json +7 -0
  1821. package/node_modules/zod/v4-mini/index.cjs +51 -0
  1822. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  1823. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  1824. package/node_modules/zod/v4-mini/index.js +3 -0
  1825. package/node_modules/zod/v4-mini/package.json +7 -0
  1826. package/package.json +50 -0
package/dist/ssh.js ADDED
@@ -0,0 +1,1667 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { execFile, spawn } from "node:child_process";
3
+ import { constants as fsConstants, createReadStream, createWriteStream, promises as fs } from "node:fs";
4
+ import net from "node:net";
5
+ import os from "node:os";
6
+ import path from "node:path";
7
+ import { Transform } from "node:stream";
8
+ import { createUnrelatedHistoryGraftCommit, GIT_SYNC_COMMIT_IDENTITY_ARGS, readSanitizedOriginRemoteUrl, } from "./git-workspace-sync.js";
9
+ import { mergeDirectoryWithBaseline } from "./workspace-restore-merge.js";
10
+ import { createRuntimeProgressReporter, } from "./runtime-progress.js";
11
+ export function createSshCommandManagedRuntimeRunner(input) {
12
+ const defaultCwd = input.defaultCwd?.trim() || input.spec.remoteCwd;
13
+ const maxBufferBytes = typeof input.maxBufferBytes === "number" && Number.isFinite(input.maxBufferBytes) && input.maxBufferBytes > 0
14
+ ? Math.trunc(input.maxBufferBytes)
15
+ : 1024 * 1024;
16
+ return {
17
+ execute: async (commandInput) => {
18
+ const startedAt = new Date().toISOString();
19
+ const command = commandInput.command.trim();
20
+ const args = commandInput.args ?? [];
21
+ const cwd = commandInput.cwd?.trim() || defaultCwd;
22
+ const envEntries = Object.entries(commandInput.env ?? {})
23
+ .filter((entry) => typeof entry[1] === "string");
24
+ const envPrefix = envEntries.length > 0
25
+ ? `env ${envEntries.map(([key, value]) => `${key}=${shellQuote(value)}`).join(" ")} `
26
+ : "";
27
+ const exportPrefix = envEntries.length > 0
28
+ ? envEntries.map(([key, value]) => `export ${key}=${shellQuote(value)};`).join(" ") + " "
29
+ : "";
30
+ const commandScript = command === "sh" || command === "bash"
31
+ ? (args[0] === "-c" || args[0] === "-lc") && typeof args[1] === "string"
32
+ ? `${exportPrefix}${args[1]}`
33
+ : `${envPrefix}exec ${[shellQuote(command), ...args.map((arg) => shellQuote(arg))].join(" ")}`
34
+ : `${envPrefix}exec ${[shellQuote(command), ...args.map((arg) => shellQuote(arg))].join(" ")}`;
35
+ const remoteCommand = `cd ${shellQuote(cwd)} && ${commandScript}`;
36
+ try {
37
+ const result = await runSshCommand(input.spec, remoteCommand, {
38
+ stdin: commandInput.stdin,
39
+ timeoutMs: commandInput.timeoutMs,
40
+ maxBuffer: maxBufferBytes,
41
+ });
42
+ if (result.stdout)
43
+ await commandInput.onLog?.("stdout", result.stdout);
44
+ if (result.stderr)
45
+ await commandInput.onLog?.("stderr", result.stderr);
46
+ return {
47
+ exitCode: 0,
48
+ signal: null,
49
+ timedOut: false,
50
+ stdout: result.stdout,
51
+ stderr: result.stderr,
52
+ pid: null,
53
+ startedAt,
54
+ };
55
+ }
56
+ catch (error) {
57
+ const failure = error;
58
+ const stdout = typeof failure.stdout === "string" ? failure.stdout : "";
59
+ const stderr = typeof failure.stderr === "string"
60
+ ? failure.stderr
61
+ : error instanceof Error
62
+ ? error.message
63
+ : String(error);
64
+ if (stdout)
65
+ await commandInput.onLog?.("stdout", stdout);
66
+ if (stderr)
67
+ await commandInput.onLog?.("stderr", stderr);
68
+ return {
69
+ exitCode: typeof failure.code === "number" ? failure.code : null,
70
+ signal: typeof failure.signal === "string" ? failure.signal : null,
71
+ timedOut: failure.killed === true,
72
+ stdout,
73
+ stderr,
74
+ pid: null,
75
+ startedAt,
76
+ };
77
+ }
78
+ },
79
+ };
80
+ }
81
+ export function shellQuote(value) {
82
+ return `'${value.replace(/'/g, `'\"'\"'`)}'`;
83
+ }
84
+ function isValidShellEnvKey(value) {
85
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
86
+ }
87
+ export function parseSshRemoteExecutionSpec(value) {
88
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
89
+ return null;
90
+ }
91
+ const parsed = value;
92
+ const host = typeof parsed.host === "string" ? parsed.host.trim() : "";
93
+ const username = typeof parsed.username === "string" ? parsed.username.trim() : "";
94
+ const remoteCwd = typeof parsed.remoteCwd === "string" ? parsed.remoteCwd.trim() : "";
95
+ const portValue = typeof parsed.port === "number" ? parsed.port : Number(parsed.port);
96
+ if (!host || !username || !remoteCwd || !Number.isInteger(portValue) || portValue < 1 || portValue > 65535) {
97
+ return null;
98
+ }
99
+ return {
100
+ host,
101
+ port: portValue,
102
+ username,
103
+ remoteCwd,
104
+ remoteWorkspacePath: typeof parsed.remoteWorkspacePath === "string" && parsed.remoteWorkspacePath.trim().length > 0
105
+ ? parsed.remoteWorkspacePath.trim()
106
+ : remoteCwd,
107
+ privateKey: typeof parsed.privateKey === "string" && parsed.privateKey.length > 0 ? parsed.privateKey : null,
108
+ knownHosts: typeof parsed.knownHosts === "string" && parsed.knownHosts.length > 0 ? parsed.knownHosts : null,
109
+ strictHostKeyChecking: typeof parsed.strictHostKeyChecking === "boolean" ? parsed.strictHostKeyChecking : true,
110
+ };
111
+ }
112
+ async function execFileText(file, args, options = {}) {
113
+ return await new Promise((resolve, reject) => {
114
+ execFile(file, args, {
115
+ timeout: options.timeout ?? 15_000,
116
+ maxBuffer: options.maxBuffer ?? 1024 * 128,
117
+ }, (error, stdout, stderr) => {
118
+ if (error) {
119
+ reject(Object.assign(error, { stdout: stdout ?? "", stderr: stderr ?? "" }));
120
+ return;
121
+ }
122
+ resolve({
123
+ stdout: stdout ?? "",
124
+ stderr: stderr ?? "",
125
+ });
126
+ });
127
+ });
128
+ }
129
+ async function spawnText(file, args, options = {}) {
130
+ return await new Promise((resolve, reject) => {
131
+ const child = spawn(file, args, {
132
+ stdio: [options.stdin != null ? "pipe" : "ignore", "pipe", "pipe"],
133
+ });
134
+ const maxBuffer = options.maxBuffer ?? 1024 * 128;
135
+ let stdout = "";
136
+ let stderr = "";
137
+ let settled = false;
138
+ let timedOut = false;
139
+ const finishReject = (error) => {
140
+ if (settled)
141
+ return;
142
+ settled = true;
143
+ error.stdout = stdout;
144
+ error.stderr = stderr;
145
+ error.killed = timedOut;
146
+ reject(error);
147
+ };
148
+ const append = (streamName, chunk) => {
149
+ const text = String(chunk);
150
+ if (streamName === "stdout") {
151
+ stdout += text;
152
+ }
153
+ else {
154
+ stderr += text;
155
+ }
156
+ if (Buffer.byteLength(stdout, "utf8") > maxBuffer || Buffer.byteLength(stderr, "utf8") > maxBuffer) {
157
+ child.kill("SIGTERM");
158
+ finishReject(Object.assign(new Error(`Process output exceeded maxBuffer of ${maxBuffer} bytes.`), {
159
+ code: null,
160
+ }));
161
+ }
162
+ };
163
+ let killEscalation = null;
164
+ const timeout = options.timeout && options.timeout > 0
165
+ ? setTimeout(() => {
166
+ timedOut = true;
167
+ child.kill("SIGTERM");
168
+ // Escalate to SIGKILL after a 5s grace window so a hung remote
169
+ // command that ignores SIGTERM cannot keep the child alive
170
+ // indefinitely.
171
+ killEscalation = setTimeout(() => {
172
+ try {
173
+ child.kill("SIGKILL");
174
+ }
175
+ catch {
176
+ // child may have already exited between the SIGTERM and the
177
+ // escalation — that's fine.
178
+ }
179
+ }, 5_000);
180
+ killEscalation.unref?.();
181
+ }, options.timeout)
182
+ : null;
183
+ const clearTimers = () => {
184
+ if (timeout)
185
+ clearTimeout(timeout);
186
+ if (killEscalation)
187
+ clearTimeout(killEscalation);
188
+ };
189
+ child.stdout?.on("data", (chunk) => {
190
+ append("stdout", chunk);
191
+ });
192
+ child.stderr?.on("data", (chunk) => {
193
+ append("stderr", chunk);
194
+ });
195
+ child.on("error", (error) => {
196
+ clearTimers();
197
+ finishReject(Object.assign(error, { code: null }));
198
+ });
199
+ child.on("close", (code, signal) => {
200
+ clearTimers();
201
+ if (settled)
202
+ return;
203
+ settled = true;
204
+ if (code === 0) {
205
+ resolve({ stdout, stderr });
206
+ return;
207
+ }
208
+ reject(Object.assign(new Error(stderr.trim() || stdout.trim() || `Process exited with code ${code ?? -1}`), {
209
+ stdout,
210
+ stderr,
211
+ code,
212
+ signal,
213
+ killed: timedOut,
214
+ }));
215
+ });
216
+ if (options.stdin != null && child.stdin) {
217
+ child.stdin.end(options.stdin);
218
+ }
219
+ });
220
+ }
221
+ async function runLocalGit(localDir, args, options = {}) {
222
+ return await execFileText("git", ["-C", localDir, ...args], options);
223
+ }
224
+ async function commandExists(command) {
225
+ return (await resolveCommandPath(command)) !== null;
226
+ }
227
+ async function resolveCommandPath(command) {
228
+ try {
229
+ const result = await execFileText("sh", ["-c", `command -v ${shellQuote(command)}`], {
230
+ timeout: 5_000,
231
+ maxBuffer: 8 * 1024,
232
+ });
233
+ const resolved = result.stdout.trim().split("\n")[0]?.trim() ?? "";
234
+ return resolved.length > 0 ? resolved : null;
235
+ }
236
+ catch {
237
+ return null;
238
+ }
239
+ }
240
+ async function withTempFile(prefix, contents, mode) {
241
+ const dir = await fs.mkdtemp(path.join(os.tmpdir(), prefix));
242
+ const filePath = path.join(dir, "payload");
243
+ const normalizedContents = contents.endsWith("\n") ? contents : `${contents}\n`;
244
+ await fs.writeFile(filePath, normalizedContents, { mode, encoding: "utf8" });
245
+ return {
246
+ path: filePath,
247
+ cleanup: async () => {
248
+ await fs.rm(dir, { recursive: true, force: true }).catch(() => undefined);
249
+ },
250
+ };
251
+ }
252
+ async function createSshAuthArgs(config) {
253
+ const tempFiles = [];
254
+ const sshArgs = [
255
+ "-o",
256
+ "BatchMode=yes",
257
+ "-o",
258
+ "ConnectTimeout=10",
259
+ "-o",
260
+ `StrictHostKeyChecking=${config.strictHostKeyChecking ? "yes" : "no"}`,
261
+ ];
262
+ if (config.strictHostKeyChecking) {
263
+ if (config.knownHosts) {
264
+ const knownHosts = await withTempFile("paperclip-ssh-known-hosts-", config.knownHosts, 0o600);
265
+ tempFiles.push(knownHosts.cleanup);
266
+ sshArgs.push("-o", `UserKnownHostsFile=${knownHosts.path}`);
267
+ }
268
+ }
269
+ else {
270
+ sshArgs.push("-o", "UserKnownHostsFile=/dev/null");
271
+ }
272
+ if (config.privateKey) {
273
+ const privateKey = await withTempFile("paperclip-ssh-key-", config.privateKey, 0o600);
274
+ tempFiles.push(privateKey.cleanup);
275
+ sshArgs.push("-i", privateKey.path);
276
+ }
277
+ return {
278
+ args: sshArgs,
279
+ cleanup: async () => {
280
+ await Promise.all(tempFiles.map((cleanup) => cleanup()));
281
+ },
282
+ };
283
+ }
284
+ function tarExcludeArgs(exclude) {
285
+ const combined = ["._*", ...(exclude ?? [])];
286
+ return combined.flatMap((entry) => ["--exclude", entry]);
287
+ }
288
+ function tarSpawnEnv() {
289
+ return {
290
+ ...process.env,
291
+ // Prevent macOS bsdtar from emitting AppleDouble metadata files like ._README.md.
292
+ COPYFILE_DISABLE: "1",
293
+ };
294
+ }
295
+ // Converts a tar `--exclude` pattern into a regexp for the local-size estimate.
296
+ // We only need approximate fidelity here (the estimate feeds a clamped percent),
297
+ // so we support the literal names and `*`/`?` globs used in practice.
298
+ function tarPatternToRegExp(pattern) {
299
+ const escaped = pattern
300
+ .replace(/[.+^${}()|[\]\\]/g, "\\$&")
301
+ .replace(/\*/g, "[^/]*")
302
+ .replace(/\?/g, "[^/]");
303
+ return new RegExp(`^${escaped}$`);
304
+ }
305
+ // Walks `localDir` summing regular-file sizes, mirroring tar's `--exclude`
306
+ // handling (plus the implicit `._*`) and `followSymlinks` so the to-ssh upload
307
+ // can report an estimated total before tar finishes producing the stream.
308
+ async function estimateLocalDirSize(input) {
309
+ const regexes = ["._*", ...(input.exclude ?? [])].map(tarPatternToRegExp);
310
+ const isExcluded = (relPath, base) => regexes.some((regex) => regex.test(relPath) || regex.test(base));
311
+ let total = 0;
312
+ const walk = async (dir, relative) => {
313
+ const entries = await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
314
+ for (const entry of entries) {
315
+ const entryRelative = relative ? `${relative}/${entry.name}` : entry.name;
316
+ if (isExcluded(entryRelative, entry.name))
317
+ continue;
318
+ const full = path.join(dir, entry.name);
319
+ const stats = await (input.followSymlinks ? fs.stat(full) : fs.lstat(full)).catch(() => null);
320
+ if (!stats)
321
+ continue;
322
+ if (stats.isDirectory()) {
323
+ await walk(full, entryRelative);
324
+ }
325
+ else if (stats.isFile()) {
326
+ total += stats.size;
327
+ }
328
+ }
329
+ };
330
+ await walk(input.localDir, "");
331
+ return total;
332
+ }
333
+ // Best-effort remote size probe for the from-ssh restore. `du -sk` is POSIX and
334
+ // available on the BSD/Linux remotes we target; it over-counts (block-rounded,
335
+ // includes excluded dirs) which keeps the reported percent safely below 100
336
+ // until the stream actually closes. Returns null when unavailable so the caller
337
+ // falls back to MB-received mode.
338
+ async function probeRemoteDirSize(input) {
339
+ try {
340
+ const result = await runSshScript(input.spec, `du -sk ${shellQuote(input.remoteDir)} 2>/dev/null | cut -f1`, { timeoutMs: 15_000, maxBuffer: 16 * 1024 });
341
+ const kilobytes = Number.parseInt(result.stdout.trim(), 10);
342
+ return Number.isFinite(kilobytes) && kilobytes > 0 ? kilobytes * 1024 : null;
343
+ }
344
+ catch {
345
+ return null;
346
+ }
347
+ }
348
+ // Wraps a throttled progress reporter behind a counting Transform so transports
349
+ // can `source.pipe(progress.counter).pipe(dest)`. When `totalBytes` is a known
350
+ // exact size (e.g. a git bundle) the reporter emits an exact percentage. When it
351
+ // is an estimate (tar upload / remote probe) we clamp the reported bytes to 99%
352
+ // of the estimate so an inaccurate total never shows a premature 100%; `finish`
353
+ // then emits the terminal 100% (or, in MB-only mode, the final MB) line.
354
+ //
355
+ // `totalBytes` may be a promise so an expensive size estimate (a local dir walk
356
+ // or a remote `du` probe) runs concurrently with the transfer instead of
357
+ // blocking the pipe from opening. Until it resolves the counter reports bytes in
358
+ // MB-only mode, then adopts the percentage once the total is known; `finish`
359
+ // awaits the estimate so the terminal 100% line is still guaranteed.
360
+ function createTransferProgress(input) {
361
+ const reporter = createRuntimeProgressReporter({
362
+ sink: input.onProgress,
363
+ phase: input.phase,
364
+ direction: input.direction,
365
+ label: input.label,
366
+ target: "ssh",
367
+ });
368
+ let total = null;
369
+ let cap = null;
370
+ const applyTotal = (value) => {
371
+ total = value != null && value > 0 ? value : null;
372
+ cap = total != null && input.estimated ? Math.floor(total * 0.99) : null;
373
+ };
374
+ const totalReady = input.totalBytes != null && typeof input.totalBytes.then === "function"
375
+ ? input.totalBytes.then(applyTotal, () => applyTotal(null))
376
+ : (applyTotal(input.totalBytes), Promise.resolve());
377
+ let transferred = 0;
378
+ let chain = Promise.resolve();
379
+ const enqueue = (work) => {
380
+ chain = chain.then(work).catch(() => undefined);
381
+ };
382
+ const counter = new Transform({
383
+ transform(chunk, _encoding, callback) {
384
+ transferred += chunk.length;
385
+ const reported = cap != null ? Math.min(transferred, cap) : transferred;
386
+ const totalSnapshot = total;
387
+ enqueue(() => reporter.report(reported, totalSnapshot));
388
+ callback(null, chunk);
389
+ },
390
+ });
391
+ return {
392
+ counter,
393
+ transferred: () => transferred,
394
+ finish: async () => {
395
+ await chain.catch(() => undefined);
396
+ await totalReady.catch(() => undefined);
397
+ await reporter.complete(total != null ? total : transferred, total).catch(() => undefined);
398
+ },
399
+ fail: async () => {
400
+ await chain.catch(() => undefined);
401
+ await reporter.fail(transferred, total).catch(() => undefined);
402
+ },
403
+ };
404
+ }
405
+ async function runSshScript(config, script, options = {}) {
406
+ return await runSshCommand(config, script, options);
407
+ }
408
+ async function clearLocalDirectory(localDir, preserveEntries = []) {
409
+ await fs.mkdir(localDir, { recursive: true });
410
+ const preserve = new Set(preserveEntries);
411
+ const entries = await fs.readdir(localDir);
412
+ await Promise.all(entries
413
+ .filter((entry) => !preserve.has(entry))
414
+ .map((entry) => fs.rm(path.join(localDir, entry), { recursive: true, force: true })));
415
+ }
416
+ async function copyDirectoryContents(sourceDir, targetDir) {
417
+ await fs.mkdir(targetDir, { recursive: true });
418
+ const entries = await fs.readdir(sourceDir);
419
+ await Promise.all(entries.map(async (entry) => {
420
+ await fs.cp(path.join(sourceDir, entry), path.join(targetDir, entry), {
421
+ recursive: true,
422
+ force: true,
423
+ preserveTimestamps: true,
424
+ });
425
+ }));
426
+ }
427
+ async function readLocalGitWorkspaceSnapshot(localDir) {
428
+ try {
429
+ const insideWorkTree = await runLocalGit(localDir, ["rev-parse", "--is-inside-work-tree"], {
430
+ timeout: 10_000,
431
+ maxBuffer: 16 * 1024,
432
+ });
433
+ if (insideWorkTree.stdout.trim() !== "true") {
434
+ return null;
435
+ }
436
+ const [headCommitResult, branchResult, deletedResult] = await Promise.all([
437
+ runLocalGit(localDir, ["rev-parse", "HEAD"], {
438
+ timeout: 10_000,
439
+ maxBuffer: 16 * 1024,
440
+ }),
441
+ runLocalGit(localDir, ["rev-parse", "--abbrev-ref", "HEAD"], {
442
+ timeout: 10_000,
443
+ maxBuffer: 16 * 1024,
444
+ }),
445
+ runLocalGit(localDir, ["ls-files", "--deleted", "-z"], {
446
+ timeout: 10_000,
447
+ maxBuffer: 256 * 1024,
448
+ }),
449
+ ]);
450
+ const branchName = branchResult.stdout.trim();
451
+ return {
452
+ headCommit: headCommitResult.stdout.trim(),
453
+ branchName: branchName && branchName !== "HEAD" ? branchName : null,
454
+ deletedPaths: deletedResult.stdout
455
+ .split("\0")
456
+ .map((entry) => entry.trim())
457
+ .filter(Boolean),
458
+ };
459
+ }
460
+ catch {
461
+ return null;
462
+ }
463
+ }
464
+ async function streamLocalFileToSsh(input) {
465
+ const auth = await createSshAuthArgs(input.spec);
466
+ const sshArgs = [
467
+ ...auth.args,
468
+ "-p",
469
+ String(input.spec.port),
470
+ `${input.spec.username}@${input.spec.host}`,
471
+ `sh -c ${shellQuote(input.remoteScript)}`,
472
+ ];
473
+ await new Promise((resolve, reject) => {
474
+ const source = createReadStream(input.localFile);
475
+ const ssh = spawn("ssh", sshArgs, {
476
+ stdio: ["pipe", "ignore", "pipe"],
477
+ });
478
+ let sshStderr = "";
479
+ let settled = false;
480
+ const fail = (error) => {
481
+ if (settled)
482
+ return;
483
+ settled = true;
484
+ source.destroy();
485
+ ssh.kill("SIGTERM");
486
+ reject(error);
487
+ };
488
+ ssh.stderr?.on("data", (chunk) => {
489
+ sshStderr += String(chunk);
490
+ });
491
+ source.on("error", fail);
492
+ ssh.on("error", fail);
493
+ if (input.progress) {
494
+ input.progress.counter.on("error", fail);
495
+ source.pipe(input.progress.counter).pipe(ssh.stdin ?? null);
496
+ }
497
+ else {
498
+ source.pipe(ssh.stdin ?? null);
499
+ }
500
+ ssh.on("close", (code) => {
501
+ if (settled)
502
+ return;
503
+ settled = true;
504
+ if ((code ?? 0) !== 0) {
505
+ reject(new Error(sshStderr.trim() || `ssh exited with code ${code ?? -1}`));
506
+ return;
507
+ }
508
+ resolve();
509
+ });
510
+ }).finally(auth.cleanup);
511
+ }
512
+ async function streamSshToLocalFile(input) {
513
+ const auth = await createSshAuthArgs(input.spec);
514
+ const sshArgs = [
515
+ ...auth.args,
516
+ "-p",
517
+ String(input.spec.port),
518
+ `${input.spec.username}@${input.spec.host}`,
519
+ `sh -c ${shellQuote(input.remoteScript)}`,
520
+ ];
521
+ await new Promise((resolve, reject) => {
522
+ const ssh = spawn("ssh", sshArgs, {
523
+ stdio: ["ignore", "pipe", "pipe"],
524
+ });
525
+ const sink = createWriteStream(input.localFile, { mode: 0o600 });
526
+ let sshStderr = "";
527
+ let settled = false;
528
+ const fail = (error) => {
529
+ if (settled)
530
+ return;
531
+ settled = true;
532
+ ssh.kill("SIGTERM");
533
+ sink.destroy();
534
+ reject(error);
535
+ };
536
+ if (input.progress) {
537
+ input.progress.counter.on("error", fail);
538
+ ssh.stdout?.pipe(input.progress.counter).pipe(sink);
539
+ }
540
+ else {
541
+ ssh.stdout?.pipe(sink);
542
+ }
543
+ ssh.stderr?.on("data", (chunk) => {
544
+ sshStderr += String(chunk);
545
+ });
546
+ ssh.on("error", fail);
547
+ sink.on("error", fail);
548
+ ssh.on("close", (code) => {
549
+ sink.end(() => {
550
+ if (settled)
551
+ return;
552
+ settled = true;
553
+ if ((code ?? 0) !== 0) {
554
+ reject(new Error(sshStderr.trim() || `ssh exited with code ${code ?? -1}`));
555
+ return;
556
+ }
557
+ resolve();
558
+ });
559
+ });
560
+ }).finally(auth.cleanup);
561
+ }
562
+ async function importGitWorkspaceToSsh(input) {
563
+ const bundleDir = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-ssh-bundle-"));
564
+ const bundlePath = path.join(bundleDir, "workspace.bundle");
565
+ // Per-import unique ref so concurrent imports against the same local repo
566
+ // can't race on `update-ref` between this run's update and bundle create.
567
+ const tempRef = `refs/paperclip/ssh-sync/import/${randomUUID()}`;
568
+ try {
569
+ await runLocalGit(input.localDir, ["update-ref", tempRef, input.snapshot.headCommit], {
570
+ timeout: 10_000,
571
+ maxBuffer: 16 * 1024,
572
+ });
573
+ await runLocalGit(input.localDir, ["bundle", "create", bundlePath, tempRef], {
574
+ timeout: 60_000,
575
+ maxBuffer: 1024 * 1024,
576
+ });
577
+ const originUrl = await readSanitizedOriginRemoteUrl(input.localDir);
578
+ const remoteSetupScript = [
579
+ "set -e",
580
+ `mkdir -p ${shellQuote(path.posix.join(input.remoteDir, ".paperclip-runtime"))}`,
581
+ `tmp_bundle=$(mktemp ${shellQuote(path.posix.join(input.remoteDir, ".paperclip-runtime", "import-XXXXXX.bundle"))})`,
582
+ 'trap \'rm -f "$tmp_bundle"\' EXIT',
583
+ 'cat > "$tmp_bundle"',
584
+ `if [ ! -d ${shellQuote(path.posix.join(input.remoteDir, ".git"))} ]; then git init ${shellQuote(input.remoteDir)} >/dev/null; fi`,
585
+ // Carry the workspace's (credential-scrubbed) origin into the transported
586
+ // repo so branches there keep a publishable remote instead of reading as
587
+ // remote-less snapshots. set-url covers a reused workspace whose origin
588
+ // changed; add covers the fresh-init case. Best-effort under `set -e`.
589
+ ...(originUrl
590
+ ? [
591
+ `{ git -C ${shellQuote(input.remoteDir)} remote set-url origin ${shellQuote(originUrl)} >/dev/null 2>&1 || git -C ${shellQuote(input.remoteDir)} remote add origin ${shellQuote(originUrl)} >/dev/null 2>&1; } || true`,
592
+ ]
593
+ : []),
594
+ `git -C ${shellQuote(input.remoteDir)} fetch --force "$tmp_bundle" '${tempRef}:${tempRef}' >/dev/null`,
595
+ input.snapshot.branchName
596
+ ? `git -C ${shellQuote(input.remoteDir)} checkout --force -B ${shellQuote(input.snapshot.branchName)} ${shellQuote(input.snapshot.headCommit)} >/dev/null`
597
+ : `git -C ${shellQuote(input.remoteDir)} -c advice.detachedHead=false checkout --force --detach ${shellQuote(input.snapshot.headCommit)} >/dev/null`,
598
+ `git -C ${shellQuote(input.remoteDir)} reset --hard ${shellQuote(input.snapshot.headCommit)} >/dev/null`,
599
+ `git -C ${shellQuote(input.remoteDir)} clean -fdx -e .paperclip-runtime >/dev/null`,
600
+ // Drop the per-import ref on the remote side too so it can't accumulate.
601
+ `git -C ${shellQuote(input.remoteDir)} update-ref -d ${shellQuote(tempRef)} >/dev/null 2>&1 || true`,
602
+ ].join("\n");
603
+ // The git bundle is a real local file of known size, so report an exact
604
+ // percentage. No `workspace` label: the "Importing git history" phase is
605
+ // already self-describing in the log line.
606
+ const progress = input.onProgress
607
+ ? createTransferProgress({
608
+ onProgress: input.onProgress,
609
+ phase: "Importing git history",
610
+ direction: "to",
611
+ totalBytes: (await fs.stat(bundlePath)).size,
612
+ estimated: false,
613
+ })
614
+ : null;
615
+ try {
616
+ await streamLocalFileToSsh({
617
+ spec: input.spec,
618
+ localFile: bundlePath,
619
+ remoteScript: remoteSetupScript,
620
+ progress: progress ?? undefined,
621
+ });
622
+ await progress?.finish();
623
+ }
624
+ catch (error) {
625
+ await progress?.fail();
626
+ throw error;
627
+ }
628
+ }
629
+ finally {
630
+ await runLocalGit(input.localDir, ["update-ref", "-d", tempRef], {
631
+ timeout: 10_000,
632
+ maxBuffer: 16 * 1024,
633
+ }).catch(() => undefined);
634
+ await fs.rm(bundleDir, { recursive: true, force: true }).catch(() => undefined);
635
+ }
636
+ }
637
+ async function exportGitWorkspaceFromSsh(input) {
638
+ const bundleDir = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-ssh-bundle-"));
639
+ const bundlePath = path.join(bundleDir, "workspace.bundle");
640
+ const importedRef = input.importedRef ?? `refs/paperclip/ssh-sync/imported/${randomUUID()}`;
641
+ try {
642
+ const exportScript = [
643
+ "set -e",
644
+ `git -C ${shellQuote(input.remoteDir)} update-ref refs/paperclip/ssh-sync/export HEAD`,
645
+ `mkdir -p ${shellQuote(path.posix.join(input.remoteDir, ".paperclip-runtime"))}`,
646
+ `tmp_bundle=$(mktemp ${shellQuote(path.posix.join(input.remoteDir, ".paperclip-runtime", "export-XXXXXX.bundle"))})`,
647
+ 'cleanup() { rm -f "$tmp_bundle"; git -C ' + shellQuote(input.remoteDir) + ' update-ref -d refs/paperclip/ssh-sync/export >/dev/null 2>&1 || true; }',
648
+ 'trap cleanup EXIT',
649
+ `git -C ${shellQuote(input.remoteDir)} bundle create "$tmp_bundle" refs/paperclip/ssh-sync/export >/dev/null`,
650
+ 'cat "$tmp_bundle"',
651
+ ].join("\n");
652
+ // The remote bundle size isn't known before streaming, so report bytes
653
+ // received (MB mode) with a terminal completion line.
654
+ const progress = input.onProgress
655
+ ? createTransferProgress({
656
+ onProgress: input.onProgress,
657
+ phase: "Exporting git history",
658
+ direction: "from",
659
+ totalBytes: null,
660
+ estimated: false,
661
+ })
662
+ : null;
663
+ try {
664
+ await streamSshToLocalFile({
665
+ spec: input.spec,
666
+ remoteScript: exportScript,
667
+ localFile: bundlePath,
668
+ progress: progress ?? undefined,
669
+ });
670
+ await progress?.finish();
671
+ }
672
+ catch (error) {
673
+ await progress?.fail();
674
+ throw error;
675
+ }
676
+ await runLocalGit(input.localDir, ["fetch", "--force", bundlePath, `refs/paperclip/ssh-sync/export:${importedRef}`], {
677
+ timeout: 60_000,
678
+ maxBuffer: 1024 * 1024,
679
+ });
680
+ if (input.resetLocalWorkspace !== false) {
681
+ await runLocalGit(input.localDir, ["reset", "--hard", importedRef], {
682
+ timeout: 60_000,
683
+ maxBuffer: 1024 * 1024,
684
+ });
685
+ }
686
+ const importedHead = await runLocalGit(input.localDir, ["rev-parse", importedRef], {
687
+ timeout: 10_000,
688
+ maxBuffer: 16 * 1024,
689
+ });
690
+ return importedHead.stdout.trim();
691
+ }
692
+ finally {
693
+ if (input.resetLocalWorkspace !== false) {
694
+ await runLocalGit(input.localDir, ["update-ref", "-d", importedRef], {
695
+ timeout: 10_000,
696
+ maxBuffer: 16 * 1024,
697
+ }).catch(() => undefined);
698
+ }
699
+ await fs.rm(bundleDir, { recursive: true, force: true }).catch(() => undefined);
700
+ }
701
+ }
702
+ async function integrateImportedGitHead(input) {
703
+ const isConcurrentRefUpdateError = (error) => {
704
+ const message = error instanceof Error ? error.message : String(error);
705
+ return message.includes("cannot lock ref") && message.includes("expected");
706
+ };
707
+ for (let attempt = 0; attempt < 5; attempt += 1) {
708
+ const snapshot = await readLocalGitWorkspaceSnapshot(input.localDir);
709
+ if (!snapshot)
710
+ return;
711
+ const currentHead = snapshot.headCommit;
712
+ if (!currentHead || currentHead === input.importedHead)
713
+ return;
714
+ const headRef = snapshot.branchName ? `refs/heads/${snapshot.branchName}` : "HEAD";
715
+ // `git merge-base` exits 1 when the commits share no ancestor — the only
716
+ // outcome that authorizes the graft fallback below. Every other failure
717
+ // (timeout, missing object, repository error) must keep failing the
718
+ // integration instead of silently rewriting the tip.
719
+ let noCommonAncestor = false;
720
+ const mergeBase = await runLocalGit(input.localDir, ["merge-base", currentHead, input.importedHead], {
721
+ timeout: 10_000,
722
+ maxBuffer: 16 * 1024,
723
+ }).catch((error) => {
724
+ noCommonAncestor = error?.code === 1;
725
+ return null;
726
+ });
727
+ const mergeBaseHead = mergeBase?.stdout.trim() ?? "";
728
+ if (mergeBaseHead === input.importedHead) {
729
+ return;
730
+ }
731
+ if (mergeBaseHead === currentHead) {
732
+ try {
733
+ await runLocalGit(input.localDir, ["update-ref", headRef, input.importedHead, currentHead], {
734
+ timeout: 10_000,
735
+ maxBuffer: 16 * 1024,
736
+ });
737
+ return;
738
+ }
739
+ catch (error) {
740
+ if (isConcurrentRefUpdateError(error) && attempt < 4)
741
+ continue;
742
+ throw error;
743
+ }
744
+ }
745
+ if (noCommonAncestor) {
746
+ // No common ancestor — merging is impossible and failing here would
747
+ // discard the imported work. Graft it onto the current head instead;
748
+ // see createUnrelatedHistoryGraftCommit.
749
+ const graftCommit = await createUnrelatedHistoryGraftCommit({
750
+ localDir: input.localDir,
751
+ currentHead,
752
+ importedHead: input.importedHead,
753
+ syncLabel: "Paperclip SSH sync",
754
+ });
755
+ try {
756
+ await runLocalGit(input.localDir, ["update-ref", headRef, graftCommit, currentHead], {
757
+ timeout: 10_000,
758
+ maxBuffer: 16 * 1024,
759
+ });
760
+ return;
761
+ }
762
+ catch (error) {
763
+ if (isConcurrentRefUpdateError(error) && attempt < 4)
764
+ continue;
765
+ throw error;
766
+ }
767
+ }
768
+ let mergedTree;
769
+ try {
770
+ mergedTree = await runLocalGit(input.localDir, ["merge-tree", "--write-tree", currentHead, input.importedHead], {
771
+ timeout: 60_000,
772
+ maxBuffer: 256 * 1024,
773
+ });
774
+ }
775
+ catch (error) {
776
+ const reason = error instanceof Error ? error.message : String(error);
777
+ throw new Error(`Failed to merge concurrent SSH git histories for ${currentHead.slice(0, 12)} and ${input.importedHead.slice(0, 12)}: ${reason}`);
778
+ }
779
+ const mergedTreeId = mergedTree.stdout.trim().split("\n")[0]?.trim() ?? "";
780
+ if (!mergedTreeId) {
781
+ throw new Error("Failed to compute a merged git tree for SSH workspace restore.");
782
+ }
783
+ const mergeCommit = await runLocalGit(input.localDir, [
784
+ ...GIT_SYNC_COMMIT_IDENTITY_ARGS,
785
+ "commit-tree",
786
+ mergedTreeId,
787
+ "-p",
788
+ currentHead,
789
+ "-p",
790
+ input.importedHead,
791
+ "-m",
792
+ `Paperclip SSH sync merge ${input.importedHead.slice(0, 12)}`,
793
+ ], {
794
+ timeout: 60_000,
795
+ maxBuffer: 64 * 1024,
796
+ });
797
+ try {
798
+ await runLocalGit(input.localDir, ["update-ref", headRef, mergeCommit.stdout.trim(), currentHead], {
799
+ timeout: 10_000,
800
+ maxBuffer: 16 * 1024,
801
+ });
802
+ return;
803
+ }
804
+ catch (error) {
805
+ if (isConcurrentRefUpdateError(error) && attempt < 4)
806
+ continue;
807
+ throw error;
808
+ }
809
+ }
810
+ throw new Error(`Failed to integrate concurrent SSH git history for ${input.importedHead.slice(0, 12)} after multiple retries.`);
811
+ }
812
+ async function clearRemoteDirectory(input) {
813
+ const preservePatterns = (input.preserveEntries ?? [])
814
+ .map((entry) => `! -name ${shellQuote(entry)}`)
815
+ .join(" ");
816
+ const script = [
817
+ "set -e",
818
+ `mkdir -p ${shellQuote(input.remoteDir)}`,
819
+ `find ${shellQuote(input.remoteDir)} -mindepth 1 -maxdepth 1 ${preservePatterns} -exec rm -rf -- {} +`,
820
+ ].join("\n");
821
+ await runSshScript(input.spec, script, {
822
+ timeoutMs: 30_000,
823
+ maxBuffer: 256 * 1024,
824
+ });
825
+ }
826
+ async function removeDeletedPathsOnSsh(input) {
827
+ if (input.deletedPaths.length === 0)
828
+ return;
829
+ const quotedPaths = input.deletedPaths.map((entry) => shellQuote(entry)).join(" ");
830
+ const script = `cd ${shellQuote(input.remoteDir)} && rm -rf -- ${quotedPaths}`;
831
+ await runSshScript(input.spec, script, {
832
+ timeoutMs: 30_000,
833
+ maxBuffer: 256 * 1024,
834
+ });
835
+ }
836
+ async function allocateLoopbackPort(host) {
837
+ return await new Promise((resolve, reject) => {
838
+ const server = net.createServer();
839
+ server.once("error", reject);
840
+ server.listen(0, host, () => {
841
+ const address = server.address();
842
+ if (!address || typeof address === "string") {
843
+ server.close(() => reject(new Error("Failed to allocate a loopback port.")));
844
+ return;
845
+ }
846
+ const { port } = address;
847
+ server.close((error) => {
848
+ if (error) {
849
+ reject(error);
850
+ return;
851
+ }
852
+ resolve(port);
853
+ });
854
+ });
855
+ });
856
+ }
857
+ async function waitForCondition(fn, options = {}) {
858
+ const timeoutAt = Date.now() + (options.timeoutMs ?? 10_000);
859
+ const intervalMs = options.intervalMs ?? 200;
860
+ let lastError = null;
861
+ while (Date.now() < timeoutAt) {
862
+ try {
863
+ await fn();
864
+ return;
865
+ }
866
+ catch (error) {
867
+ lastError = error;
868
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
869
+ }
870
+ }
871
+ throw lastError instanceof Error
872
+ ? lastError
873
+ : new Error("Timed out waiting for SSH fixture readiness.");
874
+ }
875
+ async function isPidRunning(pid) {
876
+ try {
877
+ process.kill(pid, 0);
878
+ return true;
879
+ }
880
+ catch {
881
+ return false;
882
+ }
883
+ }
884
+ async function readProcessCommand(pid) {
885
+ for (const format of ["command=", "args="]) {
886
+ try {
887
+ const result = await execFileText("ps", ["-o", format, "-p", String(pid)], {
888
+ timeout: 5_000,
889
+ maxBuffer: 16 * 1024,
890
+ });
891
+ const command = result.stdout.trim();
892
+ if (command.length > 0) {
893
+ return command;
894
+ }
895
+ }
896
+ catch {
897
+ continue;
898
+ }
899
+ }
900
+ return null;
901
+ }
902
+ async function isSshEnvLabFixtureProcess(state) {
903
+ if (!(await isPidRunning(state.pid))) {
904
+ return false;
905
+ }
906
+ const command = await readProcessCommand(state.pid);
907
+ if (!command) {
908
+ return false;
909
+ }
910
+ return command.includes(state.sshdConfigPath);
911
+ }
912
+ export async function getSshEnvLabSupport() {
913
+ if (process.platform === "darwin" && process.env.PAPERCLIP_ENABLE_DARWIN_SSH_ENV_LAB !== "1") {
914
+ return {
915
+ supported: false,
916
+ reason: "SSH env-lab fixture is disabled on macOS; set PAPERCLIP_ENABLE_DARWIN_SSH_ENV_LAB=1 to opt in.",
917
+ };
918
+ }
919
+ for (const command of ["ssh", "sshd", "ssh-keygen"]) {
920
+ if (!(await commandExists(command))) {
921
+ return {
922
+ supported: false,
923
+ reason: `Missing required command: ${command}`,
924
+ };
925
+ }
926
+ }
927
+ return {
928
+ supported: true,
929
+ reason: null,
930
+ };
931
+ }
932
+ export function buildKnownHostsEntry(input) {
933
+ return `[${input.host}]:${input.port} ${input.publicKey.trim()}`;
934
+ }
935
+ export async function runSshCommand(config, remoteCommand, options = {}) {
936
+ let cleanup = () => Promise.resolve();
937
+ try {
938
+ const auth = await createSshAuthArgs(config);
939
+ cleanup = auth.cleanup;
940
+ const sshArgs = [...auth.args];
941
+ const envEntries = Object.entries(options.env ?? {})
942
+ .filter((entry) => typeof entry[1] === "string");
943
+ for (const [key] of envEntries) {
944
+ if (!isValidShellEnvKey(key)) {
945
+ throw new Error(`Invalid SSH environment variable key: ${key}`);
946
+ }
947
+ }
948
+ // Mirror buildSshSpawnTarget: source the login profiles first, then run
949
+ // `env KEY=VAL cmd` so user-supplied identity overrides win over anything a
950
+ // profile re-exports. The SSH target is an operator-configured host, not a
951
+ // Paperclip sandbox image, so it can expose `node` or an agent CLI only
952
+ // through a login profile; a non-login SSH command would miss that PATH.
953
+ // Source `/etc/profile` first so a host that exposes the PATH through
954
+ // `/etc/profile.d` scripts still resolves node and the agent CLI.
955
+ // The script no longer sources `nvm.sh`; a profile that adds nvm still runs.
956
+ // .bash_profile typically sources .bashrc itself; only source .bashrc
957
+ // directly when no .bash_profile exists, so a host that adds nvm in
958
+ // .bashrc still resolves node without a double-run of the setup.
959
+ const envArgs = envEntries.map(([key, value]) => `${key}=${shellQuote(value)}`);
960
+ const remoteScript = [
961
+ 'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',
962
+ 'if [ -f "$HOME/.profile" ]; then . "$HOME/.profile" >/dev/null 2>&1 || true; fi',
963
+ 'if [ -f "$HOME/.bash_profile" ]; then . "$HOME/.bash_profile" >/dev/null 2>&1 || true; elif [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" >/dev/null 2>&1 || true; fi',
964
+ 'if [ -f "$HOME/.zprofile" ]; then . "$HOME/.zprofile" >/dev/null 2>&1 || true; fi',
965
+ envArgs.length > 0
966
+ ? `exec env ${envArgs.join(" ")} sh -c ${shellQuote(remoteCommand)}`
967
+ : `exec sh -c ${shellQuote(remoteCommand)}`,
968
+ ].join(" && ");
969
+ sshArgs.push("-p", String(config.port), `${config.username}@${config.host}`, `sh -c ${shellQuote(remoteScript)}`);
970
+ return options.stdin != null
971
+ ? await spawnText("ssh", sshArgs, {
972
+ stdin: options.stdin,
973
+ timeout: options.timeoutMs ?? 15_000,
974
+ maxBuffer: options.maxBuffer ?? 1024 * 128,
975
+ })
976
+ : await execFileText("ssh", sshArgs, {
977
+ timeout: options.timeoutMs ?? 15_000,
978
+ maxBuffer: options.maxBuffer ?? 1024 * 128,
979
+ });
980
+ }
981
+ finally {
982
+ await cleanup();
983
+ }
984
+ }
985
+ export async function buildSshSpawnTarget(input) {
986
+ for (const key of Object.keys(input.env)) {
987
+ if (!isValidShellEnvKey(key)) {
988
+ throw new Error(`Invalid SSH environment variable key: ${key}`);
989
+ }
990
+ }
991
+ const auth = await createSshAuthArgs(input.spec);
992
+ const sshArgs = [...auth.args];
993
+ const envArgs = Object.entries(input.env)
994
+ .filter((entry) => typeof entry[1] === "string")
995
+ .map(([key, value]) => `${key}=${shellQuote(value)}`);
996
+ const remoteCommandParts = [shellQuote(input.command), ...input.args.map((arg) => shellQuote(arg))].join(" ");
997
+ // Source the login profiles first, then run `env KEY=VAL cmd` so
998
+ // user-supplied identity overrides win over anything a profile re-exports.
999
+ // The SSH target is an operator-configured host, not a Paperclip sandbox
1000
+ // image, so it can expose `node` or an agent CLI only through a login
1001
+ // profile; a non-login SSH command would miss that PATH. Source
1002
+ // `/etc/profile` first so a host that exposes the PATH through
1003
+ // `/etc/profile.d` scripts still resolves node and the agent CLI. The script
1004
+ // no longer sources `nvm.sh`; a profile that adds nvm still runs.
1005
+ // .bash_profile typically sources .bashrc itself; only source .bashrc
1006
+ // directly when no .bash_profile exists, so a host that adds nvm in
1007
+ // .bashrc still resolves node without a double-run of the setup.
1008
+ const remoteScript = [
1009
+ 'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',
1010
+ 'if [ -f "$HOME/.profile" ]; then . "$HOME/.profile" >/dev/null 2>&1 || true; fi',
1011
+ 'if [ -f "$HOME/.bash_profile" ]; then . "$HOME/.bash_profile" >/dev/null 2>&1 || true; elif [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" >/dev/null 2>&1 || true; fi',
1012
+ 'if [ -f "$HOME/.zprofile" ]; then . "$HOME/.zprofile" >/dev/null 2>&1 || true; fi',
1013
+ `cd ${shellQuote(input.spec.remoteCwd)}`,
1014
+ envArgs.length > 0
1015
+ ? `exec env ${envArgs.join(" ")} ${remoteCommandParts}`
1016
+ : `exec ${remoteCommandParts}`,
1017
+ ].join(" && ");
1018
+ sshArgs.push("-p", String(input.spec.port), `${input.spec.username}@${input.spec.host}`, `sh -c ${shellQuote(remoteScript)}`);
1019
+ return {
1020
+ command: "ssh",
1021
+ args: sshArgs,
1022
+ cleanup: auth.cleanup,
1023
+ };
1024
+ }
1025
+ export async function syncDirectoryToSsh(input) {
1026
+ const auth = await createSshAuthArgs(input.spec);
1027
+ const sshArgs = [
1028
+ ...auth.args,
1029
+ "-p",
1030
+ String(input.spec.port),
1031
+ `${input.spec.username}@${input.spec.host}`,
1032
+ `sh -c ${shellQuote(`mkdir -p ${shellQuote(input.remoteDir)} && tar -xf - -C ${shellQuote(input.remoteDir)}`)}`,
1033
+ ];
1034
+ // tar's archive size isn't known until tar finishes, so estimate it from the
1035
+ // local file sizes and clamp the reported percent to 99% until the pipe closes.
1036
+ // The estimate walk runs concurrently with the transfer so it never delays the
1037
+ // pipe from opening on large workspaces.
1038
+ const progress = input.onProgress
1039
+ ? createTransferProgress({
1040
+ onProgress: input.onProgress,
1041
+ phase: "Syncing",
1042
+ direction: "to",
1043
+ label: input.progressLabel,
1044
+ totalBytes: estimateLocalDirSize({
1045
+ localDir: input.localDir,
1046
+ exclude: input.exclude,
1047
+ followSymlinks: input.followSymlinks,
1048
+ }),
1049
+ estimated: true,
1050
+ })
1051
+ : null;
1052
+ try {
1053
+ await new Promise((resolve, reject) => {
1054
+ const tarArgs = [
1055
+ ...(input.followSymlinks ? ["-h"] : []),
1056
+ "-C",
1057
+ input.localDir,
1058
+ ...tarExcludeArgs(input.exclude),
1059
+ "-cf",
1060
+ "-",
1061
+ ".",
1062
+ ];
1063
+ const tar = spawn("tar", tarArgs, {
1064
+ stdio: ["ignore", "pipe", "pipe"],
1065
+ env: tarSpawnEnv(),
1066
+ });
1067
+ const ssh = spawn("ssh", sshArgs, {
1068
+ stdio: ["pipe", "ignore", "pipe"],
1069
+ });
1070
+ let tarStderr = "";
1071
+ let sshStderr = "";
1072
+ let settled = false;
1073
+ let tarExited = false;
1074
+ let sshExited = false;
1075
+ let tarExitCode = null;
1076
+ let sshExitCode = null;
1077
+ const maybeFinish = () => {
1078
+ if (settled || !tarExited || !sshExited) {
1079
+ return;
1080
+ }
1081
+ settled = true;
1082
+ if ((tarExitCode ?? 0) !== 0) {
1083
+ reject(new Error(tarStderr.trim() || `tar exited with code ${tarExitCode ?? -1}`));
1084
+ return;
1085
+ }
1086
+ if ((sshExitCode ?? 0) !== 0) {
1087
+ reject(new Error(sshStderr.trim() || `ssh exited with code ${sshExitCode ?? -1}`));
1088
+ return;
1089
+ }
1090
+ resolve();
1091
+ };
1092
+ const fail = (error) => {
1093
+ if (settled) {
1094
+ return;
1095
+ }
1096
+ settled = true;
1097
+ tar.kill("SIGTERM");
1098
+ ssh.kill("SIGTERM");
1099
+ reject(error);
1100
+ };
1101
+ if (progress) {
1102
+ progress.counter.on("error", fail);
1103
+ tar.stdout?.pipe(progress.counter).pipe(ssh.stdin ?? null);
1104
+ }
1105
+ else {
1106
+ tar.stdout?.pipe(ssh.stdin ?? null);
1107
+ }
1108
+ tar.stderr?.on("data", (chunk) => {
1109
+ tarStderr += String(chunk);
1110
+ });
1111
+ ssh.stderr?.on("data", (chunk) => {
1112
+ sshStderr += String(chunk);
1113
+ });
1114
+ tar.on("error", fail);
1115
+ ssh.on("error", fail);
1116
+ tar.on("close", (code) => {
1117
+ tarExited = true;
1118
+ tarExitCode = code;
1119
+ maybeFinish();
1120
+ });
1121
+ ssh.on("close", (code) => {
1122
+ sshExited = true;
1123
+ sshExitCode = code;
1124
+ maybeFinish();
1125
+ });
1126
+ }).finally(auth.cleanup);
1127
+ await progress?.finish();
1128
+ }
1129
+ catch (error) {
1130
+ await progress?.fail();
1131
+ throw error;
1132
+ }
1133
+ }
1134
+ export async function syncDirectoryFromSsh(input) {
1135
+ const auth = await createSshAuthArgs(input.spec);
1136
+ const stagingDir = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-ssh-sync-back-"));
1137
+ const remoteTarScript = [
1138
+ `cd ${shellQuote(input.remoteDir)}`,
1139
+ `tar ${[...tarExcludeArgs(input.exclude).map(shellQuote), "-cf", "-", "."].join(" ")}`,
1140
+ ].join(" && ");
1141
+ const sshArgs = [
1142
+ ...auth.args,
1143
+ "-p",
1144
+ String(input.spec.port),
1145
+ `${input.spec.username}@${input.spec.host}`,
1146
+ `sh -c ${shellQuote(remoteTarScript)}`,
1147
+ ];
1148
+ // The remote tar size isn't known locally, so probe the remote directory for
1149
+ // an estimate (clamped to 99%). The probe runs concurrently with the transfer
1150
+ // so its round-trip never delays the restore; when it is unavailable we report
1151
+ // bytes received in MB mode with a terminal completion line.
1152
+ const progress = input.onProgress
1153
+ ? createTransferProgress({
1154
+ onProgress: input.onProgress,
1155
+ phase: "Restoring",
1156
+ direction: "from",
1157
+ label: input.progressLabel,
1158
+ totalBytes: probeRemoteDirSize({ spec: input.spec, remoteDir: input.remoteDir }),
1159
+ estimated: true,
1160
+ })
1161
+ : null;
1162
+ try {
1163
+ await new Promise((resolve, reject) => {
1164
+ const ssh = spawn("ssh", sshArgs, {
1165
+ stdio: ["ignore", "pipe", "pipe"],
1166
+ });
1167
+ const tar = spawn("tar", ["-xf", "-", "-C", stagingDir], {
1168
+ stdio: ["pipe", "ignore", "pipe"],
1169
+ env: tarSpawnEnv(),
1170
+ });
1171
+ let sshStderr = "";
1172
+ let tarStderr = "";
1173
+ let settled = false;
1174
+ let sshExited = false;
1175
+ let tarExited = false;
1176
+ let sshExitCode = null;
1177
+ let tarExitCode = null;
1178
+ const maybeFinish = () => {
1179
+ if (settled || !sshExited || !tarExited)
1180
+ return;
1181
+ settled = true;
1182
+ if ((sshExitCode ?? 0) !== 0) {
1183
+ reject(new Error(sshStderr.trim() || `ssh exited with code ${sshExitCode ?? -1}`));
1184
+ return;
1185
+ }
1186
+ if ((tarExitCode ?? 0) !== 0) {
1187
+ reject(new Error(tarStderr.trim() || `tar exited with code ${tarExitCode ?? -1}`));
1188
+ return;
1189
+ }
1190
+ resolve();
1191
+ };
1192
+ const fail = (error) => {
1193
+ if (settled)
1194
+ return;
1195
+ settled = true;
1196
+ ssh.kill("SIGTERM");
1197
+ tar.kill("SIGTERM");
1198
+ reject(error);
1199
+ };
1200
+ if (progress) {
1201
+ progress.counter.on("error", fail);
1202
+ ssh.stdout?.pipe(progress.counter).pipe(tar.stdin ?? null);
1203
+ }
1204
+ else {
1205
+ ssh.stdout?.pipe(tar.stdin ?? null);
1206
+ }
1207
+ ssh.stderr?.on("data", (chunk) => {
1208
+ sshStderr += String(chunk);
1209
+ });
1210
+ tar.stderr?.on("data", (chunk) => {
1211
+ tarStderr += String(chunk);
1212
+ });
1213
+ ssh.on("error", fail);
1214
+ tar.on("error", fail);
1215
+ ssh.on("close", (code) => {
1216
+ sshExited = true;
1217
+ sshExitCode = code;
1218
+ maybeFinish();
1219
+ });
1220
+ tar.on("close", (code) => {
1221
+ tarExited = true;
1222
+ tarExitCode = code;
1223
+ maybeFinish();
1224
+ });
1225
+ });
1226
+ await progress?.finish();
1227
+ await clearLocalDirectory(input.localDir, input.preserveLocalEntries);
1228
+ await copyDirectoryContents(stagingDir, input.localDir);
1229
+ }
1230
+ catch (error) {
1231
+ await progress?.fail();
1232
+ throw error;
1233
+ }
1234
+ finally {
1235
+ await fs.rm(stagingDir, { recursive: true, force: true }).catch(() => undefined);
1236
+ await auth.cleanup();
1237
+ }
1238
+ }
1239
+ export async function prepareWorkspaceForSshExecution(input) {
1240
+ const remoteDir = input.remoteDir ?? input.spec.remoteCwd;
1241
+ const gitSnapshot = await readLocalGitWorkspaceSnapshot(input.localDir);
1242
+ if (gitSnapshot) {
1243
+ await importGitWorkspaceToSsh({
1244
+ spec: input.spec,
1245
+ localDir: input.localDir,
1246
+ remoteDir,
1247
+ snapshot: gitSnapshot,
1248
+ onProgress: input.onProgress,
1249
+ });
1250
+ await syncDirectoryToSsh({
1251
+ spec: input.spec,
1252
+ localDir: input.localDir,
1253
+ remoteDir,
1254
+ exclude: [".git", ".paperclip-runtime"],
1255
+ onProgress: input.onProgress,
1256
+ progressLabel: "workspace",
1257
+ });
1258
+ await removeDeletedPathsOnSsh({
1259
+ spec: input.spec,
1260
+ remoteDir,
1261
+ deletedPaths: gitSnapshot.deletedPaths,
1262
+ });
1263
+ return { gitBacked: true };
1264
+ }
1265
+ await clearRemoteDirectory({
1266
+ spec: input.spec,
1267
+ remoteDir,
1268
+ preserveEntries: [".paperclip-runtime"],
1269
+ });
1270
+ await syncDirectoryToSsh({
1271
+ spec: input.spec,
1272
+ localDir: input.localDir,
1273
+ remoteDir,
1274
+ exclude: [".paperclip-runtime"],
1275
+ onProgress: input.onProgress,
1276
+ progressLabel: "workspace",
1277
+ });
1278
+ return { gitBacked: false };
1279
+ }
1280
+ export async function restoreWorkspaceFromSshExecution(input) {
1281
+ const remoteDir = input.remoteDir ?? input.spec.remoteCwd;
1282
+ if (input.baselineSnapshot) {
1283
+ const stagingDir = await fs.mkdtemp(path.join(os.tmpdir(), "paperclip-ssh-sync-back-"));
1284
+ const importedRef = input.restoreGitHistory
1285
+ ? `refs/paperclip/ssh-sync/imported/${randomUUID()}`
1286
+ : null;
1287
+ try {
1288
+ const importedHead = input.restoreGitHistory
1289
+ ? await exportGitWorkspaceFromSsh({
1290
+ spec: input.spec,
1291
+ remoteDir,
1292
+ localDir: input.localDir,
1293
+ importedRef: importedRef ?? undefined,
1294
+ resetLocalWorkspace: false,
1295
+ onProgress: input.onProgress,
1296
+ })
1297
+ : null;
1298
+ await syncDirectoryFromSsh({
1299
+ spec: input.spec,
1300
+ remoteDir,
1301
+ localDir: stagingDir,
1302
+ exclude: input.baselineSnapshot.exclude,
1303
+ onProgress: input.onProgress,
1304
+ progressLabel: "workspace",
1305
+ });
1306
+ await mergeDirectoryWithBaseline({
1307
+ baseline: input.baselineSnapshot,
1308
+ sourceDir: stagingDir,
1309
+ targetDir: input.localDir,
1310
+ // Git history advances via integrateImportedGitHead; the working tree
1311
+ // still comes from the remote file snapshot so dirty remote edits win.
1312
+ beforeApply: importedHead
1313
+ ? async () => {
1314
+ await integrateImportedGitHead({
1315
+ localDir: input.localDir,
1316
+ importedHead,
1317
+ });
1318
+ }
1319
+ : undefined,
1320
+ });
1321
+ }
1322
+ finally {
1323
+ if (importedRef) {
1324
+ await runLocalGit(input.localDir, ["update-ref", "-d", importedRef], {
1325
+ timeout: 10_000,
1326
+ maxBuffer: 16 * 1024,
1327
+ }).catch(() => undefined);
1328
+ }
1329
+ await fs.rm(stagingDir, { recursive: true, force: true }).catch(() => undefined);
1330
+ }
1331
+ return;
1332
+ }
1333
+ const gitSnapshot = await readLocalGitWorkspaceSnapshot(input.localDir);
1334
+ if (gitSnapshot) {
1335
+ await exportGitWorkspaceFromSsh({
1336
+ spec: input.spec,
1337
+ remoteDir,
1338
+ localDir: input.localDir,
1339
+ onProgress: input.onProgress,
1340
+ });
1341
+ await syncDirectoryFromSsh({
1342
+ spec: input.spec,
1343
+ remoteDir,
1344
+ localDir: input.localDir,
1345
+ exclude: [".git", ".paperclip-runtime"],
1346
+ preserveLocalEntries: [".git"],
1347
+ onProgress: input.onProgress,
1348
+ progressLabel: "workspace",
1349
+ });
1350
+ return;
1351
+ }
1352
+ await syncDirectoryFromSsh({
1353
+ spec: input.spec,
1354
+ remoteDir,
1355
+ localDir: input.localDir,
1356
+ exclude: [".paperclip-runtime"],
1357
+ onProgress: input.onProgress,
1358
+ progressLabel: "workspace",
1359
+ });
1360
+ }
1361
+ export async function ensureSshWorkspaceReady(config) {
1362
+ const result = await runSshCommand(config, `mkdir -p ${shellQuote(config.remoteWorkspacePath)} && cd ${shellQuote(config.remoteWorkspacePath)} && pwd`);
1363
+ return {
1364
+ remoteCwd: result.stdout.trim(),
1365
+ };
1366
+ }
1367
+ const SSH_ENV_LAB_FIXTURE_PATH_FIELDS = [
1368
+ "rootDir",
1369
+ "workspaceDir",
1370
+ "statePath",
1371
+ "clientPrivateKeyPath",
1372
+ "clientPublicKeyPath",
1373
+ "hostPrivateKeyPath",
1374
+ "hostPublicKeyPath",
1375
+ "authorizedKeysPath",
1376
+ "knownHostsPath",
1377
+ "sshdConfigPath",
1378
+ "sshdLogPath",
1379
+ ];
1380
+ // True when candidate is an absolute path equal to rootDir or nested under
1381
+ // it. Used to reject a state file whose paths point outside the fixture
1382
+ // root it was read from.
1383
+ function isPathRootedAt(candidate, rootDir) {
1384
+ if (!path.isAbsolute(candidate))
1385
+ return false;
1386
+ if (candidate === rootDir)
1387
+ return true;
1388
+ const relative = path.relative(rootDir, candidate);
1389
+ return (relative.length > 0 &&
1390
+ relative !== ".." &&
1391
+ !relative.startsWith(`..${path.sep}`) &&
1392
+ !path.isAbsolute(relative));
1393
+ }
1394
+ // The state file is untrusted input: any local process running as the same
1395
+ // user can write one. A forged pid or an empty sshdConfigPath would weaken
1396
+ // isSshEnvLabFixtureProcess's identity check — an empty string is a
1397
+ // substring of every command line, so it would match any running process.
1398
+ // Reject a state file that fails this check before any identity check or
1399
+ // signal runs against it.
1400
+ function isValidSshEnvLabFixtureState(raw, expectedRootDir) {
1401
+ if (!Number.isSafeInteger(raw.pid) || raw.pid <= 0)
1402
+ return false;
1403
+ if (raw.rootDir !== expectedRootDir)
1404
+ return false;
1405
+ for (const field of SSH_ENV_LAB_FIXTURE_PATH_FIELDS) {
1406
+ const value = raw[field];
1407
+ if (typeof value !== "string" || !isPathRootedAt(value, expectedRootDir)) {
1408
+ return false;
1409
+ }
1410
+ }
1411
+ const expectedSshdConfigPath = path.join(expectedRootDir, "sshd_config");
1412
+ if (raw.sshdConfigPath.length === 0 || raw.sshdConfigPath !== expectedSshdConfigPath) {
1413
+ return false;
1414
+ }
1415
+ return true;
1416
+ }
1417
+ export async function readSshEnvLabFixtureState(statePath) {
1418
+ try {
1419
+ // Resolve a relative statePath against the current working directory
1420
+ // before use. The state validator below only accepts absolute paths, and
1421
+ // a relative statePath must resolve to the same absolute directory every
1422
+ // time a caller reads it, no matter the process working directory.
1423
+ const resolvedStatePath = path.resolve(statePath);
1424
+ const raw = JSON.parse(await fs.readFile(resolvedStatePath, "utf8"));
1425
+ if (!raw || raw.kind !== "ssh_openbsd")
1426
+ return null;
1427
+ if (!isValidSshEnvLabFixtureState(raw, path.dirname(resolvedStatePath)))
1428
+ return null;
1429
+ return raw;
1430
+ }
1431
+ catch {
1432
+ return null;
1433
+ }
1434
+ }
1435
+ async function waitUntilFixtureProcessExits(state, timeoutMs, intervalMs = 100) {
1436
+ const timeoutAt = Date.now() + timeoutMs;
1437
+ while (true) {
1438
+ if (!(await isSshEnvLabFixtureProcess(state)))
1439
+ return true;
1440
+ if (Date.now() >= timeoutAt)
1441
+ return false;
1442
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
1443
+ }
1444
+ }
1445
+ // Sends a signal to a pid and treats an already-dead process as success.
1446
+ // The identity check that runs before this call is not free: it spawns
1447
+ // `ps`, which opens a real gap between the check and the signal. If the
1448
+ // process exits inside that gap, `process.kill` throws ESRCH even though
1449
+ // the outcome the caller wants (the process is gone) already holds. Any
1450
+ // other error, such as EPERM for a pid that belongs to another user, must
1451
+ // still propagate.
1452
+ function signalFixtureProcess(pid, signal) {
1453
+ try {
1454
+ process.kill(pid, signal);
1455
+ return true;
1456
+ }
1457
+ catch (error) {
1458
+ if (error instanceof Error && "code" in error && error.code === "ESRCH") {
1459
+ return false;
1460
+ }
1461
+ throw error;
1462
+ }
1463
+ }
1464
+ // Bounded shutdown escalation shared by every caller that must stop a
1465
+ // fixture process: send SIGTERM, wait, re-check process identity (the pid
1466
+ // can be reused in the gap between two signals), then SIGKILL, then wait
1467
+ // again. Returns true only when the listener is confirmed gone.
1468
+ async function escalateSshEnvLabFixtureShutdown(state) {
1469
+ if (!(await isSshEnvLabFixtureProcess(state)))
1470
+ return true;
1471
+ if (!signalFixtureProcess(state.pid, "SIGTERM"))
1472
+ return true;
1473
+ if (await waitUntilFixtureProcessExits(state, 5_000))
1474
+ return true;
1475
+ if (!(await isSshEnvLabFixtureProcess(state)))
1476
+ return true;
1477
+ if (!signalFixtureProcess(state.pid, "SIGKILL"))
1478
+ return true;
1479
+ if (await waitUntilFixtureProcessExits(state, 2_000))
1480
+ return true;
1481
+ return !(await isSshEnvLabFixtureProcess(state));
1482
+ }
1483
+ // Accepts a state path or an already-read state so a caller that already
1484
+ // holds the fixture state in memory does not have to depend on the state
1485
+ // file, which a teardown step may have already removed.
1486
+ export async function stopSshEnvLabFixture(stateOrPath) {
1487
+ const state = typeof stateOrPath === "string"
1488
+ ? await readSshEnvLabFixtureState(stateOrPath)
1489
+ : stateOrPath;
1490
+ if (!state)
1491
+ return false;
1492
+ if (!(await escalateSshEnvLabFixtureShutdown(state))) {
1493
+ throw new Error(`SSH env-lab fixture did not stop: pid ${state.pid} on port ${state.port} is still running after SIGKILL.`);
1494
+ }
1495
+ // Remove the root directory only after the listener process is confirmed
1496
+ // gone. Removing it earlier would delete the state file the process needs
1497
+ // for a later stop attempt to find and signal it.
1498
+ await fs.rm(state.rootDir, { recursive: true, force: true }).catch(() => undefined);
1499
+ return true;
1500
+ }
1501
+ export async function startSshEnvLabFixture(input) {
1502
+ // Resolve a relative statePath against the current working directory once,
1503
+ // up front. Every derived path (rootDir and the persisted statePath field)
1504
+ // must be absolute, so the state validator in readSshEnvLabFixtureState
1505
+ // accepts the file that this function writes.
1506
+ const statePath = path.resolve(input.statePath);
1507
+ const existing = await readSshEnvLabFixtureState(statePath);
1508
+ if (existing && await isSshEnvLabFixtureProcess(existing)) {
1509
+ return existing;
1510
+ }
1511
+ if (existing) {
1512
+ await fs.rm(existing.rootDir, { recursive: true, force: true }).catch(() => undefined);
1513
+ }
1514
+ const support = await getSshEnvLabSupport();
1515
+ if (!support.supported) {
1516
+ throw new Error(`SSH env-lab fixture is unavailable: ${support.reason}`);
1517
+ }
1518
+ const sshdPath = await resolveCommandPath("sshd");
1519
+ if (!sshdPath) {
1520
+ throw new Error("SSH env-lab fixture is unavailable: missing required command: sshd");
1521
+ }
1522
+ const bindHost = input.bindHost ?? "127.0.0.1";
1523
+ const host = input.host ?? bindHost;
1524
+ const rootDir = path.dirname(statePath);
1525
+ await fs.mkdir(rootDir, { recursive: true });
1526
+ const username = os.userInfo().username;
1527
+ const port = await allocateLoopbackPort(bindHost);
1528
+ const workspaceDir = path.join(rootDir, "workspace");
1529
+ const clientPrivateKeyPath = path.join(rootDir, "client_key");
1530
+ const clientPublicKeyPath = `${clientPrivateKeyPath}.pub`;
1531
+ const hostPrivateKeyPath = path.join(rootDir, "host_key");
1532
+ const hostPublicKeyPath = `${hostPrivateKeyPath}.pub`;
1533
+ const authorizedKeysPath = path.join(rootDir, "authorized_keys");
1534
+ const knownHostsPath = path.join(rootDir, "known_hosts");
1535
+ const sshdConfigPath = path.join(rootDir, "sshd_config");
1536
+ const sshdLogPath = path.join(rootDir, "sshd.log");
1537
+ const sshdPidPath = path.join(rootDir, "sshd.pid");
1538
+ await fs.mkdir(workspaceDir, { recursive: true });
1539
+ await execFileText("ssh-keygen", ["-q", "-t", "ed25519", "-N", "", "-f", clientPrivateKeyPath], {
1540
+ timeout: 15_000,
1541
+ });
1542
+ await execFileText("ssh-keygen", ["-q", "-t", "ed25519", "-N", "", "-f", hostPrivateKeyPath], {
1543
+ timeout: 15_000,
1544
+ });
1545
+ await fs.copyFile(clientPublicKeyPath, authorizedKeysPath);
1546
+ const hostPublicKey = (await execFileText("ssh-keygen", ["-y", "-f", hostPrivateKeyPath], {
1547
+ timeout: 15_000,
1548
+ })).stdout.trim();
1549
+ await fs.writeFile(knownHostsPath, `${buildKnownHostsEntry({ host, port, publicKey: hostPublicKey })}\n`, { mode: 0o600 });
1550
+ await fs.writeFile(sshdConfigPath, [
1551
+ `Port ${port}`,
1552
+ `ListenAddress ${bindHost}`,
1553
+ `HostKey ${hostPrivateKeyPath}`,
1554
+ `PidFile ${sshdPidPath}`,
1555
+ `AuthorizedKeysFile ${authorizedKeysPath}`,
1556
+ "PasswordAuthentication no",
1557
+ "ChallengeResponseAuthentication no",
1558
+ "KbdInteractiveAuthentication no",
1559
+ "PubkeyAuthentication yes",
1560
+ "PermitRootLogin no",
1561
+ "UsePAM no",
1562
+ "StrictModes no",
1563
+ `AllowUsers ${username}`,
1564
+ "LogLevel VERBOSE",
1565
+ "PrintMotd no",
1566
+ "UseDNS no",
1567
+ "Subsystem sftp internal-sftp",
1568
+ "",
1569
+ ].join("\n"), { mode: 0o600 });
1570
+ const child = spawn(sshdPath, ["-D", "-f", sshdConfigPath, "-E", sshdLogPath], {
1571
+ detached: true,
1572
+ stdio: "ignore",
1573
+ });
1574
+ child.unref();
1575
+ const state = {
1576
+ kind: "ssh_openbsd",
1577
+ bindHost,
1578
+ host,
1579
+ port,
1580
+ username,
1581
+ rootDir,
1582
+ workspaceDir,
1583
+ statePath,
1584
+ pid: child.pid ?? 0,
1585
+ createdAt: new Date().toISOString(),
1586
+ clientPrivateKeyPath,
1587
+ clientPublicKeyPath,
1588
+ hostPrivateKeyPath,
1589
+ hostPublicKeyPath,
1590
+ authorizedKeysPath,
1591
+ knownHostsPath,
1592
+ sshdConfigPath,
1593
+ sshdLogPath,
1594
+ };
1595
+ if (!state.pid) {
1596
+ throw new Error("Failed to start SSH env-lab fixture.");
1597
+ }
1598
+ try {
1599
+ await waitForCondition(async () => {
1600
+ if (!(await isPidRunning(state.pid))) {
1601
+ const logOutput = await fs.readFile(sshdLogPath, "utf8").catch(() => "");
1602
+ throw new Error(logOutput || "SSH env-lab fixture exited before becoming ready.");
1603
+ }
1604
+ const config = await buildSshEnvLabFixtureConfig(state);
1605
+ await ensureSshWorkspaceReady(config);
1606
+ }, { timeoutMs: input.readinessTimeoutMs ?? 10_000, intervalMs: 250 });
1607
+ await fs.writeFile(statePath, JSON.stringify(state, null, 2), { mode: 0o600 });
1608
+ return state;
1609
+ }
1610
+ catch (error) {
1611
+ // No state file exists on this path yet, so a later stopSshEnvLabFixture
1612
+ // call can never find this pid. Escalate and wait for exit here, the
1613
+ // same way stopSshEnvLabFixture does, before the root directory goes
1614
+ // away — otherwise a slow-to-exit sshd survives as an orphan with its
1615
+ // root directory already gone.
1616
+ const stopped = await escalateSshEnvLabFixtureShutdown(state);
1617
+ if (stopped) {
1618
+ await fs.rm(rootDir, { recursive: true, force: true }).catch(() => undefined);
1619
+ }
1620
+ else {
1621
+ const survivalNote = `SSH env-lab fixture pid ${state.pid} on port ${state.port} is still running after SIGKILL. ` +
1622
+ `Kept ${rootDir} for inspection; no state file exists to target it with a later stop call.`;
1623
+ if (error instanceof Error) {
1624
+ error.message = `${error.message}\n${survivalNote}`;
1625
+ }
1626
+ else {
1627
+ console.error(survivalNote);
1628
+ }
1629
+ }
1630
+ throw error;
1631
+ }
1632
+ }
1633
+ export async function buildSshEnvLabFixtureConfig(state) {
1634
+ const [privateKey, knownHosts] = await Promise.all([
1635
+ fs.readFile(state.clientPrivateKeyPath, "utf8"),
1636
+ fs.readFile(state.knownHostsPath, "utf8"),
1637
+ ]);
1638
+ return {
1639
+ host: state.host,
1640
+ port: state.port,
1641
+ username: state.username,
1642
+ remoteWorkspacePath: state.workspaceDir,
1643
+ privateKey,
1644
+ knownHosts,
1645
+ strictHostKeyChecking: true,
1646
+ };
1647
+ }
1648
+ export async function readSshEnvLabFixtureStatus(statePath) {
1649
+ const state = await readSshEnvLabFixtureState(statePath);
1650
+ if (!state) {
1651
+ return { running: false, state: null };
1652
+ }
1653
+ return {
1654
+ running: await isSshEnvLabFixtureProcess(state),
1655
+ state,
1656
+ };
1657
+ }
1658
+ export async function fileExists(filePath) {
1659
+ try {
1660
+ await fs.access(filePath, fsConstants.F_OK);
1661
+ return true;
1662
+ }
1663
+ catch {
1664
+ return false;
1665
+ }
1666
+ }
1667
+ //# sourceMappingURL=ssh.js.map