@microvac/adapter-utils 0.0.0-stage → 0.1.0-rc.14

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 (3029) hide show
  1. package/README.md +69 -2
  2. package/dist/acpx-engine/accounting-model.d.ts +7 -0
  3. package/dist/acpx-engine/accounting-model.d.ts.map +1 -0
  4. package/dist/acpx-engine/accounting-model.js +12 -0
  5. package/dist/acpx-engine/accounting-model.js.map +1 -0
  6. package/dist/acpx-engine/accounting-model.test.d.ts +2 -0
  7. package/dist/acpx-engine/accounting-model.test.d.ts.map +1 -0
  8. package/dist/acpx-engine/accounting-model.test.js +28 -0
  9. package/dist/acpx-engine/accounting-model.test.js.map +1 -0
  10. package/dist/acpx-engine/cli.d.ts +2 -0
  11. package/dist/acpx-engine/cli.d.ts.map +1 -0
  12. package/dist/acpx-engine/cli.js +128 -0
  13. package/dist/acpx-engine/cli.js.map +1 -0
  14. package/dist/acpx-engine/constants.d.ts +28 -0
  15. package/dist/acpx-engine/constants.d.ts.map +1 -0
  16. package/dist/acpx-engine/constants.js +74 -0
  17. package/dist/acpx-engine/constants.js.map +1 -0
  18. package/dist/acpx-engine/ephemeral-session-environment.d.ts +4 -0
  19. package/dist/acpx-engine/ephemeral-session-environment.d.ts.map +1 -0
  20. package/dist/acpx-engine/ephemeral-session-environment.js +45 -0
  21. package/dist/acpx-engine/ephemeral-session-environment.js.map +1 -0
  22. package/dist/acpx-engine/ephemeral-session-environment.test.d.ts +2 -0
  23. package/dist/acpx-engine/ephemeral-session-environment.test.d.ts.map +1 -0
  24. package/dist/acpx-engine/ephemeral-session-environment.test.js +219 -0
  25. package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -0
  26. package/dist/acpx-engine/execute-identity.test.d.ts +2 -0
  27. package/dist/acpx-engine/execute-identity.test.d.ts.map +1 -0
  28. package/dist/acpx-engine/execute-identity.test.js +218 -0
  29. package/dist/acpx-engine/execute-identity.test.js.map +1 -0
  30. package/dist/acpx-engine/execute.d.ts +366 -0
  31. package/dist/acpx-engine/execute.d.ts.map +1 -0
  32. package/dist/acpx-engine/execute.js +5021 -0
  33. package/dist/acpx-engine/execute.js.map +1 -0
  34. package/dist/acpx-engine/execute.test.d.ts +2 -0
  35. package/dist/acpx-engine/execute.test.d.ts.map +1 -0
  36. package/dist/acpx-engine/execute.test.js +8269 -0
  37. package/dist/acpx-engine/execute.test.js.map +1 -0
  38. package/dist/acpx-engine/filesystem-protocol.test.d.ts +2 -0
  39. package/dist/acpx-engine/filesystem-protocol.test.d.ts.map +1 -0
  40. package/dist/acpx-engine/filesystem-protocol.test.js +96 -0
  41. package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -0
  42. package/dist/acpx-engine/index.d.ts +6 -0
  43. package/dist/acpx-engine/index.d.ts.map +1 -0
  44. package/dist/acpx-engine/index.js +6 -0
  45. package/dist/acpx-engine/index.js.map +1 -0
  46. package/dist/acpx-engine/local-process-control.d.ts +5 -0
  47. package/dist/acpx-engine/local-process-control.d.ts.map +1 -0
  48. package/dist/acpx-engine/local-process-control.js +39 -0
  49. package/dist/acpx-engine/local-process-control.js.map +1 -0
  50. package/dist/acpx-engine/local-process-control.test.d.ts +2 -0
  51. package/dist/acpx-engine/local-process-control.test.d.ts.map +1 -0
  52. package/dist/acpx-engine/local-process-control.test.js +38 -0
  53. package/dist/acpx-engine/local-process-control.test.js.map +1 -0
  54. package/dist/acpx-engine/operator-stop.test.d.ts +2 -0
  55. package/dist/acpx-engine/operator-stop.test.d.ts.map +1 -0
  56. package/dist/acpx-engine/operator-stop.test.js +107 -0
  57. package/dist/acpx-engine/operator-stop.test.js.map +1 -0
  58. package/dist/acpx-engine/remote-spawn-smoke.test.d.ts +2 -0
  59. package/dist/acpx-engine/remote-spawn-smoke.test.d.ts.map +1 -0
  60. package/dist/acpx-engine/remote-spawn-smoke.test.js +152 -0
  61. package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -0
  62. package/dist/acpx-engine/run-contracts.d.ts +414 -0
  63. package/dist/acpx-engine/run-contracts.d.ts.map +1 -0
  64. package/dist/acpx-engine/run-contracts.js +20 -0
  65. package/dist/acpx-engine/run-contracts.js.map +1 -0
  66. package/dist/acpx-engine/run-contracts.test.d.ts +2 -0
  67. package/dist/acpx-engine/run-contracts.test.d.ts.map +1 -0
  68. package/dist/acpx-engine/run-contracts.test.js +57 -0
  69. package/dist/acpx-engine/run-contracts.test.js.map +1 -0
  70. package/dist/acpx-engine/run-coordinator.d.ts +57 -0
  71. package/dist/acpx-engine/run-coordinator.d.ts.map +1 -0
  72. package/dist/acpx-engine/run-coordinator.js +63 -0
  73. package/dist/acpx-engine/run-coordinator.js.map +1 -0
  74. package/dist/acpx-engine/run-coordinator.test.d.ts +2 -0
  75. package/dist/acpx-engine/run-coordinator.test.d.ts.map +1 -0
  76. package/dist/acpx-engine/run-coordinator.test.js +160 -0
  77. package/dist/acpx-engine/run-coordinator.test.js.map +1 -0
  78. package/dist/acpx-engine/run-fault-matrix.test.d.ts +2 -0
  79. package/dist/acpx-engine/run-fault-matrix.test.d.ts.map +1 -0
  80. package/dist/acpx-engine/run-fault-matrix.test.js +877 -0
  81. package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -0
  82. package/dist/acpx-engine/run-resource-ledger.d.ts +30 -0
  83. package/dist/acpx-engine/run-resource-ledger.d.ts.map +1 -0
  84. package/dist/acpx-engine/run-resource-ledger.js +148 -0
  85. package/dist/acpx-engine/run-resource-ledger.js.map +1 -0
  86. package/dist/acpx-engine/run-resource-ledger.test.d.ts +2 -0
  87. package/dist/acpx-engine/run-resource-ledger.test.d.ts.map +1 -0
  88. package/dist/acpx-engine/run-resource-ledger.test.js +154 -0
  89. package/dist/acpx-engine/run-resource-ledger.test.js.map +1 -0
  90. package/dist/acpx-engine/run-site-host.d.ts +78 -0
  91. package/dist/acpx-engine/run-site-host.d.ts.map +1 -0
  92. package/dist/acpx-engine/run-site-host.js +65 -0
  93. package/dist/acpx-engine/run-site-host.js.map +1 -0
  94. package/dist/acpx-engine/run-site-host.test.d.ts +2 -0
  95. package/dist/acpx-engine/run-site-host.test.d.ts.map +1 -0
  96. package/dist/acpx-engine/run-site-host.test.js +98 -0
  97. package/dist/acpx-engine/run-site-host.test.js.map +1 -0
  98. package/dist/acpx-engine/run-site-sandbox.d.ts +155 -0
  99. package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -0
  100. package/dist/acpx-engine/run-site-sandbox.js +285 -0
  101. package/dist/acpx-engine/run-site-sandbox.js.map +1 -0
  102. package/dist/acpx-engine/run-site-sandbox.test.d.ts +2 -0
  103. package/dist/acpx-engine/run-site-sandbox.test.d.ts.map +1 -0
  104. package/dist/acpx-engine/run-site-sandbox.test.js +307 -0
  105. package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -0
  106. package/dist/acpx-engine/session-codec.d.ts +3 -0
  107. package/dist/acpx-engine/session-codec.d.ts.map +1 -0
  108. package/dist/acpx-engine/session-codec.js +50 -0
  109. package/dist/acpx-engine/session-codec.js.map +1 -0
  110. package/dist/acpx-engine/session-reuse-store.d.ts +62 -0
  111. package/dist/acpx-engine/session-reuse-store.d.ts.map +1 -0
  112. package/dist/acpx-engine/session-reuse-store.js +134 -0
  113. package/dist/acpx-engine/session-reuse-store.js.map +1 -0
  114. package/dist/acpx-engine/session-reuse-store.test.d.ts +2 -0
  115. package/dist/acpx-engine/session-reuse-store.test.d.ts.map +1 -0
  116. package/dist/acpx-engine/session-reuse-store.test.js +134 -0
  117. package/dist/acpx-engine/session-reuse-store.test.js.map +1 -0
  118. package/dist/acpx-engine/settlement-sequence.d.ts +77 -0
  119. package/dist/acpx-engine/settlement-sequence.d.ts.map +1 -0
  120. package/dist/acpx-engine/settlement-sequence.js +119 -0
  121. package/dist/acpx-engine/settlement-sequence.js.map +1 -0
  122. package/dist/acpx-engine/settlement-sequence.test.d.ts +2 -0
  123. package/dist/acpx-engine/settlement-sequence.test.d.ts.map +1 -0
  124. package/dist/acpx-engine/settlement-sequence.test.js +272 -0
  125. package/dist/acpx-engine/settlement-sequence.test.js.map +1 -0
  126. package/dist/acpx-engine/spawn-smoke.test.d.ts +2 -0
  127. package/dist/acpx-engine/spawn-smoke.test.d.ts.map +1 -0
  128. package/dist/acpx-engine/spawn-smoke.test.js +193 -0
  129. package/dist/acpx-engine/spawn-smoke.test.js.map +1 -0
  130. package/dist/acpx-engine/startup-cancellation.d.ts +9 -0
  131. package/dist/acpx-engine/startup-cancellation.d.ts.map +1 -0
  132. package/dist/acpx-engine/startup-cancellation.js +97 -0
  133. package/dist/acpx-engine/startup-cancellation.js.map +1 -0
  134. package/dist/acpx-engine/startup-cancellation.test.d.ts +2 -0
  135. package/dist/acpx-engine/startup-cancellation.test.d.ts.map +1 -0
  136. package/dist/acpx-engine/startup-cancellation.test.js +115 -0
  137. package/dist/acpx-engine/startup-cancellation.test.js.map +1 -0
  138. package/dist/acpx-engine/startup-timing.d.ts +433 -0
  139. package/dist/acpx-engine/startup-timing.d.ts.map +1 -0
  140. package/dist/acpx-engine/startup-timing.js +631 -0
  141. package/dist/acpx-engine/startup-timing.js.map +1 -0
  142. package/dist/acpx-engine/startup-timing.test.d.ts +2 -0
  143. package/dist/acpx-engine/startup-timing.test.d.ts.map +1 -0
  144. package/dist/acpx-engine/startup-timing.test.js +619 -0
  145. package/dist/acpx-engine/startup-timing.test.js.map +1 -0
  146. package/dist/acpx-engine/stock-runtime-options.d.ts +37 -0
  147. package/dist/acpx-engine/stock-runtime-options.d.ts.map +1 -0
  148. package/dist/acpx-engine/stock-runtime-options.js +101 -0
  149. package/dist/acpx-engine/stock-runtime-options.js.map +1 -0
  150. package/dist/acpx-engine/stock-runtime-options.test.d.ts +2 -0
  151. package/dist/acpx-engine/stock-runtime-options.test.d.ts.map +1 -0
  152. package/dist/acpx-engine/stock-runtime-options.test.js +91 -0
  153. package/dist/acpx-engine/stock-runtime-options.test.js.map +1 -0
  154. package/dist/acpx-engine/terminal-session-failure.d.ts +48 -0
  155. package/dist/acpx-engine/terminal-session-failure.d.ts.map +1 -0
  156. package/dist/acpx-engine/terminal-session-failure.js +123 -0
  157. package/dist/acpx-engine/terminal-session-failure.js.map +1 -0
  158. package/dist/acpx-engine/terminal-session-failure.test.d.ts +2 -0
  159. package/dist/acpx-engine/terminal-session-failure.test.d.ts.map +1 -0
  160. package/dist/acpx-engine/terminal-session-failure.test.js +150 -0
  161. package/dist/acpx-engine/terminal-session-failure.test.js.map +1 -0
  162. package/dist/acpx-engine/turn-sequence.d.ts +54 -0
  163. package/dist/acpx-engine/turn-sequence.d.ts.map +1 -0
  164. package/dist/acpx-engine/turn-sequence.js +75 -0
  165. package/dist/acpx-engine/turn-sequence.js.map +1 -0
  166. package/dist/acpx-engine/turn-sequence.test.d.ts +2 -0
  167. package/dist/acpx-engine/turn-sequence.test.d.ts.map +1 -0
  168. package/dist/acpx-engine/turn-sequence.test.js +177 -0
  169. package/dist/acpx-engine/turn-sequence.test.js.map +1 -0
  170. package/dist/acpx-engine/ui.d.ts +3 -0
  171. package/dist/acpx-engine/ui.d.ts.map +1 -0
  172. package/dist/acpx-engine/ui.js +162 -0
  173. package/dist/acpx-engine/ui.js.map +1 -0
  174. package/dist/agent-observability.d.ts +25 -0
  175. package/dist/agent-observability.d.ts.map +1 -0
  176. package/dist/agent-observability.js +92 -0
  177. package/dist/agent-observability.js.map +1 -0
  178. package/dist/agent-observability.test.d.ts +2 -0
  179. package/dist/agent-observability.test.d.ts.map +1 -0
  180. package/dist/agent-observability.test.js +127 -0
  181. package/dist/agent-observability.test.js.map +1 -0
  182. package/dist/api-billing-type.d.ts +5 -0
  183. package/dist/api-billing-type.d.ts.map +1 -0
  184. package/dist/api-billing-type.js +16 -0
  185. package/dist/api-billing-type.js.map +1 -0
  186. package/dist/api-billing-type.test.d.ts +2 -0
  187. package/dist/api-billing-type.test.d.ts.map +1 -0
  188. package/dist/api-billing-type.test.js +20 -0
  189. package/dist/api-billing-type.test.js.map +1 -0
  190. package/dist/billing.d.ts +9 -0
  191. package/dist/billing.d.ts.map +1 -0
  192. package/dist/billing.js +39 -0
  193. package/dist/billing.js.map +1 -0
  194. package/dist/billing.test.d.ts +2 -0
  195. package/dist/billing.test.d.ts.map +1 -0
  196. package/dist/billing.test.js +30 -0
  197. package/dist/billing.test.js.map +1 -0
  198. package/dist/bridge-transport-contract.d.ts +43 -0
  199. package/dist/bridge-transport-contract.d.ts.map +1 -0
  200. package/dist/bridge-transport-contract.js +33 -0
  201. package/dist/bridge-transport-contract.js.map +1 -0
  202. package/dist/chat-file-delivery.d.ts +10 -0
  203. package/dist/chat-file-delivery.d.ts.map +1 -0
  204. package/dist/chat-file-delivery.js +39 -0
  205. package/dist/chat-file-delivery.js.map +1 -0
  206. package/dist/chat-file-delivery.test.d.ts +2 -0
  207. package/dist/chat-file-delivery.test.d.ts.map +1 -0
  208. package/dist/chat-file-delivery.test.js +92 -0
  209. package/dist/chat-file-delivery.test.js.map +1 -0
  210. package/dist/codex-observability-home.d.ts +7 -0
  211. package/dist/codex-observability-home.d.ts.map +1 -0
  212. package/dist/codex-observability-home.js +75 -0
  213. package/dist/codex-observability-home.js.map +1 -0
  214. package/dist/codex-observability-profile.d.ts +16 -0
  215. package/dist/codex-observability-profile.d.ts.map +1 -0
  216. package/dist/codex-observability-profile.js +51 -0
  217. package/dist/codex-observability-profile.js.map +1 -0
  218. package/dist/codex-shell-environment.d.ts +6 -0
  219. package/dist/codex-shell-environment.d.ts.map +1 -0
  220. package/dist/codex-shell-environment.js +32 -0
  221. package/dist/codex-shell-environment.js.map +1 -0
  222. package/dist/codex-shell-environment.test.d.ts +2 -0
  223. package/dist/codex-shell-environment.test.d.ts.map +1 -0
  224. package/dist/codex-shell-environment.test.js +49 -0
  225. package/dist/codex-shell-environment.test.js.map +1 -0
  226. package/dist/command-managed-runtime.d.ts +178 -0
  227. package/dist/command-managed-runtime.d.ts.map +1 -0
  228. package/dist/command-managed-runtime.js +486 -0
  229. package/dist/command-managed-runtime.js.map +1 -0
  230. package/dist/command-managed-runtime.test.d.ts +2 -0
  231. package/dist/command-managed-runtime.test.d.ts.map +1 -0
  232. package/dist/command-managed-runtime.test.js +900 -0
  233. package/dist/command-managed-runtime.test.js.map +1 -0
  234. package/dist/command-redaction.d.ts +32 -0
  235. package/dist/command-redaction.d.ts.map +1 -0
  236. package/dist/command-redaction.js +280 -0
  237. package/dist/command-redaction.js.map +1 -0
  238. package/dist/command-redaction.test.d.ts +2 -0
  239. package/dist/command-redaction.test.d.ts.map +1 -0
  240. package/dist/command-redaction.test.js +297 -0
  241. package/dist/command-redaction.test.js.map +1 -0
  242. package/dist/connection-failure.d.ts +33 -0
  243. package/dist/connection-failure.d.ts.map +1 -0
  244. package/dist/connection-failure.js +43 -0
  245. package/dist/connection-failure.js.map +1 -0
  246. package/dist/connection-failure.test.d.ts +2 -0
  247. package/dist/connection-failure.test.d.ts.map +1 -0
  248. package/dist/connection-failure.test.js +94 -0
  249. package/dist/connection-failure.test.js.map +1 -0
  250. package/dist/directory-merge-lock-diagnostics.d.ts +24 -0
  251. package/dist/directory-merge-lock-diagnostics.d.ts.map +1 -0
  252. package/dist/directory-merge-lock-diagnostics.js +54 -0
  253. package/dist/directory-merge-lock-diagnostics.js.map +1 -0
  254. package/dist/directory-merge-lock-diagnostics.test.d.ts +2 -0
  255. package/dist/directory-merge-lock-diagnostics.test.d.ts.map +1 -0
  256. package/dist/directory-merge-lock-diagnostics.test.js +44 -0
  257. package/dist/directory-merge-lock-diagnostics.test.js.map +1 -0
  258. package/dist/directory-merge-lock.test.d.ts +2 -0
  259. package/dist/directory-merge-lock.test.d.ts.map +1 -0
  260. package/dist/directory-merge-lock.test.js +168 -0
  261. package/dist/directory-merge-lock.test.js.map +1 -0
  262. package/dist/duplex-frame-codec.d.ts +124 -0
  263. package/dist/duplex-frame-codec.d.ts.map +1 -0
  264. package/dist/duplex-frame-codec.js +134 -0
  265. package/dist/duplex-frame-codec.js.map +1 -0
  266. package/dist/duplex-frame-codec.test.d.ts +2 -0
  267. package/dist/duplex-frame-codec.test.d.ts.map +1 -0
  268. package/dist/duplex-frame-codec.test.js +172 -0
  269. package/dist/duplex-frame-codec.test.js.map +1 -0
  270. package/dist/duplex-observability.d.ts +220 -0
  271. package/dist/duplex-observability.d.ts.map +1 -0
  272. package/dist/duplex-observability.js +248 -0
  273. package/dist/duplex-observability.js.map +1 -0
  274. package/dist/duplex-observability.test.d.ts +2 -0
  275. package/dist/duplex-observability.test.d.ts.map +1 -0
  276. package/dist/duplex-observability.test.js +55 -0
  277. package/dist/duplex-observability.test.js.map +1 -0
  278. package/dist/env-bindings.d.ts +17 -0
  279. package/dist/env-bindings.d.ts.map +1 -0
  280. package/dist/env-bindings.js +98 -0
  281. package/dist/env-bindings.js.map +1 -0
  282. package/dist/env-bindings.test.d.ts +2 -0
  283. package/dist/env-bindings.test.d.ts.map +1 -0
  284. package/dist/env-bindings.test.js +66 -0
  285. package/dist/env-bindings.test.js.map +1 -0
  286. package/dist/exclude-patterns.d.ts +13 -0
  287. package/dist/exclude-patterns.d.ts.map +1 -0
  288. package/dist/exclude-patterns.js +37 -0
  289. package/dist/exclude-patterns.js.map +1 -0
  290. package/dist/execution-phase.d.ts +10 -0
  291. package/dist/execution-phase.d.ts.map +1 -0
  292. package/dist/execution-phase.js +27 -0
  293. package/dist/execution-phase.js.map +1 -0
  294. package/dist/execution-phase.test.d.ts +2 -0
  295. package/dist/execution-phase.test.d.ts.map +1 -0
  296. package/dist/execution-phase.test.js +26 -0
  297. package/dist/execution-phase.test.js.map +1 -0
  298. package/dist/execution-target-sandbox.test.d.ts +2 -0
  299. package/dist/execution-target-sandbox.test.d.ts.map +1 -0
  300. package/dist/execution-target-sandbox.test.js +5599 -0
  301. package/dist/execution-target-sandbox.test.js.map +1 -0
  302. package/dist/execution-target-stdin-race.test.d.ts +2 -0
  303. package/dist/execution-target-stdin-race.test.d.ts.map +1 -0
  304. package/dist/execution-target-stdin-race.test.js +2166 -0
  305. package/dist/execution-target-stdin-race.test.js.map +1 -0
  306. package/dist/execution-target.d.ts +604 -0
  307. package/dist/execution-target.d.ts.map +1 -0
  308. package/dist/execution-target.js +4018 -0
  309. package/dist/execution-target.js.map +1 -0
  310. package/dist/execution-target.test.d.ts +2 -0
  311. package/dist/execution-target.test.d.ts.map +1 -0
  312. package/dist/execution-target.test.js +404 -0
  313. package/dist/execution-target.test.js.map +1 -0
  314. package/dist/git-shallow-import-budget.test.d.ts +2 -0
  315. package/dist/git-shallow-import-budget.test.d.ts.map +1 -0
  316. package/dist/git-shallow-import-budget.test.js +72 -0
  317. package/dist/git-shallow-import-budget.test.js.map +1 -0
  318. package/dist/git-workspace-sync.d.ts +224 -0
  319. package/dist/git-workspace-sync.d.ts.map +1 -0
  320. package/dist/git-workspace-sync.js +1081 -0
  321. package/dist/git-workspace-sync.js.map +1 -0
  322. package/dist/git-workspace-sync.test.d.ts +2 -0
  323. package/dist/git-workspace-sync.test.d.ts.map +1 -0
  324. package/dist/git-workspace-sync.test.js +1262 -0
  325. package/dist/git-workspace-sync.test.js.map +1 -0
  326. package/dist/github-launcher-environment.test.d.ts +2 -0
  327. package/dist/github-launcher-environment.test.d.ts.map +1 -0
  328. package/dist/github-launcher-environment.test.js +557 -0
  329. package/dist/github-launcher-environment.test.js.map +1 -0
  330. package/dist/github-launcher.d.ts +12 -0
  331. package/dist/github-launcher.d.ts.map +1 -0
  332. package/dist/github-launcher.js +240 -0
  333. package/dist/github-launcher.js.map +1 -0
  334. package/dist/github-launcher.test.d.ts +2 -0
  335. package/dist/github-launcher.test.d.ts.map +1 -0
  336. package/dist/github-launcher.test.js +608 -0
  337. package/dist/github-launcher.test.js.map +1 -0
  338. package/dist/http2-bridge-server.d.ts +464 -0
  339. package/dist/http2-bridge-server.d.ts.map +1 -0
  340. package/dist/http2-bridge-server.js +1086 -0
  341. package/dist/http2-bridge-server.js.map +1 -0
  342. package/dist/http2-bridge-server.test.d.ts +2 -0
  343. package/dist/http2-bridge-server.test.d.ts.map +1 -0
  344. package/dist/http2-bridge-server.test.js +2183 -0
  345. package/dist/http2-bridge-server.test.js.map +1 -0
  346. package/dist/index.d.ts +20 -0
  347. package/dist/index.d.ts.map +1 -0
  348. package/dist/index.js +12 -0
  349. package/dist/index.js.map +1 -0
  350. package/dist/local-process-sandbox.d.ts +41 -0
  351. package/dist/local-process-sandbox.d.ts.map +1 -0
  352. package/dist/local-process-sandbox.js +432 -0
  353. package/dist/local-process-sandbox.js.map +1 -0
  354. package/dist/local-process-sandbox.test.d.ts +2 -0
  355. package/dist/local-process-sandbox.test.d.ts.map +1 -0
  356. package/dist/local-process-sandbox.test.js +399 -0
  357. package/dist/local-process-sandbox.test.js.map +1 -0
  358. package/dist/log-redaction.d.ts +9 -0
  359. package/dist/log-redaction.d.ts.map +1 -0
  360. package/dist/log-redaction.js +88 -0
  361. package/dist/log-redaction.js.map +1 -0
  362. package/dist/login-capability.d.ts +88 -0
  363. package/dist/login-capability.d.ts.map +1 -0
  364. package/dist/login-capability.js +78 -0
  365. package/dist/login-capability.js.map +1 -0
  366. package/dist/login-capability.test.d.ts +2 -0
  367. package/dist/login-capability.test.d.ts.map +1 -0
  368. package/dist/login-capability.test.js +78 -0
  369. package/dist/login-capability.test.js.map +1 -0
  370. package/dist/login-pty-transport.d.ts +80 -0
  371. package/dist/login-pty-transport.d.ts.map +1 -0
  372. package/dist/login-pty-transport.js +75 -0
  373. package/dist/login-pty-transport.js.map +1 -0
  374. package/dist/login-pty-transport.test.d.ts +2 -0
  375. package/dist/login-pty-transport.test.d.ts.map +1 -0
  376. package/dist/login-pty-transport.test.js +185 -0
  377. package/dist/login-pty-transport.test.js.map +1 -0
  378. package/dist/login-runner-lifecycle.d.ts +70 -0
  379. package/dist/login-runner-lifecycle.d.ts.map +1 -0
  380. package/dist/login-runner-lifecycle.js +52 -0
  381. package/dist/login-runner-lifecycle.js.map +1 -0
  382. package/dist/login-runner-lifecycle.test.d.ts +2 -0
  383. package/dist/login-runner-lifecycle.test.d.ts.map +1 -0
  384. package/dist/login-runner-lifecycle.test.js +122 -0
  385. package/dist/login-runner-lifecycle.test.js.map +1 -0
  386. package/dist/managed-ai-runtime-env.d.ts +4 -0
  387. package/dist/managed-ai-runtime-env.d.ts.map +1 -0
  388. package/dist/managed-ai-runtime-env.js +47 -0
  389. package/dist/managed-ai-runtime-env.js.map +1 -0
  390. package/dist/managed-clone-staging.test.d.ts +2 -0
  391. package/dist/managed-clone-staging.test.d.ts.map +1 -0
  392. package/dist/managed-clone-staging.test.js +167 -0
  393. package/dist/managed-clone-staging.test.js.map +1 -0
  394. package/dist/mcp-isolation.integration.test.d.ts +2 -0
  395. package/dist/mcp-isolation.integration.test.d.ts.map +1 -0
  396. package/dist/mcp-isolation.integration.test.js +202 -0
  397. package/dist/mcp-isolation.integration.test.js.map +1 -0
  398. package/dist/model-facing-history.d.ts +10 -0
  399. package/dist/model-facing-history.d.ts.map +1 -0
  400. package/dist/model-facing-history.js +44 -0
  401. package/dist/model-facing-history.js.map +1 -0
  402. package/dist/model-facing-history.test.d.ts +2 -0
  403. package/dist/model-facing-history.test.d.ts.map +1 -0
  404. package/dist/model-facing-history.test.js +27 -0
  405. package/dist/model-facing-history.test.js.map +1 -0
  406. package/dist/openrouter-attribution.d.ts +2 -0
  407. package/dist/openrouter-attribution.d.ts.map +1 -0
  408. package/dist/openrouter-attribution.js +2 -0
  409. package/dist/openrouter-attribution.js.map +1 -0
  410. package/dist/paperclip-runner-lifecycle-default.test.d.ts +2 -0
  411. package/dist/paperclip-runner-lifecycle-default.test.d.ts.map +1 -0
  412. package/dist/paperclip-runner-lifecycle-default.test.js +30 -0
  413. package/dist/paperclip-runner-lifecycle-default.test.js.map +1 -0
  414. package/dist/paperclip-runner-permissions.d.ts +182 -0
  415. package/dist/paperclip-runner-permissions.d.ts.map +1 -0
  416. package/dist/paperclip-runner-permissions.js +205 -0
  417. package/dist/paperclip-runner-permissions.js.map +1 -0
  418. package/dist/paperclip-runner-permissions.test.d.ts +2 -0
  419. package/dist/paperclip-runner-permissions.test.d.ts.map +1 -0
  420. package/dist/paperclip-runner-permissions.test.js +104 -0
  421. package/dist/paperclip-runner-permissions.test.js.map +1 -0
  422. package/dist/prompt-sections.test.d.ts +2 -0
  423. package/dist/prompt-sections.test.d.ts.map +1 -0
  424. package/dist/prompt-sections.test.js +53 -0
  425. package/dist/prompt-sections.test.js.map +1 -0
  426. package/dist/provider-stopped-boundary.d.ts +7 -0
  427. package/dist/provider-stopped-boundary.d.ts.map +1 -0
  428. package/dist/provider-stopped-boundary.js +22 -0
  429. package/dist/provider-stopped-boundary.js.map +1 -0
  430. package/dist/provider-stopped-boundary.test.d.ts +2 -0
  431. package/dist/provider-stopped-boundary.test.d.ts.map +1 -0
  432. package/dist/provider-stopped-boundary.test.js +76 -0
  433. package/dist/provider-stopped-boundary.test.js.map +1 -0
  434. package/dist/published-exports.test.d.ts +2 -0
  435. package/dist/published-exports.test.d.ts.map +1 -0
  436. package/dist/published-exports.test.js +17 -0
  437. package/dist/published-exports.test.js.map +1 -0
  438. package/dist/remote-execution-env.d.ts +3 -0
  439. package/dist/remote-execution-env.d.ts.map +1 -0
  440. package/dist/remote-execution-env.js +56 -0
  441. package/dist/remote-execution-env.js.map +1 -0
  442. package/dist/remote-managed-runtime.d.ts +52 -0
  443. package/dist/remote-managed-runtime.d.ts.map +1 -0
  444. package/dist/remote-managed-runtime.js +265 -0
  445. package/dist/remote-managed-runtime.js.map +1 -0
  446. package/dist/remote-managed-runtime.test.d.ts +2 -0
  447. package/dist/remote-managed-runtime.test.d.ts.map +1 -0
  448. package/dist/remote-managed-runtime.test.js +425 -0
  449. package/dist/remote-managed-runtime.test.js.map +1 -0
  450. package/dist/remote-pid-lock.d.ts +3 -0
  451. package/dist/remote-pid-lock.d.ts.map +1 -0
  452. package/dist/remote-pid-lock.js +35 -0
  453. package/dist/remote-pid-lock.js.map +1 -0
  454. package/dist/remote-text-file-sync.d.ts +41 -0
  455. package/dist/remote-text-file-sync.d.ts.map +1 -0
  456. package/dist/remote-text-file-sync.js +103 -0
  457. package/dist/remote-text-file-sync.js.map +1 -0
  458. package/dist/runner-connectivity.d.ts +61 -0
  459. package/dist/runner-connectivity.d.ts.map +1 -0
  460. package/dist/runner-connectivity.js +81 -0
  461. package/dist/runner-connectivity.js.map +1 -0
  462. package/dist/runner-connectivity.test.d.ts +2 -0
  463. package/dist/runner-connectivity.test.d.ts.map +1 -0
  464. package/dist/runner-connectivity.test.js +183 -0
  465. package/dist/runner-connectivity.test.js.map +1 -0
  466. package/dist/runtime-progress.d.ts +48 -0
  467. package/dist/runtime-progress.d.ts.map +1 -0
  468. package/dist/runtime-progress.js +99 -0
  469. package/dist/runtime-progress.js.map +1 -0
  470. package/dist/runtime-progress.test.d.ts +2 -0
  471. package/dist/runtime-progress.test.d.ts.map +1 -0
  472. package/dist/runtime-progress.test.js +240 -0
  473. package/dist/runtime-progress.test.js.map +1 -0
  474. package/dist/sandbox-callback-bridge-body.d.ts +12 -0
  475. package/dist/sandbox-callback-bridge-body.d.ts.map +1 -0
  476. package/dist/sandbox-callback-bridge-body.js +39 -0
  477. package/dist/sandbox-callback-bridge-body.js.map +1 -0
  478. package/dist/sandbox-callback-bridge-body.test.d.ts +2 -0
  479. package/dist/sandbox-callback-bridge-body.test.d.ts.map +1 -0
  480. package/dist/sandbox-callback-bridge-body.test.js +31 -0
  481. package/dist/sandbox-callback-bridge-body.test.js.map +1 -0
  482. package/dist/sandbox-callback-bridge.d.ts +249 -0
  483. package/dist/sandbox-callback-bridge.d.ts.map +1 -0
  484. package/dist/sandbox-callback-bridge.js +2309 -0
  485. package/dist/sandbox-callback-bridge.js.map +1 -0
  486. package/dist/sandbox-callback-bridge.test.d.ts +2 -0
  487. package/dist/sandbox-callback-bridge.test.d.ts.map +1 -0
  488. package/dist/sandbox-callback-bridge.test.js +3434 -0
  489. package/dist/sandbox-callback-bridge.test.js.map +1 -0
  490. package/dist/sandbox-callback-context-routes.test.d.ts +2 -0
  491. package/dist/sandbox-callback-context-routes.test.d.ts.map +1 -0
  492. package/dist/sandbox-callback-context-routes.test.js +40 -0
  493. package/dist/sandbox-callback-context-routes.test.js.map +1 -0
  494. package/dist/sandbox-file-sync.test.d.ts +2 -0
  495. package/dist/sandbox-file-sync.test.d.ts.map +1 -0
  496. package/dist/sandbox-file-sync.test.js +419 -0
  497. package/dist/sandbox-file-sync.test.js.map +1 -0
  498. package/dist/sandbox-install-command.d.ts +2 -0
  499. package/dist/sandbox-install-command.d.ts.map +1 -0
  500. package/dist/sandbox-install-command.js +47 -0
  501. package/dist/sandbox-install-command.js.map +1 -0
  502. package/dist/sandbox-install-command.test.d.ts +2 -0
  503. package/dist/sandbox-install-command.test.d.ts.map +1 -0
  504. package/dist/sandbox-install-command.test.js +22 -0
  505. package/dist/sandbox-install-command.test.js.map +1 -0
  506. package/dist/sandbox-managed-deletions.test.d.ts +2 -0
  507. package/dist/sandbox-managed-deletions.test.d.ts.map +1 -0
  508. package/dist/sandbox-managed-deletions.test.js +85 -0
  509. package/dist/sandbox-managed-deletions.test.js.map +1 -0
  510. package/dist/sandbox-managed-runtime.d.ts +465 -0
  511. package/dist/sandbox-managed-runtime.d.ts.map +1 -0
  512. package/dist/sandbox-managed-runtime.js +1801 -0
  513. package/dist/sandbox-managed-runtime.js.map +1 -0
  514. package/dist/sandbox-managed-runtime.test.d.ts +2 -0
  515. package/dist/sandbox-managed-runtime.test.d.ts.map +1 -0
  516. package/dist/sandbox-managed-runtime.test.js +3824 -0
  517. package/dist/sandbox-managed-runtime.test.js.map +1 -0
  518. package/dist/sandbox-managed-seed.test.d.ts +2 -0
  519. package/dist/sandbox-managed-seed.test.d.ts.map +1 -0
  520. package/dist/sandbox-managed-seed.test.js +223 -0
  521. package/dist/sandbox-managed-seed.test.js.map +1 -0
  522. package/dist/sandbox-run-log-stream.d.ts +44 -0
  523. package/dist/sandbox-run-log-stream.d.ts.map +1 -0
  524. package/dist/sandbox-run-log-stream.js +203 -0
  525. package/dist/sandbox-run-log-stream.js.map +1 -0
  526. package/dist/sandbox-shell.d.ts +3 -0
  527. package/dist/sandbox-shell.d.ts.map +1 -0
  528. package/dist/sandbox-shell.js +7 -0
  529. package/dist/sandbox-shell.js.map +1 -0
  530. package/dist/server-utils-env.test.d.ts +2 -0
  531. package/dist/server-utils-env.test.d.ts.map +1 -0
  532. package/dist/server-utils-env.test.js +15 -0
  533. package/dist/server-utils-env.test.js.map +1 -0
  534. package/dist/server-utils.d.ts +691 -0
  535. package/dist/server-utils.d.ts.map +1 -0
  536. package/dist/server-utils.js +3479 -0
  537. package/dist/server-utils.js.map +1 -0
  538. package/dist/server-utils.test.d.ts +2 -0
  539. package/dist/server-utils.test.d.ts.map +1 -0
  540. package/dist/server-utils.test.js +3571 -0
  541. package/dist/server-utils.test.js.map +1 -0
  542. package/dist/session-compaction.d.ts +25 -0
  543. package/dist/session-compaction.d.ts.map +1 -0
  544. package/dist/session-compaction.js +166 -0
  545. package/dist/session-compaction.js.map +1 -0
  546. package/dist/sigv4-presigned-url.d.ts +7 -0
  547. package/dist/sigv4-presigned-url.d.ts.map +1 -0
  548. package/dist/sigv4-presigned-url.js +119 -0
  549. package/dist/sigv4-presigned-url.js.map +1 -0
  550. package/dist/skill-library-manifest.d.ts +6 -0
  551. package/dist/skill-library-manifest.d.ts.map +1 -0
  552. package/dist/skill-library-manifest.js +53 -0
  553. package/dist/skill-library-manifest.js.map +1 -0
  554. package/dist/skill-library-manifest.test.d.ts +2 -0
  555. package/dist/skill-library-manifest.test.d.ts.map +1 -0
  556. package/dist/skill-library-manifest.test.js +84 -0
  557. package/dist/skill-library-manifest.test.js.map +1 -0
  558. package/dist/skills-staging-follow-symlinks.test.d.ts +2 -0
  559. package/dist/skills-staging-follow-symlinks.test.d.ts.map +1 -0
  560. package/dist/skills-staging-follow-symlinks.test.js +126 -0
  561. package/dist/skills-staging-follow-symlinks.test.js.map +1 -0
  562. package/dist/ssh-auth.test.d.ts +2 -0
  563. package/dist/ssh-auth.test.d.ts.map +1 -0
  564. package/dist/ssh-auth.test.js +20 -0
  565. package/dist/ssh-auth.test.js.map +1 -0
  566. package/dist/ssh-command-managed.test.d.ts +2 -0
  567. package/dist/ssh-command-managed.test.d.ts.map +1 -0
  568. package/dist/ssh-command-managed.test.js +136 -0
  569. package/dist/ssh-command-managed.test.js.map +1 -0
  570. package/dist/ssh-conversation-state.d.ts +22 -0
  571. package/dist/ssh-conversation-state.d.ts.map +1 -0
  572. package/dist/ssh-conversation-state.js +36 -0
  573. package/dist/ssh-conversation-state.js.map +1 -0
  574. package/dist/ssh-export-stream.test.d.ts +2 -0
  575. package/dist/ssh-export-stream.test.d.ts.map +1 -0
  576. package/dist/ssh-export-stream.test.js +104 -0
  577. package/dist/ssh-export-stream.test.js.map +1 -0
  578. package/dist/ssh-export.test.d.ts +2 -0
  579. package/dist/ssh-export.test.d.ts.map +1 -0
  580. package/dist/ssh-export.test.js +102 -0
  581. package/dist/ssh-export.test.js.map +1 -0
  582. package/dist/ssh-fixture.test.d.ts +2 -0
  583. package/dist/ssh-fixture.test.d.ts.map +1 -0
  584. package/dist/ssh-fixture.test.js +1107 -0
  585. package/dist/ssh-fixture.test.js.map +1 -0
  586. package/dist/ssh-tailscale.test.d.ts +2 -0
  587. package/dist/ssh-tailscale.test.d.ts.map +1 -0
  588. package/dist/ssh-tailscale.test.js +58 -0
  589. package/dist/ssh-tailscale.test.js.map +1 -0
  590. package/dist/ssh.d.ts +138 -0
  591. package/dist/ssh.d.ts.map +1 -0
  592. package/dist/ssh.js +1868 -0
  593. package/dist/ssh.js.map +1 -0
  594. package/dist/startup-reuse.d.ts +38 -0
  595. package/dist/startup-reuse.d.ts.map +1 -0
  596. package/dist/startup-reuse.js +90 -0
  597. package/dist/startup-reuse.js.map +1 -0
  598. package/dist/startup-reuse.test.d.ts +2 -0
  599. package/dist/startup-reuse.test.d.ts.map +1 -0
  600. package/dist/startup-reuse.test.js +71 -0
  601. package/dist/startup-reuse.test.js.map +1 -0
  602. package/dist/sync-operation-schedule.d.ts +17 -0
  603. package/dist/sync-operation-schedule.d.ts.map +1 -0
  604. package/dist/sync-operation-schedule.js +66 -0
  605. package/dist/sync-operation-schedule.js.map +1 -0
  606. package/dist/sync-operation-schedule.test.d.ts +2 -0
  607. package/dist/sync-operation-schedule.test.d.ts.map +1 -0
  608. package/dist/sync-operation-schedule.test.js +130 -0
  609. package/dist/sync-operation-schedule.test.js.map +1 -0
  610. package/dist/test-fixtures/follow-up-after-swarm-wake.d.ts +45 -0
  611. package/dist/test-fixtures/follow-up-after-swarm-wake.d.ts.map +1 -0
  612. package/dist/test-fixtures/follow-up-after-swarm-wake.js +80 -0
  613. package/dist/test-fixtures/follow-up-after-swarm-wake.js.map +1 -0
  614. package/dist/test-fixtures/prompt-context.d.ts +54 -0
  615. package/dist/test-fixtures/prompt-context.d.ts.map +1 -0
  616. package/dist/test-fixtures/prompt-context.js +55 -0
  617. package/dist/test-fixtures/prompt-context.js.map +1 -0
  618. package/dist/test-support/mcp-isolation-harness.d.ts +23 -0
  619. package/dist/test-support/mcp-isolation-harness.d.ts.map +1 -0
  620. package/dist/test-support/mcp-isolation-harness.js +67 -0
  621. package/dist/test-support/mcp-isolation-harness.js.map +1 -0
  622. package/dist/types.d.ts +910 -0
  623. package/dist/types.d.ts.map +1 -0
  624. package/dist/types.js +5 -0
  625. package/dist/types.js.map +1 -0
  626. package/dist/usage-checkpoint.d.ts +11 -0
  627. package/dist/usage-checkpoint.d.ts.map +1 -0
  628. package/dist/usage-checkpoint.js +165 -0
  629. package/dist/usage-checkpoint.js.map +1 -0
  630. package/dist/usage-checkpoint.test.d.ts +2 -0
  631. package/dist/usage-checkpoint.test.d.ts.map +1 -0
  632. package/dist/usage-checkpoint.test.js +131 -0
  633. package/dist/usage-checkpoint.test.js.map +1 -0
  634. package/dist/workspace-checkpoint-capture.test.d.ts +2 -0
  635. package/dist/workspace-checkpoint-capture.test.d.ts.map +1 -0
  636. package/dist/workspace-checkpoint-capture.test.js +232 -0
  637. package/dist/workspace-checkpoint-capture.test.js.map +1 -0
  638. package/dist/workspace-checkpoint.d.ts +16 -0
  639. package/dist/workspace-checkpoint.d.ts.map +1 -0
  640. package/dist/workspace-checkpoint.js +236 -0
  641. package/dist/workspace-checkpoint.js.map +1 -0
  642. package/dist/workspace-checkpoint.test.d.ts +2 -0
  643. package/dist/workspace-checkpoint.test.d.ts.map +1 -0
  644. package/dist/workspace-checkpoint.test.js +588 -0
  645. package/dist/workspace-checkpoint.test.js.map +1 -0
  646. package/dist/workspace-git-stream.d.ts +19 -0
  647. package/dist/workspace-git-stream.d.ts.map +1 -0
  648. package/dist/workspace-git-stream.js +99 -0
  649. package/dist/workspace-git-stream.js.map +1 -0
  650. package/dist/workspace-git-stream.test.d.ts +2 -0
  651. package/dist/workspace-git-stream.test.d.ts.map +1 -0
  652. package/dist/workspace-git-stream.test.js +71 -0
  653. package/dist/workspace-git-stream.test.js.map +1 -0
  654. package/dist/workspace-manifest.d.ts +61 -0
  655. package/dist/workspace-manifest.d.ts.map +1 -0
  656. package/dist/workspace-manifest.js +257 -0
  657. package/dist/workspace-manifest.js.map +1 -0
  658. package/dist/workspace-manifest.test.d.ts +2 -0
  659. package/dist/workspace-manifest.test.d.ts.map +1 -0
  660. package/dist/workspace-manifest.test.js +160 -0
  661. package/dist/workspace-manifest.test.js.map +1 -0
  662. package/dist/workspace-restore-diagnostics.d.ts +41 -0
  663. package/dist/workspace-restore-diagnostics.d.ts.map +1 -0
  664. package/dist/workspace-restore-diagnostics.js +265 -0
  665. package/dist/workspace-restore-diagnostics.js.map +1 -0
  666. package/dist/workspace-restore-diagnostics.test.d.ts +2 -0
  667. package/dist/workspace-restore-diagnostics.test.d.ts.map +1 -0
  668. package/dist/workspace-restore-diagnostics.test.js +294 -0
  669. package/dist/workspace-restore-diagnostics.test.js.map +1 -0
  670. package/dist/workspace-restore-merge.d.ts +126 -0
  671. package/dist/workspace-restore-merge.d.ts.map +1 -0
  672. package/dist/workspace-restore-merge.js +768 -0
  673. package/dist/workspace-restore-merge.js.map +1 -0
  674. package/dist/workspace-restore-merge.test.d.ts +2 -0
  675. package/dist/workspace-restore-merge.test.d.ts.map +1 -0
  676. package/dist/workspace-restore-merge.test.js +805 -0
  677. package/dist/workspace-restore-merge.test.js.map +1 -0
  678. package/dist/workspace-restore-result.d.ts +6 -0
  679. package/dist/workspace-restore-result.d.ts.map +1 -0
  680. package/dist/workspace-restore-result.js +72 -0
  681. package/dist/workspace-restore-result.js.map +1 -0
  682. package/dist/workspace-restore-result.test.d.ts +2 -0
  683. package/dist/workspace-restore-result.test.d.ts.map +1 -0
  684. package/dist/workspace-restore-result.test.js +74 -0
  685. package/dist/workspace-restore-result.test.js.map +1 -0
  686. package/dist/workspace-restore-teardown.d.ts +29 -0
  687. package/dist/workspace-restore-teardown.d.ts.map +1 -0
  688. package/dist/workspace-restore-teardown.js +36 -0
  689. package/dist/workspace-restore-teardown.js.map +1 -0
  690. package/dist/workspace-restore-teardown.test.d.ts +2 -0
  691. package/dist/workspace-restore-teardown.test.d.ts.map +1 -0
  692. package/dist/workspace-restore-teardown.test.js +104 -0
  693. package/dist/workspace-restore-teardown.test.js.map +1 -0
  694. package/dist/workspace-restore-unchanged.test.d.ts +2 -0
  695. package/dist/workspace-restore-unchanged.test.d.ts.map +1 -0
  696. package/dist/workspace-restore-unchanged.test.js +143 -0
  697. package/dist/workspace-restore-unchanged.test.js.map +1 -0
  698. package/dist/workspace-seed-cache.d.ts +41 -0
  699. package/dist/workspace-seed-cache.d.ts.map +1 -0
  700. package/dist/workspace-seed-cache.js +354 -0
  701. package/dist/workspace-seed-cache.js.map +1 -0
  702. package/dist/workspace-seed-cache.test.d.ts +2 -0
  703. package/dist/workspace-seed-cache.test.d.ts.map +1 -0
  704. package/dist/workspace-seed-cache.test.js +522 -0
  705. package/dist/workspace-seed-cache.test.js.map +1 -0
  706. package/dist/workspace-seed-reuse.test.d.ts +2 -0
  707. package/dist/workspace-seed-reuse.test.d.ts.map +1 -0
  708. package/dist/workspace-seed-reuse.test.js +274 -0
  709. package/dist/workspace-seed-reuse.test.js.map +1 -0
  710. package/dist/workspace-snapshot-concurrency.test.d.ts +2 -0
  711. package/dist/workspace-snapshot-concurrency.test.d.ts.map +1 -0
  712. package/dist/workspace-snapshot-concurrency.test.js +165 -0
  713. package/dist/workspace-snapshot-concurrency.test.js.map +1 -0
  714. package/dist/workspace-snapshot-thread-limit.test.d.ts +2 -0
  715. package/dist/workspace-snapshot-thread-limit.test.d.ts.map +1 -0
  716. package/dist/workspace-snapshot-thread-limit.test.js +84 -0
  717. package/dist/workspace-snapshot-thread-limit.test.js.map +1 -0
  718. package/dist/workspace-snapshot-thread-worker.d.ts +2 -0
  719. package/dist/workspace-snapshot-thread-worker.d.ts.map +1 -0
  720. package/dist/workspace-snapshot-thread-worker.js +28 -0
  721. package/dist/workspace-snapshot-thread-worker.js.map +1 -0
  722. package/dist/workspace-snapshot-thread.d.ts +27 -0
  723. package/dist/workspace-snapshot-thread.d.ts.map +1 -0
  724. package/dist/workspace-snapshot-thread.js +77 -0
  725. package/dist/workspace-snapshot-thread.js.map +1 -0
  726. package/dist/workspace-snapshot-thread.test.d.ts +2 -0
  727. package/dist/workspace-snapshot-thread.test.d.ts.map +1 -0
  728. package/dist/workspace-snapshot-thread.test.js +140 -0
  729. package/dist/workspace-snapshot-thread.test.js.map +1 -0
  730. package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
  731. package/node_modules/@agentclientprotocol/sdk/README.md +77 -0
  732. package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1637 -0
  733. package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1729 -0
  734. package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  735. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
  736. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5093 -0
  737. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
  738. package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +277 -0
  739. package/node_modules/@agentclientprotocol/sdk/dist/connection.js +898 -0
  740. package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
  741. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
  742. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +666 -0
  743. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
  744. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
  745. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
  746. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
  747. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
  748. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
  749. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
  750. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
  751. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
  752. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
  753. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
  754. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
  755. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
  756. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
  757. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +229 -0
  758. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
  759. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
  760. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
  761. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
  762. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
  763. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +117 -0
  764. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
  765. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
  766. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
  767. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
  768. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +35 -0
  769. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +473 -0
  770. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
  771. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
  772. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
  773. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
  774. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +604 -0
  775. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1082 -0
  776. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
  777. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
  778. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +917 -0
  779. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
  780. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +24 -0
  781. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +71 -0
  782. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
  783. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
  784. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
  785. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
  786. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.d.ts +563 -0
  787. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js +106 -0
  788. package/node_modules/@agentclientprotocol/sdk/dist/nes/acp.js.map +1 -0
  789. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.d.ts +1261 -0
  790. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js +4 -0
  791. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/types.gen.js.map +1 -0
  792. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.d.ts +962 -0
  793. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js +526 -0
  794. package/node_modules/@agentclientprotocol/sdk/dist/nes/schema/zod.gen.js.map +1 -0
  795. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
  796. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +457 -0
  797. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
  798. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
  799. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +586 -0
  800. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
  801. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +43 -0
  802. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +467 -0
  803. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
  804. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
  805. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +592 -0
  806. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
  807. package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
  808. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +60 -0
  809. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
  810. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
  811. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +72 -0
  812. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
  813. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +305 -0
  814. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +355 -0
  815. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
  816. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +39 -0
  817. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +40 -0
  818. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
  819. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +5438 -0
  820. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
  821. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
  822. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +15955 -0
  823. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +2827 -0
  824. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
  825. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +31 -0
  826. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +117 -0
  827. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
  828. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
  829. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
  830. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
  831. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
  832. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
  833. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
  834. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
  835. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +536 -0
  836. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
  837. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +7 -0
  838. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +136 -0
  839. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
  840. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
  841. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +106 -0
  842. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
  843. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
  844. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +1310 -0
  845. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
  846. package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +82 -0
  847. package/node_modules/@agentclientprotocol/sdk/dist/server.js +414 -0
  848. package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
  849. package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
  850. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1646 -0
  851. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
  852. package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +6 -0
  853. package/node_modules/@agentclientprotocol/sdk/dist/sse.js +114 -0
  854. package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
  855. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
  856. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
  857. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
  858. package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.d.ts +15 -0
  859. package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.js +58 -0
  860. package/node_modules/@agentclientprotocol/sdk/dist/stream-limits.js.map +1 -0
  861. package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +38 -0
  862. package/node_modules/@agentclientprotocol/sdk/dist/stream.js +119 -0
  863. package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  864. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
  865. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +195 -0
  866. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
  867. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
  868. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
  869. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
  870. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
  871. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
  872. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
  873. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
  874. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
  875. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
  876. package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.d.ts +5 -0
  877. package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.js +14 -0
  878. package/node_modules/@agentclientprotocol/sdk/dist/test-support/until.js.map +1 -0
  879. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +961 -0
  880. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1451 -0
  881. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
  882. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
  883. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +1423 -0
  884. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
  885. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +1084 -0
  886. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1157 -0
  887. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
  888. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +30 -0
  889. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +31 -0
  890. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
  891. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +5672 -0
  892. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
  893. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
  894. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +37653 -0
  895. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +2952 -0
  896. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
  897. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
  898. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +485 -0
  899. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
  900. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
  901. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +253 -0
  902. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
  903. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
  904. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +836 -0
  905. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
  906. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +19 -0
  907. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
  908. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
  909. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
  910. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
  911. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
  912. package/node_modules/@agentclientprotocol/sdk/package.json +110 -0
  913. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +7852 -0
  914. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +8814 -0
  915. package/node_modules/@clack/core/LICENSE +9 -0
  916. package/node_modules/@clack/core/README.md +22 -0
  917. package/node_modules/@clack/core/dist/index.d.mts +505 -0
  918. package/node_modules/@clack/core/dist/index.mjs +1006 -0
  919. package/node_modules/@clack/core/package.json +64 -0
  920. package/node_modules/@clack/prompts/LICENSE +9 -0
  921. package/node_modules/@clack/prompts/README.md +396 -0
  922. package/node_modules/@clack/prompts/dist/index.d.mts +950 -0
  923. package/node_modules/@clack/prompts/dist/index.mjs +1448 -0
  924. package/node_modules/@clack/prompts/package.json +67 -0
  925. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +1772 -0
  926. package/node_modules/@openclaw/fs-safe/LICENSE +22 -0
  927. package/node_modules/@openclaw/fs-safe/README.md +383 -0
  928. package/node_modules/@openclaw/fs-safe/SECURITY.md +45 -0
  929. package/node_modules/@openclaw/fs-safe/dist/absolute-path.d.ts +32 -0
  930. package/node_modules/@openclaw/fs-safe/dist/absolute-path.js +307 -0
  931. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +45 -0
  932. package/node_modules/@openclaw/fs-safe/dist/advanced.js +43 -0
  933. package/node_modules/@openclaw/fs-safe/dist/archive-crc32.d.ts +1 -0
  934. package/node_modules/@openclaw/fs-safe/dist/archive-crc32.js +19 -0
  935. package/node_modules/@openclaw/fs-safe/dist/archive-deadline.d.ts +11 -0
  936. package/node_modules/@openclaw/fs-safe/dist/archive-deadline.js +101 -0
  937. package/node_modules/@openclaw/fs-safe/dist/archive-durability.d.ts +23 -0
  938. package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +180 -0
  939. package/node_modules/@openclaw/fs-safe/dist/archive-entry.d.ts +13 -0
  940. package/node_modules/@openclaw/fs-safe/dist/archive-entry.js +89 -0
  941. package/node_modules/@openclaw/fs-safe/dist/archive-errors.d.ts +12 -0
  942. package/node_modules/@openclaw/fs-safe/dist/archive-errors.js +23 -0
  943. package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.d.ts +20 -0
  944. package/node_modules/@openclaw/fs-safe/dist/archive-gzip-tail.js +99 -0
  945. package/node_modules/@openclaw/fs-safe/dist/archive-input.d.ts +18 -0
  946. package/node_modules/@openclaw/fs-safe/dist/archive-input.js +100 -0
  947. package/node_modules/@openclaw/fs-safe/dist/archive-kind.d.ts +7 -0
  948. package/node_modules/@openclaw/fs-safe/dist/archive-kind.js +71 -0
  949. package/node_modules/@openclaw/fs-safe/dist/archive-limits.d.ts +56 -0
  950. package/node_modules/@openclaw/fs-safe/dist/archive-limits.js +131 -0
  951. package/node_modules/@openclaw/fs-safe/dist/archive-merge.d.ts +22 -0
  952. package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +307 -0
  953. package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.d.ts +1 -0
  954. package/node_modules/@openclaw/fs-safe/dist/archive-parser-errors.js +12 -0
  955. package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
  956. package/node_modules/@openclaw/fs-safe/dist/archive-plan.d.ts +85 -0
  957. package/node_modules/@openclaw/fs-safe/dist/archive-plan.js +119 -0
  958. package/node_modules/@openclaw/fs-safe/dist/archive-read.d.ts +5 -0
  959. package/node_modules/@openclaw/fs-safe/dist/archive-read.js +241 -0
  960. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +32 -0
  961. package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +291 -0
  962. package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.d.ts +27 -0
  963. package/node_modules/@openclaw/fs-safe/dist/archive-tar-stream.js +127 -0
  964. package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.d.ts +29 -0
  965. package/node_modules/@openclaw/fs-safe/dist/archive-tar-wasm.js +203 -0
  966. package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.d.ts +7 -0
  967. package/node_modules/@openclaw/fs-safe/dist/archive-zip-admission.js +96 -0
  968. package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.d.ts +1 -0
  969. package/node_modules/@openclaw/fs-safe/dist/archive-zip-count.js +160 -0
  970. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.d.ts +21 -0
  971. package/node_modules/@openclaw/fs-safe/dist/archive-zip-directory.js +267 -0
  972. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.d.ts +24 -0
  973. package/node_modules/@openclaw/fs-safe/dist/archive-zip-entry.js +10 -0
  974. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.d.ts +4 -0
  975. package/node_modules/@openclaw/fs-safe/dist/archive-zip-integrity.js +30 -0
  976. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.d.ts +12 -0
  977. package/node_modules/@openclaw/fs-safe/dist/archive-zip-loader.js +152 -0
  978. package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.d.ts +4 -0
  979. package/node_modules/@openclaw/fs-safe/dist/archive-zip-manifest.js +24 -0
  980. package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.d.ts +17 -0
  981. package/node_modules/@openclaw/fs-safe/dist/archive-zip-names.js +149 -0
  982. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.d.ts +4 -0
  983. package/node_modules/@openclaw/fs-safe/dist/archive-zip-preflight.js +21 -0
  984. package/node_modules/@openclaw/fs-safe/dist/archive.d.ts +20 -0
  985. package/node_modules/@openclaw/fs-safe/dist/archive.js +329 -0
  986. package/node_modules/@openclaw/fs-safe/dist/async-lock.d.ts +1 -0
  987. package/node_modules/@openclaw/fs-safe/dist/async-lock.js +17 -0
  988. package/node_modules/@openclaw/fs-safe/dist/atomic-io.d.ts +52 -0
  989. package/node_modules/@openclaw/fs-safe/dist/atomic-io.js +248 -0
  990. package/node_modules/@openclaw/fs-safe/dist/atomic.d.ts +7 -0
  991. package/node_modules/@openclaw/fs-safe/dist/atomic.js +4 -0
  992. package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.d.ts +2 -0
  993. package/node_modules/@openclaw/fs-safe/dist/bounded-read-stream.js +15 -0
  994. package/node_modules/@openclaw/fs-safe/dist/bounded-read.d.ts +26 -0
  995. package/node_modules/@openclaw/fs-safe/dist/bounded-read.js +161 -0
  996. package/node_modules/@openclaw/fs-safe/dist/byte-budget.d.ts +3 -0
  997. package/node_modules/@openclaw/fs-safe/dist/byte-budget.js +9 -0
  998. package/node_modules/@openclaw/fs-safe/dist/byte-view.d.ts +2 -0
  999. package/node_modules/@openclaw/fs-safe/dist/byte-view.js +13 -0
  1000. package/node_modules/@openclaw/fs-safe/dist/clone-metadata.d.ts +21 -0
  1001. package/node_modules/@openclaw/fs-safe/dist/clone-metadata.js +37 -0
  1002. package/node_modules/@openclaw/fs-safe/dist/config.d.ts +8 -0
  1003. package/node_modules/@openclaw/fs-safe/dist/config.js +7 -0
  1004. package/node_modules/@openclaw/fs-safe/dist/containment.d.ts +1 -0
  1005. package/node_modules/@openclaw/fs-safe/dist/containment.js +1 -0
  1006. package/node_modules/@openclaw/fs-safe/dist/copy-file-input.d.ts +23 -0
  1007. package/node_modules/@openclaw/fs-safe/dist/copy-file-input.js +74 -0
  1008. package/node_modules/@openclaw/fs-safe/dist/copy-link.d.ts +26 -0
  1009. package/node_modules/@openclaw/fs-safe/dist/copy-link.js +170 -0
  1010. package/node_modules/@openclaw/fs-safe/dist/copy-metadata.d.ts +9 -0
  1011. package/node_modules/@openclaw/fs-safe/dist/copy-metadata.js +39 -0
  1012. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
  1013. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +126 -0
  1014. package/node_modules/@openclaw/fs-safe/dist/copy-policy.d.ts +2 -0
  1015. package/node_modules/@openclaw/fs-safe/dist/copy-policy.js +8 -0
  1016. package/node_modules/@openclaw/fs-safe/dist/copy-publication.d.ts +18 -0
  1017. package/node_modules/@openclaw/fs-safe/dist/copy-publication.js +29 -0
  1018. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +36 -0
  1019. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +204 -0
  1020. package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.d.ts +8 -0
  1021. package/node_modules/@openclaw/fs-safe/dist/copy-tree-portable.js +244 -0
  1022. package/node_modules/@openclaw/fs-safe/dist/copy.d.ts +15 -0
  1023. package/node_modules/@openclaw/fs-safe/dist/copy.js +143 -0
  1024. package/node_modules/@openclaw/fs-safe/dist/create-owned-file.d.ts +7 -0
  1025. package/node_modules/@openclaw/fs-safe/dist/create-owned-file.js +16 -0
  1026. package/node_modules/@openclaw/fs-safe/dist/create.d.ts +18 -0
  1027. package/node_modules/@openclaw/fs-safe/dist/create.js +398 -0
  1028. package/node_modules/@openclaw/fs-safe/dist/creation-boundary.d.ts +60 -0
  1029. package/node_modules/@openclaw/fs-safe/dist/creation-boundary.js +374 -0
  1030. package/node_modules/@openclaw/fs-safe/dist/darwin-acl.d.ts +12 -0
  1031. package/node_modules/@openclaw/fs-safe/dist/darwin-acl.js +29 -0
  1032. package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.d.ts +2 -0
  1033. package/node_modules/@openclaw/fs-safe/dist/deny-mutation-match.js +71 -0
  1034. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts +11 -0
  1035. package/node_modules/@openclaw/fs-safe/dist/deny-mutations.js +96 -0
  1036. package/node_modules/@openclaw/fs-safe/dist/device-path.d.ts +14 -0
  1037. package/node_modules/@openclaw/fs-safe/dist/device-path.js +139 -0
  1038. package/node_modules/@openclaw/fs-safe/dist/directory-durability.d.ts +46 -0
  1039. package/node_modules/@openclaw/fs-safe/dist/directory-durability.js +286 -0
  1040. package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.d.ts +2 -0
  1041. package/node_modules/@openclaw/fs-safe/dist/directory-entry-path.js +21 -0
  1042. package/node_modules/@openclaw/fs-safe/dist/directory-guard.d.ts +65 -0
  1043. package/node_modules/@openclaw/fs-safe/dist/directory-guard.js +197 -0
  1044. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.d.ts +47 -0
  1045. package/node_modules/@openclaw/fs-safe/dist/directory-mode-node.js +323 -0
  1046. package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.d.ts +3 -0
  1047. package/node_modules/@openclaw/fs-safe/dist/directory-mode-options.js +6 -0
  1048. package/node_modules/@openclaw/fs-safe/dist/directory-receipt.d.ts +23 -0
  1049. package/node_modules/@openclaw/fs-safe/dist/directory-receipt.js +126 -0
  1050. package/node_modules/@openclaw/fs-safe/dist/durability.d.ts +5 -0
  1051. package/node_modules/@openclaw/fs-safe/dist/durability.js +3 -0
  1052. package/node_modules/@openclaw/fs-safe/dist/effective-uid.d.ts +1 -0
  1053. package/node_modules/@openclaw/fs-safe/dist/effective-uid.js +22 -0
  1054. package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.d.ts +55 -0
  1055. package/node_modules/@openclaw/fs-safe/dist/entry-publication-types.js +1 -0
  1056. package/node_modules/@openclaw/fs-safe/dist/entry-publication.d.ts +8 -0
  1057. package/node_modules/@openclaw/fs-safe/dist/entry-publication.js +264 -0
  1058. package/node_modules/@openclaw/fs-safe/dist/error-detail.d.ts +2 -0
  1059. package/node_modules/@openclaw/fs-safe/dist/error-detail.js +13 -0
  1060. package/node_modules/@openclaw/fs-safe/dist/errors.d.ts +17 -0
  1061. package/node_modules/@openclaw/fs-safe/dist/errors.js +33 -0
  1062. package/node_modules/@openclaw/fs-safe/dist/exact-identity.d.ts +17 -0
  1063. package/node_modules/@openclaw/fs-safe/dist/exact-identity.js +29 -0
  1064. package/node_modules/@openclaw/fs-safe/dist/exclusive-create.d.ts +3 -0
  1065. package/node_modules/@openclaw/fs-safe/dist/exclusive-create.js +22 -0
  1066. package/node_modules/@openclaw/fs-safe/dist/file-cleanup.d.ts +14 -0
  1067. package/node_modules/@openclaw/fs-safe/dist/file-cleanup.js +78 -0
  1068. package/node_modules/@openclaw/fs-safe/dist/file-contents.d.ts +5 -0
  1069. package/node_modules/@openclaw/fs-safe/dist/file-contents.js +40 -0
  1070. package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.d.ts +15 -0
  1071. package/node_modules/@openclaw/fs-safe/dist/file-handle-transfer.js +192 -0
  1072. package/node_modules/@openclaw/fs-safe/dist/file-hash.d.ts +16 -0
  1073. package/node_modules/@openclaw/fs-safe/dist/file-hash.js +298 -0
  1074. package/node_modules/@openclaw/fs-safe/dist/file-identity.d.ts +13 -0
  1075. package/node_modules/@openclaw/fs-safe/dist/file-identity.js +75 -0
  1076. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.d.ts +22 -0
  1077. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-acquisition.js +98 -0
  1078. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.d.ts +16 -0
  1079. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-admission.js +47 -0
  1080. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +6 -0
  1081. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +349 -0
  1082. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.d.ts +25 -0
  1083. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-held.js +392 -0
  1084. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.d.ts +40 -0
  1085. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-io.js +209 -0
  1086. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.d.ts +16 -0
  1087. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-mutation.js +284 -0
  1088. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.d.ts +11 -0
  1089. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-options.js +58 -0
  1090. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.d.ts +1 -0
  1091. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-registration.js +90 -0
  1092. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.d.ts +34 -0
  1093. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root.js +286 -0
  1094. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.d.ts +19 -0
  1095. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-stale-admission.js +198 -0
  1096. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.d.ts +17 -0
  1097. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync.js +356 -0
  1098. package/node_modules/@openclaw/fs-safe/dist/file-lock.d.ts +24 -0
  1099. package/node_modules/@openclaw/fs-safe/dist/file-lock.js +67 -0
  1100. package/node_modules/@openclaw/fs-safe/dist/file-observation.d.ts +8 -0
  1101. package/node_modules/@openclaw/fs-safe/dist/file-observation.js +22 -0
  1102. package/node_modules/@openclaw/fs-safe/dist/file-open-error.d.ts +2 -0
  1103. package/node_modules/@openclaw/fs-safe/dist/file-open-error.js +14 -0
  1104. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.d.ts +34 -0
  1105. package/node_modules/@openclaw/fs-safe/dist/file-store-boundary.js +202 -0
  1106. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.d.ts +11 -0
  1107. package/node_modules/@openclaw/fs-safe/dist/file-store-prune.js +116 -0
  1108. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.d.ts +15 -0
  1109. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-directory.js +345 -0
  1110. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.d.ts +9 -0
  1111. package/node_modules/@openclaw/fs-safe/dist/file-store-sync-write.js +132 -0
  1112. package/node_modules/@openclaw/fs-safe/dist/file-store.d.ts +63 -0
  1113. package/node_modules/@openclaw/fs-safe/dist/file-store.js +359 -0
  1114. package/node_modules/@openclaw/fs-safe/dist/file-sync.d.ts +5 -0
  1115. package/node_modules/@openclaw/fs-safe/dist/file-sync.js +24 -0
  1116. package/node_modules/@openclaw/fs-safe/dist/file-write-lease.d.ts +9 -0
  1117. package/node_modules/@openclaw/fs-safe/dist/file-write-lease.js +42 -0
  1118. package/node_modules/@openclaw/fs-safe/dist/filename.d.ts +8 -0
  1119. package/node_modules/@openclaw/fs-safe/dist/filename.js +138 -0
  1120. package/node_modules/@openclaw/fs-safe/dist/fs.d.ts +4 -0
  1121. package/node_modules/@openclaw/fs-safe/dist/fs.js +22 -0
  1122. package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.d.ts +27 -0
  1123. package/node_modules/@openclaw/fs-safe/dist/guarded-mkdir.js +285 -0
  1124. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.d.ts +32 -0
  1125. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +81 -0
  1126. package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.d.ts +1 -0
  1127. package/node_modules/@openclaw/fs-safe/dist/guest-dispatch-python.js +68 -0
  1128. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.d.ts +3 -0
  1129. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +178 -0
  1130. package/node_modules/@openclaw/fs-safe/dist/guest.d.ts +8 -0
  1131. package/node_modules/@openclaw/fs-safe/dist/guest.js +427 -0
  1132. package/node_modules/@openclaw/fs-safe/dist/hardlink-fallback.d.ts +1 -0
  1133. package/node_modules/@openclaw/fs-safe/dist/hardlink-fallback.js +5 -0
  1134. package/node_modules/@openclaw/fs-safe/dist/home-dir.d.ts +11 -0
  1135. package/node_modules/@openclaw/fs-safe/dist/home-dir.js +149 -0
  1136. package/node_modules/@openclaw/fs-safe/dist/index.d.ts +10 -0
  1137. package/node_modules/@openclaw/fs-safe/dist/index.js +6 -0
  1138. package/node_modules/@openclaw/fs-safe/dist/install-path.d.ts +25 -0
  1139. package/node_modules/@openclaw/fs-safe/dist/install-path.js +136 -0
  1140. package/node_modules/@openclaw/fs-safe/dist/json-document-store.d.ts +32 -0
  1141. package/node_modules/@openclaw/fs-safe/dist/json-document-store.js +105 -0
  1142. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.d.ts +14 -0
  1143. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-directory.js +150 -0
  1144. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.d.ts +19 -0
  1145. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-ownership.js +368 -0
  1146. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.d.ts +5 -0
  1147. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue-read.js +65 -0
  1148. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.d.ts +44 -0
  1149. package/node_modules/@openclaw/fs-safe/dist/json-durable-queue.js +210 -0
  1150. package/node_modules/@openclaw/fs-safe/dist/json-store.d.ts +9 -0
  1151. package/node_modules/@openclaw/fs-safe/dist/json-store.js +15 -0
  1152. package/node_modules/@openclaw/fs-safe/dist/json-stringify.d.ts +1 -0
  1153. package/node_modules/@openclaw/fs-safe/dist/json-stringify.js +7 -0
  1154. package/node_modules/@openclaw/fs-safe/dist/json.d.ts +49 -0
  1155. package/node_modules/@openclaw/fs-safe/dist/json.js +305 -0
  1156. package/node_modules/@openclaw/fs-safe/dist/local-file-access.d.ts +8 -0
  1157. package/node_modules/@openclaw/fs-safe/dist/local-file-access.js +81 -0
  1158. package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.d.ts +13 -0
  1159. package/node_modules/@openclaw/fs-safe/dist/local-file-descriptor.js +101 -0
  1160. package/node_modules/@openclaw/fs-safe/dist/local-roots.d.ts +20 -0
  1161. package/node_modules/@openclaw/fs-safe/dist/local-roots.js +160 -0
  1162. package/node_modules/@openclaw/fs-safe/dist/lock-config.d.ts +9 -0
  1163. package/node_modules/@openclaw/fs-safe/dist/lock-config.js +12 -0
  1164. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.d.ts +30 -0
  1165. package/node_modules/@openclaw/fs-safe/dist/move-path-cleanup.js +224 -0
  1166. package/node_modules/@openclaw/fs-safe/dist/move-path-stage.d.ts +7 -0
  1167. package/node_modules/@openclaw/fs-safe/dist/move-path-stage.js +56 -0
  1168. package/node_modules/@openclaw/fs-safe/dist/move-path.d.ts +20 -0
  1169. package/node_modules/@openclaw/fs-safe/dist/move-path.js +392 -0
  1170. package/node_modules/@openclaw/fs-safe/dist/mutation-authority.d.ts +9 -0
  1171. package/node_modules/@openclaw/fs-safe/dist/mutation-authority.js +49 -0
  1172. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +323 -0
  1173. package/node_modules/@openclaw/fs-safe/dist/native-binding.js +8 -0
  1174. package/node_modules/@openclaw/fs-safe/dist/native-config.d.ts +13 -0
  1175. package/node_modules/@openclaw/fs-safe/dist/native-config.js +59 -0
  1176. package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.d.ts +16 -0
  1177. package/node_modules/@openclaw/fs-safe/dist/native-directory-observation.js +39 -0
  1178. package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.d.ts +4 -0
  1179. package/node_modules/@openclaw/fs-safe/dist/native-fallback-warning.js +35 -0
  1180. package/node_modules/@openclaw/fs-safe/dist/native-guidance.d.ts +3 -0
  1181. package/node_modules/@openclaw/fs-safe/dist/native-guidance.js +21 -0
  1182. package/node_modules/@openclaw/fs-safe/dist/native-move-fallback.d.ts +3 -0
  1183. package/node_modules/@openclaw/fs-safe/dist/native-move-fallback.js +56 -0
  1184. package/node_modules/@openclaw/fs-safe/dist/native-noreplace.d.ts +8 -0
  1185. package/node_modules/@openclaw/fs-safe/dist/native-noreplace.js +55 -0
  1186. package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +14 -0
  1187. package/node_modules/@openclaw/fs-safe/dist/native-operations.js +111 -0
  1188. package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.d.ts +76 -0
  1189. package/node_modules/@openclaw/fs-safe/dist/native-parent-admission.js +220 -0
  1190. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.d.ts +6 -0
  1191. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +290 -0
  1192. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.d.ts +7 -0
  1193. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write.js +202 -0
  1194. package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.d.ts +11 -0
  1195. package/node_modules/@openclaw/fs-safe/dist/native-policy-directory-observation.js +62 -0
  1196. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.d.ts +13 -0
  1197. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent-windows.js +62 -0
  1198. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.d.ts +15 -0
  1199. package/node_modules/@openclaw/fs-safe/dist/native-policy-parent.js +421 -0
  1200. package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.d.ts +3 -0
  1201. package/node_modules/@openclaw/fs-safe/dist/native-rename-outcome.js +15 -0
  1202. package/node_modules/@openclaw/fs-safe/dist/native-staged-file-metadata.d.ts +3 -0
  1203. package/node_modules/@openclaw/fs-safe/dist/native-staged-file-metadata.js +16 -0
  1204. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.d.ts +45 -0
  1205. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +516 -0
  1206. package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.d.ts +13 -0
  1207. package/node_modules/@openclaw/fs-safe/dist/native-staged-symlink.js +285 -0
  1208. package/node_modules/@openclaw/fs-safe/dist/native-stat-identity.d.ts +3 -0
  1209. package/node_modules/@openclaw/fs-safe/dist/native-stat-identity.js +7 -0
  1210. package/node_modules/@openclaw/fs-safe/dist/native-status.d.ts +17 -0
  1211. package/node_modules/@openclaw/fs-safe/dist/native-status.js +30 -0
  1212. package/node_modules/@openclaw/fs-safe/dist/native.d.ts +40 -0
  1213. package/node_modules/@openclaw/fs-safe/dist/native.js +311 -0
  1214. package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.d.ts +7 -0
  1215. package/node_modules/@openclaw/fs-safe/dist/opened-file-failure.js +48 -0
  1216. package/node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts +15 -0
  1217. package/node_modules/@openclaw/fs-safe/dist/opened-realpath.js +110 -0
  1218. package/node_modules/@openclaw/fs-safe/dist/output.d.ts +16 -0
  1219. package/node_modules/@openclaw/fs-safe/dist/output.js +145 -0
  1220. package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.d.ts +9 -0
  1221. package/node_modules/@openclaw/fs-safe/dist/overwrite-file-handle.js +71 -0
  1222. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.d.ts +1 -0
  1223. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch-worker.js +54 -0
  1224. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.d.ts +5 -0
  1225. package/node_modules/@openclaw/fs-safe/dist/owner-dacl-batch.js +64 -0
  1226. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.d.ts +34 -0
  1227. package/node_modules/@openclaw/fs-safe/dist/owner-dacl.js +40 -0
  1228. package/node_modules/@openclaw/fs-safe/dist/path-case.d.ts +6 -0
  1229. package/node_modules/@openclaw/fs-safe/dist/path-case.js +137 -0
  1230. package/node_modules/@openclaw/fs-safe/dist/path-policy.d.ts +24 -0
  1231. package/node_modules/@openclaw/fs-safe/dist/path-policy.js +49 -0
  1232. package/node_modules/@openclaw/fs-safe/dist/path-prefix.d.ts +7 -0
  1233. package/node_modules/@openclaw/fs-safe/dist/path-prefix.js +181 -0
  1234. package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.d.ts +13 -0
  1235. package/node_modules/@openclaw/fs-safe/dist/path-scope-lexical.js +40 -0
  1236. package/node_modules/@openclaw/fs-safe/dist/path-segment-route.d.ts +7 -0
  1237. package/node_modules/@openclaw/fs-safe/dist/path-segment-route.js +27 -0
  1238. package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.d.ts +11 -0
  1239. package/node_modules/@openclaw/fs-safe/dist/path-suffix-aliases.js +394 -0
  1240. package/node_modules/@openclaw/fs-safe/dist/path.d.ts +20 -0
  1241. package/node_modules/@openclaw/fs-safe/dist/path.js +192 -0
  1242. package/node_modules/@openclaw/fs-safe/dist/permission-exec.d.ts +32 -0
  1243. package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +203 -0
  1244. package/node_modules/@openclaw/fs-safe/dist/permissions-public.d.ts +6 -0
  1245. package/node_modules/@openclaw/fs-safe/dist/permissions-public.js +5 -0
  1246. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.d.ts +47 -0
  1247. package/node_modules/@openclaw/fs-safe/dist/permissions-windows.js +380 -0
  1248. package/node_modules/@openclaw/fs-safe/dist/permissions.d.ts +52 -0
  1249. package/node_modules/@openclaw/fs-safe/dist/permissions.js +131 -0
  1250. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.d.ts +23 -0
  1251. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-admission.js +419 -0
  1252. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.d.ts +38 -0
  1253. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-observation.js +205 -0
  1254. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.d.ts +18 -0
  1255. package/node_modules/@openclaw/fs-safe/dist/pinned-mutation-shared-route.js +70 -0
  1256. package/node_modules/@openclaw/fs-safe/dist/pinned-open.d.ts +37 -0
  1257. package/node_modules/@openclaw/fs-safe/dist/pinned-open.js +118 -0
  1258. package/node_modules/@openclaw/fs-safe/dist/pinned-operation.d.ts +1 -0
  1259. package/node_modules/@openclaw/fs-safe/dist/pinned-operation.js +22 -0
  1260. package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.d.ts +5 -0
  1261. package/node_modules/@openclaw/fs-safe/dist/pinned-write-input.js +54 -0
  1262. package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.d.ts +4 -0
  1263. package/node_modules/@openclaw/fs-safe/dist/pinned-write-mode.js +31 -0
  1264. package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.d.ts +5 -0
  1265. package/node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js +212 -0
  1266. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +74 -0
  1267. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.js +1 -0
  1268. package/node_modules/@openclaw/fs-safe/dist/pinned-write.d.ts +12 -0
  1269. package/node_modules/@openclaw/fs-safe/dist/pinned-write.js +301 -0
  1270. package/node_modules/@openclaw/fs-safe/dist/pipe.d.ts +9 -0
  1271. package/node_modules/@openclaw/fs-safe/dist/pipe.js +26 -0
  1272. package/node_modules/@openclaw/fs-safe/dist/positional-read.d.ts +8 -0
  1273. package/node_modules/@openclaw/fs-safe/dist/positional-read.js +36 -0
  1274. package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.d.ts +9 -0
  1275. package/node_modules/@openclaw/fs-safe/dist/prepare-directory-mode.js +61 -0
  1276. package/node_modules/@openclaw/fs-safe/dist/private-directory.d.ts +4 -0
  1277. package/node_modules/@openclaw/fs-safe/dist/private-directory.js +30 -0
  1278. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.d.ts +3 -0
  1279. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff-sync.js +72 -0
  1280. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.d.ts +53 -0
  1281. package/node_modules/@openclaw/fs-safe/dist/private-producer-handoff.js +352 -0
  1282. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.d.ts +8 -0
  1283. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +370 -0
  1284. package/node_modules/@openclaw/fs-safe/dist/publication-handle.d.ts +4 -0
  1285. package/node_modules/@openclaw/fs-safe/dist/publication-handle.js +32 -0
  1286. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.d.ts +14 -0
  1287. package/node_modules/@openclaw/fs-safe/dist/publish-copy-stage.js +152 -0
  1288. package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.d.ts +35 -0
  1289. package/node_modules/@openclaw/fs-safe/dist/publish-file-failure.js +26 -0
  1290. package/node_modules/@openclaw/fs-safe/dist/publish-file.d.ts +23 -0
  1291. package/node_modules/@openclaw/fs-safe/dist/publish-file.js +371 -0
  1292. package/node_modules/@openclaw/fs-safe/dist/publish-rename-fallback.d.ts +21 -0
  1293. package/node_modules/@openclaw/fs-safe/dist/publish-rename-fallback.js +102 -0
  1294. package/node_modules/@openclaw/fs-safe/dist/read-open-flags.d.ts +7 -0
  1295. package/node_modules/@openclaw/fs-safe/dist/read-open-flags.js +13 -0
  1296. package/node_modules/@openclaw/fs-safe/dist/read-opened-file.d.ts +19 -0
  1297. package/node_modules/@openclaw/fs-safe/dist/read-opened-file.js +17 -0
  1298. package/node_modules/@openclaw/fs-safe/dist/realpath.d.ts +5 -0
  1299. package/node_modules/@openclaw/fs-safe/dist/realpath.js +102 -0
  1300. package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.d.ts +2 -0
  1301. package/node_modules/@openclaw/fs-safe/dist/recursive-mkdir-path.js +8 -0
  1302. package/node_modules/@openclaw/fs-safe/dist/regular-file.d.ts +41 -0
  1303. package/node_modules/@openclaw/fs-safe/dist/regular-file.js +313 -0
  1304. package/node_modules/@openclaw/fs-safe/dist/replace-directory.d.ts +6 -0
  1305. package/node_modules/@openclaw/fs-safe/dist/replace-directory.js +276 -0
  1306. package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.d.ts +3 -0
  1307. package/node_modules/@openclaw/fs-safe/dist/replace-file-buffer.js +22 -0
  1308. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.d.ts +20 -0
  1309. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +228 -0
  1310. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.d.ts +9 -0
  1311. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-source.js +60 -0
  1312. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.d.ts +22 -0
  1313. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +172 -0
  1314. package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.d.ts +19 -0
  1315. package/node_modules/@openclaw/fs-safe/dist/replace-file-destination.js +89 -0
  1316. package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.d.ts +2 -0
  1317. package/node_modules/@openclaw/fs-safe/dist/replace-file-mode.js +10 -0
  1318. package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.d.ts +26 -0
  1319. package/node_modules/@openclaw/fs-safe/dist/replace-file-mutation.js +47 -0
  1320. package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.d.ts +5 -0
  1321. package/node_modules/@openclaw/fs-safe/dist/replace-file-rename-policy.js +30 -0
  1322. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.d.ts +32 -0
  1323. package/node_modules/@openclaw/fs-safe/dist/replace-file-temp-owner.js +229 -0
  1324. package/node_modules/@openclaw/fs-safe/dist/replace-file-types.d.ts +51 -0
  1325. package/node_modules/@openclaw/fs-safe/dist/replace-file-types.js +1 -0
  1326. package/node_modules/@openclaw/fs-safe/dist/replace-file.d.ts +6 -0
  1327. package/node_modules/@openclaw/fs-safe/dist/replace-file.js +223 -0
  1328. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.d.ts +26 -0
  1329. package/node_modules/@openclaw/fs-safe/dist/retained-directory-replacement.js +193 -0
  1330. package/node_modules/@openclaw/fs-safe/dist/retained-file-types.d.ts +50 -0
  1331. package/node_modules/@openclaw/fs-safe/dist/retained-file-types.js +1 -0
  1332. package/node_modules/@openclaw/fs-safe/dist/retained-file.d.ts +3 -0
  1333. package/node_modules/@openclaw/fs-safe/dist/retained-file.js +121 -0
  1334. package/node_modules/@openclaw/fs-safe/dist/root-boundary.d.ts +29 -0
  1335. package/node_modules/@openclaw/fs-safe/dist/root-boundary.js +176 -0
  1336. package/node_modules/@openclaw/fs-safe/dist/root-context.d.ts +40 -0
  1337. package/node_modules/@openclaw/fs-safe/dist/root-context.js +237 -0
  1338. package/node_modules/@openclaw/fs-safe/dist/root-copy.d.ts +18 -0
  1339. package/node_modules/@openclaw/fs-safe/dist/root-copy.js +128 -0
  1340. package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +30 -0
  1341. package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +97 -0
  1342. package/node_modules/@openclaw/fs-safe/dist/root-create-native.d.ts +47 -0
  1343. package/node_modules/@openclaw/fs-safe/dist/root-create-native.js +586 -0
  1344. package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.d.ts +12 -0
  1345. package/node_modules/@openclaw/fs-safe/dist/root-directory-creation.js +229 -0
  1346. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.d.ts +11 -0
  1347. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +31 -0
  1348. package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.d.ts +41 -0
  1349. package/node_modules/@openclaw/fs-safe/dist/root-directory-list-types.js +1 -0
  1350. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +21 -0
  1351. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +462 -0
  1352. package/node_modules/@openclaw/fs-safe/dist/root-directory.d.ts +22 -0
  1353. package/node_modules/@openclaw/fs-safe/dist/root-directory.js +138 -0
  1354. package/node_modules/@openclaw/fs-safe/dist/root-entries.d.ts +10 -0
  1355. package/node_modules/@openclaw/fs-safe/dist/root-entries.js +61 -0
  1356. package/node_modules/@openclaw/fs-safe/dist/root-errors.d.ts +18 -0
  1357. package/node_modules/@openclaw/fs-safe/dist/root-errors.js +156 -0
  1358. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.d.ts +24 -0
  1359. package/node_modules/@openclaw/fs-safe/dist/root-file-final-admission.js +98 -0
  1360. package/node_modules/@openclaw/fs-safe/dist/root-file-open-batch-sync.d.ts +8 -0
  1361. package/node_modules/@openclaw/fs-safe/dist/root-file-open-batch-sync.js +108 -0
  1362. package/node_modules/@openclaw/fs-safe/dist/root-file.d.ts +53 -0
  1363. package/node_modules/@openclaw/fs-safe/dist/root-file.js +216 -0
  1364. package/node_modules/@openclaw/fs-safe/dist/root-handle-context.d.ts +4 -0
  1365. package/node_modules/@openclaw/fs-safe/dist/root-handle-context.js +12 -0
  1366. package/node_modules/@openclaw/fs-safe/dist/root-impl.d.ts +119 -0
  1367. package/node_modules/@openclaw/fs-safe/dist/root-impl.js +1496 -0
  1368. package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.d.ts +2 -0
  1369. package/node_modules/@openclaw/fs-safe/dist/root-mkdir-native.js +258 -0
  1370. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.d.ts +17 -0
  1371. package/node_modules/@openclaw/fs-safe/dist/root-move-noreplace.js +252 -0
  1372. package/node_modules/@openclaw/fs-safe/dist/root-native-creation-path.d.ts +32 -0
  1373. package/node_modules/@openclaw/fs-safe/dist/root-native-creation-path.js +56 -0
  1374. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.d.ts +7 -0
  1375. package/node_modules/@openclaw/fs-safe/dist/root-observed-path.js +88 -0
  1376. package/node_modules/@openclaw/fs-safe/dist/root-options.d.ts +85 -0
  1377. package/node_modules/@openclaw/fs-safe/dist/root-options.js +18 -0
  1378. package/node_modules/@openclaw/fs-safe/dist/root-path-errors.d.ts +12 -0
  1379. package/node_modules/@openclaw/fs-safe/dist/root-path-errors.js +22 -0
  1380. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +16 -0
  1381. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +188 -0
  1382. package/node_modules/@openclaw/fs-safe/dist/root-path-observation.d.ts +55 -0
  1383. package/node_modules/@openclaw/fs-safe/dist/root-path-observation.js +180 -0
  1384. package/node_modules/@openclaw/fs-safe/dist/root-path-stat.d.ts +4 -0
  1385. package/node_modules/@openclaw/fs-safe/dist/root-path-stat.js +134 -0
  1386. package/node_modules/@openclaw/fs-safe/dist/root-path.d.ts +53 -0
  1387. package/node_modules/@openclaw/fs-safe/dist/root-path.js +452 -0
  1388. package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.d.ts +12 -0
  1389. package/node_modules/@openclaw/fs-safe/dist/root-paths-lexical.js +22 -0
  1390. package/node_modules/@openclaw/fs-safe/dist/root-paths.d.ts +58 -0
  1391. package/node_modules/@openclaw/fs-safe/dist/root-paths.js +291 -0
  1392. package/node_modules/@openclaw/fs-safe/dist/root-public-types.d.ts +12 -0
  1393. package/node_modules/@openclaw/fs-safe/dist/root-public-types.js +1 -0
  1394. package/node_modules/@openclaw/fs-safe/dist/root-read-admission.d.ts +25 -0
  1395. package/node_modules/@openclaw/fs-safe/dist/root-read-admission.js +108 -0
  1396. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.d.ts +12 -0
  1397. package/node_modules/@openclaw/fs-safe/dist/root-remove-identity.js +87 -0
  1398. package/node_modules/@openclaw/fs-safe/dist/root-remove-native.d.ts +4 -0
  1399. package/node_modules/@openclaw/fs-safe/dist/root-remove-native.js +390 -0
  1400. package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.d.ts +16 -0
  1401. package/node_modules/@openclaw/fs-safe/dist/root-remove-receipt.js +37 -0
  1402. package/node_modules/@openclaw/fs-safe/dist/root-remove.d.ts +17 -0
  1403. package/node_modules/@openclaw/fs-safe/dist/root-remove.js +468 -0
  1404. package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.d.ts +13 -0
  1405. package/node_modules/@openclaw/fs-safe/dist/root-symlink-policy.js +34 -0
  1406. package/node_modules/@openclaw/fs-safe/dist/root-walk.d.ts +48 -0
  1407. package/node_modules/@openclaw/fs-safe/dist/root-walk.js +236 -0
  1408. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.d.ts +65 -0
  1409. package/node_modules/@openclaw/fs-safe/dist/root-write-admission.js +302 -0
  1410. package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.d.ts +11 -0
  1411. package/node_modules/@openclaw/fs-safe/dist/root-write-compatibility.js +23 -0
  1412. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.d.ts +43 -0
  1413. package/node_modules/@openclaw/fs-safe/dist/root-write-complete-parent.js +180 -0
  1414. package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.d.ts +14 -0
  1415. package/node_modules/@openclaw/fs-safe/dist/root-write-lock-binding.js +162 -0
  1416. package/node_modules/@openclaw/fs-safe/dist/root-write-mode.d.ts +7 -0
  1417. package/node_modules/@openclaw/fs-safe/dist/root-write-mode.js +72 -0
  1418. package/node_modules/@openclaw/fs-safe/dist/root-write-publication.d.ts +23 -0
  1419. package/node_modules/@openclaw/fs-safe/dist/root-write-publication.js +89 -0
  1420. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +20 -0
  1421. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +115 -0
  1422. package/node_modules/@openclaw/fs-safe/dist/root.d.ts +2 -0
  1423. package/node_modules/@openclaw/fs-safe/dist/root.js +1 -0
  1424. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.d.ts +11 -0
  1425. package/node_modules/@openclaw/fs-safe/dist/safe-path-segment.js +76 -0
  1426. package/node_modules/@openclaw/fs-safe/dist/secret-file.d.ts +30 -0
  1427. package/node_modules/@openclaw/fs-safe/dist/secret-file.js +338 -0
  1428. package/node_modules/@openclaw/fs-safe/dist/secret-read-async.d.ts +3 -0
  1429. package/node_modules/@openclaw/fs-safe/dist/secret-read-async.js +58 -0
  1430. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.d.ts +20 -0
  1431. package/node_modules/@openclaw/fs-safe/dist/secret-read-policy.js +68 -0
  1432. package/node_modules/@openclaw/fs-safe/dist/secret.d.ts +3 -0
  1433. package/node_modules/@openclaw/fs-safe/dist/secret.js +3 -0
  1434. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.d.ts +10 -0
  1435. package/node_modules/@openclaw/fs-safe/dist/secure-file-windows.js +81 -0
  1436. package/node_modules/@openclaw/fs-safe/dist/secure-file.d.ts +33 -0
  1437. package/node_modules/@openclaw/fs-safe/dist/secure-file.js +304 -0
  1438. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.d.ts +27 -0
  1439. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +188 -0
  1440. package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.d.ts +34 -0
  1441. package/node_modules/@openclaw/fs-safe/dist/secure-temp-repair.js +110 -0
  1442. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +20 -0
  1443. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +333 -0
  1444. package/node_modules/@openclaw/fs-safe/dist/sibling-temp.d.ts +29 -0
  1445. package/node_modules/@openclaw/fs-safe/dist/sibling-temp.js +136 -0
  1446. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.d.ts +4 -0
  1447. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +471 -0
  1448. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.d.ts +18 -0
  1449. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-context.js +60 -0
  1450. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.d.ts +41 -0
  1451. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission-parser.js +113 -0
  1452. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +33 -0
  1453. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.js +1 -0
  1454. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.d.ts +20 -0
  1455. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-handle.js +48 -0
  1456. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.d.ts +15 -0
  1457. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-policy.js +112 -0
  1458. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.d.ts +64 -0
  1459. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-reclaim.js +356 -0
  1460. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.d.ts +13 -0
  1461. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-registration.js +47 -0
  1462. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
  1463. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
  1464. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.d.ts +2 -0
  1465. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-root.js +79 -0
  1466. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.d.ts +34 -0
  1467. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-stale-admission.js +230 -0
  1468. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.d.ts +7 -0
  1469. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-target.js +62 -0
  1470. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.d.ts +68 -0
  1471. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-types.js +1 -0
  1472. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.d.ts +13 -0
  1473. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +296 -0
  1474. package/node_modules/@openclaw/fs-safe/dist/staged-directory.d.ts +40 -0
  1475. package/node_modules/@openclaw/fs-safe/dist/staged-directory.js +177 -0
  1476. package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.d.ts +17 -0
  1477. package/node_modules/@openclaw/fs-safe/dist/staged-file-settlement.js +65 -0
  1478. package/node_modules/@openclaw/fs-safe/dist/staged-file-types.d.ts +55 -0
  1479. package/node_modules/@openclaw/fs-safe/dist/staged-file-types.js +1 -0
  1480. package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.d.ts +39 -0
  1481. package/node_modules/@openclaw/fs-safe/dist/staged-symlink-types.js +1 -0
  1482. package/node_modules/@openclaw/fs-safe/dist/stat-observation.d.ts +10 -0
  1483. package/node_modules/@openclaw/fs-safe/dist/stat-observation.js +57 -0
  1484. package/node_modules/@openclaw/fs-safe/dist/store.d.ts +3 -0
  1485. package/node_modules/@openclaw/fs-safe/dist/store.js +3 -0
  1486. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.d.ts +7 -0
  1487. package/node_modules/@openclaw/fs-safe/dist/strict-file-identity.js +88 -0
  1488. package/node_modules/@openclaw/fs-safe/dist/string-coerce.d.ts +4 -0
  1489. package/node_modules/@openclaw/fs-safe/dist/string-coerce.js +16 -0
  1490. package/node_modules/@openclaw/fs-safe/dist/suppressed-error.d.ts +5 -0
  1491. package/node_modules/@openclaw/fs-safe/dist/suppressed-error.js +15 -0
  1492. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.d.ts +11 -0
  1493. package/node_modules/@openclaw/fs-safe/dist/symlink-parents.js +109 -0
  1494. package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.d.ts +13 -0
  1495. package/node_modules/@openclaw/fs-safe/dist/temp-cleanup.js +81 -0
  1496. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
  1497. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
  1498. package/node_modules/@openclaw/fs-safe/dist/temp-target.d.ts +31 -0
  1499. package/node_modules/@openclaw/fs-safe/dist/temp-target.js +251 -0
  1500. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.d.ts +14 -0
  1501. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +387 -0
  1502. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +23 -0
  1503. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +146 -0
  1504. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.d.ts +50 -0
  1505. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +344 -0
  1506. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.d.ts +25 -0
  1507. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-owner.js +489 -0
  1508. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.d.ts +9 -0
  1509. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-ownership.js +74 -0
  1510. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.d.ts +43 -0
  1511. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-types.js +1 -0
  1512. package/node_modules/@openclaw/fs-safe/dist/temp.d.ts +3 -0
  1513. package/node_modules/@openclaw/fs-safe/dist/temp.js +2 -0
  1514. package/node_modules/@openclaw/fs-safe/dist/test-hooks.d.ts +36 -0
  1515. package/node_modules/@openclaw/fs-safe/dist/test-hooks.js +14 -0
  1516. package/node_modules/@openclaw/fs-safe/dist/text-atomic.d.ts +10 -0
  1517. package/node_modules/@openclaw/fs-safe/dist/text-atomic.js +18 -0
  1518. package/node_modules/@openclaw/fs-safe/dist/timing.d.ts +8 -0
  1519. package/node_modules/@openclaw/fs-safe/dist/timing.js +59 -0
  1520. package/node_modules/@openclaw/fs-safe/dist/trash.d.ts +4 -0
  1521. package/node_modules/@openclaw/fs-safe/dist/trash.js +249 -0
  1522. package/node_modules/@openclaw/fs-safe/dist/types.d.ts +27 -0
  1523. package/node_modules/@openclaw/fs-safe/dist/types.js +1 -0
  1524. package/node_modules/@openclaw/fs-safe/dist/unicode-path.d.ts +2 -0
  1525. package/node_modules/@openclaw/fs-safe/dist/unicode-path.js +16 -0
  1526. package/node_modules/@openclaw/fs-safe/dist/walk.d.ts +37 -0
  1527. package/node_modules/@openclaw/fs-safe/dist/walk.js +250 -0
  1528. package/node_modules/@openclaw/fs-safe/dist/watch-hints.d.ts +16 -0
  1529. package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +365 -0
  1530. package/node_modules/@openclaw/fs-safe/dist/watch-io-error.d.ts +2 -0
  1531. package/node_modules/@openclaw/fs-safe/dist/watch-io-error.js +27 -0
  1532. package/node_modules/@openclaw/fs-safe/dist/watch-io-worker.d.ts +1 -0
  1533. package/node_modules/@openclaw/fs-safe/dist/watch-io-worker.js +93 -0
  1534. package/node_modules/@openclaw/fs-safe/dist/watch-io.d.ts +47 -0
  1535. package/node_modules/@openclaw/fs-safe/dist/watch-io.js +236 -0
  1536. package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +55 -0
  1537. package/node_modules/@openclaw/fs-safe/dist/watch-native.js +93 -0
  1538. package/node_modules/@openclaw/fs-safe/dist/watch-probe.d.ts +16 -0
  1539. package/node_modules/@openclaw/fs-safe/dist/watch-probe.js +135 -0
  1540. package/node_modules/@openclaw/fs-safe/dist/watch-rescan.d.ts +6 -0
  1541. package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +167 -0
  1542. package/node_modules/@openclaw/fs-safe/dist/watch-scan.d.ts +45 -0
  1543. package/node_modules/@openclaw/fs-safe/dist/watch-scan.js +385 -0
  1544. package/node_modules/@openclaw/fs-safe/dist/watch-stream.d.ts +10 -0
  1545. package/node_modules/@openclaw/fs-safe/dist/watch-stream.js +57 -0
  1546. package/node_modules/@openclaw/fs-safe/dist/watch-types.d.ts +62 -0
  1547. package/node_modules/@openclaw/fs-safe/dist/watch-types.js +1 -0
  1548. package/node_modules/@openclaw/fs-safe/dist/watch.d.ts +5 -0
  1549. package/node_modules/@openclaw/fs-safe/dist/watch.js +667 -0
  1550. package/node_modules/@openclaw/fs-safe/dist/windows-appcontainer.d.ts +5 -0
  1551. package/node_modules/@openclaw/fs-safe/dist/windows-appcontainer.js +39 -0
  1552. package/node_modules/@openclaw/fs-safe/dist/windows-command.d.ts +1 -0
  1553. package/node_modules/@openclaw/fs-safe/dist/windows-command.js +34 -0
  1554. package/node_modules/@openclaw/fs-safe/dist/windows-owner.d.ts +26 -0
  1555. package/node_modules/@openclaw/fs-safe/dist/windows-owner.js +90 -0
  1556. package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.d.ts +47 -0
  1557. package/node_modules/@openclaw/fs-safe/dist/windows-path-alias.js +140 -0
  1558. package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.d.ts +18 -0
  1559. package/node_modules/@openclaw/fs-safe/dist/windows-path-syntax.js +72 -0
  1560. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.d.ts +33 -0
  1561. package/node_modules/@openclaw/fs-safe/dist/windows-security-command.js +433 -0
  1562. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.d.ts +10 -0
  1563. package/node_modules/@openclaw/fs-safe/dist/windows-security-facts.js +117 -0
  1564. package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.d.ts +2 -0
  1565. package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
  1566. package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.js +7 -0
  1567. package/node_modules/@openclaw/fs-safe/dist/windows-test-hooks.d.ts +16 -0
  1568. package/node_modules/@openclaw/fs-safe/dist/windows-test-hooks.js +51 -0
  1569. package/node_modules/@openclaw/fs-safe/dist/write-file-handle.d.ts +13 -0
  1570. package/node_modules/@openclaw/fs-safe/dist/write-file-handle.js +49 -0
  1571. package/node_modules/@openclaw/fs-safe/dist/write-open-flags.d.ts +4 -0
  1572. package/node_modules/@openclaw/fs-safe/dist/write-open-flags.js +27 -0
  1573. package/node_modules/@openclaw/fs-safe/dist/write-queue.d.ts +1 -0
  1574. package/node_modules/@openclaw/fs-safe/dist/write-queue.js +15 -0
  1575. package/node_modules/@openclaw/fs-safe/docs/advanced.md +285 -0
  1576. package/node_modules/@openclaw/fs-safe/docs/archive.md +879 -0
  1577. package/node_modules/@openclaw/fs-safe/docs/assets/readme-banner.jpg +0 -0
  1578. package/node_modules/@openclaw/fs-safe/docs/atomic.md +635 -0
  1579. package/node_modules/@openclaw/fs-safe/docs/compiler-qualification.md +392 -0
  1580. package/node_modules/@openclaw/fs-safe/docs/config.md +204 -0
  1581. package/node_modules/@openclaw/fs-safe/docs/contributing.md +445 -0
  1582. package/node_modules/@openclaw/fs-safe/docs/copy.md +357 -0
  1583. package/node_modules/@openclaw/fs-safe/docs/creation.md +132 -0
  1584. package/node_modules/@openclaw/fs-safe/docs/directory-identity.md +85 -0
  1585. package/node_modules/@openclaw/fs-safe/docs/durability.md +500 -0
  1586. package/node_modules/@openclaw/fs-safe/docs/entries.md +109 -0
  1587. package/node_modules/@openclaw/fs-safe/docs/entry-publication.md +146 -0
  1588. package/node_modules/@openclaw/fs-safe/docs/errors.md +316 -0
  1589. package/node_modules/@openclaw/fs-safe/docs/file-contents.md +68 -0
  1590. package/node_modules/@openclaw/fs-safe/docs/file-store.md +404 -0
  1591. package/node_modules/@openclaw/fs-safe/docs/filename.md +110 -0
  1592. package/node_modules/@openclaw/fs-safe/docs/guest.md +171 -0
  1593. package/node_modules/@openclaw/fs-safe/docs/in-place-write.md +112 -0
  1594. package/node_modules/@openclaw/fs-safe/docs/index.md +58 -0
  1595. package/node_modules/@openclaw/fs-safe/docs/install-path.md +216 -0
  1596. package/node_modules/@openclaw/fs-safe/docs/install.md +251 -0
  1597. package/node_modules/@openclaw/fs-safe/docs/json-store.md +245 -0
  1598. package/node_modules/@openclaw/fs-safe/docs/json.md +229 -0
  1599. package/node_modules/@openclaw/fs-safe/docs/local-roots.md +149 -0
  1600. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +207 -0
  1601. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.6.md +48 -0
  1602. package/node_modules/@openclaw/fs-safe/docs/native-helper.md +209 -0
  1603. package/node_modules/@openclaw/fs-safe/docs/native.md +657 -0
  1604. package/node_modules/@openclaw/fs-safe/docs/output.md +195 -0
  1605. package/node_modules/@openclaw/fs-safe/docs/path-case.md +64 -0
  1606. package/node_modules/@openclaw/fs-safe/docs/path-prefix.md +84 -0
  1607. package/node_modules/@openclaw/fs-safe/docs/path-scope.md +163 -0
  1608. package/node_modules/@openclaw/fs-safe/docs/path-suffix-aliases.md +204 -0
  1609. package/node_modules/@openclaw/fs-safe/docs/path.md +222 -0
  1610. package/node_modules/@openclaw/fs-safe/docs/permissions.md +428 -0
  1611. package/node_modules/@openclaw/fs-safe/docs/pipe.md +81 -0
  1612. package/node_modules/@openclaw/fs-safe/docs/platform-capabilities.md +63 -0
  1613. package/node_modules/@openclaw/fs-safe/docs/positional-read.md +63 -0
  1614. package/node_modules/@openclaw/fs-safe/docs/public-api.md +201 -0
  1615. package/node_modules/@openclaw/fs-safe/docs/queue-link-free-design.md +237 -0
  1616. package/node_modules/@openclaw/fs-safe/docs/quickstart.md +174 -0
  1617. package/node_modules/@openclaw/fs-safe/docs/reading.md +256 -0
  1618. package/node_modules/@openclaw/fs-safe/docs/regular-file.md +195 -0
  1619. package/node_modules/@openclaw/fs-safe/docs/retained-file.md +115 -0
  1620. package/node_modules/@openclaw/fs-safe/docs/root.md +413 -0
  1621. package/node_modules/@openclaw/fs-safe/docs/secret-file.md +322 -0
  1622. package/node_modules/@openclaw/fs-safe/docs/secure-file.md +112 -0
  1623. package/node_modules/@openclaw/fs-safe/docs/security-model.md +428 -0
  1624. package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +659 -0
  1625. package/node_modules/@openclaw/fs-safe/docs/staged-file.md +219 -0
  1626. package/node_modules/@openclaw/fs-safe/docs/staged-symlink.md +124 -0
  1627. package/node_modules/@openclaw/fs-safe/docs/store.md +144 -0
  1628. package/node_modules/@openclaw/fs-safe/docs/temp.md +810 -0
  1629. package/node_modules/@openclaw/fs-safe/docs/testing.md +444 -0
  1630. package/node_modules/@openclaw/fs-safe/docs/timing.md +123 -0
  1631. package/node_modules/@openclaw/fs-safe/docs/types.md +178 -0
  1632. package/node_modules/@openclaw/fs-safe/docs/walk.md +314 -0
  1633. package/node_modules/@openclaw/fs-safe/docs/watch.md +394 -0
  1634. package/node_modules/@openclaw/fs-safe/docs/writing.md +959 -0
  1635. package/node_modules/@openclaw/fs-safe/package.json +219 -0
  1636. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  1637. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +32 -0
  1638. package/node_modules/acpx/LICENSE +21 -0
  1639. package/node_modules/acpx/README.md +142 -0
  1640. package/node_modules/acpx/dist/agent-registry-CxpAF3nI.js +844 -0
  1641. package/node_modules/acpx/dist/agent-registry-CxpAF3nI.js.map +1 -0
  1642. package/node_modules/acpx/dist/agent-registry.d.ts +69 -0
  1643. package/node_modules/acpx/dist/agent-registry.d.ts.map +1 -0
  1644. package/node_modules/acpx/dist/agent-registry.js +1 -0
  1645. package/node_modules/acpx/dist/cli-DeYZhjw6.js +187 -0
  1646. package/node_modules/acpx/dist/cli-DeYZhjw6.js.map +1 -0
  1647. package/node_modules/acpx/dist/cli.d.ts +9 -0
  1648. package/node_modules/acpx/dist/cli.d.ts.map +1 -0
  1649. package/node_modules/acpx/dist/cli.js +2573 -0
  1650. package/node_modules/acpx/dist/cli.js.map +1 -0
  1651. package/node_modules/acpx/dist/client-BqZW_W14.d.ts +217 -0
  1652. package/node_modules/acpx/dist/client-BqZW_W14.d.ts.map +1 -0
  1653. package/node_modules/acpx/dist/flows-Bxlp6H8u.js +2541 -0
  1654. package/node_modules/acpx/dist/flows-Bxlp6H8u.js.map +1 -0
  1655. package/node_modules/acpx/dist/flows.d.ts +344 -0
  1656. package/node_modules/acpx/dist/flows.d.ts.map +1 -0
  1657. package/node_modules/acpx/dist/flows.js +1 -0
  1658. package/node_modules/acpx/dist/invocation-options-8lEkbe7g.js +349 -0
  1659. package/node_modules/acpx/dist/invocation-options-8lEkbe7g.js.map +1 -0
  1660. package/node_modules/acpx/dist/ipc-CQUNQ8QQ.js +5304 -0
  1661. package/node_modules/acpx/dist/ipc-CQUNQ8QQ.js.map +1 -0
  1662. package/node_modules/acpx/dist/output-C_T39Ap1.js +1055 -0
  1663. package/node_modules/acpx/dist/output-C_T39Ap1.js.map +1 -0
  1664. package/node_modules/acpx/dist/queue-owner-runtime-ucHvXJ33.js +8387 -0
  1665. package/node_modules/acpx/dist/queue-owner-runtime-ucHvXJ33.js.map +1 -0
  1666. package/node_modules/acpx/dist/runtime.d.ts +899 -0
  1667. package/node_modules/acpx/dist/runtime.d.ts.map +1 -0
  1668. package/node_modules/acpx/dist/runtime.js +2896 -0
  1669. package/node_modules/acpx/dist/runtime.js.map +1 -0
  1670. package/node_modules/acpx/dist/session-options-D9KL7-d8.d.ts +371 -0
  1671. package/node_modules/acpx/dist/session-options-D9KL7-d8.d.ts.map +1 -0
  1672. package/node_modules/acpx/dist/session-watch-D0YvKsnQ.js +75 -0
  1673. package/node_modules/acpx/dist/session-watch-D0YvKsnQ.js.map +1 -0
  1674. package/node_modules/acpx/dist/watch-CXy2A5VY.js +84 -0
  1675. package/node_modules/acpx/dist/watch-CXy2A5VY.js.map +1 -0
  1676. package/node_modules/acpx/package.json +131 -0
  1677. package/node_modules/acpx/skills/acpx/SKILL.md +722 -0
  1678. package/node_modules/b4a/LICENSE +201 -0
  1679. package/node_modules/b4a/README.md +153 -0
  1680. package/node_modules/b4a/browser.js +546 -0
  1681. package/node_modules/b4a/index.d.ts +144 -0
  1682. package/node_modules/b4a/index.js +193 -0
  1683. package/node_modules/b4a/lib/ascii.js +31 -0
  1684. package/node_modules/b4a/lib/base64.js +64 -0
  1685. package/node_modules/b4a/lib/hex.js +51 -0
  1686. package/node_modules/b4a/lib/latin1.js +31 -0
  1687. package/node_modules/b4a/lib/utf16le.js +40 -0
  1688. package/node_modules/b4a/lib/utf8.js +144 -0
  1689. package/node_modules/b4a/package.json +54 -0
  1690. package/node_modules/b4a/react-native.js +5 -0
  1691. package/node_modules/b4a/runtime.d.ts +14 -0
  1692. package/node_modules/bare-buffer/CMakeLists.txt +20 -0
  1693. package/node_modules/bare-buffer/LICENSE +201 -0
  1694. package/node_modules/bare-buffer/README.md +30 -0
  1695. package/node_modules/bare-buffer/binding.c +2041 -0
  1696. package/node_modules/bare-buffer/binding.js +1 -0
  1697. package/node_modules/bare-buffer/global.d.ts +21 -0
  1698. package/node_modules/bare-buffer/global.js +6 -0
  1699. package/node_modules/bare-buffer/index.d.ts +769 -0
  1700. package/node_modules/bare-buffer/index.js +1339 -0
  1701. package/node_modules/bare-buffer/lib/ascii.js +36 -0
  1702. package/node_modules/bare-buffer/lib/base64.js +25 -0
  1703. package/node_modules/bare-buffer/lib/base64url.js +25 -0
  1704. package/node_modules/bare-buffer/lib/checked.js +23 -0
  1705. package/node_modules/bare-buffer/lib/constants.d.ts +7 -0
  1706. package/node_modules/bare-buffer/lib/constants.js +3 -0
  1707. package/node_modules/bare-buffer/lib/hex.js +20 -0
  1708. package/node_modules/bare-buffer/lib/latin1.js +14 -0
  1709. package/node_modules/bare-buffer/lib/utf16le.js +20 -0
  1710. package/node_modules/bare-buffer/lib/utf8.js +18 -0
  1711. package/node_modules/bare-buffer/package.json +59 -0
  1712. package/node_modules/bare-buffer/prebuilds/android-arm/bare-buffer.bare +0 -0
  1713. package/node_modules/bare-buffer/prebuilds/android-arm64/bare-buffer.bare +0 -0
  1714. package/node_modules/bare-buffer/prebuilds/android-ia32/bare-buffer.bare +0 -0
  1715. package/node_modules/bare-buffer/prebuilds/android-x64/bare-buffer.bare +0 -0
  1716. package/node_modules/bare-buffer/prebuilds/darwin-arm64/bare-buffer.bare +0 -0
  1717. package/node_modules/bare-buffer/prebuilds/darwin-x64/bare-buffer.bare +0 -0
  1718. package/node_modules/bare-buffer/prebuilds/ios-arm64/bare-buffer.bare +0 -0
  1719. package/node_modules/bare-buffer/prebuilds/ios-arm64-simulator/bare-buffer.bare +0 -0
  1720. package/node_modules/bare-buffer/prebuilds/ios-x64-simulator/bare-buffer.bare +0 -0
  1721. package/node_modules/bare-buffer/prebuilds/linux-arm64/bare-buffer.bare +0 -0
  1722. package/node_modules/bare-buffer/prebuilds/linux-x64/bare-buffer.bare +0 -0
  1723. package/node_modules/bare-buffer/prebuilds/win32-arm64/bare-buffer.bare +0 -0
  1724. package/node_modules/bare-buffer/prebuilds/win32-x64/bare-buffer.bare +0 -0
  1725. package/node_modules/bare-events/LICENSE +201 -0
  1726. package/node_modules/bare-events/README.md +29 -0
  1727. package/node_modules/bare-events/global.d.ts +15 -0
  1728. package/node_modules/bare-events/global.js +5 -0
  1729. package/node_modules/bare-events/index.d.ts +246 -0
  1730. package/node_modules/bare-events/index.js +423 -0
  1731. package/node_modules/bare-events/lib/errors.js +23 -0
  1732. package/node_modules/bare-events/package.json +63 -0
  1733. package/node_modules/bare-events/web.d.ts +108 -0
  1734. package/node_modules/bare-events/web.js +417 -0
  1735. package/node_modules/bare-fs/CMakeLists.txt +13 -0
  1736. package/node_modules/bare-fs/LICENSE +201 -0
  1737. package/node_modules/bare-fs/README.md +33 -0
  1738. package/node_modules/bare-fs/binding.c +3055 -0
  1739. package/node_modules/bare-fs/binding.js +1 -0
  1740. package/node_modules/bare-fs/index.d.ts +1504 -0
  1741. package/node_modules/bare-fs/index.js +2902 -0
  1742. package/node_modules/bare-fs/lib/constants.d.ts +50 -0
  1743. package/node_modules/bare-fs/lib/constants.js +49 -0
  1744. package/node_modules/bare-fs/lib/errors.d.ts +13 -0
  1745. package/node_modules/bare-fs/lib/errors.js +55 -0
  1746. package/node_modules/bare-fs/lib/queue.js +29 -0
  1747. package/node_modules/bare-fs/package.json +74 -0
  1748. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  1749. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  1750. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  1751. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  1752. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  1753. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  1754. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  1755. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  1756. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  1757. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  1758. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  1759. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  1760. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  1761. package/node_modules/bare-fs/promises.d.ts +480 -0
  1762. package/node_modules/bare-fs/promises.js +119 -0
  1763. package/node_modules/bare-path/CMakeLists.txt +13 -0
  1764. package/node_modules/bare-path/LICENSE +201 -0
  1765. package/node_modules/bare-path/NOTICE +28 -0
  1766. package/node_modules/bare-path/README.md +27 -0
  1767. package/node_modules/bare-path/binding.c +127 -0
  1768. package/node_modules/bare-path/binding.js +1 -0
  1769. package/node_modules/bare-path/index.d.ts +91 -0
  1770. package/node_modules/bare-path/index.js +9 -0
  1771. package/node_modules/bare-path/lib/constants.js +11 -0
  1772. package/node_modules/bare-path/lib/posix.js +263 -0
  1773. package/node_modules/bare-path/lib/shared.js +81 -0
  1774. package/node_modules/bare-path/lib/win32.js +564 -0
  1775. package/node_modules/bare-path/package.json +47 -0
  1776. package/node_modules/bare-path/prebuilds/android-arm/bare-path.bare +0 -0
  1777. package/node_modules/bare-path/prebuilds/android-arm64/bare-path.bare +0 -0
  1778. package/node_modules/bare-path/prebuilds/android-ia32/bare-path.bare +0 -0
  1779. package/node_modules/bare-path/prebuilds/android-x64/bare-path.bare +0 -0
  1780. package/node_modules/bare-path/prebuilds/darwin-arm64/bare-path.bare +0 -0
  1781. package/node_modules/bare-path/prebuilds/darwin-x64/bare-path.bare +0 -0
  1782. package/node_modules/bare-path/prebuilds/ios-arm64/bare-path.bare +0 -0
  1783. package/node_modules/bare-path/prebuilds/ios-arm64-simulator/bare-path.bare +0 -0
  1784. package/node_modules/bare-path/prebuilds/ios-x64-simulator/bare-path.bare +0 -0
  1785. package/node_modules/bare-path/prebuilds/linux-arm64/bare-path.bare +0 -0
  1786. package/node_modules/bare-path/prebuilds/linux-x64/bare-path.bare +0 -0
  1787. package/node_modules/bare-path/prebuilds/win32-arm64/bare-path.bare +0 -0
  1788. package/node_modules/bare-path/prebuilds/win32-x64/bare-path.bare +0 -0
  1789. package/node_modules/bare-stream/LICENSE +201 -0
  1790. package/node_modules/bare-stream/README.md +354 -0
  1791. package/node_modules/bare-stream/global.d.ts +31 -0
  1792. package/node_modules/bare-stream/global.js +15 -0
  1793. package/node_modules/bare-stream/index.d.ts +235 -0
  1794. package/node_modules/bare-stream/index.js +493 -0
  1795. package/node_modules/bare-stream/package.json +75 -0
  1796. package/node_modules/bare-stream/promises.js +3 -0
  1797. package/node_modules/bare-stream/web.d.ts +152 -0
  1798. package/node_modules/bare-stream/web.js +607 -0
  1799. package/node_modules/bare-url/CMakeLists.txt +36 -0
  1800. package/node_modules/bare-url/LICENSE +201 -0
  1801. package/node_modules/bare-url/README.md +37 -0
  1802. package/node_modules/bare-url/binding.c +465 -0
  1803. package/node_modules/bare-url/binding.js +1 -0
  1804. package/node_modules/bare-url/global.d.ts +24 -0
  1805. package/node_modules/bare-url/global.js +2 -0
  1806. package/node_modules/bare-url/index.d.ts +115 -0
  1807. package/node_modules/bare-url/index.js +734 -0
  1808. package/node_modules/bare-url/lib/errors.d.ts +10 -0
  1809. package/node_modules/bare-url/lib/errors.js +37 -0
  1810. package/node_modules/bare-url/lib/url-search-params.d.ts +66 -0
  1811. package/node_modules/bare-url/lib/url-search-params.js +291 -0
  1812. package/node_modules/bare-url/package.json +55 -0
  1813. package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
  1814. package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
  1815. package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
  1816. package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
  1817. package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
  1818. package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
  1819. package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
  1820. package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
  1821. package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
  1822. package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
  1823. package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
  1824. package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
  1825. package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
  1826. package/node_modules/commander/LICENSE +22 -0
  1827. package/node_modules/commander/Readme.md +1146 -0
  1828. package/node_modules/commander/index.js +21 -0
  1829. package/node_modules/commander/lib/argument.js +147 -0
  1830. package/node_modules/commander/lib/command.js +2803 -0
  1831. package/node_modules/commander/lib/error.js +36 -0
  1832. package/node_modules/commander/lib/help.js +735 -0
  1833. package/node_modules/commander/lib/option.js +377 -0
  1834. package/node_modules/commander/lib/suggestSimilar.js +99 -0
  1835. package/node_modules/commander/package-support.json +19 -0
  1836. package/node_modules/commander/package.json +65 -0
  1837. package/node_modules/commander/typings/index.d.ts +1116 -0
  1838. package/node_modules/core-util-is/LICENSE +19 -0
  1839. package/node_modules/core-util-is/README.md +3 -0
  1840. package/node_modules/core-util-is/lib/util.js +107 -0
  1841. package/node_modules/core-util-is/package.json +38 -0
  1842. package/node_modules/esbuild/LICENSE.md +21 -0
  1843. package/node_modules/esbuild/README.md +3 -0
  1844. package/node_modules/esbuild/bin/esbuild +223 -0
  1845. package/node_modules/esbuild/install.js +300 -0
  1846. package/node_modules/esbuild/lib/main.d.ts +720 -0
  1847. package/node_modules/esbuild/lib/main.js +2536 -0
  1848. package/node_modules/esbuild/package.json +74 -0
  1849. package/node_modules/events-universal/LICENSE +201 -0
  1850. package/node_modules/events-universal/README.md +17 -0
  1851. package/node_modules/events-universal/bare.js +1 -0
  1852. package/node_modules/events-universal/default.js +1 -0
  1853. package/node_modules/events-universal/index.js +1 -0
  1854. package/node_modules/events-universal/package.json +39 -0
  1855. package/node_modules/events-universal/react-native.js +1 -0
  1856. package/node_modules/fast-fifo/LICENSE +21 -0
  1857. package/node_modules/fast-fifo/README.md +78 -0
  1858. package/node_modules/fast-fifo/fixed-size.js +39 -0
  1859. package/node_modules/fast-fifo/index.js +48 -0
  1860. package/node_modules/fast-fifo/package.json +28 -0
  1861. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  1862. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  1863. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  1864. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  1865. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  1866. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  1867. package/node_modules/fast-string-truncated-width/license +21 -0
  1868. package/node_modules/fast-string-truncated-width/package.json +35 -0
  1869. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  1870. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  1871. package/node_modules/fast-string-width/dist/index.js +14 -0
  1872. package/node_modules/fast-string-width/license +21 -0
  1873. package/node_modules/fast-string-width/package.json +34 -0
  1874. package/node_modules/fast-string-width/readme.md +42 -0
  1875. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  1876. package/node_modules/fast-wrap-ansi/README.md +26 -0
  1877. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  1878. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  1879. package/node_modules/fast-wrap-ansi/package.json +51 -0
  1880. package/node_modules/immediate/LICENSE.txt +20 -0
  1881. package/node_modules/immediate/README.md +93 -0
  1882. package/node_modules/immediate/dist/immediate.js +75 -0
  1883. package/node_modules/immediate/dist/immediate.min.js +1 -0
  1884. package/node_modules/immediate/lib/browser.js +69 -0
  1885. package/node_modules/immediate/lib/index.js +73 -0
  1886. package/node_modules/immediate/package.json +42 -0
  1887. package/node_modules/inherits/LICENSE +16 -0
  1888. package/node_modules/inherits/README.md +42 -0
  1889. package/node_modules/inherits/inherits.js +9 -0
  1890. package/node_modules/inherits/inherits_browser.js +27 -0
  1891. package/node_modules/inherits/package.json +29 -0
  1892. package/node_modules/isarray/.npmignore +1 -0
  1893. package/node_modules/isarray/.travis.yml +4 -0
  1894. package/node_modules/isarray/Makefile +6 -0
  1895. package/node_modules/isarray/README.md +60 -0
  1896. package/node_modules/isarray/component.json +19 -0
  1897. package/node_modules/isarray/index.js +5 -0
  1898. package/node_modules/isarray/package.json +45 -0
  1899. package/node_modules/isarray/test.js +20 -0
  1900. package/node_modules/jszip/.codeclimate.yml +16 -0
  1901. package/node_modules/jszip/.editorconfig +8 -0
  1902. package/node_modules/jszip/.eslintrc.js +43 -0
  1903. package/node_modules/jszip/.github/FUNDING.yml +1 -0
  1904. package/node_modules/jszip/.github/actions/setup/action.yml +23 -0
  1905. package/node_modules/jszip/.github/workflows/benchmark.yml +38 -0
  1906. package/node_modules/jszip/.github/workflows/main.yml +55 -0
  1907. package/node_modules/jszip/CHANGES.md +210 -0
  1908. package/node_modules/jszip/LICENSE.markdown +651 -0
  1909. package/node_modules/jszip/README.markdown +33 -0
  1910. package/node_modules/jszip/dist/jszip.js +11586 -0
  1911. package/node_modules/jszip/dist/jszip.min.js +13 -0
  1912. package/node_modules/jszip/index.d.ts +344 -0
  1913. package/node_modules/jszip/lib/base64.js +106 -0
  1914. package/node_modules/jszip/lib/compressedObject.js +74 -0
  1915. package/node_modules/jszip/lib/compressions.js +14 -0
  1916. package/node_modules/jszip/lib/crc32.js +77 -0
  1917. package/node_modules/jszip/lib/defaults.js +11 -0
  1918. package/node_modules/jszip/lib/external.js +18 -0
  1919. package/node_modules/jszip/lib/flate.js +85 -0
  1920. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  1921. package/node_modules/jszip/lib/generate/index.js +57 -0
  1922. package/node_modules/jszip/lib/index.js +55 -0
  1923. package/node_modules/jszip/lib/license_header.js +11 -0
  1924. package/node_modules/jszip/lib/load.js +88 -0
  1925. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  1926. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  1927. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  1928. package/node_modules/jszip/lib/object.js +384 -0
  1929. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  1930. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  1931. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  1932. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  1933. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  1934. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  1935. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  1936. package/node_modules/jszip/lib/signature.js +7 -0
  1937. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  1938. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  1939. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  1940. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  1941. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  1942. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  1943. package/node_modules/jszip/lib/support.js +38 -0
  1944. package/node_modules/jszip/lib/utf8.js +275 -0
  1945. package/node_modules/jszip/lib/utils.js +510 -0
  1946. package/node_modules/jszip/lib/zipEntries.js +261 -0
  1947. package/node_modules/jszip/lib/zipEntry.js +293 -0
  1948. package/node_modules/jszip/lib/zipObject.js +133 -0
  1949. package/node_modules/jszip/package.json +67 -0
  1950. package/node_modules/jszip/sponsors.md +21 -0
  1951. package/node_modules/jszip/tsconfig.json +101 -0
  1952. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  1953. package/node_modules/lie/README.md +62 -0
  1954. package/node_modules/lie/dist/lie.js +350 -0
  1955. package/node_modules/lie/dist/lie.min.js +1 -0
  1956. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  1957. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  1958. package/node_modules/lie/lib/browser.js +273 -0
  1959. package/node_modules/lie/lib/index.js +298 -0
  1960. package/node_modules/lie/license.md +7 -0
  1961. package/node_modules/lie/lie.d.ts +244 -0
  1962. package/node_modules/lie/package.json +69 -0
  1963. package/node_modules/lie/polyfill.js +4 -0
  1964. package/node_modules/pako/LICENSE +21 -0
  1965. package/node_modules/pako/README.md +191 -0
  1966. package/node_modules/pako/dist/pako.js +6818 -0
  1967. package/node_modules/pako/dist/pako.min.js +1 -0
  1968. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  1969. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  1970. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  1971. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  1972. package/node_modules/pako/index.js +14 -0
  1973. package/node_modules/pako/lib/deflate.js +400 -0
  1974. package/node_modules/pako/lib/inflate.js +423 -0
  1975. package/node_modules/pako/lib/utils/common.js +105 -0
  1976. package/node_modules/pako/lib/utils/strings.js +187 -0
  1977. package/node_modules/pako/lib/zlib/README +59 -0
  1978. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  1979. package/node_modules/pako/lib/zlib/constants.js +68 -0
  1980. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  1981. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  1982. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  1983. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  1984. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  1985. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  1986. package/node_modules/pako/lib/zlib/messages.js +32 -0
  1987. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  1988. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  1989. package/node_modules/pako/package.json +44 -0
  1990. package/node_modules/process-nextick-args/index.js +45 -0
  1991. package/node_modules/process-nextick-args/license.md +19 -0
  1992. package/node_modules/process-nextick-args/package.json +25 -0
  1993. package/node_modules/process-nextick-args/readme.md +18 -0
  1994. package/node_modules/readable-stream/.travis.yml +34 -0
  1995. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  1996. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  1997. package/node_modules/readable-stream/LICENSE +47 -0
  1998. package/node_modules/readable-stream/README.md +58 -0
  1999. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  2000. package/node_modules/readable-stream/duplex-browser.js +1 -0
  2001. package/node_modules/readable-stream/duplex.js +1 -0
  2002. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  2003. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  2004. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  2005. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  2006. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  2007. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  2008. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  2009. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  2010. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  2011. package/node_modules/readable-stream/package.json +52 -0
  2012. package/node_modules/readable-stream/passthrough.js +1 -0
  2013. package/node_modules/readable-stream/readable-browser.js +7 -0
  2014. package/node_modules/readable-stream/readable.js +19 -0
  2015. package/node_modules/readable-stream/transform.js +1 -0
  2016. package/node_modules/readable-stream/writable-browser.js +1 -0
  2017. package/node_modules/readable-stream/writable.js +8 -0
  2018. package/node_modules/safe-buffer/LICENSE +21 -0
  2019. package/node_modules/safe-buffer/README.md +584 -0
  2020. package/node_modules/safe-buffer/index.d.ts +187 -0
  2021. package/node_modules/safe-buffer/index.js +62 -0
  2022. package/node_modules/safe-buffer/package.json +37 -0
  2023. package/node_modules/setimmediate/LICENSE.txt +20 -0
  2024. package/node_modules/setimmediate/package.json +30 -0
  2025. package/node_modules/setimmediate/setImmediate.js +186 -0
  2026. package/node_modules/sisteransi/dist/index.d.ts +33 -0
  2027. package/node_modules/sisteransi/dist/index.js +57 -0
  2028. package/node_modules/sisteransi/license +21 -0
  2029. package/node_modules/sisteransi/package.json +45 -0
  2030. package/node_modules/sisteransi/readme.md +126 -0
  2031. package/node_modules/skillflag/LICENSE +21 -0
  2032. package/node_modules/skillflag/README.md +44 -0
  2033. package/node_modules/skillflag/dist/bin/skill-install.d.ts +3 -0
  2034. package/node_modules/skillflag/dist/bin/skill-install.d.ts.map +1 -0
  2035. package/node_modules/skillflag/dist/bin/skill-install.js +6 -0
  2036. package/node_modules/skillflag/dist/bin/skill-install.js.map +1 -0
  2037. package/node_modules/skillflag/dist/bin/skillflag.d.ts +3 -0
  2038. package/node_modules/skillflag/dist/bin/skillflag.d.ts.map +1 -0
  2039. package/node_modules/skillflag/dist/bin/skillflag.js +25 -0
  2040. package/node_modules/skillflag/dist/bin/skillflag.js.map +1 -0
  2041. package/node_modules/skillflag/dist/core/digest.d.ts +2 -0
  2042. package/node_modules/skillflag/dist/core/digest.d.ts.map +1 -0
  2043. package/node_modules/skillflag/dist/core/digest.js +15 -0
  2044. package/node_modules/skillflag/dist/core/digest.js.map +1 -0
  2045. package/node_modules/skillflag/dist/core/errors.d.ts +6 -0
  2046. package/node_modules/skillflag/dist/core/errors.d.ts.map +1 -0
  2047. package/node_modules/skillflag/dist/core/errors.js +13 -0
  2048. package/node_modules/skillflag/dist/core/errors.js.map +1 -0
  2049. package/node_modules/skillflag/dist/core/export.d.ts +2 -0
  2050. package/node_modules/skillflag/dist/core/export.d.ts.map +1 -0
  2051. package/node_modules/skillflag/dist/core/export.js +28 -0
  2052. package/node_modules/skillflag/dist/core/export.js.map +1 -0
  2053. package/node_modules/skillflag/dist/core/list.d.ts +21 -0
  2054. package/node_modules/skillflag/dist/core/list.d.ts.map +1 -0
  2055. package/node_modules/skillflag/dist/core/list.js +71 -0
  2056. package/node_modules/skillflag/dist/core/list.js.map +1 -0
  2057. package/node_modules/skillflag/dist/core/paths.d.ts +15 -0
  2058. package/node_modules/skillflag/dist/core/paths.d.ts.map +1 -0
  2059. package/node_modules/skillflag/dist/core/paths.js +149 -0
  2060. package/node_modules/skillflag/dist/core/paths.js.map +1 -0
  2061. package/node_modules/skillflag/dist/core/show.d.ts +2 -0
  2062. package/node_modules/skillflag/dist/core/show.d.ts.map +1 -0
  2063. package/node_modules/skillflag/dist/core/show.js +8 -0
  2064. package/node_modules/skillflag/dist/core/show.js.map +1 -0
  2065. package/node_modules/skillflag/dist/core/skillflag.d.ts +3 -0
  2066. package/node_modules/skillflag/dist/core/skillflag.d.ts.map +1 -0
  2067. package/node_modules/skillflag/dist/core/skillflag.js +2 -0
  2068. package/node_modules/skillflag/dist/core/skillflag.js.map +1 -0
  2069. package/node_modules/skillflag/dist/core/tar.d.ts +16 -0
  2070. package/node_modules/skillflag/dist/core/tar.d.ts.map +1 -0
  2071. package/node_modules/skillflag/dist/core/tar.js +140 -0
  2072. package/node_modules/skillflag/dist/core/tar.js.map +1 -0
  2073. package/node_modules/skillflag/dist/index.d.ts +5 -0
  2074. package/node_modules/skillflag/dist/index.d.ts.map +1 -0
  2075. package/node_modules/skillflag/dist/index.js +3 -0
  2076. package/node_modules/skillflag/dist/index.js.map +1 -0
  2077. package/node_modules/skillflag/dist/install/cli.d.ts +57 -0
  2078. package/node_modules/skillflag/dist/install/cli.d.ts.map +1 -0
  2079. package/node_modules/skillflag/dist/install/cli.js +653 -0
  2080. package/node_modules/skillflag/dist/install/cli.js.map +1 -0
  2081. package/node_modules/skillflag/dist/install/copy.d.ts +2 -0
  2082. package/node_modules/skillflag/dist/install/copy.d.ts.map +1 -0
  2083. package/node_modules/skillflag/dist/install/copy.js +19 -0
  2084. package/node_modules/skillflag/dist/install/copy.js.map +1 -0
  2085. package/node_modules/skillflag/dist/install/errors.d.ts +6 -0
  2086. package/node_modules/skillflag/dist/install/errors.d.ts.map +1 -0
  2087. package/node_modules/skillflag/dist/install/errors.js +13 -0
  2088. package/node_modules/skillflag/dist/install/errors.js.map +1 -0
  2089. package/node_modules/skillflag/dist/install/extract.d.ts +3 -0
  2090. package/node_modules/skillflag/dist/install/extract.d.ts.map +1 -0
  2091. package/node_modules/skillflag/dist/install/extract.js +76 -0
  2092. package/node_modules/skillflag/dist/install/extract.js.map +1 -0
  2093. package/node_modules/skillflag/dist/install/install.d.ts +21 -0
  2094. package/node_modules/skillflag/dist/install/install.d.ts.map +1 -0
  2095. package/node_modules/skillflag/dist/install/install.js +35 -0
  2096. package/node_modules/skillflag/dist/install/install.js.map +1 -0
  2097. package/node_modules/skillflag/dist/install/resolve.d.ts +12 -0
  2098. package/node_modules/skillflag/dist/install/resolve.d.ts.map +1 -0
  2099. package/node_modules/skillflag/dist/install/resolve.js +119 -0
  2100. package/node_modules/skillflag/dist/install/resolve.js.map +1 -0
  2101. package/node_modules/skillflag/dist/install/validate.d.ts +7 -0
  2102. package/node_modules/skillflag/dist/install/validate.d.ts.map +1 -0
  2103. package/node_modules/skillflag/dist/install/validate.js +28 -0
  2104. package/node_modules/skillflag/dist/install/validate.js.map +1 -0
  2105. package/node_modules/skillflag/dist/shared/frontmatter.d.ts +2 -0
  2106. package/node_modules/skillflag/dist/shared/frontmatter.d.ts.map +1 -0
  2107. package/node_modules/skillflag/dist/shared/frontmatter.js +28 -0
  2108. package/node_modules/skillflag/dist/shared/frontmatter.js.map +1 -0
  2109. package/node_modules/skillflag/dist/skillflag.d.ts +29 -0
  2110. package/node_modules/skillflag/dist/skillflag.d.ts.map +1 -0
  2111. package/node_modules/skillflag/dist/skillflag.js +230 -0
  2112. package/node_modules/skillflag/dist/skillflag.js.map +1 -0
  2113. package/node_modules/skillflag/dist/utils/collections.d.ts +3 -0
  2114. package/node_modules/skillflag/dist/utils/collections.d.ts.map +1 -0
  2115. package/node_modules/skillflag/dist/utils/collections.js +18 -0
  2116. package/node_modules/skillflag/dist/utils/collections.js.map +1 -0
  2117. package/node_modules/skillflag/package.json +78 -0
  2118. package/node_modules/skillflag/skills/skillflag/SKILL.md +144 -0
  2119. package/node_modules/streamx/LICENSE +21 -0
  2120. package/node_modules/streamx/README.md +550 -0
  2121. package/node_modules/streamx/index.d.ts +198 -0
  2122. package/node_modules/streamx/index.js +1314 -0
  2123. package/node_modules/streamx/lib/errors.d.ts +13 -0
  2124. package/node_modules/streamx/lib/errors.js +47 -0
  2125. package/node_modules/streamx/package.json +51 -0
  2126. package/node_modules/streamx/runtime.d.ts +55 -0
  2127. package/node_modules/string_decoder/.travis.yml +50 -0
  2128. package/node_modules/string_decoder/LICENSE +48 -0
  2129. package/node_modules/string_decoder/README.md +47 -0
  2130. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  2131. package/node_modules/string_decoder/package.json +31 -0
  2132. package/node_modules/tar-stream/LICENSE +21 -0
  2133. package/node_modules/tar-stream/README.md +183 -0
  2134. package/node_modules/tar-stream/constants.js +14 -0
  2135. package/node_modules/tar-stream/extract.js +439 -0
  2136. package/node_modules/tar-stream/headers.js +322 -0
  2137. package/node_modules/tar-stream/index.d.ts +60 -0
  2138. package/node_modules/tar-stream/index.js +2 -0
  2139. package/node_modules/tar-stream/pack.js +287 -0
  2140. package/node_modules/tar-stream/package.json +50 -0
  2141. package/node_modules/teex/LICENSE +21 -0
  2142. package/node_modules/teex/README.md +31 -0
  2143. package/node_modules/teex/example.js +16 -0
  2144. package/node_modules/teex/index.js +52 -0
  2145. package/node_modules/teex/package.json +26 -0
  2146. package/node_modules/teex/test.js +68 -0
  2147. package/node_modules/text-decoder/LICENSE +201 -0
  2148. package/node_modules/text-decoder/README.md +36 -0
  2149. package/node_modules/text-decoder/index.js +64 -0
  2150. package/node_modules/text-decoder/lib/pass-through-decoder.js +19 -0
  2151. package/node_modules/text-decoder/lib/utf8-decoder.js +185 -0
  2152. package/node_modules/text-decoder/package.json +39 -0
  2153. package/node_modules/tsx/LICENSE +21 -0
  2154. package/node_modules/tsx/README.md +32 -0
  2155. package/node_modules/tsx/dist/cjs/api/index.cjs +2 -0
  2156. package/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
  2157. package/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
  2158. package/node_modules/tsx/dist/cjs/api/index.mjs +2 -0
  2159. package/node_modules/tsx/dist/cjs/index.cjs +1 -0
  2160. package/node_modules/tsx/dist/cli.mjs +55 -0
  2161. package/node_modules/tsx/dist/client-XItNFmsq.cjs +1 -0
  2162. package/node_modules/tsx/dist/esm/api/index.cjs +2 -0
  2163. package/node_modules/tsx/dist/esm/api/index.d.cts +37 -0
  2164. package/node_modules/tsx/dist/esm/api/index.d.mts +37 -0
  2165. package/node_modules/tsx/dist/esm/api/index.mjs +2 -0
  2166. package/node_modules/tsx/dist/esm/index.mjs +2 -0
  2167. package/node_modules/tsx/dist/index-Bqjv9TxC.mjs +1 -0
  2168. package/node_modules/tsx/dist/index-DE3OBZuV.mjs +14 -0
  2169. package/node_modules/tsx/dist/lexer-CGfpMDSb.cjs +3 -0
  2170. package/node_modules/tsx/dist/lexer-CanA6ArK.mjs +3 -0
  2171. package/node_modules/tsx/dist/loader.mjs +2 -0
  2172. package/node_modules/tsx/dist/package-Dj0mHsMt.mjs +1 -0
  2173. package/node_modules/tsx/dist/patch-repl.cjs +1 -0
  2174. package/node_modules/tsx/dist/preflight.cjs +1 -0
  2175. package/node_modules/tsx/dist/register-B1c7OH6V.cjs +23 -0
  2176. package/node_modules/tsx/dist/register-nyXW-TH3.mjs +2 -0
  2177. package/node_modules/tsx/dist/repl.mjs +4 -0
  2178. package/node_modules/tsx/dist/require-CBjy4Foe.mjs +10 -0
  2179. package/node_modules/tsx/dist/require-CVaYn9z3.cjs +1 -0
  2180. package/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
  2181. package/node_modules/tsx/dist/temporary-directory-Du7LpLp9.mjs +1 -0
  2182. package/node_modules/tsx/package.json +70 -0
  2183. package/node_modules/util-deprecate/History.md +16 -0
  2184. package/node_modules/util-deprecate/LICENSE +24 -0
  2185. package/node_modules/util-deprecate/README.md +53 -0
  2186. package/node_modules/util-deprecate/browser.js +67 -0
  2187. package/node_modules/util-deprecate/node.js +6 -0
  2188. package/node_modules/util-deprecate/package.json +27 -0
  2189. package/node_modules/zod/LICENSE +21 -0
  2190. package/node_modules/zod/README.md +218 -0
  2191. package/node_modules/zod/compile.cjs +96 -0
  2192. package/node_modules/zod/compile.d.cts +1 -0
  2193. package/node_modules/zod/compile.d.ts +1 -0
  2194. package/node_modules/zod/compile.js +52 -0
  2195. package/node_modules/zod/index.cjs +52 -0
  2196. package/node_modules/zod/index.d.cts +3 -0
  2197. package/node_modules/zod/index.d.ts +3 -0
  2198. package/node_modules/zod/index.js +7 -0
  2199. package/node_modules/zod/locales/index.cjs +36 -0
  2200. package/node_modules/zod/locales/index.d.cts +1 -0
  2201. package/node_modules/zod/locales/index.d.ts +1 -0
  2202. package/node_modules/zod/locales/index.js +1 -0
  2203. package/node_modules/zod/locales/package.json +7 -0
  2204. package/node_modules/zod/mini/index.cjs +51 -0
  2205. package/node_modules/zod/mini/index.d.cts +3 -0
  2206. package/node_modules/zod/mini/index.d.ts +3 -0
  2207. package/node_modules/zod/mini/index.js +3 -0
  2208. package/node_modules/zod/mini/package.json +7 -0
  2209. package/node_modules/zod/package.json +147 -0
  2210. package/node_modules/zod/src/compile.ts +56 -0
  2211. package/node_modules/zod/src/index.ts +7 -0
  2212. package/node_modules/zod/src/locales/index.ts +1 -0
  2213. package/node_modules/zod/src/mini/index.ts +3 -0
  2214. package/node_modules/zod/src/v3/ZodError.ts +340 -0
  2215. package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  2216. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  2217. package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  2218. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  2219. package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  2220. package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  2221. package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  2222. package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  2223. package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  2224. package/node_modules/zod/src/v3/errors.ts +13 -0
  2225. package/node_modules/zod/src/v3/external.ts +6 -0
  2226. package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  2227. package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  2228. package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  2229. package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  2230. package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  2231. package/node_modules/zod/src/v3/helpers/util.ts +224 -0
  2232. package/node_modules/zod/src/v3/index.ts +4 -0
  2233. package/node_modules/zod/src/v3/locales/en.ts +124 -0
  2234. package/node_modules/zod/src/v3/standard-schema.ts +113 -0
  2235. package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  2236. package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  2237. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  2238. package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  2239. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  2240. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  2241. package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  2242. package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  2243. package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  2244. package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  2245. package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  2246. package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  2247. package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  2248. package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  2249. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  2250. package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  2251. package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  2252. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  2253. package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  2254. package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
  2255. package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  2256. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  2257. package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  2258. package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  2259. package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  2260. package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
  2261. package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  2262. package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
  2263. package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  2264. package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  2265. package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  2266. package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  2267. package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  2268. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  2269. package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  2270. package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  2271. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  2272. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  2273. package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
  2274. package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  2275. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  2276. package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  2277. package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  2278. package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  2279. package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  2280. package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  2281. package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  2282. package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  2283. package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
  2284. package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  2285. package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  2286. package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  2287. package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  2288. package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  2289. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  2290. package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
  2291. package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  2292. package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  2293. package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  2294. package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  2295. package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  2296. package/node_modules/zod/src/v3/types.ts +5138 -0
  2297. package/node_modules/zod/src/v4/classic/checks.ts +33 -0
  2298. package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  2299. package/node_modules/zod/src/v4/classic/compat.ts +78 -0
  2300. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  2301. package/node_modules/zod/src/v4/classic/errors.ts +97 -0
  2302. package/node_modules/zod/src/v4/classic/external.ts +57 -0
  2303. package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
  2304. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  2305. package/node_modules/zod/src/v4/classic/index.ts +5 -0
  2306. package/node_modules/zod/src/v4/classic/iso.ts +20 -0
  2307. package/node_modules/zod/src/v4/classic/parse.ts +88 -0
  2308. package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
  2309. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  2310. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
  2311. package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
  2312. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
  2313. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  2314. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  2315. package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  2316. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
  2317. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  2318. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
  2319. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  2320. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
  2321. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
  2322. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  2323. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  2324. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  2325. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  2326. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  2327. package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
  2328. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
  2329. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  2330. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  2331. package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
  2332. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  2333. package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  2334. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
  2335. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
  2336. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
  2337. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
  2338. package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
  2339. package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  2340. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  2341. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  2342. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
  2343. package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
  2344. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  2345. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
  2346. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
  2347. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  2348. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  2349. package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
  2350. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  2351. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
  2352. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
  2353. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  2354. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
  2355. package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  2356. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
  2357. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
  2358. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  2359. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  2360. package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
  2361. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  2362. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  2363. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  2364. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  2365. package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
  2366. package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
  2367. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  2368. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
  2369. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
  2370. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  2371. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  2372. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
  2373. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
  2374. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  2375. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  2376. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  2377. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  2378. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  2379. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
  2380. package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
  2381. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
  2382. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  2383. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
  2384. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  2385. package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
  2386. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
  2387. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  2388. package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
  2389. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
  2390. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
  2391. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  2392. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
  2393. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  2394. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
  2395. package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
  2396. package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  2397. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  2398. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  2399. package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  2400. package/node_modules/zod/src/v4/core/api.ts +1875 -0
  2401. package/node_modules/zod/src/v4/core/checks.ts +1266 -0
  2402. package/node_modules/zod/src/v4/core/compile.ts +2322 -0
  2403. package/node_modules/zod/src/v4/core/core.ts +230 -0
  2404. package/node_modules/zod/src/v4/core/doc.ts +52 -0
  2405. package/node_modules/zod/src/v4/core/errors.ts +543 -0
  2406. package/node_modules/zod/src/v4/core/index.ts +19 -0
  2407. package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
  2408. package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
  2409. package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
  2410. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  2411. package/node_modules/zod/src/v4/core/parse.ts +309 -0
  2412. package/node_modules/zod/src/v4/core/regexes.ts +217 -0
  2413. package/node_modules/zod/src/v4/core/registries.ts +105 -0
  2414. package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
  2415. package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  2416. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  2417. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  2418. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  2419. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  2420. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  2421. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  2422. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  2423. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  2424. package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  2425. package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  2426. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  2427. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
  2428. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  2429. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
  2430. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  2431. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  2432. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  2433. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  2434. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  2435. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  2436. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  2437. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  2438. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  2439. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  2440. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  2441. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  2442. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  2443. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  2444. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  2445. package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
  2446. package/node_modules/zod/src/v4/core/util.ts +1293 -0
  2447. package/node_modules/zod/src/v4/core/versions.ts +5 -0
  2448. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  2449. package/node_modules/zod/src/v4/core/zsf.ts +323 -0
  2450. package/node_modules/zod/src/v4/index.ts +4 -0
  2451. package/node_modules/zod/src/v4/locales/ar.ts +120 -0
  2452. package/node_modules/zod/src/v4/locales/az.ts +116 -0
  2453. package/node_modules/zod/src/v4/locales/be.ts +188 -0
  2454. package/node_modules/zod/src/v4/locales/bg.ts +133 -0
  2455. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  2456. package/node_modules/zod/src/v4/locales/ca.ts +121 -0
  2457. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  2458. package/node_modules/zod/src/v4/locales/cs.ts +123 -0
  2459. package/node_modules/zod/src/v4/locales/da.ts +128 -0
  2460. package/node_modules/zod/src/v4/locales/de.ts +121 -0
  2461. package/node_modules/zod/src/v4/locales/el.ts +124 -0
  2462. package/node_modules/zod/src/v4/locales/en.ts +136 -0
  2463. package/node_modules/zod/src/v4/locales/eo.ts +123 -0
  2464. package/node_modules/zod/src/v4/locales/es.ts +145 -0
  2465. package/node_modules/zod/src/v4/locales/fa.ts +131 -0
  2466. package/node_modules/zod/src/v4/locales/fi.ts +126 -0
  2467. package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
  2468. package/node_modules/zod/src/v4/locales/fr.ts +139 -0
  2469. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  2470. package/node_modules/zod/src/v4/locales/he.ts +253 -0
  2471. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  2472. package/node_modules/zod/src/v4/locales/hr.ts +135 -0
  2473. package/node_modules/zod/src/v4/locales/hu.ts +122 -0
  2474. package/node_modules/zod/src/v4/locales/hy.ts +175 -0
  2475. package/node_modules/zod/src/v4/locales/id.ts +120 -0
  2476. package/node_modules/zod/src/v4/locales/index.ts +63 -0
  2477. package/node_modules/zod/src/v4/locales/is.ts +124 -0
  2478. package/node_modules/zod/src/v4/locales/it.ts +121 -0
  2479. package/node_modules/zod/src/v4/locales/ja.ts +119 -0
  2480. package/node_modules/zod/src/v4/locales/ka.ts +128 -0
  2481. package/node_modules/zod/src/v4/locales/kh.ts +7 -0
  2482. package/node_modules/zod/src/v4/locales/km.ts +124 -0
  2483. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  2484. package/node_modules/zod/src/v4/locales/ko.ts +126 -0
  2485. package/node_modules/zod/src/v4/locales/lt.ts +243 -0
  2486. package/node_modules/zod/src/v4/locales/mk.ts +123 -0
  2487. package/node_modules/zod/src/v4/locales/ms.ts +120 -0
  2488. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  2489. package/node_modules/zod/src/v4/locales/nl.ts +126 -0
  2490. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  2491. package/node_modules/zod/src/v4/locales/no.ts +121 -0
  2492. package/node_modules/zod/src/v4/locales/ota.ts +122 -0
  2493. package/node_modules/zod/src/v4/locales/pl.ts +123 -0
  2494. package/node_modules/zod/src/v4/locales/ps.ts +131 -0
  2495. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  2496. package/node_modules/zod/src/v4/locales/pt.ts +159 -0
  2497. package/node_modules/zod/src/v4/locales/ro.ts +132 -0
  2498. package/node_modules/zod/src/v4/locales/ru.ts +188 -0
  2499. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  2500. package/node_modules/zod/src/v4/locales/sl.ts +123 -0
  2501. package/node_modules/zod/src/v4/locales/sv.ts +124 -0
  2502. package/node_modules/zod/src/v4/locales/ta.ts +123 -0
  2503. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  2504. package/node_modules/zod/src/v4/locales/th.ts +124 -0
  2505. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  2506. package/node_modules/zod/src/v4/locales/tr.ts +116 -0
  2507. package/node_modules/zod/src/v4/locales/ua.ts +7 -0
  2508. package/node_modules/zod/src/v4/locales/uk.ts +122 -0
  2509. package/node_modules/zod/src/v4/locales/ur.ts +124 -0
  2510. package/node_modules/zod/src/v4/locales/uz.ts +120 -0
  2511. package/node_modules/zod/src/v4/locales/vi.ts +122 -0
  2512. package/node_modules/zod/src/v4/locales/yo.ts +129 -0
  2513. package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
  2514. package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
  2515. package/node_modules/zod/src/v4/mini/checks.ts +33 -0
  2516. package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  2517. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  2518. package/node_modules/zod/src/v4/mini/external.ts +52 -0
  2519. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  2520. package/node_modules/zod/src/v4/mini/index.ts +3 -0
  2521. package/node_modules/zod/src/v4/mini/iso.ts +66 -0
  2522. package/node_modules/zod/src/v4/mini/parse.ts +16 -0
  2523. package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
  2524. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
  2525. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
  2526. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  2527. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
  2528. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
  2529. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
  2530. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  2531. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  2532. package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
  2533. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
  2534. package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
  2535. package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
  2536. package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
  2537. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  2538. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
  2539. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  2540. package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
  2541. package/node_modules/zod/src/v4-mini/index.ts +3 -0
  2542. package/node_modules/zod/v3/ZodError.cjs +167 -0
  2543. package/node_modules/zod/v3/ZodError.d.cts +164 -0
  2544. package/node_modules/zod/v3/ZodError.d.ts +164 -0
  2545. package/node_modules/zod/v3/ZodError.js +143 -0
  2546. package/node_modules/zod/v3/errors.cjs +36 -0
  2547. package/node_modules/zod/v3/errors.d.cts +5 -0
  2548. package/node_modules/zod/v3/errors.d.ts +5 -0
  2549. package/node_modules/zod/v3/errors.js +9 -0
  2550. package/node_modules/zod/v3/external.cjs +41 -0
  2551. package/node_modules/zod/v3/external.d.cts +6 -0
  2552. package/node_modules/zod/v3/external.d.ts +6 -0
  2553. package/node_modules/zod/v3/external.js +6 -0
  2554. package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
  2555. package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  2556. package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  2557. package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  2558. package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
  2559. package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  2560. package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  2561. package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  2562. package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
  2563. package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  2564. package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  2565. package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  2566. package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
  2567. package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  2568. package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  2569. package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  2570. package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
  2571. package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  2572. package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  2573. package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  2574. package/node_modules/zod/v3/helpers/util.cjs +156 -0
  2575. package/node_modules/zod/v3/helpers/util.d.cts +85 -0
  2576. package/node_modules/zod/v3/helpers/util.d.ts +85 -0
  2577. package/node_modules/zod/v3/helpers/util.js +133 -0
  2578. package/node_modules/zod/v3/index.cjs +52 -0
  2579. package/node_modules/zod/v3/index.d.cts +4 -0
  2580. package/node_modules/zod/v3/index.d.ts +4 -0
  2581. package/node_modules/zod/v3/index.js +4 -0
  2582. package/node_modules/zod/v3/locales/en.cjs +112 -0
  2583. package/node_modules/zod/v3/locales/en.d.cts +3 -0
  2584. package/node_modules/zod/v3/locales/en.d.ts +3 -0
  2585. package/node_modules/zod/v3/locales/en.js +109 -0
  2586. package/node_modules/zod/v3/package.json +7 -0
  2587. package/node_modules/zod/v3/standard-schema.cjs +21 -0
  2588. package/node_modules/zod/v3/standard-schema.d.cts +102 -0
  2589. package/node_modules/zod/v3/standard-schema.d.ts +102 -0
  2590. package/node_modules/zod/v3/standard-schema.js +1 -0
  2591. package/node_modules/zod/v3/types.cjs +3798 -0
  2592. package/node_modules/zod/v3/types.d.cts +1034 -0
  2593. package/node_modules/zod/v3/types.d.ts +1034 -0
  2594. package/node_modules/zod/v3/types.js +3697 -0
  2595. package/node_modules/zod/v4/classic/checks.cjs +53 -0
  2596. package/node_modules/zod/v4/classic/checks.d.cts +1 -0
  2597. package/node_modules/zod/v4/classic/checks.d.ts +1 -0
  2598. package/node_modules/zod/v4/classic/checks.js +1 -0
  2599. package/node_modules/zod/v4/classic/coerce.cjs +66 -0
  2600. package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  2601. package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  2602. package/node_modules/zod/v4/classic/coerce.js +17 -0
  2603. package/node_modules/zod/v4/classic/compat.cjs +80 -0
  2604. package/node_modules/zod/v4/classic/compat.d.cts +48 -0
  2605. package/node_modules/zod/v4/classic/compat.d.ts +48 -0
  2606. package/node_modules/zod/v4/classic/compat.js +31 -0
  2607. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  2608. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  2609. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  2610. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  2611. package/node_modules/zod/v4/classic/errors.cjs +102 -0
  2612. package/node_modules/zod/v4/classic/errors.d.cts +29 -0
  2613. package/node_modules/zod/v4/classic/errors.d.ts +29 -0
  2614. package/node_modules/zod/v4/classic/errors.js +57 -0
  2615. package/node_modules/zod/v4/classic/external.cjs +97 -0
  2616. package/node_modules/zod/v4/classic/external.d.cts +19 -0
  2617. package/node_modules/zod/v4/classic/external.d.ts +19 -0
  2618. package/node_modules/zod/v4/classic/external.js +17 -0
  2619. package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
  2620. package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  2621. package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  2622. package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
  2623. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  2624. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  2625. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  2626. package/node_modules/zod/v4/classic/in-out.js +36 -0
  2627. package/node_modules/zod/v4/classic/index.cjs +52 -0
  2628. package/node_modules/zod/v4/classic/index.d.cts +3 -0
  2629. package/node_modules/zod/v4/classic/index.d.ts +3 -0
  2630. package/node_modules/zod/v4/classic/index.js +4 -0
  2631. package/node_modules/zod/v4/classic/iso.cjs +68 -0
  2632. package/node_modules/zod/v4/classic/iso.d.cts +7 -0
  2633. package/node_modules/zod/v4/classic/iso.d.ts +7 -0
  2634. package/node_modules/zod/v4/classic/iso.js +15 -0
  2635. package/node_modules/zod/v4/classic/package.json +7 -0
  2636. package/node_modules/zod/v4/classic/parse.cjs +63 -0
  2637. package/node_modules/zod/v4/classic/parse.d.cts +44 -0
  2638. package/node_modules/zod/v4/classic/parse.d.ts +44 -0
  2639. package/node_modules/zod/v4/classic/parse.js +16 -0
  2640. package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
  2641. package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
  2642. package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
  2643. package/node_modules/zod/v4/classic/schemas.js +1535 -0
  2644. package/node_modules/zod/v4/core/api.cjs +1269 -0
  2645. package/node_modules/zod/v4/core/api.d.cts +335 -0
  2646. package/node_modules/zod/v4/core/api.d.ts +335 -0
  2647. package/node_modules/zod/v4/core/api.js +1107 -0
  2648. package/node_modules/zod/v4/core/checks.cjs +561 -0
  2649. package/node_modules/zod/v4/core/checks.d.cts +294 -0
  2650. package/node_modules/zod/v4/core/checks.d.ts +294 -0
  2651. package/node_modules/zod/v4/core/checks.js +516 -0
  2652. package/node_modules/zod/v4/core/compile.cjs +1916 -0
  2653. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  2654. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  2655. package/node_modules/zod/v4/core/compile.js +1866 -0
  2656. package/node_modules/zod/v4/core/core.cjs +167 -0
  2657. package/node_modules/zod/v4/core/core.d.cts +82 -0
  2658. package/node_modules/zod/v4/core/core.d.ts +82 -0
  2659. package/node_modules/zod/v4/core/core.js +141 -0
  2660. package/node_modules/zod/v4/core/doc.cjs +61 -0
  2661. package/node_modules/zod/v4/core/doc.d.cts +16 -0
  2662. package/node_modules/zod/v4/core/doc.d.ts +16 -0
  2663. package/node_modules/zod/v4/core/doc.js +38 -0
  2664. package/node_modules/zod/v4/core/errors.cjs +317 -0
  2665. package/node_modules/zod/v4/core/errors.d.cts +225 -0
  2666. package/node_modules/zod/v4/core/errors.d.ts +225 -0
  2667. package/node_modules/zod/v4/core/errors.js +267 -0
  2668. package/node_modules/zod/v4/core/index.cjs +70 -0
  2669. package/node_modules/zod/v4/core/index.d.cts +19 -0
  2670. package/node_modules/zod/v4/core/index.d.ts +19 -0
  2671. package/node_modules/zod/v4/core/index.js +19 -0
  2672. package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
  2673. package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  2674. package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  2675. package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
  2676. package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
  2677. package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
  2678. package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
  2679. package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
  2680. package/node_modules/zod/v4/core/json-schema.cjs +21 -0
  2681. package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
  2682. package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
  2683. package/node_modules/zod/v4/core/json-schema.js +1 -0
  2684. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  2685. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  2686. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  2687. package/node_modules/zod/v4/core/memoizer.js +311 -0
  2688. package/node_modules/zod/v4/core/package.json +7 -0
  2689. package/node_modules/zod/v4/core/parse.cjs +233 -0
  2690. package/node_modules/zod/v4/core/parse.d.cts +52 -0
  2691. package/node_modules/zod/v4/core/parse.d.ts +52 -0
  2692. package/node_modules/zod/v4/core/parse.js +175 -0
  2693. package/node_modules/zod/v4/core/regexes.cjs +209 -0
  2694. package/node_modules/zod/v4/core/regexes.d.cts +90 -0
  2695. package/node_modules/zod/v4/core/regexes.d.ts +90 -0
  2696. package/node_modules/zod/v4/core/regexes.js +156 -0
  2697. package/node_modules/zod/v4/core/registries.cjs +75 -0
  2698. package/node_modules/zod/v4/core/registries.d.cts +35 -0
  2699. package/node_modules/zod/v4/core/registries.d.ts +35 -0
  2700. package/node_modules/zod/v4/core/registries.js +51 -0
  2701. package/node_modules/zod/v4/core/schemas.cjs +2699 -0
  2702. package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
  2703. package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
  2704. package/node_modules/zod/v4/core/schemas.js +2636 -0
  2705. package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
  2706. package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  2707. package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  2708. package/node_modules/zod/v4/core/standard-schema.js +1 -0
  2709. package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
  2710. package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
  2711. package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
  2712. package/node_modules/zod/v4/core/to-json-schema.js +651 -0
  2713. package/node_modules/zod/v4/core/util.cjs +964 -0
  2714. package/node_modules/zod/v4/core/util.d.cts +280 -0
  2715. package/node_modules/zod/v4/core/util.d.ts +280 -0
  2716. package/node_modules/zod/v4/core/util.js +873 -0
  2717. package/node_modules/zod/v4/core/versions.cjs +27 -0
  2718. package/node_modules/zod/v4/core/versions.d.cts +5 -0
  2719. package/node_modules/zod/v4/core/versions.d.ts +5 -0
  2720. package/node_modules/zod/v4/core/versions.js +5 -0
  2721. package/node_modules/zod/v4/core/visit.cjs +214 -0
  2722. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  2723. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  2724. package/node_modules/zod/v4/core/visit.js +169 -0
  2725. package/node_modules/zod/v4/index.cjs +51 -0
  2726. package/node_modules/zod/v4/index.d.cts +3 -0
  2727. package/node_modules/zod/v4/index.d.ts +3 -0
  2728. package/node_modules/zod/v4/index.js +4 -0
  2729. package/node_modules/zod/v4/locales/ar.cjs +138 -0
  2730. package/node_modules/zod/v4/locales/ar.d.cts +5 -0
  2731. package/node_modules/zod/v4/locales/ar.d.ts +4 -0
  2732. package/node_modules/zod/v4/locales/ar.js +111 -0
  2733. package/node_modules/zod/v4/locales/az.cjs +137 -0
  2734. package/node_modules/zod/v4/locales/az.d.cts +5 -0
  2735. package/node_modules/zod/v4/locales/az.d.ts +4 -0
  2736. package/node_modules/zod/v4/locales/az.js +110 -0
  2737. package/node_modules/zod/v4/locales/be.cjs +195 -0
  2738. package/node_modules/zod/v4/locales/be.d.cts +5 -0
  2739. package/node_modules/zod/v4/locales/be.d.ts +4 -0
  2740. package/node_modules/zod/v4/locales/be.js +168 -0
  2741. package/node_modules/zod/v4/locales/bg.cjs +152 -0
  2742. package/node_modules/zod/v4/locales/bg.d.cts +5 -0
  2743. package/node_modules/zod/v4/locales/bg.d.ts +4 -0
  2744. package/node_modules/zod/v4/locales/bg.js +125 -0
  2745. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  2746. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  2747. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  2748. package/node_modules/zod/v4/locales/bn.js +113 -0
  2749. package/node_modules/zod/v4/locales/ca.cjs +139 -0
  2750. package/node_modules/zod/v4/locales/ca.d.cts +5 -0
  2751. package/node_modules/zod/v4/locales/ca.d.ts +4 -0
  2752. package/node_modules/zod/v4/locales/ca.js +112 -0
  2753. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  2754. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  2755. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  2756. package/node_modules/zod/v4/locales/ckb.js +133 -0
  2757. package/node_modules/zod/v4/locales/cs.cjs +143 -0
  2758. package/node_modules/zod/v4/locales/cs.d.cts +5 -0
  2759. package/node_modules/zod/v4/locales/cs.d.ts +4 -0
  2760. package/node_modules/zod/v4/locales/cs.js +116 -0
  2761. package/node_modules/zod/v4/locales/da.cjs +147 -0
  2762. package/node_modules/zod/v4/locales/da.d.cts +5 -0
  2763. package/node_modules/zod/v4/locales/da.d.ts +4 -0
  2764. package/node_modules/zod/v4/locales/da.js +120 -0
  2765. package/node_modules/zod/v4/locales/de.cjs +140 -0
  2766. package/node_modules/zod/v4/locales/de.d.cts +5 -0
  2767. package/node_modules/zod/v4/locales/de.d.ts +4 -0
  2768. package/node_modules/zod/v4/locales/de.js +113 -0
  2769. package/node_modules/zod/v4/locales/el.cjs +139 -0
  2770. package/node_modules/zod/v4/locales/el.d.cts +5 -0
  2771. package/node_modules/zod/v4/locales/el.d.ts +4 -0
  2772. package/node_modules/zod/v4/locales/el.js +112 -0
  2773. package/node_modules/zod/v4/locales/en.cjs +152 -0
  2774. package/node_modules/zod/v4/locales/en.d.cts +5 -0
  2775. package/node_modules/zod/v4/locales/en.d.ts +4 -0
  2776. package/node_modules/zod/v4/locales/en.js +125 -0
  2777. package/node_modules/zod/v4/locales/eo.cjs +141 -0
  2778. package/node_modules/zod/v4/locales/eo.d.cts +5 -0
  2779. package/node_modules/zod/v4/locales/eo.d.ts +4 -0
  2780. package/node_modules/zod/v4/locales/eo.js +114 -0
  2781. package/node_modules/zod/v4/locales/es.cjs +163 -0
  2782. package/node_modules/zod/v4/locales/es.d.cts +5 -0
  2783. package/node_modules/zod/v4/locales/es.d.ts +4 -0
  2784. package/node_modules/zod/v4/locales/es.js +136 -0
  2785. package/node_modules/zod/v4/locales/fa.cjs +146 -0
  2786. package/node_modules/zod/v4/locales/fa.d.cts +5 -0
  2787. package/node_modules/zod/v4/locales/fa.d.ts +4 -0
  2788. package/node_modules/zod/v4/locales/fa.js +119 -0
  2789. package/node_modules/zod/v4/locales/fi.cjs +144 -0
  2790. package/node_modules/zod/v4/locales/fi.d.cts +5 -0
  2791. package/node_modules/zod/v4/locales/fi.d.ts +4 -0
  2792. package/node_modules/zod/v4/locales/fi.js +117 -0
  2793. package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
  2794. package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  2795. package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  2796. package/node_modules/zod/v4/locales/fr-CA.js +112 -0
  2797. package/node_modules/zod/v4/locales/fr.cjs +156 -0
  2798. package/node_modules/zod/v4/locales/fr.d.cts +5 -0
  2799. package/node_modules/zod/v4/locales/fr.d.ts +4 -0
  2800. package/node_modules/zod/v4/locales/fr.js +129 -0
  2801. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  2802. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  2803. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  2804. package/node_modules/zod/v4/locales/gu.js +113 -0
  2805. package/node_modules/zod/v4/locales/he.cjs +248 -0
  2806. package/node_modules/zod/v4/locales/he.d.cts +5 -0
  2807. package/node_modules/zod/v4/locales/he.d.ts +4 -0
  2808. package/node_modules/zod/v4/locales/he.js +221 -0
  2809. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  2810. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  2811. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  2812. package/node_modules/zod/v4/locales/hi.js +111 -0
  2813. package/node_modules/zod/v4/locales/hr.cjs +153 -0
  2814. package/node_modules/zod/v4/locales/hr.d.cts +5 -0
  2815. package/node_modules/zod/v4/locales/hr.d.ts +4 -0
  2816. package/node_modules/zod/v4/locales/hr.js +126 -0
  2817. package/node_modules/zod/v4/locales/hu.cjs +140 -0
  2818. package/node_modules/zod/v4/locales/hu.d.cts +5 -0
  2819. package/node_modules/zod/v4/locales/hu.d.ts +4 -0
  2820. package/node_modules/zod/v4/locales/hu.js +113 -0
  2821. package/node_modules/zod/v4/locales/hy.cjs +185 -0
  2822. package/node_modules/zod/v4/locales/hy.d.cts +5 -0
  2823. package/node_modules/zod/v4/locales/hy.d.ts +4 -0
  2824. package/node_modules/zod/v4/locales/hy.js +158 -0
  2825. package/node_modules/zod/v4/locales/id.cjs +138 -0
  2826. package/node_modules/zod/v4/locales/id.d.cts +5 -0
  2827. package/node_modules/zod/v4/locales/id.d.ts +4 -0
  2828. package/node_modules/zod/v4/locales/id.js +111 -0
  2829. package/node_modules/zod/v4/locales/index.cjs +152 -0
  2830. package/node_modules/zod/v4/locales/index.d.cts +63 -0
  2831. package/node_modules/zod/v4/locales/index.d.ts +63 -0
  2832. package/node_modules/zod/v4/locales/index.js +63 -0
  2833. package/node_modules/zod/v4/locales/is.cjs +141 -0
  2834. package/node_modules/zod/v4/locales/is.d.cts +5 -0
  2835. package/node_modules/zod/v4/locales/is.d.ts +4 -0
  2836. package/node_modules/zod/v4/locales/is.js +114 -0
  2837. package/node_modules/zod/v4/locales/it.cjs +140 -0
  2838. package/node_modules/zod/v4/locales/it.d.cts +5 -0
  2839. package/node_modules/zod/v4/locales/it.d.ts +4 -0
  2840. package/node_modules/zod/v4/locales/it.js +113 -0
  2841. package/node_modules/zod/v4/locales/ja.cjs +139 -0
  2842. package/node_modules/zod/v4/locales/ja.d.cts +5 -0
  2843. package/node_modules/zod/v4/locales/ja.d.ts +4 -0
  2844. package/node_modules/zod/v4/locales/ja.js +112 -0
  2845. package/node_modules/zod/v4/locales/ka.cjs +144 -0
  2846. package/node_modules/zod/v4/locales/ka.d.cts +5 -0
  2847. package/node_modules/zod/v4/locales/ka.d.ts +4 -0
  2848. package/node_modules/zod/v4/locales/ka.js +117 -0
  2849. package/node_modules/zod/v4/locales/kh.cjs +12 -0
  2850. package/node_modules/zod/v4/locales/kh.d.cts +5 -0
  2851. package/node_modules/zod/v4/locales/kh.d.ts +5 -0
  2852. package/node_modules/zod/v4/locales/kh.js +5 -0
  2853. package/node_modules/zod/v4/locales/km.cjs +142 -0
  2854. package/node_modules/zod/v4/locales/km.d.cts +5 -0
  2855. package/node_modules/zod/v4/locales/km.d.ts +4 -0
  2856. package/node_modules/zod/v4/locales/km.js +115 -0
  2857. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  2858. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  2859. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  2860. package/node_modules/zod/v4/locales/kn.js +116 -0
  2861. package/node_modules/zod/v4/locales/ko.cjs +143 -0
  2862. package/node_modules/zod/v4/locales/ko.d.cts +5 -0
  2863. package/node_modules/zod/v4/locales/ko.d.ts +4 -0
  2864. package/node_modules/zod/v4/locales/ko.js +116 -0
  2865. package/node_modules/zod/v4/locales/lt.cjs +234 -0
  2866. package/node_modules/zod/v4/locales/lt.d.cts +5 -0
  2867. package/node_modules/zod/v4/locales/lt.d.ts +4 -0
  2868. package/node_modules/zod/v4/locales/lt.js +207 -0
  2869. package/node_modules/zod/v4/locales/mk.cjs +141 -0
  2870. package/node_modules/zod/v4/locales/mk.d.cts +5 -0
  2871. package/node_modules/zod/v4/locales/mk.d.ts +4 -0
  2872. package/node_modules/zod/v4/locales/mk.js +114 -0
  2873. package/node_modules/zod/v4/locales/ms.cjs +139 -0
  2874. package/node_modules/zod/v4/locales/ms.d.cts +5 -0
  2875. package/node_modules/zod/v4/locales/ms.d.ts +4 -0
  2876. package/node_modules/zod/v4/locales/ms.js +112 -0
  2877. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  2878. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  2879. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  2880. package/node_modules/zod/v4/locales/ne.js +111 -0
  2881. package/node_modules/zod/v4/locales/nl.cjs +142 -0
  2882. package/node_modules/zod/v4/locales/nl.d.cts +5 -0
  2883. package/node_modules/zod/v4/locales/nl.d.ts +4 -0
  2884. package/node_modules/zod/v4/locales/nl.js +115 -0
  2885. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  2886. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  2887. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  2888. package/node_modules/zod/v4/locales/nn.js +113 -0
  2889. package/node_modules/zod/v4/locales/no.cjs +140 -0
  2890. package/node_modules/zod/v4/locales/no.d.cts +5 -0
  2891. package/node_modules/zod/v4/locales/no.d.ts +4 -0
  2892. package/node_modules/zod/v4/locales/no.js +113 -0
  2893. package/node_modules/zod/v4/locales/ota.cjs +141 -0
  2894. package/node_modules/zod/v4/locales/ota.d.cts +5 -0
  2895. package/node_modules/zod/v4/locales/ota.d.ts +4 -0
  2896. package/node_modules/zod/v4/locales/ota.js +114 -0
  2897. package/node_modules/zod/v4/locales/package.json +7 -0
  2898. package/node_modules/zod/v4/locales/pl.cjs +141 -0
  2899. package/node_modules/zod/v4/locales/pl.d.cts +5 -0
  2900. package/node_modules/zod/v4/locales/pl.d.ts +4 -0
  2901. package/node_modules/zod/v4/locales/pl.js +114 -0
  2902. package/node_modules/zod/v4/locales/ps.cjs +146 -0
  2903. package/node_modules/zod/v4/locales/ps.d.cts +5 -0
  2904. package/node_modules/zod/v4/locales/ps.d.ts +4 -0
  2905. package/node_modules/zod/v4/locales/ps.js +119 -0
  2906. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  2907. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  2908. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  2909. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  2910. package/node_modules/zod/v4/locales/pt.cjs +169 -0
  2911. package/node_modules/zod/v4/locales/pt.d.cts +5 -0
  2912. package/node_modules/zod/v4/locales/pt.d.ts +4 -0
  2913. package/node_modules/zod/v4/locales/pt.js +142 -0
  2914. package/node_modules/zod/v4/locales/ro.cjs +149 -0
  2915. package/node_modules/zod/v4/locales/ro.d.cts +5 -0
  2916. package/node_modules/zod/v4/locales/ro.d.ts +4 -0
  2917. package/node_modules/zod/v4/locales/ro.js +122 -0
  2918. package/node_modules/zod/v4/locales/ru.cjs +195 -0
  2919. package/node_modules/zod/v4/locales/ru.d.cts +5 -0
  2920. package/node_modules/zod/v4/locales/ru.d.ts +4 -0
  2921. package/node_modules/zod/v4/locales/ru.js +168 -0
  2922. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  2923. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  2924. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  2925. package/node_modules/zod/v4/locales/sk.js +116 -0
  2926. package/node_modules/zod/v4/locales/sl.cjs +141 -0
  2927. package/node_modules/zod/v4/locales/sl.d.cts +5 -0
  2928. package/node_modules/zod/v4/locales/sl.d.ts +4 -0
  2929. package/node_modules/zod/v4/locales/sl.js +114 -0
  2930. package/node_modules/zod/v4/locales/sv.cjs +142 -0
  2931. package/node_modules/zod/v4/locales/sv.d.cts +5 -0
  2932. package/node_modules/zod/v4/locales/sv.d.ts +4 -0
  2933. package/node_modules/zod/v4/locales/sv.js +115 -0
  2934. package/node_modules/zod/v4/locales/ta.cjs +142 -0
  2935. package/node_modules/zod/v4/locales/ta.d.cts +5 -0
  2936. package/node_modules/zod/v4/locales/ta.d.ts +4 -0
  2937. package/node_modules/zod/v4/locales/ta.js +115 -0
  2938. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  2939. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  2940. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  2941. package/node_modules/zod/v4/locales/tg.js +117 -0
  2942. package/node_modules/zod/v4/locales/th.cjs +142 -0
  2943. package/node_modules/zod/v4/locales/th.d.cts +5 -0
  2944. package/node_modules/zod/v4/locales/th.d.ts +4 -0
  2945. package/node_modules/zod/v4/locales/th.js +115 -0
  2946. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  2947. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  2948. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  2949. package/node_modules/zod/v4/locales/tk.js +107 -0
  2950. package/node_modules/zod/v4/locales/tr.cjs +137 -0
  2951. package/node_modules/zod/v4/locales/tr.d.cts +5 -0
  2952. package/node_modules/zod/v4/locales/tr.d.ts +4 -0
  2953. package/node_modules/zod/v4/locales/tr.js +110 -0
  2954. package/node_modules/zod/v4/locales/ua.cjs +12 -0
  2955. package/node_modules/zod/v4/locales/ua.d.cts +5 -0
  2956. package/node_modules/zod/v4/locales/ua.d.ts +5 -0
  2957. package/node_modules/zod/v4/locales/ua.js +5 -0
  2958. package/node_modules/zod/v4/locales/uk.cjs +140 -0
  2959. package/node_modules/zod/v4/locales/uk.d.cts +5 -0
  2960. package/node_modules/zod/v4/locales/uk.d.ts +4 -0
  2961. package/node_modules/zod/v4/locales/uk.js +113 -0
  2962. package/node_modules/zod/v4/locales/ur.cjs +142 -0
  2963. package/node_modules/zod/v4/locales/ur.d.cts +5 -0
  2964. package/node_modules/zod/v4/locales/ur.d.ts +4 -0
  2965. package/node_modules/zod/v4/locales/ur.js +115 -0
  2966. package/node_modules/zod/v4/locales/uz.cjs +140 -0
  2967. package/node_modules/zod/v4/locales/uz.d.cts +5 -0
  2968. package/node_modules/zod/v4/locales/uz.d.ts +4 -0
  2969. package/node_modules/zod/v4/locales/uz.js +113 -0
  2970. package/node_modules/zod/v4/locales/vi.cjs +140 -0
  2971. package/node_modules/zod/v4/locales/vi.d.cts +5 -0
  2972. package/node_modules/zod/v4/locales/vi.d.ts +4 -0
  2973. package/node_modules/zod/v4/locales/vi.js +113 -0
  2974. package/node_modules/zod/v4/locales/yo.cjs +139 -0
  2975. package/node_modules/zod/v4/locales/yo.d.cts +5 -0
  2976. package/node_modules/zod/v4/locales/yo.d.ts +4 -0
  2977. package/node_modules/zod/v4/locales/yo.js +112 -0
  2978. package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
  2979. package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  2980. package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  2981. package/node_modules/zod/v4/locales/zh-CN.js +114 -0
  2982. package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
  2983. package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  2984. package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  2985. package/node_modules/zod/v4/locales/zh-TW.js +112 -0
  2986. package/node_modules/zod/v4/mini/checks.cjs +54 -0
  2987. package/node_modules/zod/v4/mini/checks.d.cts +1 -0
  2988. package/node_modules/zod/v4/mini/checks.d.ts +1 -0
  2989. package/node_modules/zod/v4/mini/checks.js +1 -0
  2990. package/node_modules/zod/v4/mini/coerce.cjs +71 -0
  2991. package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  2992. package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  2993. package/node_modules/zod/v4/mini/coerce.js +22 -0
  2994. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  2995. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  2996. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  2997. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  2998. package/node_modules/zod/v4/mini/external.cjs +95 -0
  2999. package/node_modules/zod/v4/mini/external.d.cts +16 -0
  3000. package/node_modules/zod/v4/mini/external.d.ts +16 -0
  3001. package/node_modules/zod/v4/mini/external.js +16 -0
  3002. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  3003. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  3004. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  3005. package/node_modules/zod/v4/mini/in-out.js +36 -0
  3006. package/node_modules/zod/v4/mini/index.cjs +51 -0
  3007. package/node_modules/zod/v4/mini/index.d.cts +3 -0
  3008. package/node_modules/zod/v4/mini/index.d.ts +3 -0
  3009. package/node_modules/zod/v4/mini/index.js +3 -0
  3010. package/node_modules/zod/v4/mini/iso.cjs +83 -0
  3011. package/node_modules/zod/v4/mini/iso.d.cts +22 -0
  3012. package/node_modules/zod/v4/mini/iso.d.ts +22 -0
  3013. package/node_modules/zod/v4/mini/iso.js +34 -0
  3014. package/node_modules/zod/v4/mini/package.json +7 -0
  3015. package/node_modules/zod/v4/mini/parse.cjs +37 -0
  3016. package/node_modules/zod/v4/mini/parse.d.cts +1 -0
  3017. package/node_modules/zod/v4/mini/parse.d.ts +1 -0
  3018. package/node_modules/zod/v4/mini/parse.js +1 -0
  3019. package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
  3020. package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
  3021. package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
  3022. package/node_modules/zod/v4/mini/schemas.js +1002 -0
  3023. package/node_modules/zod/v4/package.json +7 -0
  3024. package/node_modules/zod/v4-mini/index.cjs +51 -0
  3025. package/node_modules/zod/v4-mini/index.d.cts +3 -0
  3026. package/node_modules/zod/v4-mini/index.d.ts +3 -0
  3027. package/node_modules/zod/v4-mini/index.js +3 -0
  3028. package/node_modules/zod/v4-mini/package.json +7 -0
  3029. package/package.json +73 -4
@@ -0,0 +1,3434 @@
1
+ import { execFile as execFileCallback, spawn } from "node:child_process";
2
+ import { createServer } from "node:http";
3
+ import fs, { mkdir, mkdtemp, readFile, readdir, rm, utimes, writeFile } from "node:fs/promises";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import { promisify } from "node:util";
7
+ import { afterEach, describe, expect, it, vi } from "vitest";
8
+ import { getActiveStepContext, measureStartupStep } from "./acpx-engine/startup-timing.js";
9
+ import { prepareCommandManagedRuntime } from "./command-managed-runtime.js";
10
+ import { authorizeSandboxCallbackBridgeRequestWithRoutes, createCommandManagedSandboxCallbackBridgeQueueClient, createFileSystemSandboxCallbackBridgeQueueClient, createSandboxCallbackBridgeAsset, createSandboxCallbackBridgeToken, getSandboxBridgeProcessBodyLedgerSource, getSandboxCallbackBridgeServerSource, HTTP2_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST, sandboxCallbackBridgeDirectories, syncRemoteTextFileWithHashSkip, syncSandboxCallbackBridgeEntrypoint, startSandboxCallbackBridgeServer, startSandboxCallbackBridgeWorker, } from "./sandbox-callback-bridge.js";
11
+ import { DUPLEX_FRAME_VERSION, encodeDuplexFrame } from "./duplex-frame-codec.js";
12
+ import { createHttp2BridgeServer } from "./http2-bridge-server.js";
13
+ const execFile = promisify(execFileCallback);
14
+ describe("sandbox callback bridge", () => {
15
+ const cleanupDirs = [];
16
+ function queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset) {
17
+ return {
18
+ runner,
19
+ spec: {
20
+ remoteCwd: remoteWorkspaceDir,
21
+ timeoutMs: 30_000,
22
+ },
23
+ adapterKey: "codex",
24
+ workspaceLocalDir: localWorkspaceDir,
25
+ assets: [
26
+ {
27
+ key: "bridge",
28
+ localDir: bridgeAsset.localDir,
29
+ },
30
+ ],
31
+ };
32
+ }
33
+ function createWorkerWaiter() {
34
+ return async (predicate, timeoutMs) => {
35
+ const deadline = Date.now() + timeoutMs;
36
+ while (Date.now() < deadline) {
37
+ if (predicate()) {
38
+ return;
39
+ }
40
+ await new Promise((resolve) => setTimeout(resolve, 5));
41
+ }
42
+ throw new Error("waitFor timed out");
43
+ };
44
+ }
45
+ function virtualQueueReadClient(directories, requestBodies) {
46
+ return {
47
+ makeDir: async () => { },
48
+ makeDirs: async () => { },
49
+ listJsonFiles: async (dir) => dir === directories.requestsDir
50
+ ? [...requestBodies.keys()].map((entry) => path.posix.basename(entry)).sort()
51
+ : [],
52
+ readTextFile: async (remotePath) => {
53
+ const body = requestBodies.get(remotePath);
54
+ if (body === undefined) {
55
+ throw new Error(`missing request ${remotePath}`);
56
+ }
57
+ return body;
58
+ },
59
+ writeTextFile: async () => { },
60
+ };
61
+ }
62
+ const cleanupFns = [];
63
+ function createExecRunner() {
64
+ return {
65
+ execute: async (input) => {
66
+ const startedAt = new Date().toISOString();
67
+ const env = {
68
+ ...process.env,
69
+ ...input.env,
70
+ };
71
+ const command = input.command === "sh" ? "/bin/sh" : input.command === "bash" ? "/bin/bash" : input.command;
72
+ const args = [...(input.args ?? [])];
73
+ if (input.stdin != null &&
74
+ (input.command === "sh" || input.command === "bash") &&
75
+ (args[0] === "-c" || args[0] === "-lc") &&
76
+ typeof args[1] === "string") {
77
+ env.PAPERCLIP_TEST_STDIN = input.stdin;
78
+ args[1] = `printf '%s' \"$PAPERCLIP_TEST_STDIN\" | (${args[1]})`;
79
+ }
80
+ try {
81
+ const result = await execFile(command, args, {
82
+ cwd: input.cwd,
83
+ env,
84
+ maxBuffer: 32 * 1024 * 1024,
85
+ timeout: input.timeoutMs,
86
+ });
87
+ return {
88
+ exitCode: 0,
89
+ signal: null,
90
+ timedOut: false,
91
+ stdout: result.stdout,
92
+ stderr: result.stderr,
93
+ pid: null,
94
+ startedAt,
95
+ };
96
+ }
97
+ catch (error) {
98
+ const err = error;
99
+ return {
100
+ exitCode: typeof err.code === "number" ? err.code : null,
101
+ signal: err.signal ?? null,
102
+ timedOut: Boolean(err.killed && input.timeoutMs),
103
+ stdout: err.stdout ?? "",
104
+ stderr: err.stderr ?? "",
105
+ pid: null,
106
+ startedAt,
107
+ };
108
+ }
109
+ },
110
+ };
111
+ }
112
+ // Match the gateway's atomic publication. A visible, growing .json file can
113
+ // be stat'ed while empty and exceed the reader's reserved size on the read.
114
+ function publishBridgeRequest(requestPath, body) {
115
+ return createFileSystemSandboxCallbackBridgeQueueClient().writeTextFile(requestPath, body);
116
+ }
117
+ async function waitForJsonFile(directory, timeoutMs = 2_000) {
118
+ const deadline = Date.now() + timeoutMs;
119
+ while (Date.now() < deadline) {
120
+ const entries = await readdir(directory).catch(() => []);
121
+ const match = entries.find((entry) => entry.endsWith(".json"));
122
+ if (match)
123
+ return match;
124
+ await new Promise((resolve) => setTimeout(resolve, 10));
125
+ }
126
+ throw new Error(`Timed out waiting for a JSON file in ${directory}.`);
127
+ }
128
+ afterEach(async () => {
129
+ while (cleanupFns.length > 0) {
130
+ const cleanup = cleanupFns.pop();
131
+ if (!cleanup)
132
+ continue;
133
+ await cleanup().catch(() => undefined);
134
+ }
135
+ while (cleanupDirs.length > 0) {
136
+ const dir = cleanupDirs.pop();
137
+ if (!dir)
138
+ continue;
139
+ await rm(dir, { recursive: true, force: true }).catch(() => undefined);
140
+ }
141
+ });
142
+ it("round-trips localhost bridge requests over the sandbox queue without forwarding the bridge token", async () => {
143
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-runtime-"));
144
+ cleanupDirs.push(rootDir);
145
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
146
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
147
+ await mkdir(localWorkspaceDir, { recursive: true });
148
+ await mkdir(remoteWorkspaceDir, { recursive: true });
149
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge test\n", "utf8");
150
+ const runner = createExecRunner();
151
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
152
+ cleanupFns.push(bridgeAsset.cleanup);
153
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
154
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
155
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
156
+ const bridgeToken = createSandboxCallbackBridgeToken();
157
+ const seenRequests = [];
158
+ const worker = await startSandboxCallbackBridgeWorker({
159
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
160
+ queueDir,
161
+ authorizeRequest: async (request) => ["/api/agents/me", "/runtime-tools/github/credentials"].includes(request.path) ? null
162
+ : request.path.endsWith("/agent-commentary") ? authorizeSandboxCallbackBridgeRequestWithRoutes(request)
163
+ : `Route not allowed: ${request.method} ${request.path}`,
164
+ handleRequest: async (request) => {
165
+ seenRequests.push({
166
+ method: request.method,
167
+ path: request.path,
168
+ query: request.query,
169
+ headers: request.headers,
170
+ body: request.body,
171
+ });
172
+ return {
173
+ status: 200,
174
+ headers: {
175
+ "content-type": "application/json",
176
+ etag: '"bridge-rev-1"',
177
+ "last-modified": "Tue, 01 Apr 2025 00:00:00 GMT",
178
+ },
179
+ body: JSON.stringify({
180
+ ok: true,
181
+ method: request.method,
182
+ path: request.path,
183
+ }),
184
+ };
185
+ },
186
+ });
187
+ cleanupFns.push(async () => {
188
+ await worker.stop();
189
+ });
190
+ const bridge = await startSandboxCallbackBridgeServer({
191
+ runner,
192
+ remoteCwd: remoteWorkspaceDir,
193
+ assetRemoteDir: prepared.assetDirs.bridge,
194
+ queueDir,
195
+ bridgeToken,
196
+ timeoutMs: 30_000,
197
+ });
198
+ cleanupFns.push(async () => {
199
+ await bridge.stop();
200
+ });
201
+ const okResponse = await fetch(`${bridge.baseUrl}/api/agents/me?view=compact`, {
202
+ headers: {
203
+ authorization: `Bearer ${bridgeToken}`,
204
+ accept: "application/json",
205
+ "if-none-match": '"client-cache-key"',
206
+ "x-paperclip-run-id": "run-bridge-1",
207
+ "x-bridge-debug": "drop-me",
208
+ },
209
+ });
210
+ expect(okResponse.status).toBe(200);
211
+ expect(okResponse.headers.get("content-type")).toContain("application/json");
212
+ expect(okResponse.headers.get("etag")).toBe('"bridge-rev-1"');
213
+ expect(okResponse.headers.get("last-modified")).toBe("Tue, 01 Apr 2025 00:00:00 GMT");
214
+ await expect(okResponse.json()).resolves.toMatchObject({
215
+ ok: true,
216
+ method: "GET",
217
+ path: "/api/agents/me",
218
+ });
219
+ const deniedResponse = await fetch(`${bridge.baseUrl}/api/issues/issue-1`, {
220
+ method: "PATCH",
221
+ headers: {
222
+ authorization: `Bearer ${bridgeToken}`,
223
+ "content-type": "application/json",
224
+ },
225
+ body: JSON.stringify({ status: "in_progress" }),
226
+ });
227
+ expect(deniedResponse.status).toBe(403);
228
+ await expect(deniedResponse.json()).resolves.toMatchObject({
229
+ error: "Route not allowed: PATCH /api/issues/issue-1",
230
+ });
231
+ const unauthorizedResponse = await fetch(`${bridge.baseUrl}/api/agents/me`, {
232
+ headers: {
233
+ authorization: "Bearer wrong-token",
234
+ },
235
+ });
236
+ expect(unauthorizedResponse.status).toBe(401);
237
+ await expect(unauthorizedResponse.json()).resolves.toMatchObject({
238
+ error: "Invalid bridge token.",
239
+ });
240
+ expect(seenRequests).toHaveLength(1);
241
+ expect(seenRequests[0]).toMatchObject({
242
+ method: "GET",
243
+ path: "/api/agents/me",
244
+ query: "?view=compact",
245
+ body: "",
246
+ headers: {
247
+ accept: "application/json",
248
+ "if-none-match": '"client-cache-key"',
249
+ },
250
+ });
251
+ expect(seenRequests[0]?.headers.authorization).toBeUndefined();
252
+ expect(seenRequests[0]?.headers["x-paperclip-run-id"]).toBeUndefined();
253
+ // The public Paperclip API documents the "X-API-Key" header, so an agent in
254
+ // the sandbox sends that header before it sends "Authorization: Bearer".
255
+ // The gateway accepts the same per-run token through either header.
256
+ const apiKeyResponse = await fetch(`${bridge.baseUrl}/api/agents/me`, {
257
+ headers: {
258
+ "x-api-key": bridgeToken,
259
+ accept: "application/json",
260
+ },
261
+ });
262
+ expect(apiKeyResponse.status).toBe(200);
263
+ await expect(apiKeyResponse.json()).resolves.toMatchObject({
264
+ ok: true,
265
+ method: "GET",
266
+ path: "/api/agents/me",
267
+ });
268
+ // A wrong token in the same header still fails closed.
269
+ const apiKeyDeniedResponse = await fetch(`${bridge.baseUrl}/api/agents/me`, {
270
+ headers: {
271
+ "x-api-key": "wrong-token",
272
+ },
273
+ });
274
+ expect(apiKeyDeniedResponse.status).toBe(401);
275
+ await expect(apiKeyDeniedResponse.json()).resolves.toMatchObject({
276
+ error: "Invalid bridge token.",
277
+ });
278
+ // The header allowlist strips the credential header, so the token never
279
+ // leaves the sandbox with the forwarded request.
280
+ expect(seenRequests).toHaveLength(2);
281
+ expect(seenRequests[1]).toMatchObject({
282
+ method: "GET",
283
+ path: "/api/agents/me",
284
+ });
285
+ expect(seenRequests[1]?.headers["x-api-key"]).toBeUndefined();
286
+ const githubResponse = await fetch(`${bridge.baseUrl}/runtime-tools/github/credentials`, {
287
+ method: "POST",
288
+ headers: {
289
+ authorization: `Bearer ${bridgeToken}`,
290
+ "content-type": "application/json",
291
+ "x-paperclip-github-capability": "test-run-scoped-capability",
292
+ },
293
+ body: "{}",
294
+ });
295
+ expect(githubResponse.status).toBe(200);
296
+ await githubResponse.arrayBuffer();
297
+ expect(seenRequests[2]).toMatchObject({
298
+ method: "POST", path: "/runtime-tools/github/credentials", body: "{}",
299
+ headers: { "x-paperclip-github-capability": "test-run-scoped-capability" },
300
+ });
301
+ expect(seenRequests[2]?.headers.authorization).toBeUndefined();
302
+ const feedbackBody = JSON.stringify({ kind: "complaint", body: "😭".repeat(5000), idempotencyKey: "bridge-feedback" });
303
+ const feedbackResponse = await fetch(`${bridge.baseUrl}/api/companies/company-1/agent-commentary`, {
304
+ method: "POST", headers: { authorization: `Bearer ${bridgeToken}`, "content-type": "application/json" }, body: feedbackBody,
305
+ });
306
+ expect(feedbackResponse.status).toBe(200);
307
+ await feedbackResponse.arrayBuffer();
308
+ expect(seenRequests).toHaveLength(4);
309
+ expect(seenRequests[3]).toMatchObject({ method: "POST", path: "/api/companies/company-1/agent-commentary", body: feedbackBody });
310
+ expect(seenRequests[3]?.headers.authorization).toBeUndefined();
311
+ });
312
+ it("publishes complete fixture envelopes before queue readers can reserve their size", async () => {
313
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-publication-"));
314
+ cleanupDirs.push(rootDir);
315
+ const client = createFileSystemSandboxCallbackBridgeQueueClient();
316
+ const requestPath = path.join(rootDir, "fixture.json");
317
+ const payload = JSON.stringify({ id: "fixture", method: "GET", path: "/api/openapi.json", body: "" });
318
+ const listingsDuringWrite = [];
319
+ const write = fs.writeFile.bind(fs);
320
+ // Force a poll while the writer has created its file but not filled it.
321
+ // A direct .json write would become visible and reserve zero bytes here.
322
+ const spy = vi.spyOn(fs, "writeFile").mockImplementation(async (file, body, options) => {
323
+ if (typeof file !== "string" || path.dirname(file) !== rootDir)
324
+ return write(file, body, options);
325
+ await write(file, "", options);
326
+ const visible = await client.listJsonFiles(rootDir);
327
+ listingsDuringWrite.push(visible);
328
+ const reserved = visible.includes("fixture.json") ? await client.fileSize(requestPath) : null;
329
+ await write(file, body, options);
330
+ if (reserved !== null)
331
+ await client.readTextFile(requestPath, reserved);
332
+ });
333
+ try {
334
+ await publishBridgeRequest(requestPath, payload);
335
+ expect(listingsDuringWrite).toEqual([[]]);
336
+ expect(await client.listJsonFiles(rootDir)).toEqual(["fixture.json"]);
337
+ const size = await client.fileSize(requestPath);
338
+ expect(size).toBe(Buffer.byteLength(payload));
339
+ await expect(client.readTextFile(requestPath, size)).resolves.toBe(payload);
340
+ }
341
+ finally {
342
+ spy.mockRestore();
343
+ }
344
+ });
345
+ it("keeps the bounded reader fail-closed when a visible request grows after its size is reserved", async () => {
346
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-growing-request-"));
347
+ cleanupDirs.push(rootDir);
348
+ const queueDir = path.join(rootDir, "queue");
349
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
350
+ const client = createFileSystemSandboxCallbackBridgeQueueClient();
351
+ const requestPath = path.join(directories.requestsDir, "growing.json");
352
+ await mkdir(directories.requestsDir, { recursive: true });
353
+ // Deliberately violate the publication contract to reproduce the old
354
+ // fixture interleaving, without timing assumptions or a weakened limit.
355
+ await writeFile(requestPath, "");
356
+ const payload = JSON.stringify({ id: "growing", method: "GET", path: "/api/openapi.json", body: "" });
357
+ let reserved;
358
+ const handleRequest = vi.fn(async () => ({ status: 200, body: "unexpected" }));
359
+ const warn = vi.spyOn(console, "warn").mockImplementation(() => { });
360
+ try {
361
+ const worker = await startSandboxCallbackBridgeWorker({
362
+ queueDir, handleRequest,
363
+ client: { ...client, fileSize: async (file) => {
364
+ const size = await client.fileSize(file);
365
+ if (file === requestPath && reserved === undefined) {
366
+ reserved = size;
367
+ await writeFile(requestPath, payload);
368
+ }
369
+ return size;
370
+ } },
371
+ });
372
+ cleanupFns.push(() => worker.stop());
373
+ const responseFile = await waitForJsonFile(directories.responsesDir);
374
+ const response = JSON.parse(await readFile(path.join(directories.responsesDir, responseFile), "utf8"));
375
+ expect(reserved).toBe(0);
376
+ expect(response.status).toBe(503);
377
+ expect(JSON.parse(response.body)).toEqual({
378
+ error: "Sandbox callback bridge worker failed: Bridge envelope exceeded the configured size limit.",
379
+ });
380
+ expect(warn).toHaveBeenCalledWith(expect.stringContaining("Bridge envelope exceeded the configured size limit."));
381
+ expect(handleRequest).not.toHaveBeenCalled();
382
+ await worker.stop();
383
+ }
384
+ finally {
385
+ warn.mockRestore();
386
+ }
387
+ });
388
+ it("serves schema discovery over the queue and denies schema mutations and lookalikes", async () => {
389
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-schema-"));
390
+ cleanupDirs.push(rootDir);
391
+ const queueDir = path.join(rootDir, "queue");
392
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
393
+ const schema = { openapi: "3.1.0", paths: {} };
394
+ const forwarded = [];
395
+ const worker = await startSandboxCallbackBridgeWorker({
396
+ client: createFileSystemSandboxCallbackBridgeQueueClient(), queueDir,
397
+ handleRequest: async (request) => {
398
+ forwarded.push(`${request.method} ${request.path}`);
399
+ return { status: 200, body: JSON.stringify(schema) };
400
+ },
401
+ });
402
+ cleanupFns.push(() => worker.stop());
403
+ const requests = [
404
+ { method: "GET", path: "/api/openapi.json" },
405
+ { method: "POST", path: "/api/openapi.json" },
406
+ { method: "PATCH", path: "/api/openapi.json" },
407
+ { method: "DELETE", path: "/api/openapi.json" },
408
+ { method: "GET", path: "/api/openapi.json/extra" },
409
+ { method: "GET", path: "/api/openapiXjson" },
410
+ { method: "GET", path: "/api/secrets" },
411
+ ];
412
+ for (const [index, request] of requests.entries()) {
413
+ await publishBridgeRequest(path.join(directories.requestsDir, `schema-${index}.json`), JSON.stringify({
414
+ id: `schema-${index}`, ...request, query: "", headers: {}, body: "", createdAt: new Date().toISOString(),
415
+ }));
416
+ }
417
+ await vi.waitFor(async () => {
418
+ expect(await createFileSystemSandboxCallbackBridgeQueueClient().listJsonFiles(directories.responsesDir))
419
+ .toEqual(requests.map((_, index) => `schema-${index}.json`));
420
+ }, { timeout: 5_000 });
421
+ for (const [index] of requests.entries()) {
422
+ const response = JSON.parse(await readFile(path.join(directories.responsesDir, `schema-${index}.json`), "utf8"));
423
+ expect(response.status).toBe(index === 0 ? 200 : 403);
424
+ if (index === 0)
425
+ expect(JSON.parse(response.body)).toEqual(schema);
426
+ }
427
+ expect(forwarded).toEqual(["GET /api/openapi.json"]);
428
+ });
429
+ it("denies non-allowlisted requests by default", async () => {
430
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-default-policy-"));
431
+ cleanupDirs.push(rootDir);
432
+ const queueDir = path.posix.join(rootDir, "queue");
433
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
434
+ let handled = 0;
435
+ const worker = await startSandboxCallbackBridgeWorker({
436
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
437
+ queueDir,
438
+ handleRequest: async () => {
439
+ handled += 1;
440
+ return {
441
+ status: 200,
442
+ body: "should not happen",
443
+ };
444
+ },
445
+ });
446
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-1.json"), `${JSON.stringify({
447
+ id: "req-1",
448
+ method: "DELETE",
449
+ path: "/api/secrets",
450
+ query: "",
451
+ headers: {},
452
+ body: "",
453
+ createdAt: new Date().toISOString(),
454
+ })}\n`);
455
+ await worker.stop({ drainTimeoutMs: 1_000 });
456
+ const response = JSON.parse(await readFile(path.posix.join(directories.responsesDir, "req-1.json"), "utf8"));
457
+ expect(handled).toBe(0);
458
+ expect(response.status).toBe(403);
459
+ expect(JSON.parse(response.body)).toEqual({
460
+ error: "Route not allowed: DELETE /api/secrets",
461
+ });
462
+ });
463
+ it("drains already-queued requests on stop", async () => {
464
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-drain-"));
465
+ cleanupDirs.push(rootDir);
466
+ const queueDir = path.posix.join(rootDir, "queue");
467
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
468
+ const processed = [];
469
+ const worker = await startSandboxCallbackBridgeWorker({
470
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
471
+ queueDir,
472
+ authorizeRequest: async () => null,
473
+ handleRequest: async (request) => {
474
+ processed.push(request.id);
475
+ await new Promise((resolve) => setTimeout(resolve, 25));
476
+ return {
477
+ status: 200,
478
+ body: request.id,
479
+ };
480
+ },
481
+ });
482
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-a.json"), `${JSON.stringify({
483
+ id: "req-a",
484
+ method: "GET",
485
+ path: "/api/agents/me",
486
+ query: "",
487
+ headers: {},
488
+ body: "",
489
+ createdAt: new Date().toISOString(),
490
+ })}\n`);
491
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-b.json"), `${JSON.stringify({
492
+ id: "req-b",
493
+ method: "GET",
494
+ path: "/api/agents/me",
495
+ query: "",
496
+ headers: {},
497
+ body: "",
498
+ createdAt: new Date().toISOString(),
499
+ })}\n`);
500
+ await worker.stop({ drainTimeoutMs: 1_000 });
501
+ expect(processed).toEqual(["req-a", "req-b"]);
502
+ await expect(readFile(path.posix.join(directories.responsesDir, "req-a.json"), "utf8")).resolves.toContain("\"req-a\"");
503
+ await expect(readFile(path.posix.join(directories.responsesDir, "req-b.json"), "utf8")).resolves.toContain("\"req-b\"");
504
+ });
505
+ it("writes fast 503 responses for queued requests that miss the drain deadline", async () => {
506
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-drain-timeout-"));
507
+ cleanupDirs.push(rootDir);
508
+ const queueDir = path.posix.join(rootDir, "queue");
509
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
510
+ const processed = [];
511
+ let signalStarted;
512
+ const started = new Promise(resolve => { signalStarted = resolve; });
513
+ const worker = await startSandboxCallbackBridgeWorker({
514
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
515
+ queueDir,
516
+ authorizeRequest: async () => null,
517
+ handleRequest: async (request) => {
518
+ processed.push(request.id);
519
+ signalStarted();
520
+ await new Promise((resolve) => setTimeout(resolve, 100));
521
+ return {
522
+ status: 200,
523
+ body: request.id,
524
+ };
525
+ },
526
+ });
527
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-a.json"), `${JSON.stringify({
528
+ id: "req-a",
529
+ method: "GET",
530
+ path: "/api/agents/me",
531
+ query: "",
532
+ headers: {},
533
+ body: "",
534
+ createdAt: new Date().toISOString(),
535
+ })}\n`);
536
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-b.json"), `${JSON.stringify({
537
+ id: "req-b",
538
+ method: "GET",
539
+ path: "/api/agents/me",
540
+ query: "",
541
+ headers: {},
542
+ body: "",
543
+ createdAt: new Date().toISOString(),
544
+ })}\n`);
545
+ // Begin the short drain deadline only after the first handler has started.
546
+ // A fixed 250ms polling window can expire during a loaded test run.
547
+ await started;
548
+ await worker.stop({ drainTimeoutMs: 10 });
549
+ expect(processed).toEqual(["req-a"]);
550
+ await expect(readFile(path.posix.join(directories.responsesDir, "req-a.json"), "utf8")).resolves.toContain("\"req-a\"");
551
+ await expect(readFile(path.posix.join(directories.responsesDir, "req-b.json"), "utf8")).resolves.toContain("Bridge worker stopped before request could be handled.");
552
+ });
553
+ it("handles SSH queue polling failures without emitting an unhandled rejection", async () => {
554
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-ssh-failure-"));
555
+ cleanupDirs.push(rootDir);
556
+ const queueDir = path.posix.join(rootDir, "queue");
557
+ const unhandled = [];
558
+ const onUnhandledRejection = (reason) => {
559
+ unhandled.push(reason);
560
+ };
561
+ process.on("unhandledRejection", onUnhandledRejection);
562
+ try {
563
+ const worker = await startSandboxCallbackBridgeWorker({
564
+ client: {
565
+ makeDir: async () => { },
566
+ makeDirs: async () => { },
567
+ listJsonFiles: async () => {
568
+ throw new Error("list /remote/.paperclip-runtime/gemini/paperclip-bridge/queue/requests failed with exit code 255: kex_exchange_identification: read: Connection reset by peer");
569
+ },
570
+ readTextFile: async () => {
571
+ throw new Error("unexpected readTextFile");
572
+ },
573
+ writeTextFile: async () => {
574
+ throw new Error("unexpected writeTextFile");
575
+ },
576
+ rename: async () => {
577
+ throw new Error("unexpected rename");
578
+ },
579
+ remove: async () => { },
580
+ },
581
+ queueDir,
582
+ authorizeRequest: async () => null,
583
+ handleRequest: async () => ({
584
+ status: 200,
585
+ body: "ok",
586
+ }),
587
+ });
588
+ await new Promise((resolve) => setTimeout(resolve, 50));
589
+ await worker.stop();
590
+ expect(unhandled).toEqual([]);
591
+ }
592
+ finally {
593
+ process.off("unhandledRejection", onUnhandledRejection);
594
+ }
595
+ });
596
+ it("recovers from transient queue polling failures and keeps relaying requests", async () => {
597
+ // A single reset or slow sandbox exec used to unwind the poll loop into its
598
+ // terminal catch, killing the relay for the rest of the run. The loop must
599
+ // instead back off, retry, and still deliver requests queued after the
600
+ // failure window.
601
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-transient-"));
602
+ cleanupDirs.push(rootDir);
603
+ const queueDir = path.posix.join(rootDir, "queue");
604
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
605
+ const baseClient = createFileSystemSandboxCallbackBridgeQueueClient();
606
+ let listCalls = 0;
607
+ const client = {
608
+ ...baseClient,
609
+ listJsonFiles: async (dirPath) => {
610
+ listCalls += 1;
611
+ if (listCalls <= 3) {
612
+ throw new Error("list requests failed: kex_exchange_identification: read: Connection reset by peer");
613
+ }
614
+ return baseClient.listJsonFiles(dirPath);
615
+ },
616
+ };
617
+ const seenPaths = [];
618
+ const worker = await startSandboxCallbackBridgeWorker({
619
+ client,
620
+ queueDir,
621
+ authorizeRequest: async () => null,
622
+ handleRequest: async (request) => {
623
+ seenPaths.push(request.path);
624
+ return {
625
+ status: 200,
626
+ headers: { "content-type": "application/json" },
627
+ body: JSON.stringify({ ok: true }),
628
+ };
629
+ },
630
+ });
631
+ cleanupFns.push(async () => {
632
+ await worker.stop();
633
+ });
634
+ const requestId = "transient-recovery-1";
635
+ await publishBridgeRequest(path.join(directories.requestsDir, `${requestId}.json`), JSON.stringify({
636
+ id: requestId,
637
+ method: "GET",
638
+ path: "/api/agents/me",
639
+ query: "",
640
+ headers: {},
641
+ body: "",
642
+ }));
643
+ const responseFile = await waitForJsonFile(directories.responsesDir, 10_000);
644
+ const raw = await readFile(path.join(directories.responsesDir, responseFile), "utf8");
645
+ expect(JSON.parse(raw)).toMatchObject({ id: requestId, status: 200 });
646
+ expect(seenPaths).toEqual(["/api/agents/me"]);
647
+ expect(listCalls).toBeGreaterThan(3);
648
+ });
649
+ it("keeps the queue-directory setup on the startup step but resets the poll loop store", async () => {
650
+ // The worker starts inside the measured `bridge.paperclip` step. Its awaited
651
+ // queue-directory setup is startup work, so a `makeDir` `sandbox.exec` span
652
+ // must keep the active step and its `criticalPath` flag. The long-lived poll
653
+ // loop runs run-time execs for the whole run, so a loop `sandbox.exec` span
654
+ // must open unparented with no stale flag. This test reads the active step in
655
+ // both places and proves the boundary sits at the loop, not the whole worker.
656
+ let setupStep = "unset";
657
+ let loopStep = "unset";
658
+ let resolveFirstPoll = () => { };
659
+ const firstPoll = new Promise((resolve) => {
660
+ resolveFirstPoll = resolve;
661
+ });
662
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-step-store-"));
663
+ cleanupDirs.push(rootDir);
664
+ const queueDir = path.posix.join(rootDir, "queue");
665
+ const worker = await measureStartupStep({}, () => 0, "bridge.paperclip", () => startSandboxCallbackBridgeWorker({
666
+ client: {
667
+ makeDir: async () => {
668
+ setupStep = getActiveStepContext();
669
+ },
670
+ makeDirs: async () => {
671
+ setupStep = getActiveStepContext();
672
+ },
673
+ listJsonFiles: async () => {
674
+ loopStep = getActiveStepContext();
675
+ resolveFirstPoll();
676
+ return [];
677
+ },
678
+ readTextFile: async () => {
679
+ throw new Error("unexpected readTextFile");
680
+ },
681
+ writeTextFile: async () => {
682
+ throw new Error("unexpected writeTextFile");
683
+ },
684
+ rename: async () => {
685
+ throw new Error("unexpected rename");
686
+ },
687
+ remove: async () => { },
688
+ },
689
+ queueDir,
690
+ authorizeRequest: async () => null,
691
+ handleRequest: async () => ({ status: 200, body: "ok" }),
692
+ }), { criticalPath: false });
693
+ await firstPoll;
694
+ await worker.stop();
695
+ // The setup ran on the active step, so its exec span parents to the step.
696
+ expect(setupStep).not.toBe("unset");
697
+ expect(setupStep).not.toBeNull();
698
+ expect(setupStep.criticalPath).toBe(false);
699
+ // The loop ran outside that store, so its exec span opens unparented with no
700
+ // stale `criticalPath` flag.
701
+ expect(loopStep).toBeNull();
702
+ });
703
+ it("test_paperclip_loop_exec_parents_to_run_context", async () => {
704
+ // The worker starts inside the measured `bridge.paperclip` step. Its awaited
705
+ // queue-directory setup is startup work and keeps the active step. The poll
706
+ // loop shell stays outside that store. But a per-request unit of work is
707
+ // run-time work, so the worker runs each request under the current-run
708
+ // parent context. A request `sandbox.exec` span then parents to the live run
709
+ // span, not to the ended startup step. This test drives the worker with a
710
+ // `getRuntimeParentContext` that returns a known token, queues one request,
711
+ // and proves the request work reads that token from the active step store.
712
+ const runParentToken = { marker: "run-parent-token" };
713
+ let setupStep = "unset";
714
+ let requestStep = "unset";
715
+ let served = false;
716
+ let resolveServed = () => { };
717
+ const requestServed = new Promise((resolve) => {
718
+ resolveServed = resolve;
719
+ });
720
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-run-parent-"));
721
+ cleanupDirs.push(rootDir);
722
+ const queueDir = path.posix.join(rootDir, "queue");
723
+ const worker = await measureStartupStep({}, () => 0, "bridge.paperclip", () => startSandboxCallbackBridgeWorker({
724
+ client: {
725
+ makeDir: async () => {
726
+ setupStep = getActiveStepContext();
727
+ },
728
+ makeDirs: async () => {
729
+ setupStep = getActiveStepContext();
730
+ },
731
+ // Return one request on the first poll, then nothing.
732
+ listJsonFiles: async () => (served ? [] : ["000000000001.json"]),
733
+ readTextFile: async () => JSON.stringify({ id: "req-1", method: "GET", path: "/", query: "", headers: {}, body: "" }),
734
+ writeTextFile: async () => { },
735
+ rename: async () => { },
736
+ remove: async () => { },
737
+ },
738
+ queueDir,
739
+ authorizeRequest: async () => null,
740
+ handleRequest: async () => {
741
+ requestStep = getActiveStepContext();
742
+ served = true;
743
+ resolveServed();
744
+ return { status: 200, body: "ok" };
745
+ },
746
+ getRuntimeParentContext: () => runParentToken,
747
+ }), { criticalPath: false });
748
+ await requestServed;
749
+ await worker.stop();
750
+ // The setup ran on the active step, so its exec span parents to the step.
751
+ expect(setupStep).not.toBe("unset");
752
+ expect(setupStep).not.toBeNull();
753
+ // The request work ran under the run parent context. Its exec span parents
754
+ // to the run token, not to the ended startup step, and it carries no
755
+ // startup `criticalPath` flag.
756
+ expect(requestStep).not.toBe("unset");
757
+ expect(requestStep).not.toBeNull();
758
+ expect(requestStep.parentContext).toBe(runParentToken);
759
+ expect(requestStep.criticalPath).toBe(false);
760
+ });
761
+ it("wraps each request in a sandbox.callbackBridge.relayRequest span", async () => {
762
+ // With a span runner injected, the worker wraps each request in one
763
+ // `sandbox.callbackBridge.relayRequest` span, so the request's read, write,
764
+ // and remove execs group under one named span. This test drives the worker
765
+ // with a recording runner and proves it opens the wrapper span around the
766
+ // request work.
767
+ const wrapped = [];
768
+ let served = false;
769
+ let resolveServed = () => { };
770
+ const requestServed = new Promise((resolve) => {
771
+ resolveServed = resolve;
772
+ });
773
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-relay-span-"));
774
+ cleanupDirs.push(rootDir);
775
+ const queueDir = path.posix.join(rootDir, "queue");
776
+ const worker = await startSandboxCallbackBridgeWorker({
777
+ client: {
778
+ makeDir: async () => { },
779
+ makeDirs: async () => { },
780
+ listJsonFiles: async () => (served ? [] : ["000000000001.json"]),
781
+ readTextFile: async () => JSON.stringify({ id: "req-1", method: "GET", path: "/", query: "", headers: {}, body: "" }),
782
+ writeTextFile: async () => { },
783
+ rename: async () => { },
784
+ remove: async () => { },
785
+ },
786
+ queueDir,
787
+ authorizeRequest: async () => null,
788
+ handleRequest: async () => {
789
+ served = true;
790
+ resolveServed();
791
+ return { status: 200, body: "ok" };
792
+ },
793
+ // Record each wrapper span name, then run the wrapped work.
794
+ runtimeSpan: async (name, work) => {
795
+ wrapped.push(name);
796
+ return work();
797
+ },
798
+ });
799
+ await requestServed;
800
+ await worker.stop();
801
+ expect(wrapped).toContain("sandbox.callbackBridge.relayRequest");
802
+ });
803
+ it("test_paperclip_loop_exec_stays_unparented_without_getter", async () => {
804
+ // With no `getRuntimeParentContext`, a request runs with an empty active
805
+ // step store, exactly like the earlier `runWithoutActiveStep` behavior. So a
806
+ // request `sandbox.exec` span opens unparented with no stale startup flag.
807
+ let requestStep = "unset";
808
+ let served = false;
809
+ let resolveServed = () => { };
810
+ const requestServed = new Promise((resolve) => {
811
+ resolveServed = resolve;
812
+ });
813
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-no-getter-"));
814
+ cleanupDirs.push(rootDir);
815
+ const queueDir = path.posix.join(rootDir, "queue");
816
+ const worker = await measureStartupStep({}, () => 0, "bridge.paperclip", () => startSandboxCallbackBridgeWorker({
817
+ client: {
818
+ makeDir: async () => { },
819
+ makeDirs: async () => { },
820
+ listJsonFiles: async () => (served ? [] : ["000000000001.json"]),
821
+ readTextFile: async () => JSON.stringify({ id: "req-1", method: "GET", path: "/", query: "", headers: {}, body: "" }),
822
+ writeTextFile: async () => { },
823
+ rename: async () => { },
824
+ remove: async () => { },
825
+ },
826
+ queueDir,
827
+ authorizeRequest: async () => null,
828
+ handleRequest: async () => {
829
+ requestStep = getActiveStepContext();
830
+ served = true;
831
+ resolveServed();
832
+ return { status: 200, body: "ok" };
833
+ },
834
+ }), { criticalPath: false });
835
+ await requestServed;
836
+ await worker.stop();
837
+ expect(requestStep).toBeNull();
838
+ });
839
+ it("serializes remote response writes so stop does not recreate a late orphaned response", async () => {
840
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-response-lock-"));
841
+ cleanupDirs.push(rootDir);
842
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
843
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
844
+ await mkdir(localWorkspaceDir, { recursive: true });
845
+ await mkdir(remoteWorkspaceDir, { recursive: true });
846
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge response lock test\n", "utf8");
847
+ const runner = createExecRunner();
848
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
849
+ cleanupFns.push(bridgeAsset.cleanup);
850
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
851
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
852
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
853
+ const bridgeToken = createSandboxCallbackBridgeToken();
854
+ const seenRequestIds = [];
855
+ const worker = await startSandboxCallbackBridgeWorker({
856
+ client: createCommandManagedSandboxCallbackBridgeQueueClient({
857
+ runner,
858
+ remoteCwd: remoteWorkspaceDir,
859
+ timeoutMs: 30_000,
860
+ }),
861
+ queueDir,
862
+ authorizeRequest: async () => null,
863
+ handleRequest: async (request) => {
864
+ seenRequestIds.push(request.id);
865
+ await new Promise((resolve) => setTimeout(resolve, 250));
866
+ return {
867
+ status: 200,
868
+ headers: { "content-type": "application/json" },
869
+ body: JSON.stringify({ ok: true, id: request.id }),
870
+ };
871
+ },
872
+ });
873
+ cleanupFns.push(async () => {
874
+ await worker.stop();
875
+ });
876
+ const bridge = await startSandboxCallbackBridgeServer({
877
+ runner,
878
+ remoteCwd: remoteWorkspaceDir,
879
+ assetRemoteDir: prepared.assetDirs.bridge,
880
+ queueDir,
881
+ bridgeToken,
882
+ timeoutMs: 30_000,
883
+ });
884
+ cleanupFns.push(async () => {
885
+ await bridge.stop();
886
+ });
887
+ const responsePromise = fetch(`${bridge.baseUrl}/api/agents/me`, {
888
+ headers: {
889
+ authorization: `Bearer ${bridgeToken}`,
890
+ },
891
+ });
892
+ for (let attempt = 0; attempt < 50 && seenRequestIds.length === 0; attempt += 1) {
893
+ await new Promise((resolve) => setTimeout(resolve, 5));
894
+ }
895
+ expect(seenRequestIds).toHaveLength(1);
896
+ await worker.stop({ drainTimeoutMs: 10 });
897
+ const response = await responsePromise;
898
+ expect(response.status).toBe(503);
899
+ await expect(response.json()).resolves.toEqual({
900
+ error: "Bridge worker stopped before request could be handled.",
901
+ });
902
+ await new Promise((resolve) => setTimeout(resolve, 300));
903
+ await expect(readdir(directories.responsesDir)).resolves.toEqual([]);
904
+ await expect(readdir(directories.responsesDir).then((entries) => entries.filter((entry) => entry.endsWith(".tmp") || entry.includes(".paperclip-write.lock")))).resolves.toEqual([]);
905
+ });
906
+ it("rejects non-JSON request bodies and full queues at the bridge server", async () => {
907
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-server-guards-"));
908
+ cleanupDirs.push(rootDir);
909
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
910
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
911
+ await mkdir(localWorkspaceDir, { recursive: true });
912
+ await mkdir(remoteWorkspaceDir, { recursive: true });
913
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge guard test\n", "utf8");
914
+ const runner = createExecRunner();
915
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
916
+ cleanupFns.push(bridgeAsset.cleanup);
917
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
918
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
919
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
920
+ const bridgeToken = createSandboxCallbackBridgeToken();
921
+ const bridge = await startSandboxCallbackBridgeServer({
922
+ runner,
923
+ remoteCwd: remoteWorkspaceDir,
924
+ assetRemoteDir: prepared.assetDirs.bridge,
925
+ queueDir,
926
+ bridgeToken,
927
+ timeoutMs: 30_000,
928
+ maxQueueDepth: 1,
929
+ });
930
+ cleanupFns.push(async () => {
931
+ await bridge.stop();
932
+ });
933
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "existing.json"), `${JSON.stringify({
934
+ id: "existing",
935
+ method: "GET",
936
+ path: "/api/agents/me",
937
+ query: "",
938
+ headers: {},
939
+ body: "",
940
+ createdAt: new Date().toISOString(),
941
+ })}\n`);
942
+ const queueFullResponse = await fetch(`${bridge.baseUrl}/api/agents/me`, {
943
+ headers: {
944
+ authorization: `Bearer ${bridgeToken}`,
945
+ },
946
+ });
947
+ expect(queueFullResponse.status).toBe(503);
948
+ await expect(queueFullResponse.json()).resolves.toEqual({
949
+ error: "Bridge request queue is full.",
950
+ });
951
+ await rm(path.posix.join(directories.requestsDir, "existing.json"), { force: true });
952
+ const nonJsonResponse = await fetch(`${bridge.baseUrl}/api/issues/issue-1/comments`, {
953
+ method: "POST",
954
+ headers: {
955
+ authorization: `Bearer ${bridgeToken}`,
956
+ "content-type": "text/plain",
957
+ },
958
+ body: "not json",
959
+ });
960
+ expect(nonJsonResponse.status).toBe(415);
961
+ await expect(nonJsonResponse.json()).resolves.toEqual({
962
+ error: "Bridge only accepts JSON request bodies.",
963
+ });
964
+ // The queue transport keeps its 415 gate for the attachment upload path
965
+ // too: it carries a string envelope only, so it never admits a binary body.
966
+ const attachmentOctetStreamResponse = await fetch(`${bridge.baseUrl}/api/companies/co-1/issues/issue-1/attachments`, {
967
+ method: "POST",
968
+ headers: {
969
+ authorization: `Bearer ${bridgeToken}`,
970
+ "content-type": "application/octet-stream",
971
+ },
972
+ body: Buffer.from([0x50, 0x4b, 0x03, 0x04]),
973
+ });
974
+ expect(attachmentOctetStreamResponse.status).toBe(415);
975
+ await expect(attachmentOctetStreamResponse.json()).resolves.toEqual({
976
+ error: "Bridge only accepts JSON request bodies.",
977
+ });
978
+ });
979
+ it("returns a 502 when the host response times out", async () => {
980
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-timeout-"));
981
+ cleanupDirs.push(rootDir);
982
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
983
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
984
+ await mkdir(localWorkspaceDir, { recursive: true });
985
+ await mkdir(remoteWorkspaceDir, { recursive: true });
986
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge timeout test\n", "utf8");
987
+ const runner = createExecRunner();
988
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
989
+ cleanupFns.push(bridgeAsset.cleanup);
990
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
991
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
992
+ const bridgeToken = createSandboxCallbackBridgeToken();
993
+ const bridge = await startSandboxCallbackBridgeServer({
994
+ runner,
995
+ remoteCwd: remoteWorkspaceDir,
996
+ assetRemoteDir: prepared.assetDirs.bridge,
997
+ queueDir,
998
+ bridgeToken,
999
+ timeoutMs: 30_000,
1000
+ pollIntervalMs: 10,
1001
+ responseTimeoutMs: 75,
1002
+ });
1003
+ cleanupFns.push(async () => {
1004
+ await bridge.stop();
1005
+ });
1006
+ const response = await fetch(`${bridge.baseUrl}/api/agents/me`, {
1007
+ headers: {
1008
+ authorization: `Bearer ${bridgeToken}`,
1009
+ },
1010
+ });
1011
+ expect(response.status).toBe(502);
1012
+ await expect(response.json()).resolves.toEqual({
1013
+ error: "Timed out waiting for host bridge response.",
1014
+ });
1015
+ });
1016
+ it("returns a 502 for malformed host response files", async () => {
1017
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-malformed-response-"));
1018
+ cleanupDirs.push(rootDir);
1019
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
1020
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
1021
+ await mkdir(localWorkspaceDir, { recursive: true });
1022
+ await mkdir(remoteWorkspaceDir, { recursive: true });
1023
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge malformed response test\n", "utf8");
1024
+ const runner = createExecRunner();
1025
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
1026
+ cleanupFns.push(bridgeAsset.cleanup);
1027
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
1028
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
1029
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1030
+ const bridgeToken = createSandboxCallbackBridgeToken();
1031
+ const bridge = await startSandboxCallbackBridgeServer({
1032
+ runner,
1033
+ remoteCwd: remoteWorkspaceDir,
1034
+ assetRemoteDir: prepared.assetDirs.bridge,
1035
+ queueDir,
1036
+ bridgeToken,
1037
+ timeoutMs: 30_000,
1038
+ pollIntervalMs: 10,
1039
+ responseTimeoutMs: 1_000,
1040
+ });
1041
+ cleanupFns.push(async () => {
1042
+ await bridge.stop();
1043
+ });
1044
+ const responsePromise = fetch(`${bridge.baseUrl}/api/agents/me`, {
1045
+ headers: {
1046
+ authorization: `Bearer ${bridgeToken}`,
1047
+ },
1048
+ });
1049
+ const requestFile = await waitForJsonFile(directories.requestsDir);
1050
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
1051
+ // Publish the complete malformed envelope atomically, like the host writer.
1052
+ // A direct write can instead exercise the reader's file-size race guard.
1053
+ await writeFile(`${responsePath}.tmp`, '{"status":200,"headers":{"content-type":"application/json"},"body"', "utf8");
1054
+ await fs.rename(`${responsePath}.tmp`, responsePath);
1055
+ const response = await responsePromise;
1056
+ expect(response.status).toBe(502);
1057
+ await expect(response.json()).resolves.toMatchObject({
1058
+ error: expect.stringMatching(/JSON|Unexpected|Unterminated/i),
1059
+ });
1060
+ });
1061
+ it("reuses an already-uploaded bridge entrypoint when the remote file hash matches", async () => {
1062
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-sync-"));
1063
+ cleanupDirs.push(rootDir);
1064
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
1065
+ const remoteAssetDir = path.posix.join(remoteWorkspaceDir, ".paperclip-runtime", "codex", "paperclip-bridge", "server");
1066
+ await mkdir(remoteWorkspaceDir, { recursive: true });
1067
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
1068
+ cleanupFns.push(bridgeAsset.cleanup);
1069
+ const originalSource = await readFile(bridgeAsset.entrypoint, "utf8");
1070
+ const expandedSource = `${originalSource}\n// bridge payload padding\n`;
1071
+ await writeFile(bridgeAsset.entrypoint, expandedSource, "utf8");
1072
+ const runner = createExecRunner();
1073
+ const first = await syncSandboxCallbackBridgeEntrypoint({
1074
+ runner,
1075
+ remoteCwd: remoteWorkspaceDir,
1076
+ assetRemoteDir: remoteAssetDir,
1077
+ bridgeAsset,
1078
+ timeoutMs: 30_000,
1079
+ });
1080
+ const second = await syncSandboxCallbackBridgeEntrypoint({
1081
+ runner,
1082
+ remoteCwd: remoteWorkspaceDir,
1083
+ assetRemoteDir: remoteAssetDir,
1084
+ bridgeAsset,
1085
+ timeoutMs: 30_000,
1086
+ });
1087
+ expect(first.uploaded).toBe(true);
1088
+ expect(second.uploaded).toBe(false);
1089
+ await expect(readFile(path.posix.join(remoteAssetDir, "paperclip-bridge-server.mjs"), "utf8")).resolves.toBe(expandedSource);
1090
+ await expect(readdir(remoteAssetDir).then((entries) => entries.filter((entry) => entry.endsWith(".paperclip-upload.b64") ||
1091
+ entry.endsWith(".partial") ||
1092
+ entry === ".paperclip-bridge-upload.lock"))).resolves.toEqual([]);
1093
+ });
1094
+ it("rejects a corrupted bridge entrypoint upload without committing a torn remote file", async () => {
1095
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-sync-corrupt-"));
1096
+ cleanupDirs.push(rootDir);
1097
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
1098
+ const remoteAssetDir = path.posix.join(remoteWorkspaceDir, ".paperclip-runtime", "codex", "paperclip-bridge", "server");
1099
+ await mkdir(remoteWorkspaceDir, { recursive: true });
1100
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
1101
+ cleanupFns.push(bridgeAsset.cleanup);
1102
+ const runner = {
1103
+ execute: async (input) => await createExecRunner().execute({
1104
+ ...input,
1105
+ stdin: input.stdin != null ? "" : input.stdin,
1106
+ }),
1107
+ };
1108
+ await expect(syncSandboxCallbackBridgeEntrypoint({
1109
+ runner,
1110
+ remoteCwd: remoteWorkspaceDir,
1111
+ assetRemoteDir: remoteAssetDir,
1112
+ bridgeAsset,
1113
+ timeoutMs: 30_000,
1114
+ })).rejects.toThrow(/sha mismatch/i);
1115
+ await expect(readFile(path.posix.join(remoteAssetDir, "paperclip-bridge-server.mjs"), "utf8")).rejects.toThrow();
1116
+ await expect(readdir(remoteAssetDir).then((entries) => entries.filter((entry) => entry.endsWith(".paperclip-upload.b64") ||
1117
+ entry.endsWith(".partial") ||
1118
+ entry === ".paperclip-bridge-upload.lock"))).resolves.toEqual([]);
1119
+ });
1120
+ // The process-session remote script is a static, Paperclip-authored `.mjs`
1121
+ // written into the sandbox on every bridge start. `syncRemoteTextFileWithHashSkip`
1122
+ // (which now backs that write, mirroring the bridge-entrypoint sha256 gate)
1123
+ // content-hash-skips it so a warm start where the remote script already matches
1124
+ // costs ZERO write execs instead of the prior ~3 (prepare/append/finalize base64
1125
+ // upload).
1126
+ it("test_process_session_script_skipped_when_remote_hash_matches: warm start with a matching remote hash writes 0 execs", async () => {
1127
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-hashskip-warm-"));
1128
+ cleanupDirs.push(rootDir);
1129
+ const remoteDir = path.join(rootDir, "runtime", "codex", "process-sessions");
1130
+ const remotePath = path.posix.join(remoteDir, "paperclip-process-session-remote.mjs");
1131
+ const lockDir = path.posix.join(remoteDir, ".paperclip-process-session-script.lock");
1132
+ const body = "console.log('process session remote script v1');\n";
1133
+ let execCount = 0;
1134
+ const inner = createExecRunner();
1135
+ const runner = {
1136
+ execute: async (input) => {
1137
+ execCount += 1;
1138
+ return inner.execute(input);
1139
+ },
1140
+ };
1141
+ const args = {
1142
+ runner,
1143
+ remoteCwd: rootDir,
1144
+ remoteDir,
1145
+ remotePath,
1146
+ body,
1147
+ label: "Process session remote script",
1148
+ action: "sync process session remote script",
1149
+ lockDir,
1150
+ timeoutMs: 30_000,
1151
+ };
1152
+ // Cold start: the script is uploaded (single sha-gate exec that writes).
1153
+ const first = await syncRemoteTextFileWithHashSkip(args);
1154
+ expect(first.uploaded).toBe(true);
1155
+ await expect(readFile(remotePath, "utf8")).resolves.toBe(body);
1156
+ // Warm start: the remote hash matches, so the write is skipped entirely.
1157
+ execCount = 0;
1158
+ const second = await syncRemoteTextFileWithHashSkip(args);
1159
+ expect(second.uploaded).toBe(false);
1160
+ // A single hash-gate round-trip that performed 0 writes (down from ~3 execs).
1161
+ expect(execCount).toBe(1);
1162
+ // sha is still returned on the skip path so callers get a well-formed result.
1163
+ expect(second.sha256).toBe(first.sha256);
1164
+ // The remote file is unchanged and no upload/partial/lock leftovers remain.
1165
+ await expect(readFile(remotePath, "utf8")).resolves.toBe(body);
1166
+ await expect(readdir(remoteDir).then((entries) => entries.filter((entry) => entry.endsWith(".paperclip-upload.b64") ||
1167
+ entry.endsWith(".partial") ||
1168
+ entry === ".paperclip-process-session-script.lock"))).resolves.toEqual([]);
1169
+ });
1170
+ it("creates every staged copy of a private file without group or other access", async () => {
1171
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-private-sync-"));
1172
+ cleanupDirs.push(rootDir);
1173
+ const shimDir = path.join(rootDir, "shim");
1174
+ const umaskLog = path.join(rootDir, "umask.log");
1175
+ await mkdir(shimDir);
1176
+ await writeFile(path.join(shimDir, "base64"), `#!/bin/sh\numask > ${JSON.stringify(umaskLog)}\nPATH=${JSON.stringify(process.env.PATH ?? "")} exec base64 "$@"\n`, { mode: 0o700 });
1177
+ const inner = createExecRunner();
1178
+ const runner = {
1179
+ execute: (input) => inner.execute({ ...input, env: { ...input.env, PATH: `${shimDir}:${process.env.PATH ?? ""}` } }),
1180
+ };
1181
+ const remoteDir = path.join(rootDir, "launchers");
1182
+ const remotePath = path.posix.join(remoteDir, "broker.json");
1183
+ const result = await syncRemoteTextFileWithHashSkip({
1184
+ runner, remoteCwd: rootDir, remoteDir, remotePath, body: "{\"token\":\"fixture\"}\n",
1185
+ label: "Private fixture", action: "sync private fixture",
1186
+ lockDir: path.posix.join(remoteDir, ".broker.json.lock"), private: true, timeoutMs: 30_000,
1187
+ });
1188
+ expect(result.uploaded).toBe(true);
1189
+ expect((await readFile(umaskLog, "utf8")).trim()).toMatch(/^0?077$/);
1190
+ expect((await fs.stat(remotePath)).mode & 0o777).toBe(0o600);
1191
+ });
1192
+ it("test_process_session_script_rewritten_on_hash_mismatch: a mismatched remote hash still rewrites the script", async () => {
1193
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-hashskip-cold-"));
1194
+ cleanupDirs.push(rootDir);
1195
+ const remoteDir = path.join(rootDir, "runtime", "codex", "process-sessions");
1196
+ const remotePath = path.posix.join(remoteDir, "paperclip-process-session-remote.mjs");
1197
+ const lockDir = path.posix.join(remoteDir, ".paperclip-process-session-script.lock");
1198
+ const body = "console.log('process session remote script v2');\n";
1199
+ // Pre-seed the remote with a DIFFERENT script (a prior/stale build).
1200
+ await mkdir(remoteDir, { recursive: true });
1201
+ await writeFile(remotePath, "console.log('stale remote script');\n", "utf8");
1202
+ const result = await syncRemoteTextFileWithHashSkip({
1203
+ runner: createExecRunner(),
1204
+ remoteCwd: rootDir,
1205
+ remoteDir,
1206
+ remotePath,
1207
+ body,
1208
+ label: "Process session remote script",
1209
+ action: "sync process session remote script",
1210
+ lockDir,
1211
+ timeoutMs: 30_000,
1212
+ });
1213
+ expect(result.uploaded).toBe(true);
1214
+ await expect(readFile(remotePath, "utf8")).resolves.toBe(body);
1215
+ });
1216
+ it("fails loud when the hash-skip sync exec errors instead of silently re-uploading", async () => {
1217
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-hashskip-fail-"));
1218
+ cleanupDirs.push(rootDir);
1219
+ const remoteDir = path.join(rootDir, "runtime", "codex", "process-sessions");
1220
+ const remotePath = path.posix.join(remoteDir, "paperclip-process-session-remote.mjs");
1221
+ const lockDir = path.posix.join(remoteDir, ".paperclip-process-session-script.lock");
1222
+ // A runner whose exec fails: the hash-gate cannot be evaluated. The write
1223
+ // must surface the failure, never swallow it and re-upload behind a green
1224
+ // return value.
1225
+ const runner = {
1226
+ execute: async () => ({
1227
+ exitCode: 1,
1228
+ signal: null,
1229
+ timedOut: false,
1230
+ stdout: "",
1231
+ stderr: "hash gate boom",
1232
+ pid: null,
1233
+ startedAt: new Date().toISOString(),
1234
+ }),
1235
+ };
1236
+ await expect(syncRemoteTextFileWithHashSkip({
1237
+ runner,
1238
+ remoteCwd: rootDir,
1239
+ remoteDir,
1240
+ remotePath,
1241
+ body: "console.log('never written');\n",
1242
+ label: "Process session remote script",
1243
+ action: "sync process session remote script",
1244
+ lockDir,
1245
+ timeoutMs: 30_000,
1246
+ })).rejects.toThrow(/sync process session remote script/i);
1247
+ // Nothing was written to the remote path on the failure path.
1248
+ await expect(readFile(remotePath, "utf8")).rejects.toThrow();
1249
+ });
1250
+ it.each([
1251
+ "/api/companies/co-1/heartbeat-runs",
1252
+ "/api/companies/co-1/live-runs",
1253
+ "/api/heartbeat-runs/run-1",
1254
+ "/api/heartbeat-runs/run-1/events",
1255
+ "/api/heartbeat-runs/run-1/log",
1256
+ "/api/heartbeat-runs/run-1/workspace-operations",
1257
+ "/api/heartbeat-runs/run-1/issues",
1258
+ "/api/issues/issue-1/runs",
1259
+ "/api/issues/issue-1/recovery-actions",
1260
+ ])("admits only GET for diagnostic path %s on both transports", (requestPath) => {
1261
+ for (const routes of [undefined, HTTP2_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST]) {
1262
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes({ method: "GET", path: requestPath }, routes)).toBeNull();
1263
+ for (const method of ["POST", "PUT", "PATCH", "DELETE"]) {
1264
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes({ method, path: requestPath }, routes))
1265
+ .toBe(`Route not allowed: ${method} ${requestPath}`);
1266
+ }
1267
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes({ method: "GET", path: `${requestPath}/extra` }, routes))
1268
+ .toBe(`Route not allowed: GET ${requestPath}/extra`);
1269
+ }
1270
+ });
1271
+ it.each([
1272
+ { method: "POST", path: "/api/heartbeat-runs/run-1/cancel" },
1273
+ { method: "POST", path: "/api/heartbeat-runs/run-1/retry" },
1274
+ { method: "POST", path: "/api/heartbeat-runs/run-1/watchdog-decisions" },
1275
+ { method: "POST", path: "/api/issues/issue-1/recovery-actions/resolve" },
1276
+ { method: "POST", path: "/api/issues/issue-1/recovery-actions/retry-workspace-export" },
1277
+ { method: "GET", path: "/api/heartbeat-runs/run-1/provider-trace" },
1278
+ { method: "GET", path: "/api/companies/co-1/provider-traces" },
1279
+ { method: "GET", path: "/api/companies/co-1/execution-workspaces" },
1280
+ ])("keeps execution control and unrelated reads denied: $method $path", (request) => {
1281
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request))
1282
+ .toBe(`Route not allowed: ${request.method} ${request.path}`);
1283
+ });
1284
+ it("permits the documented heartbeat surface and denies unrelated routes", () => {
1285
+ const allowed = [
1286
+ { method: "POST", path: "/api/companies/co-1/agent-commentary" },
1287
+ { method: "POST", path: "/runtime-tools/github/credentials" },
1288
+ { method: "GET", path: "/api/agents/me" },
1289
+ { method: "GET", path: "/api/agents/me/inbox-lite" },
1290
+ { method: "GET", path: "/api/agents/me/inbox/mine" },
1291
+ { method: "GET", path: "/api/agents/agent-1" },
1292
+ { method: "GET", path: "/api/agents/agent-1/skills" },
1293
+ { method: "POST", path: "/api/agents/agent-1/skills/sync" },
1294
+ { method: "PATCH", path: "/api/agents/agent-1/instructions-path" },
1295
+ { method: "GET", path: "/api/companies/co-1" },
1296
+ { method: "GET", path: "/api/companies/co-1/dashboard" },
1297
+ { method: "GET", path: "/api/companies/co-1/agents" },
1298
+ { method: "GET", path: "/api/companies/co-1/issues" },
1299
+ { method: "GET", path: "/api/companies/co-1/projects" },
1300
+ { method: "GET", path: "/api/companies/co-1/goals" },
1301
+ { method: "GET", path: "/api/companies/co-1/org" },
1302
+ { method: "GET", path: "/api/companies/co-1/approvals" },
1303
+ { method: "GET", path: "/api/companies/co-1/routines" },
1304
+ { method: "GET", path: "/api/companies/co-1/skills" },
1305
+ { method: "GET", path: "/api/agents/me/mcp-skills/skill-1/files" },
1306
+ { method: "GET", path: "/api/companies/co-1/email/inboxes" },
1307
+ { method: "GET", path: "/api/companies/co-1/email/tasks/issue-1" },
1308
+ { method: "GET", path: "/api/companies/co-1/email/deliveries/send-1" },
1309
+ { method: "POST", path: "/api/companies/co-1/email/send" },
1310
+ // Hire skill (paperclip-create-agent): discovery + submit + issue linking
1311
+ { method: "GET", path: "/llms/agent-configuration.txt" },
1312
+ { method: "GET", path: "/llms/agent-configuration/claude_local.txt" },
1313
+ { method: "GET", path: "/llms/agent-icons.txt" },
1314
+ { method: "GET", path: "/api/companies/co-1/agent-configurations" },
1315
+ { method: "POST", path: "/api/companies/co-1/agent-hires" },
1316
+ { method: "POST", path: "/api/issues/issue-1/approvals" },
1317
+ { method: "GET", path: "/api/projects/proj-1" },
1318
+ { method: "GET", path: "/api/goals/goal-1" },
1319
+ { method: "GET", path: "/api/issues/issue-1" },
1320
+ { method: "GET", path: "/api/issues/issue-1/heartbeat-context" },
1321
+ { method: "GET", path: "/api/issues/issue-1/activity" },
1322
+ { method: "GET", path: "/api/issues/issue-1/comments" },
1323
+ { method: "GET", path: "/api/issues/issue-1/comments/c-1" },
1324
+ { method: "POST", path: "/api/issues/issue-1/comments" },
1325
+ { method: "GET", path: "/api/issues/issue-1/documents" },
1326
+ { method: "GET", path: "/api/issues/issue-1/documents/plan" },
1327
+ { method: "GET", path: "/api/issues/issue-1/documents/plan/revisions" },
1328
+ { method: "PUT", path: "/api/issues/issue-1/documents/plan" },
1329
+ { method: "POST", path: "/api/issues/issue-1/checkout" },
1330
+ { method: "POST", path: "/api/issues/issue-1/release" },
1331
+ { method: "PATCH", path: "/api/issues/issue-1" },
1332
+ { method: "GET", path: "/api/issues/issue-1/approvals" },
1333
+ { method: "GET", path: "/api/issues/issue-1/work-products" },
1334
+ { method: "POST", path: "/api/issues/issue-1/work-products" },
1335
+ { method: "PATCH", path: "/api/work-products/wp-1" },
1336
+ { method: "GET", path: "/api/issues/issue-1/interactions" },
1337
+ { method: "GET", path: "/api/issues/issue-1/interactions/inter-1" },
1338
+ { method: "POST", path: "/api/issues/issue-1/interactions" },
1339
+ { method: "POST", path: "/api/issues/issue-1/interactions/inter-1/accept" },
1340
+ { method: "POST", path: "/api/issues/issue-1/interactions/inter-1/reject" },
1341
+ { method: "POST", path: "/api/issues/issue-1/interactions/inter-1/respond" },
1342
+ { method: "POST", path: "/api/issues/issue-1/interactions/inter-1/verdicts" },
1343
+ { method: "POST", path: "/api/issues/issue-1/interactions/inter-1/withdraw" },
1344
+ { method: "POST", path: "/api/companies/co-1/issues" },
1345
+ { method: "GET", path: "/api/approvals/ap-1" },
1346
+ { method: "GET", path: "/api/approvals/ap-1/issues" },
1347
+ { method: "GET", path: "/api/approvals/ap-1/comments" },
1348
+ { method: "POST", path: "/api/approvals/ap-1/comments" },
1349
+ { method: "POST", path: "/api/companies/co-1/approvals" },
1350
+ { method: "GET", path: "/api/execution-workspaces/ws-1" },
1351
+ { method: "POST", path: "/api/execution-workspaces/ws-1/runtime-services/start" },
1352
+ { method: "POST", path: "/api/execution-workspaces/ws-1/runtime-services/stop" },
1353
+ { method: "POST", path: "/api/execution-workspaces/ws-1/runtime-services/restart" },
1354
+ { method: "GET", path: "/api/routines/r-1" },
1355
+ { method: "GET", path: "/api/routines/r-1/runs" },
1356
+ { method: "POST", path: "/api/companies/co-1/routines" },
1357
+ { method: "PATCH", path: "/api/routines/r-1" },
1358
+ { method: "POST", path: "/api/routines/r-1/run" },
1359
+ { method: "POST", path: "/api/routines/r-1/triggers" },
1360
+ { method: "PATCH", path: "/api/routine-triggers/t-1" },
1361
+ { method: "DELETE", path: "/api/routine-triggers/t-1" },
1362
+ ];
1363
+ for (const request of allowed) {
1364
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request)).toBeNull();
1365
+ }
1366
+ const denied = [
1367
+ { method: "POST", path: "/api/issues/issue-1/activity" },
1368
+ { method: "GET", path: "/api/issues/issue-1/activity/extra" },
1369
+ { method: "GET", path: "/api/companies/co-1/activity" },
1370
+ { method: "GET", path: "/api/companies/co-1/audit/agent-actions" },
1371
+ { method: "GET", path: "/api/companies/co-1/agent-commentary" },
1372
+ { method: "POST", path: "/api/companies/co-1/agent-commentary/other" },
1373
+ { method: "POST", path: "/api/companies/co-1/email/inboxes" },
1374
+ { method: "POST", path: "/api/companies/co-1/email/connections" },
1375
+ { method: "POST", path: "/api/companies/co-1/email/inspect" },
1376
+ { method: "POST", path: "/api/companies/co-1/email/deliveries/send-1/resolve" },
1377
+ { method: "POST", path: "/api/email/inboxes/inbox-1/reconnect" },
1378
+ { method: "POST", path: "/api/email/inboxes/inbox-1/control" },
1379
+ { method: "DELETE", path: "/api/companies/co-1/email/tasks/issue-1" },
1380
+ { method: "DELETE", path: "/api/secrets" },
1381
+ // Pin the runtime-services regex to start/stop/restart only — anything
1382
+ // else (delete, reset, wipe, etc.) must stay denied even if the API
1383
+ // grows new actions later.
1384
+ { method: "POST", path: "/api/execution-workspaces/ws-1/runtime-services/delete" },
1385
+ { method: "POST", path: "/api/companies/co-1/agents" },
1386
+ // The hire allowlist must not over-match: only the exact .txt discovery
1387
+ // files, only agent-hires (not /agents), and no sub-resources beyond it.
1388
+ { method: "GET", path: "/llms/agent-configuration" },
1389
+ { method: "GET", path: "/llms/secrets.txt" },
1390
+ { method: "POST", path: "/api/companies/co-1/agent-hires/ap-1" },
1391
+ { method: "POST", path: "/api/issues/issue-1/approvals/ap-1" },
1392
+ { method: "POST", path: "/api/agents/agent-1/pause" },
1393
+ { method: "POST", path: "/api/agents/agent-1/terminate" },
1394
+ { method: "POST", path: "/api/agents/agent-1/keys" },
1395
+ { method: "POST", path: "/api/companies/co-1/exports" },
1396
+ { method: "POST", path: "/api/companies/co-1/imports/apply" },
1397
+ { method: "POST", path: "/api/companies/co-1/archive" },
1398
+ { method: "DELETE", path: "/api/issues/issue-1/documents/plan" },
1399
+ { method: "DELETE", path: "/api/issues/issue-1/approvals/ap-1" },
1400
+ { method: "DELETE", path: "/api/work-products/wp-1" },
1401
+ { method: "POST", path: "/api/approvals/ap-1/approve" },
1402
+ { method: "POST", path: "/api/approvals/ap-1/reject" },
1403
+ { method: "POST", path: "/api/companies/co-1/logo" },
1404
+ { method: "GET", path: "/api/companies/co-1/secrets" },
1405
+ { method: "PATCH", path: "/api/secrets/secret-1" },
1406
+ ];
1407
+ for (const request of denied) {
1408
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request)).toBe(`Route not allowed: ${request.method} ${request.path}`);
1409
+ }
1410
+ // Both transports admit the full attachment workflow.
1411
+ const http2Allowed = [
1412
+ { method: "GET", path: "/api/issues/issue-1/attachments" },
1413
+ { method: "POST", path: "/api/companies/co-1/issues/issue-1/attachments" },
1414
+ { method: "GET", path: "/api/attachments/att-1/content" },
1415
+ ];
1416
+ for (const request of http2Allowed) {
1417
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request, HTTP2_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST)).toBeNull();
1418
+ }
1419
+ const http2Denied = [
1420
+ // Wrong method for each attachment rule.
1421
+ { method: "GET", path: "/api/companies/co-1/issues/issue-1/attachments" },
1422
+ { method: "POST", path: "/api/attachments/att-1/content" },
1423
+ // Extra path segment for each attachment rule.
1424
+ { method: "POST", path: "/api/companies/co-1/issues/issue-1/attachments/att-1" },
1425
+ { method: "GET", path: "/api/attachments/att-1/content/extra" },
1426
+ ];
1427
+ for (const request of http2Denied) {
1428
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request, HTTP2_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST)).toBe(`Route not allowed: ${request.method} ${request.path}`);
1429
+ }
1430
+ });
1431
+ it("admits listing, uploads and downloads on the default queue route list", () => {
1432
+ const attachmentRequests = [
1433
+ { method: "GET", path: "/api/issues/issue-1/attachments" },
1434
+ { method: "POST", path: "/api/companies/co-1/issues/issue-1/attachments" },
1435
+ { method: "GET", path: "/api/attachments/att-1/content" },
1436
+ ];
1437
+ for (const request of attachmentRequests) {
1438
+ expect(authorizeSandboxCallbackBridgeRequestWithRoutes(request)).toBeNull();
1439
+ }
1440
+ });
1441
+ it.each([
1442
+ [4 * 60 * 60 * 1000, 30_000],
1443
+ [250, 250],
1444
+ ])("bounds a hung bridge read configured for %i ms to %i ms", async (configuredMs, expectedMs) => {
1445
+ vi.useFakeTimers();
1446
+ try {
1447
+ const runner = { execute: vi.fn(() => new Promise(() => { })) };
1448
+ const client = createCommandManagedSandboxCallbackBridgeQueueClient({
1449
+ runner, remoteCwd: "/workspace", timeoutMs: configuredMs,
1450
+ });
1451
+ let error;
1452
+ const read = client.readTextFile("/workspace/events/1.json").catch((caught) => { error = caught; });
1453
+ await vi.advanceTimersByTimeAsync(expectedMs - 1);
1454
+ expect(error).toBeUndefined();
1455
+ await vi.advanceTimersByTimeAsync(1);
1456
+ expect(error).toEqual(new Error(`Sandbox bridge control command timed out after ${expectedMs}ms.`));
1457
+ await read;
1458
+ expect(runner.execute).toHaveBeenCalledExactlyOnceWith(expect.objectContaining({
1459
+ timeoutMs: expectedMs, bypassSession: true,
1460
+ }));
1461
+ expect(vi.getTimerCount()).toBe(0);
1462
+ }
1463
+ finally {
1464
+ vi.useRealTimers();
1465
+ }
1466
+ });
1467
+ it("abandons a timed-out upload without replaying it or continuing after a late response", async () => {
1468
+ vi.useFakeTimers();
1469
+ try {
1470
+ const success = {
1471
+ exitCode: 0, signal: null, timedOut: false, stdout: "", stderr: "", pid: null,
1472
+ startedAt: new Date().toISOString(),
1473
+ };
1474
+ let finishAppend;
1475
+ const runner = {
1476
+ execute: vi.fn(async (input) => {
1477
+ if (input.args?.[1]?.startsWith("printf")) {
1478
+ return new Promise((resolve) => { finishAppend = resolve; });
1479
+ }
1480
+ return success;
1481
+ }),
1482
+ };
1483
+ const client = createCommandManagedSandboxCallbackBridgeQueueClient({
1484
+ runner, remoteCwd: "/workspace", timeoutMs: 4 * 60 * 60 * 1000,
1485
+ });
1486
+ let error;
1487
+ const write = client.writeTextFile("/workspace/stdin/1.json", "sensitive-input")
1488
+ .catch((caught) => { error = caught; });
1489
+ await vi.advanceTimersByTimeAsync(30_000);
1490
+ expect(error).toEqual(new Error("Sandbox bridge control command timed out after 30000ms."));
1491
+ await write;
1492
+ finishAppend(success);
1493
+ await vi.advanceTimersByTimeAsync(0);
1494
+ const scripts = runner.execute.mock.calls.map(([input]) => input.args?.[1] ?? "");
1495
+ expect(scripts.filter((script) => script.startsWith("printf"))).toHaveLength(1);
1496
+ expect(scripts.some((script) => script.startsWith("base64 -d"))).toBe(false);
1497
+ expect(scripts.at(-1)).toMatch(/^rm -f .*paperclip-upload/);
1498
+ expect(vi.getTimerCount()).toBe(0);
1499
+ }
1500
+ finally {
1501
+ vi.useRealTimers();
1502
+ }
1503
+ });
1504
+ it.each(["start", "stop"])("bounds a hung callback bridge %s while preserving its launch environment", async (stage) => {
1505
+ vi.useFakeTimers();
1506
+ try {
1507
+ const runner = {
1508
+ execute: vi.fn(async (input) => {
1509
+ const script = input.args?.[1] ?? "";
1510
+ if ((stage === "start" && script.includes("nohup")) ||
1511
+ (stage === "stop" && script.includes('kill "$pid"'))) {
1512
+ return new Promise(() => { });
1513
+ }
1514
+ return {
1515
+ exitCode: 0, signal: null, timedOut: false, stderr: "", pid: null,
1516
+ startedAt: new Date().toISOString(), stdout: JSON.stringify({ port: 3101 }),
1517
+ };
1518
+ }),
1519
+ };
1520
+ let error;
1521
+ const operation = startSandboxCallbackBridgeServer({
1522
+ runner, remoteCwd: "/workspace", assetRemoteDir: "/workspace/assets",
1523
+ queueDir: "/workspace/queue", bridgeToken: "private-bridge-token", timeoutMs: 4 * 60 * 60 * 1000,
1524
+ }).then(async (bridge) => { if (stage === "stop")
1525
+ await bridge.stop(); })
1526
+ .catch((caught) => { error = caught; });
1527
+ await vi.advanceTimersByTimeAsync(30_000);
1528
+ expect(error).toEqual(new Error("Sandbox bridge control command timed out after 30000ms."));
1529
+ await operation;
1530
+ expect(runner.execute.mock.calls[0]?.[0].env).toMatchObject({
1531
+ PAPERCLIP_BRIDGE_TOKEN: "private-bridge-token",
1532
+ PAPERCLIP_SANDBOX_EXEC_CHANNEL: "bridge",
1533
+ });
1534
+ expect(runner.execute).toHaveBeenLastCalledWith(expect.objectContaining({ timeoutMs: 30_000 }));
1535
+ expect(vi.getTimerCount()).toBe(0);
1536
+ }
1537
+ finally {
1538
+ vi.useRealTimers();
1539
+ }
1540
+ });
1541
+ it("marks command-managed bridge operations with the bridge execution channel", async () => {
1542
+ const runner = {
1543
+ execute: vi.fn(async () => ({
1544
+ exitCode: 0,
1545
+ signal: null,
1546
+ timedOut: false,
1547
+ stdout: "",
1548
+ stderr: "",
1549
+ pid: null,
1550
+ startedAt: new Date().toISOString(),
1551
+ })),
1552
+ };
1553
+ const client = createCommandManagedSandboxCallbackBridgeQueueClient({
1554
+ runner,
1555
+ remoteCwd: "/workspace",
1556
+ timeoutMs: 30_000,
1557
+ });
1558
+ await client.makeDir("/workspace/.paperclip-runtime/codex/paperclip-bridge/queue");
1559
+ expect(runner.execute).toHaveBeenCalledWith(expect.objectContaining({
1560
+ env: {
1561
+ PAPERCLIP_SANDBOX_EXEC_CHANNEL: "bridge",
1562
+ },
1563
+ }));
1564
+ });
1565
+ it("creates the bridge queue directories in one directory-creation exec", async () => {
1566
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-makedirs-"));
1567
+ cleanupDirs.push(rootDir);
1568
+ const queueDir = path.posix.join(rootDir, "queue");
1569
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1570
+ const makeDir = vi.fn(async () => { });
1571
+ const makeDirs = vi.fn(async () => { });
1572
+ const worker = await startSandboxCallbackBridgeWorker({
1573
+ client: {
1574
+ makeDir,
1575
+ makeDirs,
1576
+ listJsonFiles: async () => [],
1577
+ readTextFile: async () => {
1578
+ throw new Error("unexpected readTextFile");
1579
+ },
1580
+ writeTextFile: async () => { },
1581
+ rename: async () => { },
1582
+ remove: async () => { },
1583
+ },
1584
+ queueDir,
1585
+ authorizeRequest: async () => null,
1586
+ handleRequest: async () => ({ status: 200, body: "ok" }),
1587
+ });
1588
+ await worker.stop();
1589
+ expect(makeDir).not.toHaveBeenCalled();
1590
+ expect(makeDirs).toHaveBeenCalledTimes(1);
1591
+ expect(makeDirs).toHaveBeenCalledWith([
1592
+ directories.rootDir,
1593
+ directories.requestsDir,
1594
+ directories.responsesDir,
1595
+ directories.logsDir,
1596
+ ]);
1597
+ });
1598
+ it("falls back to sequential makeDir when the queue client omits makeDirs", async () => {
1599
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-makedir-fallback-"));
1600
+ cleanupDirs.push(rootDir);
1601
+ const queueDir = path.posix.join(rootDir, "queue");
1602
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1603
+ const makeDir = vi.fn(async (_remotePath) => { });
1604
+ // A queue client that predates the batched makeDirs method. The worker
1605
+ // must still create every queue directory through sequential makeDir.
1606
+ const worker = await startSandboxCallbackBridgeWorker({
1607
+ client: {
1608
+ makeDir,
1609
+ listJsonFiles: async () => [],
1610
+ readTextFile: async () => {
1611
+ throw new Error("unexpected readTextFile");
1612
+ },
1613
+ writeTextFile: async () => { },
1614
+ rename: async () => { },
1615
+ remove: async () => { },
1616
+ },
1617
+ queueDir,
1618
+ authorizeRequest: async () => null,
1619
+ handleRequest: async () => ({ status: 200, body: "ok" }),
1620
+ });
1621
+ await worker.stop();
1622
+ expect(makeDir.mock.calls.map((call) => call[0])).toEqual([
1623
+ directories.rootDir,
1624
+ directories.requestsDir,
1625
+ directories.responsesDir,
1626
+ directories.logsDir,
1627
+ ]);
1628
+ });
1629
+ it("runs one mkdir -p exec for makeDirs on the command-managed queue client", async () => {
1630
+ const runner = {
1631
+ execute: vi.fn(async (_input) => ({
1632
+ exitCode: 0,
1633
+ signal: null,
1634
+ timedOut: false,
1635
+ stdout: "",
1636
+ stderr: "",
1637
+ pid: null,
1638
+ startedAt: new Date().toISOString(),
1639
+ })),
1640
+ };
1641
+ const client = createCommandManagedSandboxCallbackBridgeQueueClient({
1642
+ runner,
1643
+ remoteCwd: "/workspace",
1644
+ timeoutMs: 30_000,
1645
+ });
1646
+ // The command-managed client always provides the batched makeDirs method.
1647
+ expect(client.makeDirs).toBeDefined();
1648
+ await client.makeDirs?.(["/workspace/a", "/workspace/b", "/workspace/c"]);
1649
+ expect(runner.execute).toHaveBeenCalledTimes(1);
1650
+ const call = runner.execute.mock.calls[0][0];
1651
+ const script = call.args?.[call.args.length - 1] ?? "";
1652
+ expect(script).toContain("mkdir -p");
1653
+ expect(script).toContain("/workspace/a");
1654
+ expect(script).toContain("/workspace/b");
1655
+ expect(script).toContain("/workspace/c");
1656
+ });
1657
+ // Capture the run-level error the worker surfaces through `runtimeSpan`. The
1658
+ // worker runs a throwing function under the `sandbox.callbackBridge.workerFailed`
1659
+ // span; this double records that error and re-throws, like the real runner.
1660
+ function createWorkerErrorCapture() {
1661
+ const workerErrors = [];
1662
+ const runtimeSpan = async (name, work) => {
1663
+ try {
1664
+ return await work();
1665
+ }
1666
+ catch (error) {
1667
+ if (name === "sandbox.callbackBridge.workerFailed") {
1668
+ workerErrors.push(error instanceof Error ? error.message : String(error));
1669
+ }
1670
+ throw error;
1671
+ }
1672
+ };
1673
+ return { runtimeSpan, workerErrors };
1674
+ }
1675
+ function bridgeRequestJson(id) {
1676
+ return `${JSON.stringify({
1677
+ id,
1678
+ method: "GET",
1679
+ path: "/api/agents/me",
1680
+ query: "",
1681
+ headers: {},
1682
+ body: "",
1683
+ createdAt: new Date().toISOString(),
1684
+ })}\n`;
1685
+ }
1686
+ it("times out a stalled poll, surfaces a run-level error, and recovers to deliver the request", async () => {
1687
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-hang-"));
1688
+ cleanupDirs.push(rootDir);
1689
+ const queueDir = path.posix.join(rootDir, "queue");
1690
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1691
+ await mkdir(directories.requestsDir, { recursive: true });
1692
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-a.json"), bridgeRequestJson("req-a"));
1693
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
1694
+ const base = createFileSystemSandboxCallbackBridgeQueueClient();
1695
+ let listCalls = 0;
1696
+ const client = {
1697
+ ...base,
1698
+ // The first poll never resolves — a silently unresponsive sandbox channel.
1699
+ // The per-iteration timeout must convert the hang into a caught error, and
1700
+ // the loop must then back off and retry rather than die: the request never
1701
+ // reached the handler, so the retry delivers the real response. A
1702
+ // sustained outage is the watchdog's job (proven separately below), not a
1703
+ // reason to fail a request one transient hang could still serve.
1704
+ listJsonFiles: async (dir) => {
1705
+ listCalls += 1;
1706
+ if (listCalls === 1) {
1707
+ return await new Promise(() => { });
1708
+ }
1709
+ return await base.listJsonFiles(dir);
1710
+ },
1711
+ };
1712
+ const worker = await startSandboxCallbackBridgeWorker({
1713
+ client,
1714
+ queueDir,
1715
+ iterationTimeoutMs: 50,
1716
+ watchdogTimeoutMs: 10_000,
1717
+ runtimeSpan,
1718
+ authorizeRequest: async () => null,
1719
+ handleRequest: async () => ({ status: 200, body: "ok" }),
1720
+ });
1721
+ const responseFile = await waitForJsonFile(directories.responsesDir, 3_000);
1722
+ const responseBody = await readFile(path.posix.join(directories.responsesDir, responseFile), "utf8");
1723
+ expect(JSON.parse(responseBody).status).toBe(200);
1724
+ expect(workerErrors.length).toBeGreaterThan(0);
1725
+ expect(workerErrors[0]).toContain("timed out");
1726
+ await worker.stop({ drainTimeoutMs: 10 });
1727
+ });
1728
+ it("does not abandon an in-flight handler, so a started mutation is not applied twice", async () => {
1729
+ // Prove the completion fence for a request whose handler already started. The
1730
+ // per-iteration timeout rejects the wrapper but does not stop the handler, so
1731
+ // the host operation (a mutation) is still in flight. The recovery path must
1732
+ // not write a 503 there; a 503 makes the caller retry while the original
1733
+ // mutation still completes, applying it twice. The test proves no 503 lands
1734
+ // and the handler's real response is delivered exactly once.
1735
+ const waitFor = createWorkerWaiter();
1736
+ const queueDir = "/virtual-bridge/queue";
1737
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1738
+ const requestFile = "req-late.json";
1739
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
1740
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
1741
+ // An in-memory queue client with no file-existence guards. A response write
1742
+ // always lands here, so only the completion fence controls the outcome. The
1743
+ // real filesystem and command clients add their own existence guards; this
1744
+ // client removes them, so the test isolates the fence.
1745
+ const requestBodies = new Map();
1746
+ requestBodies.set(requestPath, bridgeRequestJson("req-late"));
1747
+ const responseWrites = [];
1748
+ const requestRemovals = [];
1749
+ const handlerControl = { release: null };
1750
+ let handlerCompleted = false;
1751
+ const client = {
1752
+ ...virtualQueueReadClient(directories, requestBodies),
1753
+ writeResponseFile: async (remotePath, body) => {
1754
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status });
1755
+ return { wrote: true };
1756
+ },
1757
+ rename: async () => { },
1758
+ remove: async (remotePath) => {
1759
+ requestRemovals.push(remotePath);
1760
+ requestBodies.delete(remotePath);
1761
+ },
1762
+ };
1763
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
1764
+ const worker = await startSandboxCallbackBridgeWorker({
1765
+ client,
1766
+ queueDir,
1767
+ iterationTimeoutMs: 50,
1768
+ watchdogTimeoutMs: 10_000,
1769
+ runtimeSpan,
1770
+ authorizeRequest: async () => null,
1771
+ // The handler stays pending until the test releases it, well after the
1772
+ // per-iteration timeout fires. It records that it finished, so the test
1773
+ // proves the in-flight handler truly ran.
1774
+ handleRequest: () => new Promise((resolve) => {
1775
+ handlerControl.release = () => {
1776
+ handlerCompleted = true;
1777
+ resolve({ status: 200, body: "req-late" });
1778
+ };
1779
+ }),
1780
+ });
1781
+ // Wait until the per-iteration timeout surfaced a run error and the handler
1782
+ // is pending. The recovery path ran, so it already skipped the in-flight
1783
+ // request.
1784
+ await waitFor(() => workerErrors.some((message) => message.includes("timed out")) && handlerControl.release !== null, 3_000);
1785
+ // The recovery path wrote no 503 for the in-flight request.
1786
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
1787
+ // Release the handler after the timeout. It delivers the real response.
1788
+ handlerControl.release?.();
1789
+ await waitFor(() => handlerCompleted, 3_000);
1790
+ // Give the finalize write and remove time to land.
1791
+ await new Promise((resolve) => setTimeout(resolve, 50));
1792
+ expect(handlerCompleted).toBe(true);
1793
+ // The handler committed exactly one response for the request: the real 200.
1794
+ expect(responseWrites.filter((write) => write.path === responsePath)).toEqual([
1795
+ { path: responsePath, status: 200 },
1796
+ ]);
1797
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
1798
+ // The handler removed the request file exactly once, after it finalized.
1799
+ expect(requestRemovals).toEqual([requestPath]);
1800
+ await worker.stop({ drainTimeoutMs: 10 });
1801
+ });
1802
+ it("aborts an in-flight handler on timeout, so a cooperating handler finalizes instead of stranding the request", async () => {
1803
+ // A handler that threads the worker signal into its work must stop when the
1804
+ // per-iteration timeout fires. It then finalizes with its own error
1805
+ // response, so the request does not strand with no response. The recovery
1806
+ // path still writes no 503 for the handler-owned request, so a started
1807
+ // mutation is not applied twice. The abort reaches the handler after the host
1808
+ // operation started, so the handler finalizes a non-retryable 504, not a
1809
+ // retryable 502; the caller then does not retry a mutation that may have
1810
+ // committed.
1811
+ const waitFor = createWorkerWaiter();
1812
+ const queueDir = "/virtual-bridge/queue";
1813
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1814
+ const requestFile = "req-abort.json";
1815
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
1816
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
1817
+ const requestBodies = new Map();
1818
+ requestBodies.set(requestPath, bridgeRequestJson("req-abort"));
1819
+ const responseWrites = [];
1820
+ const requestRemovals = [];
1821
+ const client = {
1822
+ ...virtualQueueReadClient(directories, requestBodies),
1823
+ writeResponseFile: async (remotePath, body) => {
1824
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status });
1825
+ return { wrote: true };
1826
+ },
1827
+ rename: async () => { },
1828
+ remove: async (remotePath) => {
1829
+ requestRemovals.push(remotePath);
1830
+ requestBodies.delete(remotePath);
1831
+ },
1832
+ };
1833
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
1834
+ let handlerAborted = false;
1835
+ const worker = await startSandboxCallbackBridgeWorker({
1836
+ client,
1837
+ queueDir,
1838
+ iterationTimeoutMs: 50,
1839
+ watchdogTimeoutMs: 10_000,
1840
+ runtimeSpan,
1841
+ authorizeRequest: async () => null,
1842
+ // The handler stays pending until the worker aborts the signal. It then
1843
+ // rejects, so the request finalizes with the handler's own error response.
1844
+ handleRequest: (_request, options) => new Promise((_resolve, reject) => {
1845
+ options?.signal.addEventListener("abort", () => {
1846
+ handlerAborted = true;
1847
+ reject(new Error("aborted by worker"));
1848
+ });
1849
+ }),
1850
+ });
1851
+ // The handler finalizes only after the worker aborts it. The request gets a
1852
+ // terminal response (a 502 from the handler failure), never stranded.
1853
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
1854
+ expect(handlerAborted).toBe(true);
1855
+ expect(workerErrors.some((message) => message.includes("timed out"))).toBe(true);
1856
+ // Exactly one response landed: the handler's non-retryable 504. The recovery
1857
+ // path wrote no competing 503, and the aborted handler wrote no retryable 502.
1858
+ expect(responseWrites.filter((write) => write.path === responsePath)).toEqual([
1859
+ { path: responsePath, status: 504 },
1860
+ ]);
1861
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
1862
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
1863
+ // The handler removed the request file after it finalized. The recovery path
1864
+ // may issue a redundant idempotent remove for the same path when the handler
1865
+ // finalized first, so assert the removal happened rather than a fixed count.
1866
+ expect(requestRemovals).toContain(requestPath);
1867
+ await worker.stop({ drainTimeoutMs: 10 });
1868
+ });
1869
+ it("finalizes an aborted handler that ignores the signal and never settles with a non-retryable 504 backstop", async () => {
1870
+ // A handler that does not thread the worker signal into its work and never
1871
+ // settles must not strand the request. The recovery path aborts the handler,
1872
+ // waits the grace, then writes a non-retryable 504 backstop, so the request
1873
+ // gets a terminal response even when the handler ignores the abort. The 504
1874
+ // is non-retryable, so the caller does not retry a mutation that may have
1875
+ // committed.
1876
+ const waitFor = createWorkerWaiter();
1877
+ const queueDir = "/virtual-bridge/queue";
1878
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1879
+ const requestFile = "req-stuck.json";
1880
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
1881
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
1882
+ const requestBodies = new Map();
1883
+ requestBodies.set(requestPath, bridgeRequestJson("req-stuck"));
1884
+ const responseWrites = [];
1885
+ const requestRemovals = [];
1886
+ const client = {
1887
+ ...virtualQueueReadClient(directories, requestBodies),
1888
+ writeResponseFile: async (remotePath, body) => {
1889
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
1890
+ return { wrote: true };
1891
+ },
1892
+ rename: async () => { },
1893
+ remove: async (remotePath) => {
1894
+ requestRemovals.push(remotePath);
1895
+ requestBodies.delete(remotePath);
1896
+ },
1897
+ };
1898
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
1899
+ let handlerStarted = false;
1900
+ const worker = await startSandboxCallbackBridgeWorker({
1901
+ client,
1902
+ queueDir,
1903
+ iterationTimeoutMs: 50,
1904
+ watchdogTimeoutMs: 10_000,
1905
+ // A short grace, so the backstop fires quickly after the abort.
1906
+ abortedHandlerGraceMs: 30,
1907
+ runtimeSpan,
1908
+ authorizeRequest: async () => null,
1909
+ // The handler ignores the worker signal and never settles. Without the
1910
+ // backstop, the request would stay without a response forever.
1911
+ handleRequest: () => {
1912
+ handlerStarted = true;
1913
+ return new Promise(() => { });
1914
+ },
1915
+ });
1916
+ // The backstop writes the terminal response after the grace.
1917
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
1918
+ expect(handlerStarted).toBe(true);
1919
+ expect(workerErrors.some((message) => message.includes("timed out"))).toBe(true);
1920
+ // Exactly one response landed: the non-retryable 504 backstop. The recovery
1921
+ // path wrote no retryable 503 or 502 for the handler-owned request.
1922
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
1923
+ expect(requestResponses).toHaveLength(1);
1924
+ expect(requestResponses[0]?.status).toBe(504);
1925
+ const parsed = JSON.parse(requestResponses[0].body.trim());
1926
+ const responseBody = JSON.parse(parsed.body);
1927
+ expect(responseBody.outcome).toBe("indeterminate");
1928
+ expect(responseBody.retryable).toBe(false);
1929
+ expect(parsed.headers?.["x-paperclip-bridge-outcome"]).toBe("indeterminate");
1930
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
1931
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
1932
+ // The backstop removed the request file, so it does not strand in the queue.
1933
+ expect(requestRemovals).toContain(requestPath);
1934
+ await worker.stop({ drainTimeoutMs: 10 });
1935
+ });
1936
+ it("finalizes a late worker-aborted handler with a non-retryable 504, so the caller does not retry a committed mutation", async () => {
1937
+ // Prove the completion status for a mutating request that the worker aborts.
1938
+ // The per-iteration timeout aborts a handler that already started its host
1939
+ // operation, so the mutation may have committed. The bridge cannot cancel a
1940
+ // host operation that is in flight. The handler completes late, after the
1941
+ // abort. Its response must be a non-retryable 504, never a retryable 502 or
1942
+ // 503; a retry of either would apply the mutation twice.
1943
+ const waitFor = createWorkerWaiter();
1944
+ const queueDir = "/virtual-bridge/queue";
1945
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
1946
+ const requestFile = "req-late-abort.json";
1947
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
1948
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
1949
+ const requestBodies = new Map();
1950
+ requestBodies.set(requestPath, bridgeRequestJson("req-late-abort"));
1951
+ const responseWrites = [];
1952
+ const requestRemovals = [];
1953
+ const client = {
1954
+ ...virtualQueueReadClient(directories, requestBodies),
1955
+ writeResponseFile: async (remotePath, body) => {
1956
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
1957
+ return { wrote: true };
1958
+ },
1959
+ rename: async () => { },
1960
+ remove: async (remotePath) => {
1961
+ requestRemovals.push(remotePath);
1962
+ requestBodies.delete(remotePath);
1963
+ },
1964
+ };
1965
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
1966
+ let handlerCompletedLate = false;
1967
+ const worker = await startSandboxCallbackBridgeWorker({
1968
+ client,
1969
+ queueDir,
1970
+ iterationTimeoutMs: 50,
1971
+ watchdogTimeoutMs: 10_000,
1972
+ runtimeSpan,
1973
+ authorizeRequest: async () => null,
1974
+ // The handler mirrors a mutating forward that already committed on the
1975
+ // host. It rejects only after the worker aborts it, so its completion is
1976
+ // late. The mutation stays committed; the abort cannot undo it.
1977
+ handleRequest: (_request, options) => new Promise((_resolve, reject) => {
1978
+ options?.signal.addEventListener("abort", () => {
1979
+ handlerCompletedLate = true;
1980
+ reject(new Error("aborted by worker after the mutation committed"));
1981
+ });
1982
+ }),
1983
+ });
1984
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
1985
+ expect(handlerCompletedLate).toBe(true);
1986
+ expect(workerErrors.some((message) => message.includes("timed out"))).toBe(true);
1987
+ // Exactly one response landed for the request: the non-retryable 504.
1988
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
1989
+ expect(requestResponses).toHaveLength(1);
1990
+ expect(requestResponses[0]?.status).toBe(504);
1991
+ // The bridge wrote no retryable status for the possibly-committed mutation.
1992
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
1993
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
1994
+ // The response marks the outcome indeterminate and non-retryable, so the
1995
+ // caller does not retry.
1996
+ const parsed = JSON.parse(requestResponses[0]?.body ?? "{}");
1997
+ expect(parsed.status).toBe(504);
1998
+ const responseBody = JSON.parse(parsed.body);
1999
+ expect(responseBody.outcome).toBe("indeterminate");
2000
+ expect(responseBody.retryable).toBe(false);
2001
+ expect(parsed.headers?.["x-paperclip-bridge-outcome"]).toBe("indeterminate");
2002
+ expect(requestRemovals).toContain(requestPath);
2003
+ await worker.stop({ drainTimeoutMs: 10 });
2004
+ });
2005
+ it("retries a failed 504 backstop write and keeps the request until it lands, so the caller is not stranded", async () => {
2006
+ // A backstop write can fail transiently, or it can exceed the iteration
2007
+ // timeout. The recovery path must not drop the request file on that failure. A
2008
+ // dropped file leaves no terminal 504 for the caller and fences out a late
2009
+ // handler, so the caller waits to its own deadline and gets a generic 502. The
2010
+ // recovery path retries the write and removes the request file only after the
2011
+ // write lands.
2012
+ const waitFor = createWorkerWaiter();
2013
+ const queueDir = "/virtual-bridge/queue";
2014
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2015
+ const requestFile = "req-retry.json";
2016
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2017
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2018
+ const requestBodies = new Map();
2019
+ requestBodies.set(requestPath, bridgeRequestJson("req-retry"));
2020
+ const responseWrites = [];
2021
+ const requestRemovals = [];
2022
+ let writeAttempts = 0;
2023
+ const client = {
2024
+ ...virtualQueueReadClient(directories, requestBodies),
2025
+ writeResponseFile: async (remotePath, body) => {
2026
+ writeAttempts += 1;
2027
+ // The first backstop write fails; the retry then succeeds.
2028
+ if (writeAttempts === 1) {
2029
+ throw new Error("simulated transient write failure");
2030
+ }
2031
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
2032
+ return { wrote: true };
2033
+ },
2034
+ rename: async () => { },
2035
+ remove: async (remotePath) => {
2036
+ requestRemovals.push({ path: remotePath, afterWrites: writeAttempts });
2037
+ requestBodies.delete(remotePath);
2038
+ },
2039
+ };
2040
+ const { runtimeSpan } = createWorkerErrorCapture();
2041
+ const worker = await startSandboxCallbackBridgeWorker({
2042
+ client,
2043
+ queueDir,
2044
+ iterationTimeoutMs: 50,
2045
+ watchdogTimeoutMs: 10_000,
2046
+ // A short grace, so the backstop fires quickly after the abort.
2047
+ abortedHandlerGraceMs: 30,
2048
+ runtimeSpan,
2049
+ authorizeRequest: async () => null,
2050
+ // The handler ignores the worker signal and never settles, so only the
2051
+ // backstop can finalize the request.
2052
+ handleRequest: () => new Promise(() => { }),
2053
+ });
2054
+ // The backstop retries the write, so the terminal 504 lands after the failure.
2055
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
2056
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
2057
+ expect(requestResponses).toHaveLength(1);
2058
+ expect(requestResponses[0]?.status).toBe(504);
2059
+ // The write failed once, so the backstop wrote on a later attempt.
2060
+ expect(writeAttempts).toBeGreaterThanOrEqual(2);
2061
+ // The recovery path removed the request file only after the write landed. The
2062
+ // failed first attempt kept the file, so the request never dropped with no
2063
+ // response.
2064
+ const requestPathRemovals = requestRemovals.filter((entry) => entry.path === requestPath);
2065
+ expect(requestPathRemovals.length).toBeGreaterThanOrEqual(1);
2066
+ for (const entry of requestPathRemovals) {
2067
+ expect(entry.afterWrites).toBeGreaterThanOrEqual(2);
2068
+ }
2069
+ // The bridge wrote no retryable status for the possibly-committed mutation.
2070
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
2071
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
2072
+ await worker.stop({ drainTimeoutMs: 10 });
2073
+ });
2074
+ it("retries a handler response write that fails transiently and delivers the real response, not a retryable 503", async () => {
2075
+ // A handler settles with its own response, but the terminal write fails
2076
+ // once. `finalize` must retry the write and deliver the real response. It
2077
+ // must not fence out recovery and leave the request for a retryable 503,
2078
+ // which would let the caller repeat a possibly-committed mutation.
2079
+ const waitFor = createWorkerWaiter();
2080
+ const queueDir = "/virtual-bridge/queue";
2081
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2082
+ const requestFile = "req-write-retry.json";
2083
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2084
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2085
+ const requestBodies = new Map();
2086
+ requestBodies.set(requestPath, bridgeRequestJson("req-write-retry"));
2087
+ const responseWrites = [];
2088
+ const requestRemovals = [];
2089
+ let writeAttempts = 0;
2090
+ const client = {
2091
+ ...virtualQueueReadClient(directories, requestBodies),
2092
+ writeResponseFile: async (remotePath, body) => {
2093
+ writeAttempts += 1;
2094
+ // The first handler-response write fails; the retry then succeeds.
2095
+ if (writeAttempts === 1) {
2096
+ throw new Error("simulated transient response write failure");
2097
+ }
2098
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
2099
+ return { wrote: true };
2100
+ },
2101
+ rename: async () => { },
2102
+ remove: async (remotePath) => {
2103
+ requestRemovals.push(remotePath);
2104
+ requestBodies.delete(remotePath);
2105
+ },
2106
+ };
2107
+ const { runtimeSpan } = createWorkerErrorCapture();
2108
+ const worker = await startSandboxCallbackBridgeWorker({
2109
+ client,
2110
+ queueDir,
2111
+ iterationTimeoutMs: 500,
2112
+ watchdogTimeoutMs: 10_000,
2113
+ runtimeSpan,
2114
+ authorizeRequest: async () => null,
2115
+ // The handler settles with its own 200 response.
2116
+ handleRequest: async () => ({ status: 200, body: JSON.stringify({ ok: true }) }),
2117
+ });
2118
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
2119
+ // Exactly one response landed: the handler's real 200. The retry delivered it
2120
+ // after the transient failure.
2121
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
2122
+ expect(requestResponses).toHaveLength(1);
2123
+ expect(requestResponses[0]?.status).toBe(200);
2124
+ expect(writeAttempts).toBeGreaterThanOrEqual(2);
2125
+ // The bridge wrote no retryable status, so the caller does not repeat the
2126
+ // request.
2127
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
2128
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
2129
+ // The handler removed the request file after the write landed.
2130
+ expect(requestRemovals).toContain(requestPath);
2131
+ await worker.stop({ drainTimeoutMs: 10 });
2132
+ });
2133
+ it("re-arms the 504 backstop when every handler response write fails, so the caller gets a terminal 504 instead of stranding", async () => {
2134
+ // A handler settles with its own response, but every terminal write fails.
2135
+ // `finalize` must roll back the fence and re-arm the 504 backstop, so the
2136
+ // recovery still delivers a non-retryable terminal response. Without the
2137
+ // re-arm, a rejected write leaves the request for a retryable 503 and a hung
2138
+ // write strands the caller until its own deadline.
2139
+ const waitFor = createWorkerWaiter();
2140
+ const queueDir = "/virtual-bridge/queue";
2141
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2142
+ const requestFile = "req-write-backstop.json";
2143
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2144
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2145
+ const requestBodies = new Map();
2146
+ requestBodies.set(requestPath, bridgeRequestJson("req-write-backstop"));
2147
+ const responseWrites = [];
2148
+ const requestRemovals = [];
2149
+ let writeAttempts = 0;
2150
+ const client = {
2151
+ ...virtualQueueReadClient(directories, requestBodies),
2152
+ writeResponseFile: async (remotePath, body) => {
2153
+ writeAttempts += 1;
2154
+ // Fail every `finalize` write attempt. The re-armed 504 backstop then
2155
+ // writes on a later attempt.
2156
+ if (writeAttempts <= 3) {
2157
+ throw new Error("simulated persistent response write failure");
2158
+ }
2159
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
2160
+ return { wrote: true };
2161
+ },
2162
+ rename: async () => { },
2163
+ remove: async (remotePath) => {
2164
+ requestRemovals.push(remotePath);
2165
+ requestBodies.delete(remotePath);
2166
+ },
2167
+ };
2168
+ const { runtimeSpan } = createWorkerErrorCapture();
2169
+ const worker = await startSandboxCallbackBridgeWorker({
2170
+ client,
2171
+ queueDir,
2172
+ iterationTimeoutMs: 500,
2173
+ watchdogTimeoutMs: 10_000,
2174
+ // A short grace, so the re-armed backstop fires quickly.
2175
+ abortedHandlerGraceMs: 30,
2176
+ runtimeSpan,
2177
+ authorizeRequest: async () => null,
2178
+ // The handler settles with its own 200 response, a committed mutation.
2179
+ handleRequest: async () => ({ status: 200, body: JSON.stringify({ ok: true }) }),
2180
+ });
2181
+ // The re-armed backstop writes the terminal 504 after the finalize writes fail.
2182
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
2183
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
2184
+ expect(requestResponses).toHaveLength(1);
2185
+ // The backstop delivered a non-retryable 504 with an indeterminate outcome.
2186
+ expect(requestResponses[0]?.status).toBe(504);
2187
+ const parsed = JSON.parse(requestResponses[0]?.body ?? "{}");
2188
+ const responseBody = JSON.parse(parsed.body);
2189
+ expect(responseBody.outcome).toBe("indeterminate");
2190
+ expect(responseBody.retryable).toBe(false);
2191
+ expect(parsed.headers?.["x-paperclip-bridge-outcome"]).toBe("indeterminate");
2192
+ // The finalize writes failed before the backstop wrote, so it took a later
2193
+ // attempt.
2194
+ expect(writeAttempts).toBeGreaterThanOrEqual(4);
2195
+ // The bridge wrote no retryable status for the possibly-committed mutation.
2196
+ expect(responseWrites.some((write) => write.status === 503)).toBe(false);
2197
+ expect(responseWrites.some((write) => write.status === 502)).toBe(false);
2198
+ // The backstop removed the request file, so it does not strand in the queue.
2199
+ expect(requestRemovals).toContain(requestPath);
2200
+ await worker.stop({ drainTimeoutMs: 10 });
2201
+ });
2202
+ it("retries a recovery 503 write that fails transiently, delivers the 503, and removes the request", async () => {
2203
+ // A request attempt times out (its first read hangs), so the loop's request
2204
+ // catch runs the recovery pass, which aborts the queued request with a 503.
2205
+ // The first 503 write fails, so the recovery must retry it inside the same
2206
+ // pass. It then delivers the 503 and removes the request. The request is
2207
+ // unclaimed, so its host mutation never ran; the 503 stays retry-safe. (A
2208
+ // hung poll no longer triggers this pass — the loop backs off and retries
2209
+ // the poll instead, and a sustained hang is the watchdog's job.)
2210
+ const waitFor = createWorkerWaiter();
2211
+ const queueDir = "/virtual-bridge/queue";
2212
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2213
+ const requestFile = "req-503-retry.json";
2214
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2215
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2216
+ const requestBodies = new Map();
2217
+ requestBodies.set(requestPath, bridgeRequestJson("req-503-retry"));
2218
+ const responseWrites = [];
2219
+ const requestRemovals = [];
2220
+ let readCalls = 0;
2221
+ let writeAttempts = 0;
2222
+ const client = {
2223
+ makeDir: async () => { },
2224
+ makeDirs: async () => { },
2225
+ listJsonFiles: async (dir) => dir === directories.requestsDir
2226
+ ? [...requestBodies.keys()].map((entry) => path.posix.basename(entry)).sort()
2227
+ : [],
2228
+ // The first read never resolves — a silently unresponsive sandbox channel
2229
+ // hit mid-request, before the handler claim. The per-iteration timeout
2230
+ // converts the hang into a caught error, so the loop's request catch runs
2231
+ // the recovery pass. The recovery's own read resolves, so it can build and
2232
+ // deliver the 503.
2233
+ readTextFile: async (remotePath) => {
2234
+ readCalls += 1;
2235
+ if (readCalls === 1) {
2236
+ return await new Promise(() => { });
2237
+ }
2238
+ const body = requestBodies.get(remotePath);
2239
+ if (body === undefined) {
2240
+ throw new Error(`missing request ${remotePath}`);
2241
+ }
2242
+ return body;
2243
+ },
2244
+ writeTextFile: async () => { },
2245
+ writeResponseFile: async (remotePath, body) => {
2246
+ writeAttempts += 1;
2247
+ // The first recovery 503 write fails; the retry then succeeds.
2248
+ if (writeAttempts === 1) {
2249
+ throw new Error("simulated transient recovery 503 write failure");
2250
+ }
2251
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status, body });
2252
+ return { wrote: true };
2253
+ },
2254
+ rename: async () => { },
2255
+ remove: async (remotePath) => {
2256
+ requestRemovals.push(remotePath);
2257
+ requestBodies.delete(remotePath);
2258
+ },
2259
+ };
2260
+ const { runtimeSpan } = createWorkerErrorCapture();
2261
+ const worker = await startSandboxCallbackBridgeWorker({
2262
+ client,
2263
+ queueDir,
2264
+ iterationTimeoutMs: 200,
2265
+ watchdogTimeoutMs: 10_000,
2266
+ runtimeSpan,
2267
+ authorizeRequest: async () => null,
2268
+ handleRequest: async () => ({ status: 200, body: "ok" }),
2269
+ });
2270
+ await waitFor(() => responseWrites.some((write) => write.path === responsePath), 3_000);
2271
+ // Exactly one response landed: the retry-safe 503. The retry delivered it
2272
+ // after the transient failure.
2273
+ const requestResponses = responseWrites.filter((write) => write.path === responsePath);
2274
+ expect(requestResponses).toHaveLength(1);
2275
+ expect(requestResponses[0]?.status).toBe(503);
2276
+ expect(writeAttempts).toBeGreaterThanOrEqual(2);
2277
+ // The recovery removed the request file only after the 503 write landed.
2278
+ expect(requestRemovals).toContain(requestPath);
2279
+ await worker.stop({ drainTimeoutMs: 10 });
2280
+ });
2281
+ it("keeps the queued request when every recovery 503 write fails, so a later pass can still deliver a terminal 503", async () => {
2282
+ // The poll times out, so the recovery path aborts the queued request with a
2283
+ // 503. Every 503 write fails. The recovery must keep the request file instead
2284
+ // of dropping it. Without the fix, the recovery removed the request before its
2285
+ // single write attempt, so a failed write left no queue state; a later
2286
+ // recovery pass found nothing and the caller waited until its own deadline.
2287
+ const waitFor = createWorkerWaiter();
2288
+ const queueDir = "/virtual-bridge/queue";
2289
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2290
+ const requestFile = "req-503-keep.json";
2291
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2292
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2293
+ const requestBodies = new Map();
2294
+ requestBodies.set(requestPath, bridgeRequestJson("req-503-keep"));
2295
+ const responseWrites = [];
2296
+ const requestRemovals = [];
2297
+ let listCalls = 0;
2298
+ let writeAttempts = 0;
2299
+ const client = {
2300
+ makeDir: async () => { },
2301
+ makeDirs: async () => { },
2302
+ listJsonFiles: async (dir) => {
2303
+ if (dir !== directories.requestsDir) {
2304
+ return [];
2305
+ }
2306
+ listCalls += 1;
2307
+ if (listCalls === 1) {
2308
+ return await new Promise(() => { });
2309
+ }
2310
+ return [...requestBodies.keys()].map((entry) => path.posix.basename(entry)).sort();
2311
+ },
2312
+ readTextFile: async (remotePath) => {
2313
+ const body = requestBodies.get(remotePath);
2314
+ if (body === undefined) {
2315
+ throw new Error(`missing request ${remotePath}`);
2316
+ }
2317
+ return body;
2318
+ },
2319
+ writeTextFile: async () => { },
2320
+ writeResponseFile: async () => {
2321
+ writeAttempts += 1;
2322
+ // Fail every recovery 503 write attempt.
2323
+ throw new Error("simulated persistent recovery 503 write failure");
2324
+ },
2325
+ rename: async () => { },
2326
+ remove: async (remotePath) => {
2327
+ requestRemovals.push(remotePath);
2328
+ requestBodies.delete(remotePath);
2329
+ },
2330
+ };
2331
+ const { runtimeSpan } = createWorkerErrorCapture();
2332
+ const worker = await startSandboxCallbackBridgeWorker({
2333
+ client,
2334
+ queueDir,
2335
+ iterationTimeoutMs: 200,
2336
+ watchdogTimeoutMs: 10_000,
2337
+ runtimeSpan,
2338
+ authorizeRequest: async () => null,
2339
+ handleRequest: async () => ({ status: 200, body: "ok" }),
2340
+ });
2341
+ // Wait until the recovery pass has exhausted its bounded 503 write attempts
2342
+ // (three, the same bound as the finalize and 504 backstop writes).
2343
+ await waitFor(() => writeAttempts >= 3, 3_000);
2344
+ // The recovery could not write the 503, so it kept the request file. The
2345
+ // request still sits in the queue for a later recovery pass to deliver a
2346
+ // terminal 503. A drop here would strand the caller until its own deadline.
2347
+ expect(requestRemovals).not.toContain(requestPath);
2348
+ expect(requestBodies.has(requestPath)).toBe(true);
2349
+ // No response landed, because every write failed. The recovery wrote no
2350
+ // partial or retryable status for the possibly-committed mutation.
2351
+ expect(responseWrites).toHaveLength(0);
2352
+ await worker.stop({ drainTimeoutMs: 10 });
2353
+ });
2354
+ it("abandons a request before its handler starts, so the mutation never runs", async () => {
2355
+ // Prove the reverse race. When the recovery path claims a request before the
2356
+ // handler starts its host operation, the handler must bail without running
2357
+ // the mutation. A retry after the 503 then applies the mutation once.
2358
+ const waitFor = createWorkerWaiter();
2359
+ const queueDir = "/virtual-bridge/queue";
2360
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2361
+ const requestFile = "req-early.json";
2362
+ const requestPath = path.posix.join(directories.requestsDir, requestFile);
2363
+ const responsePath = path.posix.join(directories.responsesDir, requestFile);
2364
+ const requestBodies = new Map();
2365
+ requestBodies.set(requestPath, bridgeRequestJson("req-early"));
2366
+ const responseWrites = [];
2367
+ const client = {
2368
+ ...virtualQueueReadClient(directories, requestBodies),
2369
+ writeResponseFile: async (remotePath, body) => {
2370
+ responseWrites.push({ path: remotePath, status: JSON.parse(body.trim()).status });
2371
+ return { wrote: true };
2372
+ },
2373
+ rename: async () => { },
2374
+ remove: async (remotePath) => {
2375
+ requestBodies.delete(remotePath);
2376
+ },
2377
+ };
2378
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
2379
+ // The authorize step stays pending until the test releases it, so the handler
2380
+ // does not start before the per-iteration timeout fires and the recovery path
2381
+ // claims the request.
2382
+ const authorizeControl = { release: null };
2383
+ let handlerCalls = 0;
2384
+ const worker = await startSandboxCallbackBridgeWorker({
2385
+ client,
2386
+ queueDir,
2387
+ iterationTimeoutMs: 50,
2388
+ watchdogTimeoutMs: 10_000,
2389
+ runtimeSpan,
2390
+ authorizeRequest: () => new Promise((resolve) => {
2391
+ authorizeControl.release = () => resolve(null);
2392
+ }),
2393
+ handleRequest: async () => {
2394
+ handlerCalls += 1;
2395
+ return { status: 200, body: "req-early" };
2396
+ },
2397
+ });
2398
+ // Wait until the recovery path wrote the 503 and the authorize step is
2399
+ // pending.
2400
+ await waitFor(() => responseWrites.some((write) => write.status === 503) && authorizeControl.release !== null, 3_000);
2401
+ expect(responseWrites.some((write) => write.path === responsePath && write.status === 503)).toBe(true);
2402
+ // Release authorize after the 503. The handler must bail at its claim.
2403
+ authorizeControl.release?.();
2404
+ await new Promise((resolve) => setTimeout(resolve, 50));
2405
+ // The handler never ran, so the mutation never applied.
2406
+ expect(handlerCalls).toBe(0);
2407
+ // No competing 200 landed over the 503.
2408
+ expect(responseWrites.some((write) => write.path === responsePath && write.status === 200)).toBe(false);
2409
+ expect(workerErrors.some((message) => message.includes("timed out"))).toBe(true);
2410
+ await worker.stop({ drainTimeoutMs: 10 });
2411
+ });
2412
+ it("trips the watchdog on a stalled poll, writes a 503, and surfaces a run-level error", async () => {
2413
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-watchdog-"));
2414
+ cleanupDirs.push(rootDir);
2415
+ const queueDir = path.posix.join(rootDir, "queue");
2416
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2417
+ await mkdir(directories.requestsDir, { recursive: true });
2418
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-w.json"), bridgeRequestJson("req-w"));
2419
+ const base = createFileSystemSandboxCallbackBridgeQueueClient();
2420
+ let listCalls = 0;
2421
+ const client = {
2422
+ ...base,
2423
+ listJsonFiles: async (dir) => {
2424
+ listCalls += 1;
2425
+ // The first poll (the loop) never resolves — a stalled channel that the
2426
+ // per-iteration timeout does not catch soon enough. Later calls (the
2427
+ // watchdog's failPendingRequests) resolve, so it enumerates and 503s.
2428
+ if (listCalls === 1) {
2429
+ return await new Promise(() => { });
2430
+ }
2431
+ return await base.listJsonFiles(dir);
2432
+ },
2433
+ };
2434
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
2435
+ const worker = await startSandboxCallbackBridgeWorker({
2436
+ client,
2437
+ queueDir,
2438
+ // The per-iteration timeout is far larger than the watchdog threshold, so
2439
+ // the watchdog — not the per-iteration timeout — is the mechanism proven.
2440
+ iterationTimeoutMs: 400,
2441
+ watchdogTimeoutMs: 50,
2442
+ runtimeSpan,
2443
+ authorizeRequest: async () => null,
2444
+ handleRequest: async () => ({ status: 200, body: "ok" }),
2445
+ });
2446
+ const responseFile = await waitForJsonFile(directories.responsesDir, 3_000);
2447
+ const responseBody = await readFile(path.posix.join(directories.responsesDir, responseFile), "utf8");
2448
+ expect(JSON.parse(responseBody).status).toBe(503);
2449
+ expect(workerErrors.some((message) => message.includes("no successful poll iteration"))).toBe(true);
2450
+ await worker.stop({ drainTimeoutMs: 400 });
2451
+ });
2452
+ it("processes a fast request with no false-positive timeout and no run-level error", async () => {
2453
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-fast-"));
2454
+ cleanupDirs.push(rootDir);
2455
+ const queueDir = path.posix.join(rootDir, "queue");
2456
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
2457
+ await mkdir(directories.requestsDir, { recursive: true });
2458
+ await publishBridgeRequest(path.posix.join(directories.requestsDir, "req-ok.json"), bridgeRequestJson("req-ok"));
2459
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
2460
+ const processed = [];
2461
+ const worker = await startSandboxCallbackBridgeWorker({
2462
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
2463
+ queueDir,
2464
+ iterationTimeoutMs: 200,
2465
+ watchdogTimeoutMs: 1_000,
2466
+ runtimeSpan,
2467
+ authorizeRequest: async () => null,
2468
+ handleRequest: async (request) => {
2469
+ processed.push(request.id);
2470
+ return { status: 200, body: request.id };
2471
+ },
2472
+ });
2473
+ const responseFile = await waitForJsonFile(directories.responsesDir, 3_000);
2474
+ const responseBody = await readFile(path.posix.join(directories.responsesDir, responseFile), "utf8");
2475
+ expect(JSON.parse(responseBody).status).toBe(200);
2476
+ expect(JSON.parse(responseBody).body).toBe("req-ok");
2477
+ // Let several idle poll iterations and watchdog checks pass. A healthy idle
2478
+ // loop must never trip the watchdog and never surface a run-level error.
2479
+ await new Promise((resolve) => setTimeout(resolve, 300));
2480
+ expect(processed).toEqual(["req-ok"]);
2481
+ expect(workerErrors).toEqual([]);
2482
+ await worker.stop({ drainTimeoutMs: 50 });
2483
+ });
2484
+ async function prepareGatewayFixture(prefix) {
2485
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), prefix));
2486
+ cleanupDirs.push(rootDir);
2487
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
2488
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
2489
+ await mkdir(localWorkspaceDir, { recursive: true });
2490
+ await mkdir(remoteWorkspaceDir, { recursive: true });
2491
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge test\n", "utf8");
2492
+ const runner = createExecRunner();
2493
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
2494
+ cleanupFns.push(bridgeAsset.cleanup);
2495
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
2496
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
2497
+ return {
2498
+ runner,
2499
+ remoteWorkspaceDir,
2500
+ assetRemoteDir: prepared.assetDirs.bridge,
2501
+ queueDir,
2502
+ directories: sandboxCallbackBridgeDirectories(queueDir),
2503
+ bridgeToken: createSandboxCallbackBridgeToken(),
2504
+ };
2505
+ }
2506
+ it("cleans up a timed-out request file and keeps serving after the host recovers", async () => {
2507
+ const fixture = await prepareGatewayFixture("paperclip-bridge-timeout-clean-");
2508
+ const bridge = await startSandboxCallbackBridgeServer({
2509
+ runner: fixture.runner,
2510
+ remoteCwd: fixture.remoteWorkspaceDir,
2511
+ assetRemoteDir: fixture.assetRemoteDir,
2512
+ queueDir: fixture.queueDir,
2513
+ bridgeToken: fixture.bridgeToken,
2514
+ timeoutMs: 30_000,
2515
+ responseTimeoutMs: 600,
2516
+ pollIntervalMs: 50,
2517
+ });
2518
+ cleanupFns.push(async () => {
2519
+ await bridge.stop();
2520
+ });
2521
+ // No worker runs, so the request times out at the gateway.
2522
+ const timedOut = await fetch(`${bridge.baseUrl}/api/agents/me`, {
2523
+ headers: { authorization: `Bearer ${fixture.bridgeToken}` },
2524
+ });
2525
+ expect(timedOut.status).toBe(502);
2526
+ await expect(timedOut.json()).resolves.toMatchObject({
2527
+ error: expect.stringContaining("Timed out"),
2528
+ });
2529
+ // The gateway cleaned its own request file, so nothing counts toward the
2530
+ // queue-depth cap after the caller gave up.
2531
+ const leftover = (await readdir(fixture.directories.requestsDir).catch(() => [])).filter((name) => name.endsWith(".json"));
2532
+ expect(leftover).toEqual([]);
2533
+ // A worker that comes up afterwards serves the next request normally —
2534
+ // the timeout neither wedged nor killed the gateway.
2535
+ const worker = await startSandboxCallbackBridgeWorker({
2536
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
2537
+ queueDir: fixture.queueDir,
2538
+ authorizeRequest: async () => null,
2539
+ handleRequest: async () => ({
2540
+ status: 200,
2541
+ headers: { "content-type": "application/json" },
2542
+ body: JSON.stringify({ ok: true }),
2543
+ }),
2544
+ });
2545
+ cleanupFns.push(async () => {
2546
+ await worker.stop();
2547
+ });
2548
+ const recovered = await fetch(`${bridge.baseUrl}/api/agents/me`, {
2549
+ headers: { authorization: `Bearer ${fixture.bridgeToken}` },
2550
+ });
2551
+ expect(recovered.status).toBe(200);
2552
+ await expect(recovered.json()).resolves.toMatchObject({ ok: true });
2553
+ }, 30_000);
2554
+ it("sweeps stale request files before rejecting at the queue-depth cap", async () => {
2555
+ const fixture = await prepareGatewayFixture("paperclip-bridge-stale-sweep-");
2556
+ const bridge = await startSandboxCallbackBridgeServer({
2557
+ runner: fixture.runner,
2558
+ remoteCwd: fixture.remoteWorkspaceDir,
2559
+ assetRemoteDir: fixture.assetRemoteDir,
2560
+ queueDir: fixture.queueDir,
2561
+ bridgeToken: fixture.bridgeToken,
2562
+ timeoutMs: 30_000,
2563
+ responseTimeoutMs: 500,
2564
+ pollIntervalMs: 50,
2565
+ maxQueueDepth: 1,
2566
+ });
2567
+ cleanupFns.push(async () => {
2568
+ await bridge.stop();
2569
+ });
2570
+ // Plant an orphaned request file (a killed caller, or a previous gateway
2571
+ // process's leftover) and backdate it beyond the response deadline.
2572
+ const orphanPath = path.join(fixture.directories.requestsDir, "orphan.json");
2573
+ await writeFile(orphanPath, bridgeRequestJson("orphan"), "utf8");
2574
+ const staleTime = new Date(Date.now() - 60_000);
2575
+ await utimes(orphanPath, staleTime, staleTime);
2576
+ // The queue sits at the cap, but the only entry is stale: the gateway must
2577
+ // sweep it and admit the request instead of answering 503. With no worker
2578
+ // the admitted request then times out (502) — proof it entered the queue.
2579
+ const response = await fetch(`${bridge.baseUrl}/api/agents/me`, {
2580
+ headers: { authorization: `Bearer ${fixture.bridgeToken}` },
2581
+ });
2582
+ expect(response.status).toBe(502);
2583
+ const body = (await response.json());
2584
+ expect(body.error ?? "").not.toContain("queue is full");
2585
+ const leftover = (await readdir(fixture.directories.requestsDir).catch(() => [])).filter((name) => name.endsWith(".json"));
2586
+ expect(leftover).toEqual([]);
2587
+ }, 30_000);
2588
+ it("skips a request file that vanished before the read instead of escalating", async () => {
2589
+ // The gateway deletes a request file when its caller stops waiting. The
2590
+ // worker's read then races the deletion; a vanished file must be a quiet
2591
+ // skip, not a worker failure with a recovery pass.
2592
+ const queueDir = "/virtual-bridge/vanished";
2593
+ let listCalls = 0;
2594
+ const handled = [];
2595
+ const responseStatuses = [];
2596
+ const { runtimeSpan, workerErrors } = createWorkerErrorCapture();
2597
+ const client = {
2598
+ makeDir: async () => { },
2599
+ makeDirs: async () => { },
2600
+ listJsonFiles: async () => {
2601
+ listCalls += 1;
2602
+ return listCalls === 1 ? ["ghost.json"] : [];
2603
+ },
2604
+ readTextFile: async () => {
2605
+ throw new Error("cat: ghost.json: No such file or directory");
2606
+ },
2607
+ writeTextFile: async () => { },
2608
+ writeResponseFile: async (_remotePath, body) => {
2609
+ responseStatuses.push(JSON.parse(body.trim()).status);
2610
+ return { wrote: true };
2611
+ },
2612
+ rename: async () => { },
2613
+ remove: async () => { },
2614
+ };
2615
+ const worker = await startSandboxCallbackBridgeWorker({
2616
+ client,
2617
+ queueDir,
2618
+ runtimeSpan,
2619
+ authorizeRequest: async () => null,
2620
+ handleRequest: async (request) => {
2621
+ handled.push(request.id);
2622
+ return { status: 200, body: "ok" };
2623
+ },
2624
+ });
2625
+ await new Promise((resolve) => setTimeout(resolve, 250));
2626
+ await worker.stop({ drainTimeoutMs: 50 });
2627
+ expect(handled).toEqual([]);
2628
+ expect(responseStatuses).toEqual([]);
2629
+ expect(workerErrors).toEqual([]);
2630
+ });
2631
+ it("embeds crash handlers and queue hygiene in the generated gateway source", () => {
2632
+ // A crashed gateway is a dead loopback port for the rest of the run, so
2633
+ // the generated source must keep its crash handlers and its stale-queue
2634
+ // sweep. The readiness gate matters too: survival applies only after the
2635
+ // gateway is adoptable, so a startup fault still fails fast. This pins
2636
+ // their presence; the behavior is proven above and below.
2637
+ const source = getSandboxCallbackBridgeServerSource();
2638
+ expect(source).toContain('process.on("uncaughtException"');
2639
+ expect(source).toContain('process.on("unhandledRejection"');
2640
+ expect(source).toContain("gatewayReady");
2641
+ expect(source).toContain("sweepStaleRequests");
2642
+ });
2643
+ it("exits fast when the gateway cannot bind its port instead of lingering un-ready", async () => {
2644
+ // Before readiness, the crash handlers must not keep the process alive: a
2645
+ // failed bind means the gateway can never serve, and surviving would only
2646
+ // leave an un-ready zombie while the host waits out its readiness poll.
2647
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-bind-fail-"));
2648
+ cleanupDirs.push(rootDir);
2649
+ const entrypoint = path.join(rootDir, "paperclip-bridge-server.mjs");
2650
+ await writeFile(entrypoint, getSandboxCallbackBridgeServerSource(), "utf8");
2651
+ const queueDir = path.join(rootDir, "queue");
2652
+ await mkdir(queueDir, { recursive: true });
2653
+ const blocker = createServer();
2654
+ await new Promise((resolve) => {
2655
+ blocker.listen(0, "127.0.0.1", resolve);
2656
+ });
2657
+ cleanupFns.push(() => new Promise((resolve) => {
2658
+ blocker.close(() => resolve());
2659
+ }));
2660
+ const blockedPort = blocker.address().port;
2661
+ const child = spawn(process.execPath, [entrypoint], {
2662
+ env: {
2663
+ ...process.env,
2664
+ PAPERCLIP_BRIDGE_QUEUE_DIR: queueDir,
2665
+ PAPERCLIP_BRIDGE_TOKEN: "test-token",
2666
+ PAPERCLIP_BRIDGE_PORT: String(blockedPort),
2667
+ },
2668
+ stdio: ["ignore", "ignore", "pipe"],
2669
+ });
2670
+ let stderr = "";
2671
+ child.stderr.on("data", (chunk) => {
2672
+ stderr += chunk;
2673
+ });
2674
+ const exitCode = await new Promise((resolve) => {
2675
+ child.on("close", resolve);
2676
+ });
2677
+ expect(exitCode).toBe(1);
2678
+ expect(stderr).toContain("[paperclip-bridge] server error");
2679
+ expect(stderr).toContain("EADDRINUSE");
2680
+ }, 15_000);
2681
+ it("exits nonzero for the retired duplex_v1 mode instead of starting the queue gateway", async () => {
2682
+ // The closed mode allowlist rejects `duplex_v1` before the queue-directory
2683
+ // check, so a stale `duplex_v1` launch environment fails startup instead
2684
+ // of silently falling through to the queue gateway.
2685
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-mode-duplex-"));
2686
+ cleanupDirs.push(rootDir);
2687
+ const entrypoint = path.join(rootDir, "paperclip-bridge-server.mjs");
2688
+ await writeFile(entrypoint, getSandboxCallbackBridgeServerSource(), "utf8");
2689
+ const queueDir = path.join(rootDir, "queue");
2690
+ await mkdir(queueDir, { recursive: true });
2691
+ const child = spawn(process.execPath, [entrypoint], {
2692
+ env: {
2693
+ ...process.env,
2694
+ PAPERCLIP_API_BRIDGE_MODE: "duplex_v1",
2695
+ PAPERCLIP_BRIDGE_QUEUE_DIR: queueDir,
2696
+ PAPERCLIP_BRIDGE_TOKEN: "test-token",
2697
+ PAPERCLIP_BRIDGE_PORT: "0",
2698
+ },
2699
+ stdio: ["ignore", "ignore", "pipe"],
2700
+ });
2701
+ let stderr = "";
2702
+ child.stderr.on("data", (chunk) => {
2703
+ stderr += chunk;
2704
+ });
2705
+ const exitCode = await new Promise((resolve) => {
2706
+ child.on("close", resolve);
2707
+ });
2708
+ expect(exitCode).not.toBe(0);
2709
+ expect(stderr).toContain("Unsupported PAPERCLIP_API_BRIDGE_MODE: duplex_v1");
2710
+ }, 15_000);
2711
+ it("exits nonzero for an unknown bridge mode instead of starting the queue gateway", async () => {
2712
+ // The closed mode allowlist rejects every value it does not name, not
2713
+ // only the retired duplex transport.
2714
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-mode-unknown-"));
2715
+ cleanupDirs.push(rootDir);
2716
+ const entrypoint = path.join(rootDir, "paperclip-bridge-server.mjs");
2717
+ await writeFile(entrypoint, getSandboxCallbackBridgeServerSource(), "utf8");
2718
+ const queueDir = path.join(rootDir, "queue");
2719
+ await mkdir(queueDir, { recursive: true });
2720
+ const child = spawn(process.execPath, [entrypoint], {
2721
+ env: {
2722
+ ...process.env,
2723
+ PAPERCLIP_API_BRIDGE_MODE: "totally_unknown_mode",
2724
+ PAPERCLIP_BRIDGE_QUEUE_DIR: queueDir,
2725
+ PAPERCLIP_BRIDGE_TOKEN: "test-token",
2726
+ PAPERCLIP_BRIDGE_PORT: "0",
2727
+ },
2728
+ stdio: ["ignore", "ignore", "pipe"],
2729
+ });
2730
+ let stderr = "";
2731
+ child.stderr.on("data", (chunk) => {
2732
+ stderr += chunk;
2733
+ });
2734
+ const exitCode = await new Promise((resolve) => {
2735
+ child.on("close", resolve);
2736
+ });
2737
+ expect(exitCode).not.toBe(0);
2738
+ expect(stderr).toContain("Unsupported PAPERCLIP_API_BRIDGE_MODE: totally_unknown_mode");
2739
+ }, 15_000);
2740
+ it("test_http2_gateway_writes_no_frame_between_ready_and_the_preface", async () => {
2741
+ // Spawn the real generated gateway in http2_v1 mode and read its raw
2742
+ // stdout bytes. The only frame-codec write on this path is the READY
2743
+ // line; the very next bytes must be the HTTP/2 client connection preface
2744
+ // with nothing in between, because the gateway hands stdout to the
2745
+ // HTTP/2 client immediately after it writes READY and starts no
2746
+ // heartbeat timer and writes no envelope frame on this path.
2747
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-http2-gateway-"));
2748
+ cleanupDirs.push(rootDir);
2749
+ const entrypoint = path.join(rootDir, "paperclip-bridge-server.mjs");
2750
+ await writeFile(entrypoint, getSandboxCallbackBridgeServerSource(), "utf8");
2751
+ const probe = createServer();
2752
+ const assignedPort = await new Promise((resolve, reject) => {
2753
+ probe.once("error", reject);
2754
+ probe.listen(0, "127.0.0.1", () => {
2755
+ const address = probe.address();
2756
+ if (!address || typeof address === "string") {
2757
+ reject(new Error("Could not reserve a loopback port for the test."));
2758
+ return;
2759
+ }
2760
+ probe.close(() => resolve(address.port));
2761
+ });
2762
+ });
2763
+ const nonce = "test-nonce-http2";
2764
+ const child = spawn(process.execPath, [entrypoint], {
2765
+ env: {
2766
+ ...process.env,
2767
+ PAPERCLIP_API_BRIDGE_MODE: "http2_v1",
2768
+ PAPERCLIP_BRIDGE_TOKEN: "test-token",
2769
+ PAPERCLIP_BRIDGE_PORT: String(assignedPort),
2770
+ PAPERCLIP_BRIDGE_NONCE: nonce,
2771
+ },
2772
+ stdio: ["pipe", "pipe", "pipe"],
2773
+ });
2774
+ cleanupFns.push(async () => {
2775
+ child.kill();
2776
+ });
2777
+ let stderr = "";
2778
+ child.stderr.on("data", (chunk) => {
2779
+ stderr += chunk.toString("utf8");
2780
+ });
2781
+ const chunks = [];
2782
+ const preface = Buffer.from("505249202a20485454502f322e300d0a0d0a534d0d0a0d0a", "hex");
2783
+ const firstBytes = await new Promise((resolve, reject) => {
2784
+ const timer = setTimeout(() => reject(new Error("Timed out waiting for the http2 gateway stdout. stderr: " + stderr)), 5000);
2785
+ child.stdout.on("data", (chunk) => {
2786
+ chunks.push(chunk);
2787
+ const total = Buffer.concat(chunks);
2788
+ const newlineIndex = total.indexOf(0x0a);
2789
+ if (newlineIndex !== -1 && total.length >= newlineIndex + 1 + preface.length) {
2790
+ clearTimeout(timer);
2791
+ resolve(total);
2792
+ }
2793
+ });
2794
+ child.once("error", reject);
2795
+ child.once("exit", (code) => {
2796
+ clearTimeout(timer);
2797
+ reject(new Error("The http2 gateway exited early with code " + String(code) + ". stderr: " + stderr));
2798
+ });
2799
+ });
2800
+ const newlineIndex = firstBytes.indexOf(0x0a);
2801
+ expect(newlineIndex).toBeGreaterThan(0);
2802
+ // Assert the exact UTF-8 bytes, not a parsed-and-matched object.
2803
+ // `JSON.stringify` writes keys in the object-literal insertion order, so a
2804
+ // reordered or reformatted call site at the gateway's one `writeFrame` call
2805
+ // would change the bytes on the wire without failing a looser assertion.
2806
+ const readyLine = firstBytes.subarray(0, newlineIndex).toString("utf8");
2807
+ expect(readyLine).toBe(`{"version":2,"type":"ready","nonce":"${nonce}"}`);
2808
+ expect(encodeDuplexFrame({ version: DUPLEX_FRAME_VERSION, type: "ready", nonce })).toBe(`${readyLine}\n`);
2809
+ const afterReady = firstBytes.subarray(newlineIndex + 1, newlineIndex + 1 + preface.length);
2810
+ expect(afterReady).toEqual(preface);
2811
+ }, 15_000);
2812
+ /**
2813
+ * Spawn the real generated gateway in `http2_v1` mode, then bind the real
2814
+ * host-side `createHttp2BridgeServer` to its stdio. The gateway writes one
2815
+ * READY line before it hands stdout to its HTTP/2 client, so this helper
2816
+ * strips that line first and feeds the host only the raw HTTP/2 bytes that
2817
+ * follow. A test then drives the gateway with ordinary HTTP/1.1 requests
2818
+ * against its loopback port and inspects the exact bytes `forwardRequest`
2819
+ * receives, proving the send path carries no intermediate string.
2820
+ */
2821
+ async function startHttp2GatewayForTest(options, attempt = 0) {
2822
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-http2-test-"));
2823
+ cleanupDirs.push(rootDir);
2824
+ const entrypoint = path.join(rootDir, "paperclip-bridge-server.mjs");
2825
+ await writeFile(entrypoint, getSandboxCallbackBridgeServerSource(), "utf8");
2826
+ const probe = createServer();
2827
+ const assignedPort = await new Promise((resolve, reject) => {
2828
+ probe.once("error", reject);
2829
+ probe.listen(0, "127.0.0.1", () => {
2830
+ const address = probe.address();
2831
+ if (!address || typeof address === "string") {
2832
+ reject(new Error("Could not reserve a loopback port for the test."));
2833
+ return;
2834
+ }
2835
+ if (options.holdProbeOpen?.()) {
2836
+ cleanupFns.push(() => new Promise((resolve) => probe.close(() => resolve())));
2837
+ resolve(address.port);
2838
+ }
2839
+ else {
2840
+ probe.close(() => resolve(address.port));
2841
+ }
2842
+ });
2843
+ });
2844
+ const child = spawn(process.execPath, [entrypoint], {
2845
+ env: {
2846
+ ...process.env,
2847
+ PAPERCLIP_API_BRIDGE_MODE: "http2_v1",
2848
+ PAPERCLIP_BRIDGE_TOKEN: options.bridgeToken,
2849
+ PAPERCLIP_BRIDGE_PORT: String(assignedPort),
2850
+ PAPERCLIP_BRIDGE_NONCE: "test-nonce",
2851
+ ...(options.maxBodyBytes != null
2852
+ ? { PAPERCLIP_BRIDGE_MAX_BODY_BYTES: String(options.maxBodyBytes) }
2853
+ : {}),
2854
+ },
2855
+ stdio: ["pipe", "pipe", "pipe"],
2856
+ });
2857
+ let stderr = "";
2858
+ child.stderr.on("data", (chunk) => {
2859
+ stderr += chunk.toString("utf8");
2860
+ });
2861
+ if (options.deferStderrUntilExit) {
2862
+ const resume = child.stderr.resume.bind(child.stderr);
2863
+ child.stderr.pause();
2864
+ child.stderr.resume = () => child.stderr;
2865
+ child.once("exit", () => setImmediate(() => {
2866
+ child.stderr.resume = resume;
2867
+ resume();
2868
+ }));
2869
+ }
2870
+ const dataListeners = [];
2871
+ const pending = [];
2872
+ let dispatchStarted = false;
2873
+ let sawReadyLine = false;
2874
+ let readyBuffer = Buffer.alloc(0);
2875
+ let resolveReady;
2876
+ let rejectReady;
2877
+ const readyPromise = new Promise((resolve, reject) => {
2878
+ resolveReady = resolve;
2879
+ rejectReady = reject;
2880
+ });
2881
+ const readyTimer = setTimeout(() => rejectReady(new Error("Timed out waiting for the http2 gateway READY line. stderr: " + stderr)), 5000);
2882
+ const deliver = (chunk) => {
2883
+ if (dispatchStarted) {
2884
+ for (const listener of dataListeners)
2885
+ listener(chunk);
2886
+ }
2887
+ else {
2888
+ pending.push(chunk);
2889
+ }
2890
+ };
2891
+ child.stdout.on("data", (chunk) => {
2892
+ if (!sawReadyLine) {
2893
+ readyBuffer = Buffer.concat([readyBuffer, chunk]);
2894
+ const newlineIndex = readyBuffer.indexOf(0x0a);
2895
+ if (newlineIndex === -1)
2896
+ return;
2897
+ sawReadyLine = true;
2898
+ clearTimeout(readyTimer);
2899
+ const rest = readyBuffer.subarray(newlineIndex + 1);
2900
+ readyBuffer = Buffer.alloc(0);
2901
+ resolveReady();
2902
+ if (rest.length > 0)
2903
+ deliver(rest);
2904
+ return;
2905
+ }
2906
+ deliver(chunk);
2907
+ });
2908
+ child.once("close", (code) => {
2909
+ clearTimeout(readyTimer);
2910
+ if (!sawReadyLine) {
2911
+ rejectReady(new Error("The http2 gateway exited early with code " + String(code) + ". stderr: " + stderr));
2912
+ }
2913
+ });
2914
+ const channel = {
2915
+ write: (data) => {
2916
+ child.stdin.write(Buffer.from(data));
2917
+ },
2918
+ onData: (listener) => {
2919
+ dataListeners.push(listener);
2920
+ },
2921
+ onExit: (listener) => {
2922
+ child.once("exit", (code) => listener({ exitCode: code }));
2923
+ },
2924
+ stop: () => {
2925
+ child.kill();
2926
+ },
2927
+ close: async () => {
2928
+ child.stdin.end();
2929
+ },
2930
+ };
2931
+ try {
2932
+ await readyPromise;
2933
+ }
2934
+ catch (error) {
2935
+ child.kill();
2936
+ if (attempt < 2 && child.exitCode === 1
2937
+ && stderr.includes("http2 gateway could not bind port") && stderr.includes("EADDRINUSE")) {
2938
+ return startHttp2GatewayForTest(options, attempt + 1);
2939
+ }
2940
+ throw error;
2941
+ }
2942
+ const handle = createHttp2BridgeServer({
2943
+ bridgeToken: options.bridgeToken,
2944
+ forwardRequest: options.forwardRequest,
2945
+ });
2946
+ const boundDuplex = handle.bindChannel(channel);
2947
+ dispatchStarted = true;
2948
+ const buffered = pending.splice(0);
2949
+ for (const chunk of buffered) {
2950
+ for (const listener of dataListeners)
2951
+ listener(chunk);
2952
+ }
2953
+ // Destroy the bound duplex directly instead of `handle.close()`. The
2954
+ // duplex here wraps a spawned process's raw stdio, not a real socket,
2955
+ // and `close()` waits on a graceful HTTP/2 GOAWAY exchange that never
2956
+ // settles over this transport. A direct destroy ends the session at
2957
+ // once, which is correct for test teardown.
2958
+ const stop = async () => {
2959
+ boundDuplex.destroy();
2960
+ child.kill();
2961
+ };
2962
+ cleanupFns.push(stop);
2963
+ return { baseUrl: `http://127.0.0.1:${assignedPort}`, stop };
2964
+ }
2965
+ it("forwards the exact request body bytes to the HTTP/2 host handler, including a non-ASCII character", async () => {
2966
+ const bridgeToken = createSandboxCallbackBridgeToken();
2967
+ const seenBodies = [];
2968
+ const gateway = await startHttp2GatewayForTest({
2969
+ bridgeToken,
2970
+ forwardRequest: async (request) => {
2971
+ seenBodies.push(request.body);
2972
+ return {
2973
+ status: 200,
2974
+ headers: { "content-type": "application/json" },
2975
+ body: Buffer.from(JSON.stringify({ ok: true }), "utf8"),
2976
+ };
2977
+ },
2978
+ });
2979
+ // "café" holds one multi-byte UTF-8 character. A body-to-string-to-body
2980
+ // round trip still reproduces this text correctly, so the byte-for-byte
2981
+ // comparison below is the real proof: it fails if any re-encoding step
2982
+ // runs, even one that happens to preserve valid UTF-8 text.
2983
+ const bodyText = JSON.stringify({ note: "café" });
2984
+ const bodyBytes = Buffer.from(bodyText, "utf8");
2985
+ const response = await fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
2986
+ method: "POST",
2987
+ headers: {
2988
+ authorization: `Bearer ${bridgeToken}`,
2989
+ "content-type": "application/json",
2990
+ },
2991
+ body: bodyBytes,
2992
+ });
2993
+ expect(response.status).toBe(200);
2994
+ expect(seenBodies).toHaveLength(1);
2995
+ expect(seenBodies[0]?.equals(bodyBytes)).toBe(true);
2996
+ }, 15_000);
2997
+ it("forwards malformed UTF-8 bytes to the HTTP/2 host handler unchanged", async () => {
2998
+ const bridgeToken = createSandboxCallbackBridgeToken();
2999
+ const seenBodies = [];
3000
+ // Byte 0xC3 opens a two-byte UTF-8 sequence; 0x28 is not a valid
3001
+ // continuation byte, so this body is not valid UTF-8. The gateway does
3002
+ // not decode or validate the body, so these exact bytes must still
3003
+ // arrive at the host handler unchanged, and the same bytes must return
3004
+ // to the caller unchanged. The host answers with a non-JSON content
3005
+ // type, so the round trip proves the gateway applies no format-specific
3006
+ // handling on the response leg either.
3007
+ const malformedBytes = Buffer.from([0x7b, 0x22, 0x61, 0x22, 0x3a, 0xc3, 0x28, 0x7d]);
3008
+ const gateway = await startHttp2GatewayForTest({
3009
+ bridgeToken,
3010
+ forwardRequest: async (request) => {
3011
+ seenBodies.push(request.body);
3012
+ return { status: 200, headers: { "content-type": "application/octet-stream" }, body: malformedBytes };
3013
+ },
3014
+ });
3015
+ const response = await fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
3016
+ method: "POST",
3017
+ headers: {
3018
+ authorization: `Bearer ${bridgeToken}`,
3019
+ "content-type": "application/json",
3020
+ },
3021
+ body: malformedBytes,
3022
+ });
3023
+ expect(response.status).toBe(200);
3024
+ expect(seenBodies).toHaveLength(1);
3025
+ expect(seenBodies[0]?.equals(malformedBytes)).toBe(true);
3026
+ const responseBytes = Buffer.from(await response.arrayBuffer());
3027
+ expect(responseBytes.equals(malformedBytes)).toBe(true);
3028
+ }, 15_000);
3029
+ it("rejects a request body over maxBodyBytes on the HTTP/2 path before it forwards a byte", async () => {
3030
+ const bridgeToken = createSandboxCallbackBridgeToken();
3031
+ const maxBodyBytes = 32;
3032
+ let forwardCalls = 0;
3033
+ const gateway = await startHttp2GatewayForTest({
3034
+ bridgeToken,
3035
+ maxBodyBytes,
3036
+ forwardRequest: async () => {
3037
+ forwardCalls += 1;
3038
+ return { status: 200, headers: {}, body: Buffer.alloc(0) };
3039
+ },
3040
+ });
3041
+ const oversizeBody = Buffer.alloc(maxBodyBytes + 1, 0x41);
3042
+ const response = await fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
3043
+ method: "POST",
3044
+ headers: {
3045
+ authorization: `Bearer ${bridgeToken}`,
3046
+ "content-type": "application/json",
3047
+ },
3048
+ body: oversizeBody,
3049
+ });
3050
+ expect(response.status).toBe(502);
3051
+ await expect(response.json()).resolves.toMatchObject({
3052
+ error: "Bridge request body exceeded the configured size limit.",
3053
+ });
3054
+ expect(forwardCalls).toBe(0);
3055
+ }, 15_000);
3056
+ /** A resolvable gate a test can await, then release on its own schedule. */
3057
+ function createGate() {
3058
+ let reach;
3059
+ const reached = new Promise((resolve) => {
3060
+ reach = resolve;
3061
+ });
3062
+ return { reached, reach };
3063
+ }
3064
+ it("denies a body once concurrent reservations reach the gateway's own process ledger ceiling, then admits again once they release", async () => {
3065
+ // The per-body maxBodyBytes cap alone does not bound how many bodies
3066
+ // this gateway process holds in memory at once. The generated gateway's
3067
+ // own process ledger gives it a second, independent ceiling: 4
3068
+ // concurrent max-size bodies, each counted twice (the retained chunk
3069
+ // array and the concatenated copy), exactly fills maxBodyBytes * 8. This
3070
+ // drives 4 concurrent requests to that exact ceiling, held open by a
3071
+ // forward call that does not return, then proves a 5th is denied and a
3072
+ // later one succeeds once the 4 held requests release their bytes.
3073
+ const bridgeToken = createSandboxCallbackBridgeToken();
3074
+ const maxBodyBytes = 400;
3075
+ const holdBody = Buffer.alloc(maxBodyBytes, 0x42);
3076
+ const HOLD_COUNT = 4;
3077
+ const reachedGates = Array.from({ length: HOLD_COUNT }, () => createGate());
3078
+ const releaseGates = Array.from({ length: HOLD_COUNT }, () => createGate());
3079
+ let forwardCalls = 0;
3080
+ const gateway = await startHttp2GatewayForTest({
3081
+ bridgeToken,
3082
+ maxBodyBytes,
3083
+ forwardRequest: async () => {
3084
+ const callIndex = forwardCalls;
3085
+ forwardCalls += 1;
3086
+ if (callIndex < HOLD_COUNT) {
3087
+ reachedGates[callIndex].reach();
3088
+ await releaseGates[callIndex].reached;
3089
+ }
3090
+ return { status: 200, headers: {}, body: Buffer.alloc(0) };
3091
+ },
3092
+ });
3093
+ const postHoldBody = () => fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
3094
+ method: "POST",
3095
+ headers: { authorization: `Bearer ${bridgeToken}`, "content-type": "application/json" },
3096
+ body: holdBody,
3097
+ });
3098
+ const holdResponses = Promise.all(Array.from({ length: HOLD_COUNT }, () => postHoldBody()));
3099
+ // Each held request's own forward call started, which only happens
3100
+ // after readBodyBytes already reserved that request's bytes, so all 4
3101
+ // reservations are live once every gate below resolves.
3102
+ await Promise.all(reachedGates.map((gate) => gate.reached));
3103
+ const deniedResponse = await postHoldBody();
3104
+ expect(deniedResponse.status).toBe(503);
3105
+ await expect(deniedResponse.json()).resolves.toMatchObject({
3106
+ error: "The bridge gateway process reached its reserved body byte ceiling. Retry later.",
3107
+ });
3108
+ // The denial happened during the body read, before this stream's own
3109
+ // forward call ever ran.
3110
+ expect(forwardCalls).toBe(HOLD_COUNT);
3111
+ releaseGates.forEach((gate) => gate.reach());
3112
+ const responses = await holdResponses;
3113
+ for (const response of responses) {
3114
+ expect(response.status).toBe(200);
3115
+ }
3116
+ // Every held reservation released once its own forward call settled: a
3117
+ // fresh request at the same size now succeeds again.
3118
+ const recoveredResponse = await postHoldBody();
3119
+ expect(recoveredResponse.status).toBe(200);
3120
+ }, 15_000);
3121
+ it("maps an indeterminate host outcome to a non-retryable 409 on the HTTP/2 gateway for an unsafe method", async () => {
3122
+ // The host answers a mutating request's response-body capacity denial with a
3123
+ // 504 and the indeterminate outcome header, exactly like an aborted in-flight
3124
+ // forward: the host may have already committed the mutation, so the status
3125
+ // must not be retryable. The HTTP/2 gateway must map that 504 to a 409, the
3126
+ // same map the file gateway already applies, so a standard retry policy does
3127
+ // not repeat the mutation. The outcome header and body must survive the map.
3128
+ const bridgeToken = createSandboxCallbackBridgeToken();
3129
+ const indeterminateBody = JSON.stringify({ error: "response body over limit", outcome: "indeterminate" });
3130
+ const gateway = await startHttp2GatewayForTest({
3131
+ bridgeToken,
3132
+ forwardRequest: async () => ({
3133
+ status: 504,
3134
+ headers: { "content-type": "application/json", "x-paperclip-bridge-outcome": "indeterminate" },
3135
+ body: Buffer.from(indeterminateBody, "utf8"),
3136
+ }),
3137
+ });
3138
+ const response = await fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
3139
+ method: "POST",
3140
+ headers: { authorization: `Bearer ${bridgeToken}`, "content-type": "application/json" },
3141
+ body: JSON.stringify({ note: "test" }),
3142
+ });
3143
+ expect(response.status).toBe(409);
3144
+ expect(response.status).toBeLessThan(500);
3145
+ expect(response.headers.get("x-paperclip-bridge-outcome")).toBe("indeterminate");
3146
+ const responseBytes = Buffer.from(await response.arrayBuffer());
3147
+ expect(responseBytes.toString("utf8")).toBe(indeterminateBody);
3148
+ }, 15_000);
3149
+ it("passes through a safe method's retryable 503 on the HTTP/2 gateway unchanged", async () => {
3150
+ // A safe method's response-body capacity denial carries no indeterminate
3151
+ // outcome header, so the gateway must keep it retryable: the map above must
3152
+ // not fire on a plain 503.
3153
+ const bridgeToken = createSandboxCallbackBridgeToken();
3154
+ const gateway = await startHttp2GatewayForTest({
3155
+ bridgeToken,
3156
+ forwardRequest: async () => ({
3157
+ status: 503,
3158
+ headers: { "content-type": "application/json" },
3159
+ body: Buffer.from(JSON.stringify({ error: "response body over limit" }), "utf8"),
3160
+ }),
3161
+ });
3162
+ const response = await fetch(`${gateway.baseUrl}/api/issues/issue-1/comments`, {
3163
+ method: "GET",
3164
+ headers: { authorization: `Bearer ${bridgeToken}` },
3165
+ });
3166
+ expect(response.status).toBe(503);
3167
+ expect(response.headers.get("x-paperclip-bridge-outcome")).toBeNull();
3168
+ }, 15_000);
3169
+ async function startQueueGatewayForFileTest(options) {
3170
+ const root = await mkdtemp(path.join(os.tmpdir(), "paperclip-file-codec-"));
3171
+ cleanupDirs.push(root);
3172
+ const asset = await createSandboxCallbackBridgeAsset();
3173
+ cleanupFns.push(asset.cleanup);
3174
+ const queueDir = path.join(root, "queue");
3175
+ const bridgeToken = createSandboxCallbackBridgeToken();
3176
+ const worker = await startSandboxCallbackBridgeWorker({
3177
+ client: options.client ?? createFileSystemSandboxCallbackBridgeQueueClient(), queueDir,
3178
+ maxBodyBytes: options.maxBodyBytes, handleRequest: options.handleRequest, pollIntervalMs: 10,
3179
+ });
3180
+ cleanupFns.push(() => worker.stop());
3181
+ const gateway = await startSandboxCallbackBridgeServer({
3182
+ runner: createExecRunner(), remoteCwd: root, assetRemoteDir: asset.localDir,
3183
+ queueDir, bridgeToken, maxBodyBytes: options.maxBodyBytes, pollIntervalMs: 10,
3184
+ });
3185
+ cleanupFns.push(() => gateway.stop());
3186
+ return { ...gateway, bridgeToken, queueDir };
3187
+ }
3188
+ it.each(["queue", "http2"])("preserves multipart bytes at the configured limit on %s and rejects overflow before forwarding", async (mode) => {
3189
+ const maxBodyBytes = 1024;
3190
+ const bytes = Buffer.alloc(maxBodyBytes, 0xff);
3191
+ const handled = vi.fn(async (request) => ({
3192
+ status: 200, headers: { "content-type": "application/octet-stream" }, body: Buffer.from(request.body ?? ""),
3193
+ }));
3194
+ const bridgeToken = createSandboxCallbackBridgeToken();
3195
+ const gateway = mode === "queue"
3196
+ ? await startQueueGatewayForFileTest({ maxBodyBytes, handleRequest: handled })
3197
+ : { ...await startHttp2GatewayForTest({ bridgeToken, maxBodyBytes, forwardRequest: handled }), bridgeToken };
3198
+ const post = (body) => fetch(`${gateway.baseUrl}/api/companies/c/issues/i/attachments`, {
3199
+ method: "POST", headers: { authorization: `Bearer ${gateway.bridgeToken}`, "content-type": "multipart/form-data; boundary=exact-boundary" }, body: new Uint8Array(body),
3200
+ });
3201
+ const response = await post(bytes);
3202
+ expect(response.status).toBe(200);
3203
+ expect(Buffer.from(await response.arrayBuffer())).toEqual(bytes);
3204
+ expect(handled).toHaveBeenCalledTimes(1);
3205
+ expect(handled.mock.calls[0][0]).toMatchObject({ headers: { "content-type": "multipart/form-data; boundary=exact-boundary" } });
3206
+ const overflow = await post(Buffer.alloc(maxBodyBytes + 1));
3207
+ expect(overflow.status).toBeGreaterThanOrEqual(400);
3208
+ expect(handled).toHaveBeenCalledTimes(1);
3209
+ });
3210
+ it("rejects malformed queue encodings without forwarding a mutation", async () => {
3211
+ const handled = vi.fn(async () => ({ status: 200, body: "ok" }));
3212
+ const gateway = await startQueueGatewayForFileTest({ maxBodyBytes: 1024, handleRequest: handled });
3213
+ const directories = sandboxCallbackBridgeDirectories(gateway.queueDir);
3214
+ for (const [id, bodyEncoding, body] of [["bad-base64", "base64", "YR=="], ["bad-encoding", "hex", "00"], ["too-big", "base64", Buffer.alloc(1025).toString("base64")]]) {
3215
+ await createFileSystemSandboxCallbackBridgeQueueClient().writeTextFile(path.join(directories.requestsDir, `${id}.json`), JSON.stringify({
3216
+ id, method: "POST", path: "/api/companies/c/issues/i/attachments", query: "", headers: {}, bodyEncoding, body,
3217
+ }));
3218
+ const responsePath = path.join(directories.responsesDir, `${id}.json`);
3219
+ await vi.waitFor(async () => expect(JSON.parse(await readFile(responsePath, "utf8")).status).toBe(400));
3220
+ }
3221
+ expect(handled).not.toHaveBeenCalled();
3222
+ });
3223
+ it("reports a corrupted upload response as indeterminate and never forwards twice", async () => {
3224
+ const client = createFileSystemSandboxCallbackBridgeQueueClient();
3225
+ const writeResponse = client.writeResponseFile.bind(client);
3226
+ client.writeResponseFile = (destination, body, options) => writeResponse(destination, JSON.stringify({ ...JSON.parse(body), bodyEncoding: "base64", body: "invalid" }), options);
3227
+ const handled = vi.fn(async () => ({ status: 201, body: Buffer.from("saved") }));
3228
+ const gateway = await startQueueGatewayForFileTest({ client, maxBodyBytes: 1024, handleRequest: handled });
3229
+ const response = await fetch(`${gateway.baseUrl}/api/companies/c/issues/i/attachments`, {
3230
+ method: "POST", headers: { authorization: `Bearer ${gateway.bridgeToken}`, "content-type": "multipart/form-data; boundary=boundary" }, body: Buffer.from([0xff]),
3231
+ });
3232
+ expect(response.status).toBe(409);
3233
+ expect(response.headers.get("x-paperclip-bridge-outcome")).toBe("indeterminate");
3234
+ await expect(response.json()).resolves.toMatchObject({ retryable: false, outcome: "indeterminate" });
3235
+ expect(handled).toHaveBeenCalledTimes(1);
3236
+ });
3237
+ it("rejects a request body over maxBodyBytes on the queue path before it writes the queue file", async () => {
3238
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-queue-maxbody-"));
3239
+ cleanupDirs.push(rootDir);
3240
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
3241
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
3242
+ await mkdir(localWorkspaceDir, { recursive: true });
3243
+ await mkdir(remoteWorkspaceDir, { recursive: true });
3244
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge maxBodyBytes test\n", "utf8");
3245
+ const runner = createExecRunner();
3246
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
3247
+ cleanupFns.push(bridgeAsset.cleanup);
3248
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
3249
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
3250
+ const directories = sandboxCallbackBridgeDirectories(queueDir);
3251
+ const bridgeToken = createSandboxCallbackBridgeToken();
3252
+ const maxBodyBytes = 32;
3253
+ const bridge = await startSandboxCallbackBridgeServer({
3254
+ runner,
3255
+ remoteCwd: remoteWorkspaceDir,
3256
+ assetRemoteDir: prepared.assetDirs.bridge,
3257
+ queueDir,
3258
+ bridgeToken,
3259
+ timeoutMs: 30_000,
3260
+ maxBodyBytes,
3261
+ });
3262
+ cleanupFns.push(async () => {
3263
+ await bridge.stop();
3264
+ });
3265
+ const oversizeBody = Buffer.alloc(maxBodyBytes + 1, 0x41);
3266
+ const response = await fetch(`${bridge.baseUrl}/api/issues/issue-1/comments`, {
3267
+ method: "POST",
3268
+ headers: {
3269
+ authorization: `Bearer ${bridgeToken}`,
3270
+ "content-type": "application/json",
3271
+ },
3272
+ body: oversizeBody,
3273
+ });
3274
+ expect(response.status).toBe(502);
3275
+ await expect(response.json()).resolves.toMatchObject({
3276
+ error: "Bridge request body exceeded the configured size limit.",
3277
+ });
3278
+ const requestFiles = await readdir(directories.requestsDir);
3279
+ expect(requestFiles.filter((name) => name.endsWith(".json"))).toHaveLength(0);
3280
+ });
3281
+ it("keeps the queue request payload's body field as a plain JSON string", async () => {
3282
+ const rootDir = await mkdtemp(path.join(os.tmpdir(), "paperclip-bridge-queue-body-shape-"));
3283
+ cleanupDirs.push(rootDir);
3284
+ const localWorkspaceDir = path.join(rootDir, "local-workspace");
3285
+ const remoteWorkspaceDir = path.join(rootDir, "remote-workspace");
3286
+ await mkdir(localWorkspaceDir, { recursive: true });
3287
+ await mkdir(remoteWorkspaceDir, { recursive: true });
3288
+ await writeFile(path.join(localWorkspaceDir, "README.md"), "bridge body shape test\n", "utf8");
3289
+ const runner = createExecRunner();
3290
+ const bridgeAsset = await createSandboxCallbackBridgeAsset();
3291
+ cleanupFns.push(bridgeAsset.cleanup);
3292
+ const prepared = await prepareCommandManagedRuntime(queueRuntimeInput(runner, remoteWorkspaceDir, localWorkspaceDir, bridgeAsset));
3293
+ const queueDir = path.posix.join(prepared.runtimeRootDir, "paperclip-bridge");
3294
+ const bridgeToken = createSandboxCallbackBridgeToken();
3295
+ const requestBodyText = JSON.stringify({ note: "café" });
3296
+ const seenRequests = [];
3297
+ const worker = await startSandboxCallbackBridgeWorker({
3298
+ client: createFileSystemSandboxCallbackBridgeQueueClient(),
3299
+ queueDir,
3300
+ authorizeRequest: async () => null,
3301
+ handleRequest: async (request) => {
3302
+ seenRequests.push({ body: request.body });
3303
+ return { status: 200, headers: {}, body: JSON.stringify({ ok: true }) };
3304
+ },
3305
+ });
3306
+ cleanupFns.push(async () => {
3307
+ await worker.stop();
3308
+ });
3309
+ const bridge = await startSandboxCallbackBridgeServer({
3310
+ runner,
3311
+ remoteCwd: remoteWorkspaceDir,
3312
+ assetRemoteDir: prepared.assetDirs.bridge,
3313
+ queueDir,
3314
+ bridgeToken,
3315
+ timeoutMs: 30_000,
3316
+ });
3317
+ cleanupFns.push(async () => {
3318
+ await bridge.stop();
3319
+ });
3320
+ const response = await fetch(`${bridge.baseUrl}/api/issues/issue-1/comments`, {
3321
+ method: "POST",
3322
+ headers: {
3323
+ authorization: `Bearer ${bridgeToken}`,
3324
+ "content-type": "application/json",
3325
+ },
3326
+ body: requestBodyText,
3327
+ });
3328
+ expect(response.status).toBe(200);
3329
+ expect(seenRequests).toHaveLength(1);
3330
+ expect(typeof seenRequests[0]?.body).toBe("string");
3331
+ expect(seenRequests[0]?.body).toBe(requestBodyText);
3332
+ });
3333
+ it("does not retry unrelated HTTP/2 fixture startup failures", async () => {
3334
+ let attempts = 0;
3335
+ await expect(startHttp2GatewayForTest({
3336
+ bridgeToken: "",
3337
+ holdProbeOpen: () => { attempts++; return false; },
3338
+ forwardRequest: async () => { throw new Error("Unexpected request to an unstarted gateway"); },
3339
+ })).rejects.toThrow("PAPERCLIP_BRIDGE_TOKEN");
3340
+ expect(attempts).toBe(1);
3341
+ });
3342
+ it("limits HTTP/2 fixture retries when every assigned port is occupied", async () => {
3343
+ let attempts = 0;
3344
+ await expect(startHttp2GatewayForTest({
3345
+ bridgeToken: createSandboxCallbackBridgeToken(),
3346
+ holdProbeOpen: () => { attempts++; return true; },
3347
+ forwardRequest: async () => { throw new Error("Unexpected request to an unstarted gateway"); },
3348
+ })).rejects.toThrow("EADDRINUSE");
3349
+ expect(attempts).toBe(3);
3350
+ }, 15000);
3351
+ it.each([[false, false], [true, false], [true, true]])("accepts the bridge token in X-API-Key on the HTTP/2 path and strips the header (collision=%s, late stderr=%s)", async (portCollision, lateStderr) => {
3352
+ // Both generated gateways share one token reader, so the HTTP/2 transport
3353
+ // must accept "X-API-Key" exactly as the file-mode transport does. The
3354
+ // header allowlist must still strip the credential before the gateway
3355
+ // forwards the request to the host.
3356
+ const bridgeToken = createSandboxCallbackBridgeToken();
3357
+ const seenHeaders = [];
3358
+ let attempts = 0;
3359
+ const gateway = await startHttp2GatewayForTest({
3360
+ bridgeToken,
3361
+ holdProbeOpen: () => { attempts++; return portCollision && attempts === 1; },
3362
+ deferStderrUntilExit: lateStderr,
3363
+ forwardRequest: async (request) => {
3364
+ seenHeaders.push(request.headers);
3365
+ return {
3366
+ status: 200,
3367
+ headers: { "content-type": "application/json" },
3368
+ body: Buffer.from(JSON.stringify({ ok: true }), "utf8"),
3369
+ };
3370
+ },
3371
+ });
3372
+ expect(attempts).toBeGreaterThanOrEqual(portCollision ? 2 : 1);
3373
+ expect(attempts).toBeLessThanOrEqual(3);
3374
+ const response = await fetch(`${gateway.baseUrl}/api/agents/me`, {
3375
+ headers: {
3376
+ "x-api-key": bridgeToken,
3377
+ accept: "application/json",
3378
+ },
3379
+ });
3380
+ expect(response.status).toBe(200);
3381
+ await expect(response.json()).resolves.toMatchObject({ ok: true });
3382
+ expect(seenHeaders).toHaveLength(1);
3383
+ expect(seenHeaders[0]?.["x-api-key"]).toBeUndefined();
3384
+ const deniedResponse = await fetch(`${gateway.baseUrl}/api/agents/me`, {
3385
+ headers: {
3386
+ "x-api-key": "wrong-token",
3387
+ },
3388
+ });
3389
+ expect(deniedResponse.status).toBe(401);
3390
+ await expect(deniedResponse.json()).resolves.toMatchObject({
3391
+ error: "Invalid bridge token.",
3392
+ });
3393
+ // The rejected request never opened a stream to the host.
3394
+ expect(seenHeaders).toHaveLength(1);
3395
+ // A bearer token still works and still wins when both headers are present.
3396
+ const bearerResponse = await fetch(`${gateway.baseUrl}/api/agents/me`, {
3397
+ headers: {
3398
+ authorization: `Bearer ${bridgeToken}`,
3399
+ "x-api-key": "wrong-token",
3400
+ },
3401
+ });
3402
+ expect(bearerResponse.status).toBe(200);
3403
+ expect(seenHeaders).toHaveLength(2);
3404
+ expect(seenHeaders[1]?.authorization).toBeUndefined();
3405
+ expect(seenHeaders[1]?.["x-api-key"]).toBeUndefined();
3406
+ }, 15_000);
3407
+ });
3408
+ // This describe block covers the zero-dependency process body-byte ledger
3409
+ // every generated gateway embeds (`BRIDGE_PROCESS_BODY_LEDGER_SOURCE`),
3410
+ // exercised directly with no spawned process involved, the same way the
3411
+ // codec source in `execution-target-sandbox.test.ts` gets its own direct
3412
+ // coverage.
3413
+ describe("embedded sandbox gateway process body ledger", () => {
3414
+ it("reserves and releases bytes against its own ceiling, denying only once it is exceeded", () => {
3415
+ const ledgerFactory = new Function(`${getSandboxBridgeProcessBodyLedgerSource()}\nreturn createBridgeProcessBodyLedger;`);
3416
+ const createBridgeProcessBodyLedger = ledgerFactory();
3417
+ const ledger = createBridgeProcessBodyLedger(100);
3418
+ expect(ledger.reserve(60)).toBe(true);
3419
+ expect(ledger.reservedBytes).toBe(60);
3420
+ // A denied reservation reserves nothing: the total stays exactly what
3421
+ // the first call reserved.
3422
+ expect(ledger.reserve(41)).toBe(false);
3423
+ expect(ledger.reservedBytes).toBe(60);
3424
+ expect(ledger.reserve(40)).toBe(true);
3425
+ expect(ledger.reservedBytes).toBe(100);
3426
+ ledger.release(60);
3427
+ expect(ledger.reservedBytes).toBe(40);
3428
+ // Room freed by the release admits a request the full ceiling would
3429
+ // have denied.
3430
+ expect(ledger.reserve(60)).toBe(true);
3431
+ expect(ledger.reservedBytes).toBe(100);
3432
+ });
3433
+ });
3434
+ //# sourceMappingURL=sandbox-callback-bridge.test.js.map