@stringsync/splates 0.0.61 → 1.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (734) hide show
  1. package/README.md +2 -2
  2. package/artifact.d.ts +2 -2
  3. package/blockers.d.ts +1 -1
  4. package/config.d.ts +12 -0
  5. package/config.js +0 -0
  6. package/creds.d.ts +2 -2
  7. package/evals.d.ts +2 -2
  8. package/flags.d.ts +4 -4
  9. package/handoff.d.ts +3 -4
  10. package/hook.d.ts +2 -2
  11. package/index.js +108 -108
  12. package/lane.d.ts +2 -2
  13. package/mirror.d.ts +14 -0
  14. package/mirror.js +22 -0
  15. package/package.json +12 -4
  16. package/projects.d.ts +2 -2
  17. package/queue.d.ts +2 -2
  18. package/replica.d.ts +2 -2
  19. package/server.d.ts +2 -2
  20. package/setup.d.ts +2 -2
  21. package/ship.d.ts +2 -2
  22. package/slots.d.ts +2 -2
  23. package/splates.d.ts +2 -2
  24. package/task.d.ts +2 -2
  25. package/tunnel.d.ts +2 -2
  26. package/vendor/@stringsync/splates-server/LICENSE +21 -0
  27. package/vendor/@stringsync/splates-server/age.d.ts +2 -0
  28. package/vendor/@stringsync/splates-server/agents/acp-extensions.d.ts +92 -0
  29. package/vendor/@stringsync/splates-server/agents/agents.d.ts +19 -0
  30. package/vendor/@stringsync/splates-server/agents/compaction.d.ts +17 -0
  31. package/vendor/@stringsync/splates-server/agents/connection.d.ts +191 -0
  32. package/vendor/@stringsync/splates-server/agents/errors.d.ts +8 -0
  33. package/vendor/@stringsync/splates-server/agents/fold.d.ts +45 -0
  34. package/vendor/@stringsync/splates-server/agents/index.d.ts +16 -0
  35. package/vendor/@stringsync/splates-server/agents/index.js +60 -0
  36. package/vendor/@stringsync/splates-server/agents/process.d.ts +67 -0
  37. package/vendor/@stringsync/splates-server/agents/scratch.d.ts +7 -0
  38. package/vendor/@stringsync/splates-server/agents/shared-browser.d.ts +47 -0
  39. package/vendor/@stringsync/splates-server/agents/start-lock.d.ts +24 -0
  40. package/vendor/@stringsync/splates-server/agents/stream.d.ts +91 -0
  41. package/vendor/@stringsync/splates-server/agents/tool-calls.d.ts +18 -0
  42. package/vendor/@stringsync/splates-server/agents/watch.d.ts +46 -0
  43. package/vendor/@stringsync/splates-server/agents/watched.d.ts +43 -0
  44. package/vendor/@stringsync/splates-server/artifacts/artifact.d.ts +33 -0
  45. package/vendor/@stringsync/splates-server/artifacts/artifacts.d.ts +162 -0
  46. package/vendor/@stringsync/splates-server/artifacts/attach.d.ts +31 -0
  47. package/vendor/@stringsync/splates-server/artifacts/attachments.d.ts +50 -0
  48. package/vendor/@stringsync/splates-server/artifacts/index.d.ts +8 -0
  49. package/vendor/@stringsync/splates-server/artifacts/index.js +38 -0
  50. package/vendor/@stringsync/splates-server/artifacts/room.d.ts +46 -0
  51. package/vendor/@stringsync/splates-server/artifacts/routes.d.ts +22 -0
  52. package/vendor/@stringsync/splates-server/artifacts/viewers.d.ts +6 -0
  53. package/vendor/@stringsync/splates-server/auto-pick/classes.d.ts +29 -0
  54. package/vendor/@stringsync/splates-server/auto-pick/classify.d.ts +60 -0
  55. package/vendor/@stringsync/splates-server/auto-pick/clef.d.ts +15 -0
  56. package/vendor/@stringsync/splates-server/auto-pick/decide.d.ts +78 -0
  57. package/vendor/@stringsync/splates-server/auto-pick/defaults.d.ts +3 -0
  58. package/vendor/@stringsync/splates-server/auto-pick/follow-up.d.ts +25 -0
  59. package/vendor/@stringsync/splates-server/auto-pick/index.d.ts +24 -0
  60. package/vendor/@stringsync/splates-server/auto-pick/jev.d.ts +38 -0
  61. package/vendor/@stringsync/splates-server/auto-pick/judge.d.ts +21 -0
  62. package/vendor/@stringsync/splates-server/auto-pick/judged.d.ts +33 -0
  63. package/vendor/@stringsync/splates-server/auto-pick/key.d.ts +6 -0
  64. package/vendor/@stringsync/splates-server/auto-pick/lift.d.ts +18 -0
  65. package/vendor/@stringsync/splates-server/auto-pick/queue.d.ts +30 -0
  66. package/vendor/@stringsync/splates-server/auto-pick/rank.d.ts +10 -0
  67. package/vendor/@stringsync/splates-server/auto-pick/record.d.ts +19 -0
  68. package/vendor/@stringsync/splates-server/auto-pick/routes.d.ts +25 -0
  69. package/vendor/@stringsync/splates-server/auto-pick/rule-names.d.ts +9 -0
  70. package/vendor/@stringsync/splates-server/auto-pick/rules-routes.d.ts +49 -0
  71. package/vendor/@stringsync/splates-server/auto-pick/rules.d.ts +97 -0
  72. package/vendor/@stringsync/splates-server/auto-pick/start.d.ts +79 -0
  73. package/vendor/@stringsync/splates-server/auto-pick/store.d.ts +25 -0
  74. package/vendor/@stringsync/splates-server/auto-pick/system-one.d.ts +60 -0
  75. package/vendor/@stringsync/splates-server/auto-pick/trial.d.ts +32 -0
  76. package/vendor/@stringsync/splates-server/board/backlog.d.ts +4 -0
  77. package/vendor/@stringsync/splates-server/board/blocked-warning.d.ts +7 -0
  78. package/vendor/@stringsync/splates-server/board/browser.d.ts +8 -0
  79. package/vendor/@stringsync/splates-server/board/change-lane.d.ts +12 -0
  80. package/vendor/@stringsync/splates-server/board/deferral.d.ts +87 -0
  81. package/vendor/@stringsync/splates-server/board/elsewhere-links.d.ts +26 -0
  82. package/vendor/@stringsync/splates-server/board/elsewhere.d.ts +119 -0
  83. package/vendor/@stringsync/splates-server/board/index.d.ts +21 -0
  84. package/vendor/@stringsync/splates-server/board/index.js +112 -0
  85. package/vendor/@stringsync/splates-server/board/lane.d.ts +69 -0
  86. package/vendor/@stringsync/splates-server/board/lanes-from-tags.d.ts +17 -0
  87. package/vendor/@stringsync/splates-server/board/lanes.d.ts +117 -0
  88. package/vendor/@stringsync/splates-server/board/routes.d.ts +54 -0
  89. package/vendor/@stringsync/splates-server/board/store.d.ts +74 -0
  90. package/vendor/@stringsync/splates-server/board/task-edit.d.ts +81 -0
  91. package/vendor/@stringsync/splates-server/board/task-file.d.ts +24 -0
  92. package/vendor/@stringsync/splates-server/board/task-journal.d.ts +9 -0
  93. package/vendor/@stringsync/splates-server/board/task-lanes.d.ts +95 -0
  94. package/vendor/@stringsync/splates-server/board/task-list.d.ts +40 -0
  95. package/vendor/@stringsync/splates-server/board/task.d.ts +301 -0
  96. package/vendor/@stringsync/splates-server/board/tasks.d.ts +172 -0
  97. package/vendor/@stringsync/splates-server/chunk-files-jkqj87yx.js +14 -0
  98. package/vendor/@stringsync/splates-server/chunk-maps-mnjqydx4.txt +1 -0
  99. package/vendor/@stringsync/splates-server/chunks-3jkzx1q9.txt +1 -0
  100. package/vendor/@stringsync/splates-server/comma-list.d.ts +2 -0
  101. package/vendor/@stringsync/splates-server/comma-list.js +6 -0
  102. package/vendor/@stringsync/splates-server/config/browser.d.ts +1 -0
  103. package/vendor/@stringsync/splates-server/config/config.d.ts +210 -0
  104. package/vendor/@stringsync/splates-server/config/index.d.ts +6 -0
  105. package/vendor/@stringsync/splates-server/config/index.js +42 -0
  106. package/vendor/@stringsync/splates-server/config/legacy-names.d.ts +70 -0
  107. package/vendor/@stringsync/splates-server/config/legacy-ps.d.ts +32 -0
  108. package/vendor/@stringsync/splates-server/config/load.d.ts +46 -0
  109. package/vendor/@stringsync/splates-server/config/source.d.ts +7 -0
  110. package/vendor/@stringsync/splates-server/config/type-config.d.ts +14 -0
  111. package/vendor/@stringsync/splates-server/conversations/answered.d.ts +7 -0
  112. package/vendor/@stringsync/splates-server/conversations/archive.d.ts +16 -0
  113. package/vendor/@stringsync/splates-server/conversations/background.d.ts +21 -0
  114. package/vendor/@stringsync/splates-server/conversations/browser.d.ts +12 -0
  115. package/vendor/@stringsync/splates-server/conversations/choice.d.ts +8 -0
  116. package/vendor/@stringsync/splates-server/conversations/compact.d.ts +6 -0
  117. package/vendor/@stringsync/splates-server/conversations/conversation.d.ts +420 -0
  118. package/vendor/@stringsync/splates-server/conversations/conversations.d.ts +181 -0
  119. package/vendor/@stringsync/splates-server/conversations/entry.d.ts +286 -0
  120. package/vendor/@stringsync/splates-server/conversations/events.d.ts +36 -0
  121. package/vendor/@stringsync/splates-server/conversations/files.d.ts +62 -0
  122. package/vendor/@stringsync/splates-server/conversations/given.d.ts +18 -0
  123. package/vendor/@stringsync/splates-server/conversations/heard.d.ts +8 -0
  124. package/vendor/@stringsync/splates-server/conversations/host.d.ts +176 -0
  125. package/vendor/@stringsync/splates-server/conversations/index.d.ts +22 -0
  126. package/vendor/@stringsync/splates-server/conversations/index.js +80 -0
  127. package/vendor/@stringsync/splates-server/conversations/listing.d.ts +15 -0
  128. package/vendor/@stringsync/splates-server/conversations/log.d.ts +117 -0
  129. package/vendor/@stringsync/splates-server/conversations/messages.d.ts +23 -0
  130. package/vendor/@stringsync/splates-server/conversations/name.d.ts +38 -0
  131. package/vendor/@stringsync/splates-server/conversations/options.d.ts +87 -0
  132. package/vendor/@stringsync/splates-server/conversations/outside.d.ts +14 -0
  133. package/vendor/@stringsync/splates-server/conversations/reference.d.ts +2 -0
  134. package/vendor/@stringsync/splates-server/conversations/routes.d.ts +109 -0
  135. package/vendor/@stringsync/splates-server/conversations/search.d.ts +15 -0
  136. package/vendor/@stringsync/splates-server/conversations/spent.d.ts +19 -0
  137. package/vendor/@stringsync/splates-server/conversations/state.d.ts +606 -0
  138. package/vendor/@stringsync/splates-server/conversations/stream.d.ts +34 -0
  139. package/vendor/@stringsync/splates-server/conversations/transcript.d.ts +9 -0
  140. package/vendor/@stringsync/splates-server/conversations/tree.d.ts +11 -0
  141. package/vendor/@stringsync/splates-server/conversations/turn-end.d.ts +30 -0
  142. package/vendor/@stringsync/splates-server/conversations/turns.d.ts +134 -0
  143. package/vendor/@stringsync/splates-server/conversations/updates.d.ts +21 -0
  144. package/vendor/@stringsync/splates-server/creds/creds.d.ts +86 -0
  145. package/vendor/@stringsync/splates-server/creds/index.d.ts +6 -0
  146. package/vendor/@stringsync/splates-server/creds/index.js +28 -0
  147. package/vendor/@stringsync/splates-server/creds/key-file.d.ts +21 -0
  148. package/vendor/@stringsync/splates-server/creds/requests.d.ts +54 -0
  149. package/vendor/@stringsync/splates-server/creds/routes.d.ts +16 -0
  150. package/vendor/@stringsync/splates-server/creds/stores.d.ts +37 -0
  151. package/vendor/@stringsync/splates-server/dictate/connection.d.ts +18 -0
  152. package/vendor/@stringsync/splates-server/dictate/dictate.d.ts +16 -0
  153. package/vendor/@stringsync/splates-server/dictate/index.d.ts +4 -0
  154. package/vendor/@stringsync/splates-server/dictate/personal.d.ts +26 -0
  155. package/vendor/@stringsync/splates-server/dictate/transcriber.d.ts +16 -0
  156. package/vendor/@stringsync/splates-server/dictate/vocabulary.d.ts +12 -0
  157. package/vendor/@stringsync/splates-server/evals/agents-routes.d.ts +27 -0
  158. package/vendor/@stringsync/splates-server/evals/agents.d.ts +25 -0
  159. package/vendor/@stringsync/splates-server/evals/contract.d.ts +73 -0
  160. package/vendor/@stringsync/splates-server/evals/done.d.ts +11 -0
  161. package/vendor/@stringsync/splates-server/evals/import.d.ts +10 -0
  162. package/vendor/@stringsync/splates-server/evals/index.d.ts +19 -0
  163. package/vendor/@stringsync/splates-server/evals/index.js +40 -0
  164. package/vendor/@stringsync/splates-server/evals/inspect.d.ts +66 -0
  165. package/vendor/@stringsync/splates-server/evals/launch-routes.d.ts +39 -0
  166. package/vendor/@stringsync/splates-server/evals/launch.d.ts +123 -0
  167. package/vendor/@stringsync/splates-server/evals/routes.d.ts +39 -0
  168. package/vendor/@stringsync/splates-server/evals/store.d.ts +17 -0
  169. package/vendor/@stringsync/splates-server/evals/target.d.ts +3 -0
  170. package/vendor/@stringsync/splates-server/evals/types.d.ts +105 -0
  171. package/vendor/@stringsync/splates-server/exit.d.ts +55 -0
  172. package/vendor/@stringsync/splates-server/exit.js +12 -0
  173. package/vendor/@stringsync/splates-server/git-identity.d.ts +17 -0
  174. package/vendor/@stringsync/splates-server/git-process.d.ts +8 -0
  175. package/vendor/@stringsync/splates-server/git.d.ts +168 -0
  176. package/vendor/@stringsync/splates-server/hooks/commands.d.ts +31 -0
  177. package/vendor/@stringsync/splates-server/hooks/edit.d.ts +24 -0
  178. package/vendor/@stringsync/splates-server/hooks/events.d.ts +20 -0
  179. package/vendor/@stringsync/splates-server/hooks/groomer.d.ts +8 -0
  180. package/vendor/@stringsync/splates-server/hooks/index.d.ts +17 -0
  181. package/vendor/@stringsync/splates-server/hooks/index.js +61 -0
  182. package/vendor/@stringsync/splates-server/hooks/now.d.ts +9 -0
  183. package/vendor/@stringsync/splates-server/hooks/routes.d.ts +39 -0
  184. package/vendor/@stringsync/splates-server/hooks/runner.d.ts +75 -0
  185. package/vendor/@stringsync/splates-server/hooks/runs.d.ts +38 -0
  186. package/vendor/@stringsync/splates-server/hooks/schedule.d.ts +10 -0
  187. package/vendor/@stringsync/splates-server/hooks/scheduler.d.ts +28 -0
  188. package/vendor/@stringsync/splates-server/hooks/store.d.ts +110 -0
  189. package/vendor/@stringsync/splates-server/index-01z7ycdk.js +6 -0
  190. package/vendor/@stringsync/splates-server/index-0jttnv86.js +1309 -0
  191. package/vendor/@stringsync/splates-server/index-5axhdy8c.js +692 -0
  192. package/vendor/@stringsync/splates-server/index-76t8y8h5.js +779 -0
  193. package/vendor/@stringsync/splates-server/index-7s01973c.js +2356 -0
  194. package/vendor/@stringsync/splates-server/index-acbcm66f.js +1468 -0
  195. package/vendor/@stringsync/splates-server/index-caep3sde.js +27140 -0
  196. package/vendor/@stringsync/splates-server/index-e9z7s5hh.js +641 -0
  197. package/vendor/@stringsync/splates-server/index-g18nxyn7.js +99 -0
  198. package/vendor/@stringsync/splates-server/index-kmzdvvt0.js +23 -0
  199. package/vendor/@stringsync/splates-server/index-raqrwzdq.js +952 -0
  200. package/vendor/@stringsync/splates-server/index-t9w5a8ed.js +60 -0
  201. package/vendor/@stringsync/splates-server/limited.d.ts +8 -0
  202. package/vendor/@stringsync/splates-server/log.d.ts +14 -0
  203. package/vendor/@stringsync/splates-server/log.js +32 -0
  204. package/vendor/@stringsync/splates-server/merge/attribution.d.ts +24 -0
  205. package/vendor/@stringsync/splates-server/merge/batch.d.ts +119 -0
  206. package/vendor/@stringsync/splates-server/merge/blame.d.ts +21 -0
  207. package/vendor/@stringsync/splates-server/merge/branches.d.ts +151 -0
  208. package/vendor/@stringsync/splates-server/merge/charge.d.ts +18 -0
  209. package/vendor/@stringsync/splates-server/merge/clear-gate.d.ts +7 -0
  210. package/vendor/@stringsync/splates-server/merge/cores.d.ts +60 -0
  211. package/vendor/@stringsync/splates-server/merge/estimates.d.ts +28 -0
  212. package/vendor/@stringsync/splates-server/merge/finish.d.ts +43 -0
  213. package/vendor/@stringsync/splates-server/merge/follow.d.ts +50 -0
  214. package/vendor/@stringsync/splates-server/merge/gate.d.ts +108 -0
  215. package/vendor/@stringsync/splates-server/merge/github-app.d.ts +99 -0
  216. package/vendor/@stringsync/splates-server/merge/github-refused.d.ts +5 -0
  217. package/vendor/@stringsync/splates-server/merge/groups.d.ts +8 -0
  218. package/vendor/@stringsync/splates-server/merge/index.d.ts +19 -0
  219. package/vendor/@stringsync/splates-server/merge/index.js +46 -0
  220. package/vendor/@stringsync/splates-server/merge/landed.d.ts +28 -0
  221. package/vendor/@stringsync/splates-server/merge/landing.d.ts +38 -0
  222. package/vendor/@stringsync/splates-server/merge/local-landing.d.ts +11 -0
  223. package/vendor/@stringsync/splates-server/merge/merge-state.d.ts +37 -0
  224. package/vendor/@stringsync/splates-server/merge/merge.d.ts +45 -0
  225. package/vendor/@stringsync/splates-server/merge/output.d.ts +19 -0
  226. package/vendor/@stringsync/splates-server/merge/phases.d.ts +27 -0
  227. package/vendor/@stringsync/splates-server/merge/pre-lock.d.ts +28 -0
  228. package/vendor/@stringsync/splates-server/merge/preflight.d.ts +16 -0
  229. package/vendor/@stringsync/splates-server/merge/queue-failures.d.ts +11 -0
  230. package/vendor/@stringsync/splates-server/merge/rebase.d.ts +34 -0
  231. package/vendor/@stringsync/splates-server/merge/recent-failures.d.ts +10 -0
  232. package/vendor/@stringsync/splates-server/merge/refusal.d.ts +58 -0
  233. package/vendor/@stringsync/splates-server/merge/split.d.ts +34 -0
  234. package/vendor/@stringsync/splates-server/merge/steps.d.ts +37 -0
  235. package/vendor/@stringsync/splates-server/merge/test-report.d.ts +29 -0
  236. package/vendor/@stringsync/splates-server/merge/timing.d.ts +20 -0
  237. package/vendor/@stringsync/splates-server/merge/trunk.d.ts +69 -0
  238. package/vendor/@stringsync/splates-server/models/codex-limits.d.ts +19 -0
  239. package/vendor/@stringsync/splates-server/models/effort.d.ts +22 -0
  240. package/vendor/@stringsync/splates-server/models/index.d.ts +13 -0
  241. package/vendor/@stringsync/splates-server/models/index.js +76 -0
  242. package/vendor/@stringsync/splates-server/models/kimi-limits.d.ts +37 -0
  243. package/vendor/@stringsync/splates-server/models/kimi-usage.d.ts +19 -0
  244. package/vendor/@stringsync/splates-server/models/kimi.d.ts +10 -0
  245. package/vendor/@stringsync/splates-server/models/limits.d.ts +32 -0
  246. package/vendor/@stringsync/splates-server/models/models.d.ts +36 -0
  247. package/vendor/@stringsync/splates-server/models/offered.d.ts +47 -0
  248. package/vendor/@stringsync/splates-server/models/opencode-usage.d.ts +37 -0
  249. package/vendor/@stringsync/splates-server/models/roster.d.ts +130 -0
  250. package/vendor/@stringsync/splates-server/plans/asked.d.ts +99 -0
  251. package/vendor/@stringsync/splates-server/plans/browser.d.ts +13 -0
  252. package/vendor/@stringsync/splates-server/plans/decided.d.ts +12 -0
  253. package/vendor/@stringsync/splates-server/plans/demo.d.ts +29 -0
  254. package/vendor/@stringsync/splates-server/plans/index.d.ts +16 -0
  255. package/vendor/@stringsync/splates-server/plans/index.js +137 -0
  256. package/vendor/@stringsync/splates-server/plans/needs.d.ts +131 -0
  257. package/vendor/@stringsync/splates-server/plans/permission.d.ts +64 -0
  258. package/vendor/@stringsync/splates-server/plans/plan.d.ts +223 -0
  259. package/vendor/@stringsync/splates-server/plans/prompts.d.ts +148 -0
  260. package/vendor/@stringsync/splates-server/plans/reply.d.ts +45 -0
  261. package/vendor/@stringsync/splates-server/plans/run-command.d.ts +21 -0
  262. package/vendor/@stringsync/splates-server/plans/store.d.ts +26 -0
  263. package/vendor/@stringsync/splates-server/plans/unanswered.d.ts +15 -0
  264. package/vendor/@stringsync/splates-server/ports/index.d.ts +8 -0
  265. package/vendor/@stringsync/splates-server/ports/index.js +36 -0
  266. package/vendor/@stringsync/splates-server/ports/list.d.ts +22 -0
  267. package/vendor/@stringsync/splates-server/ports/routes.d.ts +64 -0
  268. package/vendor/@stringsync/splates-server/ports/slot-tunnel.d.ts +24 -0
  269. package/vendor/@stringsync/splates-server/ports/slot.d.ts +28 -0
  270. package/vendor/@stringsync/splates-server/ports/slots.d.ts +150 -0
  271. package/vendor/@stringsync/splates-server/ports/socket.d.ts +26 -0
  272. package/vendor/@stringsync/splates-server/ports/task-ports.d.ts +39 -0
  273. package/vendor/@stringsync/splates-server/prices/index.d.ts +2 -0
  274. package/vendor/@stringsync/splates-server/prices/prices.d.ts +65 -0
  275. package/vendor/@stringsync/splates-server/projects/everywhere-routes.d.ts +110 -0
  276. package/vendor/@stringsync/splates-server/projects/everywhere.d.ts +43 -0
  277. package/vendor/@stringsync/splates-server/projects/general.d.ts +4 -0
  278. package/vendor/@stringsync/splates-server/projects/index.d.ts +10 -0
  279. package/vendor/@stringsync/splates-server/projects/index.js +36 -0
  280. package/vendor/@stringsync/splates-server/projects/init.d.ts +28 -0
  281. package/vendor/@stringsync/splates-server/projects/picker.d.ts +64 -0
  282. package/vendor/@stringsync/splates-server/projects/projects.d.ts +155 -0
  283. package/vendor/@stringsync/splates-server/projects/reaches.d.ts +26 -0
  284. package/vendor/@stringsync/splates-server/push/index.d.ts +2 -0
  285. package/vendor/@stringsync/splates-server/push/notices.d.ts +44 -0
  286. package/vendor/@stringsync/splates-server/push/push.d.ts +91 -0
  287. package/vendor/@stringsync/splates-server/queue/commands.d.ts +44 -0
  288. package/vendor/@stringsync/splates-server/queue/index.d.ts +7 -0
  289. package/vendor/@stringsync/splates-server/queue/index.js +44 -0
  290. package/vendor/@stringsync/splates-server/queue/moves.d.ts +15 -0
  291. package/vendor/@stringsync/splates-server/queue/name.d.ts +9 -0
  292. package/vendor/@stringsync/splates-server/queue/order.d.ts +50 -0
  293. package/vendor/@stringsync/splates-server/queue/runner.d.ts +129 -0
  294. package/vendor/@stringsync/splates-server/records/elsewhere.d.ts +27 -0
  295. package/vendor/@stringsync/splates-server/records/events.d.ts +556 -0
  296. package/vendor/@stringsync/splates-server/records/format.d.ts +92 -0
  297. package/vendor/@stringsync/splates-server/records/home.d.ts +72 -0
  298. package/vendor/@stringsync/splates-server/records/index.d.ts +10 -0
  299. package/vendor/@stringsync/splates-server/records/index.js +40 -0
  300. package/vendor/@stringsync/splates-server/records/journal.d.ts +65 -0
  301. package/vendor/@stringsync/splates-server/records/lease-lock.d.ts +29 -0
  302. package/vendor/@stringsync/splates-server/records/migration.d.ts +94 -0
  303. package/vendor/@stringsync/splates-server/records/one-task-store.d.ts +15 -0
  304. package/vendor/@stringsync/splates-server/records/repository.d.ts +137 -0
  305. package/vendor/@stringsync/splates-server/records/task-files.d.ts +8 -0
  306. package/vendor/@stringsync/splates-server/records/task-stages.d.ts +7 -0
  307. package/vendor/@stringsync/splates-server/records/to-sqlite.d.ts +3 -0
  308. package/vendor/@stringsync/splates-server/replica/aws-sign.d.ts +30 -0
  309. package/vendor/@stringsync/splates-server/replica/dir.d.ts +17 -0
  310. package/vendor/@stringsync/splates-server/replica/index.d.ts +14 -0
  311. package/vendor/@stringsync/splates-server/replica/index.js +29 -0
  312. package/vendor/@stringsync/splates-server/replica/layout.d.ts +45 -0
  313. package/vendor/@stringsync/splates-server/replica/place.d.ts +31 -0
  314. package/vendor/@stringsync/splates-server/replica/replica.d.ts +37 -0
  315. package/vendor/@stringsync/splates-server/replica/replicator.d.ts +102 -0
  316. package/vendor/@stringsync/splates-server/replica/restore.d.ts +40 -0
  317. package/vendor/@stringsync/splates-server/replica/s3.d.ts +45 -0
  318. package/vendor/@stringsync/splates-server/replica/shipped.d.ts +2 -0
  319. package/vendor/@stringsync/splates-server/replica/status.d.ts +18 -0
  320. package/vendor/@stringsync/splates-server/server/assets.d.ts +35 -0
  321. package/vendor/@stringsync/splates-server/server/automations.d.ts +26 -0
  322. package/vendor/@stringsync/splates-server/server/chunk-files.d.ts +4 -0
  323. package/vendor/@stringsync/splates-server/server/conflict-watch.d.ts +22 -0
  324. package/vendor/@stringsync/splates-server/server/early-warning.d.ts +7 -0
  325. package/vendor/@stringsync/splates-server/server/general.d.ts +53 -0
  326. package/vendor/@stringsync/splates-server/server/groomer.d.ts +53 -0
  327. package/vendor/@stringsync/splates-server/server/held.d.ts +10 -0
  328. package/vendor/@stringsync/splates-server/server/http.d.ts +76 -0
  329. package/vendor/@stringsync/splates-server/server/index.d.ts +16 -0
  330. package/vendor/@stringsync/splates-server/server/index.js +14342 -0
  331. package/vendor/@stringsync/splates-server/server/interrupt.d.ts +24 -0
  332. package/vendor/@stringsync/splates-server/server/loop-watch.d.ts +12 -0
  333. package/vendor/@stringsync/splates-server/server/migrations.d.ts +46 -0
  334. package/vendor/@stringsync/splates-server/server/options.d.ts +143 -0
  335. package/vendor/@stringsync/splates-server/server/pages.d.ts +35 -0
  336. package/vendor/@stringsync/splates-server/server/ports.d.ts +11 -0
  337. package/vendor/@stringsync/splates-server/server/premerge.d.ts +61 -0
  338. package/vendor/@stringsync/splates-server/server/project-watch.d.ts +94 -0
  339. package/vendor/@stringsync/splates-server/server/project.d.ts +239 -0
  340. package/vendor/@stringsync/splates-server/server/pulse.d.ts +8 -0
  341. package/vendor/@stringsync/splates-server/server/release.d.ts +41 -0
  342. package/vendor/@stringsync/splates-server/server/replicas.d.ts +23 -0
  343. package/vendor/@stringsync/splates-server/server/restart.d.ts +177 -0
  344. package/vendor/@stringsync/splates-server/server/runtime-deps.d.ts +19 -0
  345. package/vendor/@stringsync/splates-server/server/server.d.ts +19 -0
  346. package/vendor/@stringsync/splates-server/server/servers.d.ts +31 -0
  347. package/vendor/@stringsync/splates-server/server/serving.d.ts +28 -0
  348. package/vendor/@stringsync/splates-server/server/shared.d.ts +14 -0
  349. package/vendor/@stringsync/splates-server/server/skills.d.ts +16 -0
  350. package/vendor/@stringsync/splates-server/server/sockets.d.ts +13 -0
  351. package/vendor/@stringsync/splates-server/server/start-settings.d.ts +15 -0
  352. package/vendor/@stringsync/splates-server/server/start.d.ts +21 -0
  353. package/vendor/@stringsync/splates-server/server/suite-grant.d.ts +26 -0
  354. package/vendor/@stringsync/splates-server/server/supervise.d.ts +81 -0
  355. package/vendor/@stringsync/splates-server/server/ticketed-lock.d.ts +80 -0
  356. package/vendor/@stringsync/splates-server/server/update-records.d.ts +8 -0
  357. package/vendor/@stringsync/splates-server/server/update.d.ts +56 -0
  358. package/vendor/@stringsync/splates-server/server/versions.d.ts +53 -0
  359. package/vendor/@stringsync/splates-server/setup/area-auto-pick.d.ts +7 -0
  360. package/vendor/@stringsync/splates-server/setup/area-dictation.d.ts +3 -0
  361. package/vendor/@stringsync/splates-server/setup/area-droplet.d.ts +3 -0
  362. package/vendor/@stringsync/splates-server/setup/area-evals.d.ts +3 -0
  363. package/vendor/@stringsync/splates-server/setup/area-github.d.ts +8 -0
  364. package/vendor/@stringsync/splates-server/setup/area-native.d.ts +7 -0
  365. package/vendor/@stringsync/splates-server/setup/area-opencode.d.ts +5 -0
  366. package/vendor/@stringsync/splates-server/setup/area-remote.d.ts +3 -0
  367. package/vendor/@stringsync/splates-server/setup/area-replica.d.ts +3 -0
  368. package/vendor/@stringsync/splates-server/setup/area-workers.d.ts +5 -0
  369. package/vendor/@stringsync/splates-server/setup/areas.d.ts +7 -0
  370. package/vendor/@stringsync/splates-server/setup/checks.d.ts +8 -0
  371. package/vendor/@stringsync/splates-server/setup/fields.d.ts +69 -0
  372. package/vendor/@stringsync/splates-server/setup/index.d.ts +8 -0
  373. package/vendor/@stringsync/splates-server/setup/index.js +25 -0
  374. package/vendor/@stringsync/splates-server/setup/opencode-model-error.d.ts +3 -0
  375. package/vendor/@stringsync/splates-server/setup/opencode-models.d.ts +44 -0
  376. package/vendor/@stringsync/splates-server/setup/opencode-recipe.d.ts +33 -0
  377. package/vendor/@stringsync/splates-server/setup/opencode-routes.d.ts +17 -0
  378. package/vendor/@stringsync/splates-server/setup/opencode.d.ts +61 -0
  379. package/vendor/@stringsync/splates-server/setup/project.d.ts +10 -0
  380. package/vendor/@stringsync/splates-server/setup/routes.d.ts +31 -0
  381. package/vendor/@stringsync/splates-server/setup/setup.d.ts +235 -0
  382. package/vendor/@stringsync/splates-server/setup/step-problem.d.ts +3 -0
  383. package/vendor/@stringsync/splates-server/setup/undo.d.ts +80 -0
  384. package/vendor/@stringsync/splates-server/ship/approval-watch.d.ts +57 -0
  385. package/vendor/@stringsync/splates-server/ship/approval.d.ts +17 -0
  386. package/vendor/@stringsync/splates-server/ship/cascade-routes.d.ts +25 -0
  387. package/vendor/@stringsync/splates-server/ship/cascade.d.ts +70 -0
  388. package/vendor/@stringsync/splates-server/ship/commands.d.ts +26 -0
  389. package/vendor/@stringsync/splates-server/ship/git.d.ts +31 -0
  390. package/vendor/@stringsync/splates-server/ship/graph.d.ts +60 -0
  391. package/vendor/@stringsync/splates-server/ship/history.d.ts +51 -0
  392. package/vendor/@stringsync/splates-server/ship/index.d.ts +28 -0
  393. package/vendor/@stringsync/splates-server/ship/live.d.ts +40 -0
  394. package/vendor/@stringsync/splates-server/ship/mechanical.d.ts +30 -0
  395. package/vendor/@stringsync/splates-server/ship/npm-terminal.d.ts +14 -0
  396. package/vendor/@stringsync/splates-server/ship/plan.d.ts +90 -0
  397. package/vendor/@stringsync/splates-server/ship/progress.d.ts +3 -0
  398. package/vendor/@stringsync/splates-server/ship/published-notice.d.ts +29 -0
  399. package/vendor/@stringsync/splates-server/ship/record.d.ts +55 -0
  400. package/vendor/@stringsync/splates-server/ship/registry.d.ts +13 -0
  401. package/vendor/@stringsync/splates-server/ship/release-events.d.ts +47 -0
  402. package/vendor/@stringsync/splates-server/ship/release-steps.d.ts +66 -0
  403. package/vendor/@stringsync/splates-server/ship/routes.d.ts +14 -0
  404. package/vendor/@stringsync/splates-server/ship/run.d.ts +132 -0
  405. package/vendor/@stringsync/splates-server/ship/selection.d.ts +36 -0
  406. package/vendor/@stringsync/splates-server/ship/served.d.ts +4 -0
  407. package/vendor/@stringsync/splates-server/ship/stages.d.ts +69 -0
  408. package/vendor/@stringsync/splates-server/ship/steps.d.ts +69 -0
  409. package/vendor/@stringsync/splates-server/ship/token-request.d.ts +11 -0
  410. package/vendor/@stringsync/splates-server/ship/token.d.ts +21 -0
  411. package/vendor/@stringsync/splates-server/spend/adapters.d.ts +5 -0
  412. package/vendor/@stringsync/splates-server/spend/billing.d.ts +38 -0
  413. package/vendor/@stringsync/splates-server/spend/index.d.ts +15 -0
  414. package/vendor/@stringsync/splates-server/spend/plans.d.ts +45 -0
  415. package/vendor/@stringsync/splates-server/spend/providers.d.ts +45 -0
  416. package/vendor/@stringsync/splates-server/spend/rates.d.ts +23 -0
  417. package/vendor/@stringsync/splates-server/spend/report.d.ts +39 -0
  418. package/vendor/@stringsync/splates-server/spend/routes.d.ts +46 -0
  419. package/vendor/@stringsync/splates-server/spend/spend.d.ts +15 -0
  420. package/vendor/@stringsync/splates-server/spend/totals.d.ts +63 -0
  421. package/vendor/@stringsync/splates-server/spend/turn.d.ts +39 -0
  422. package/vendor/@stringsync/splates-server/stats/adherence.d.ts +40 -0
  423. package/vendor/@stringsync/splates-server/stats/baselines.d.ts +55 -0
  424. package/vendor/@stringsync/splates-server/stats/budget-routes.d.ts +21 -0
  425. package/vendor/@stringsync/splates-server/stats/fact-tasks.d.ts +19 -0
  426. package/vendor/@stringsync/splates-server/stats/finding-facts.d.ts +37 -0
  427. package/vendor/@stringsync/splates-server/stats/findings.d.ts +89 -0
  428. package/vendor/@stringsync/splates-server/stats/index.d.ts +12 -0
  429. package/vendor/@stringsync/splates-server/stats/index.js +30 -0
  430. package/vendor/@stringsync/splates-server/stats/landed.d.ts +14 -0
  431. package/vendor/@stringsync/splates-server/stats/outcomes.d.ts +207 -0
  432. package/vendor/@stringsync/splates-server/stats/overrides.d.ts +19 -0
  433. package/vendor/@stringsync/splates-server/stats/routes.d.ts +23 -0
  434. package/vendor/@stringsync/splates-server/stats/scry-models.d.ts +22 -0
  435. package/vendor/@stringsync/splates-server/stats/skill-checks.d.ts +59 -0
  436. package/vendor/@stringsync/splates-server/stats/stats.d.ts +176 -0
  437. package/vendor/@stringsync/splates-server/stats/task-log.d.ts +67 -0
  438. package/vendor/@stringsync/splates-server/storage/atomic.d.ts +13 -0
  439. package/vendor/@stringsync/splates-server/storage/collection.d.ts +30 -0
  440. package/vendor/@stringsync/splates-server/storage/document.d.ts +26 -0
  441. package/vendor/@stringsync/splates-server/storage/fs-collection.d.ts +26 -0
  442. package/vendor/@stringsync/splates-server/storage/fs-document.d.ts +16 -0
  443. package/vendor/@stringsync/splates-server/storage/fs-log.d.ts +31 -0
  444. package/vendor/@stringsync/splates-server/storage/fs.d.ts +48 -0
  445. package/vendor/@stringsync/splates-server/storage/index.d.ts +11 -0
  446. package/vendor/@stringsync/splates-server/storage/index.js +18 -0
  447. package/vendor/@stringsync/splates-server/storage/json.d.ts +10 -0
  448. package/vendor/@stringsync/splates-server/storage/key.d.ts +7 -0
  449. package/vendor/@stringsync/splates-server/storage/log.d.ts +60 -0
  450. package/vendor/@stringsync/splates-server/storage/schema.d.ts +7 -0
  451. package/vendor/@stringsync/splates-server/storage/sqlite-collection.d.ts +31 -0
  452. package/vendor/@stringsync/splates-server/storage/sqlite-db.d.ts +62 -0
  453. package/vendor/@stringsync/splates-server/storage/sqlite-document.d.ts +20 -0
  454. package/vendor/@stringsync/splates-server/storage/sqlite-import.d.ts +11 -0
  455. package/vendor/@stringsync/splates-server/storage/sqlite-keys.d.ts +17 -0
  456. package/vendor/@stringsync/splates-server/storage/sqlite-lock.d.ts +25 -0
  457. package/vendor/@stringsync/splates-server/storage/sqlite-log.d.ts +31 -0
  458. package/vendor/@stringsync/splates-server/storage/sqlite.d.ts +53 -0
  459. package/vendor/@stringsync/splates-server/storage/storage.d.ts +87 -0
  460. package/vendor/@stringsync/splates-server/table.d.ts +5 -0
  461. package/vendor/@stringsync/splates-server/tasks/add.d.ts +45 -0
  462. package/vendor/@stringsync/splates-server/tasks/browser.d.ts +5 -0
  463. package/vendor/@stringsync/splates-server/tasks/checkpoint.d.ts +39 -0
  464. package/vendor/@stringsync/splates-server/tasks/claim.d.ts +14 -0
  465. package/vendor/@stringsync/splates-server/tasks/conflicts.d.ts +19 -0
  466. package/vendor/@stringsync/splates-server/tasks/diff.d.ts +29 -0
  467. package/vendor/@stringsync/splates-server/tasks/dispatched.d.ts +15 -0
  468. package/vendor/@stringsync/splates-server/tasks/editors.d.ts +22 -0
  469. package/vendor/@stringsync/splates-server/tasks/finished.d.ts +81 -0
  470. package/vendor/@stringsync/splates-server/tasks/follow.d.ts +48 -0
  471. package/vendor/@stringsync/splates-server/tasks/index.d.ts +30 -0
  472. package/vendor/@stringsync/splates-server/tasks/index.js +90 -0
  473. package/vendor/@stringsync/splates-server/tasks/landings.d.ts +17 -0
  474. package/vendor/@stringsync/splates-server/tasks/list.d.ts +18 -0
  475. package/vendor/@stringsync/splates-server/tasks/merge-output.d.ts +13 -0
  476. package/vendor/@stringsync/splates-server/tasks/open.d.ts +15 -0
  477. package/vendor/@stringsync/splates-server/tasks/overlaps.d.ts +16 -0
  478. package/vendor/@stringsync/splates-server/tasks/path.d.ts +13 -0
  479. package/vendor/@stringsync/splates-server/tasks/recommend.d.ts +30 -0
  480. package/vendor/@stringsync/splates-server/tasks/remove.d.ts +47 -0
  481. package/vendor/@stringsync/splates-server/tasks/retry.d.ts +35 -0
  482. package/vendor/@stringsync/splates-server/tasks/routes.d.ts +23 -0
  483. package/vendor/@stringsync/splates-server/tasks/show.d.ts +137 -0
  484. package/vendor/@stringsync/splates-server/tasks/snapshot.d.ts +86 -0
  485. package/vendor/@stringsync/splates-server/tasks/started-records.d.ts +71 -0
  486. package/vendor/@stringsync/splates-server/tasks/wait.d.ts +47 -0
  487. package/vendor/@stringsync/splates-server/tasks/worktree-checkouts.d.ts +10 -0
  488. package/vendor/@stringsync/splates-server/tasks/worktree-service.d.ts +151 -0
  489. package/vendor/@stringsync/splates-server/tasks/worktree.d.ts +342 -0
  490. package/vendor/@stringsync/splates-server/terminal/connection.d.ts +19 -0
  491. package/vendor/@stringsync/splates-server/terminal/held.d.ts +22 -0
  492. package/vendor/@stringsync/splates-server/terminal/index.d.ts +7 -0
  493. package/vendor/@stringsync/splates-server/terminal/pty.d.ts +45 -0
  494. package/vendor/@stringsync/splates-server/terminal/remote-pty.d.ts +34 -0
  495. package/vendor/@stringsync/splates-server/terminal/shell.d.ts +70 -0
  496. package/vendor/@stringsync/splates-server/terminal/spawn.d.ts +22 -0
  497. package/vendor/@stringsync/splates-server/terminal/terminal.d.ts +52 -0
  498. package/vendor/@stringsync/splates-server/tunnel/access.d.ts +61 -0
  499. package/vendor/@stringsync/splates-server/tunnel/cloudflare-api.d.ts +25 -0
  500. package/vendor/@stringsync/splates-server/tunnel/cloudflare-error.d.ts +5 -0
  501. package/vendor/@stringsync/splates-server/tunnel/cloudflared.d.ts +43 -0
  502. package/vendor/@stringsync/splates-server/tunnel/index.d.ts +14 -0
  503. package/vendor/@stringsync/splates-server/tunnel/index.js +70 -0
  504. package/vendor/@stringsync/splates-server/tunnel/machine.d.ts +18 -0
  505. package/vendor/@stringsync/splates-server/tunnel/provider.d.ts +37 -0
  506. package/vendor/@stringsync/splates-server/tunnel/remove.d.ts +35 -0
  507. package/vendor/@stringsync/splates-server/tunnel/saved-ports-host.d.ts +26 -0
  508. package/vendor/@stringsync/splates-server/tunnel/saved.d.ts +63 -0
  509. package/vendor/@stringsync/splates-server/tunnel/setup.d.ts +123 -0
  510. package/vendor/@stringsync/splates-server/tunnel/tunnel.d.ts +38 -0
  511. package/vendor/@stringsync/splates-server/workers/admin.d.ts +37 -0
  512. package/vendor/@stringsync/splates-server/workers/call-host.d.ts +68 -0
  513. package/vendor/@stringsync/splates-server/workers/channel.d.ts +90 -0
  514. package/vendor/@stringsync/splates-server/workers/connection.d.ts +24 -0
  515. package/vendor/@stringsync/splates-server/workers/coordinator-state.d.ts +44 -0
  516. package/vendor/@stringsync/splates-server/workers/daemon.d.ts +128 -0
  517. package/vendor/@stringsync/splates-server/workers/darwin-footprint.d.ts +7 -0
  518. package/vendor/@stringsync/splates-server/workers/darwin-temperature.d.ts +7 -0
  519. package/vendor/@stringsync/splates-server/workers/frame-too-large.d.ts +5 -0
  520. package/vendor/@stringsync/splates-server/workers/git.d.ts +11 -0
  521. package/vendor/@stringsync/splates-server/workers/gone.d.ts +36 -0
  522. package/vendor/@stringsync/splates-server/workers/identity.d.ts +30 -0
  523. package/vendor/@stringsync/splates-server/workers/index.d.ts +40 -0
  524. package/vendor/@stringsync/splates-server/workers/index.js +90 -0
  525. package/vendor/@stringsync/splates-server/workers/lifecycle.d.ts +14 -0
  526. package/vendor/@stringsync/splates-server/workers/list.d.ts +93 -0
  527. package/vendor/@stringsync/splates-server/workers/load.d.ts +55 -0
  528. package/vendor/@stringsync/splates-server/workers/local-id.d.ts +11 -0
  529. package/vendor/@stringsync/splates-server/workers/local-update.d.ts +81 -0
  530. package/vendor/@stringsync/splates-server/workers/log-file.d.ts +24 -0
  531. package/vendor/@stringsync/splates-server/workers/machine.d.ts +47 -0
  532. package/vendor/@stringsync/splates-server/workers/orphan.d.ts +31 -0
  533. package/vendor/@stringsync/splates-server/workers/os-sensors.d.ts +49 -0
  534. package/vendor/@stringsync/splates-server/workers/placement.d.ts +39 -0
  535. package/vendor/@stringsync/splates-server/workers/process-host.d.ts +60 -0
  536. package/vendor/@stringsync/splates-server/workers/process.d.ts +33 -0
  537. package/vendor/@stringsync/splates-server/workers/protocol.d.ts +153 -0
  538. package/vendor/@stringsync/splates-server/workers/pty-host.d.ts +35 -0
  539. package/vendor/@stringsync/splates-server/workers/queue.d.ts +39 -0
  540. package/vendor/@stringsync/splates-server/workers/records.d.ts +43 -0
  541. package/vendor/@stringsync/splates-server/workers/registry.d.ts +101 -0
  542. package/vendor/@stringsync/splates-server/workers/replay.d.ts +25 -0
  543. package/vendor/@stringsync/splates-server/workers/routes.d.ts +119 -0
  544. package/vendor/@stringsync/splates-server/workers/run-options.d.ts +11 -0
  545. package/vendor/@stringsync/splates-server/workers/run.d.ts +10 -0
  546. package/vendor/@stringsync/splates-server/workers/scheduler.d.ts +171 -0
  547. package/vendor/@stringsync/splates-server/workers/server-of.d.ts +23 -0
  548. package/vendor/@stringsync/splates-server/workers/server-socket.d.ts +25 -0
  549. package/vendor/@stringsync/splates-server/workers/session.d.ts +240 -0
  550. package/vendor/@stringsync/splates-server/workers/socket.d.ts +21 -0
  551. package/vendor/@stringsync/splates-server/workers/unix-listener.d.ts +23 -0
  552. package/vendor/@stringsync/splates-server/workers/unix-socket.d.ts +30 -0
  553. package/vendor/@stringsync/splates-server/workers/websocket-socket.d.ts +24 -0
  554. package/vendor/@stringsync/splates-server/workers/worker.d.ts +98 -0
  555. package/vendor/core/LICENSE +21 -0
  556. package/vendor/core/abort/aborts.d.ts +10 -0
  557. package/vendor/core/abort/index.d.ts +1 -0
  558. package/vendor/core/abort/index.js +24 -0
  559. package/vendor/core/assert/assert-error.d.ts +4 -0
  560. package/vendor/core/assert/assert.d.ts +24 -0
  561. package/vendor/core/assert/ensure.d.ts +18 -0
  562. package/vendor/core/assert/index.d.ts +3 -0
  563. package/vendor/core/assert/index.js +75 -0
  564. package/vendor/core/cmd/cli.d.ts +70 -0
  565. package/vendor/core/cmd/command.d.ts +96 -0
  566. package/vendor/core/cmd/deps.d.ts +12 -0
  567. package/vendor/core/cmd/help.d.ts +16 -0
  568. package/vendor/core/cmd/index.d.ts +6 -0
  569. package/vendor/core/cmd/index.js +477 -0
  570. package/vendor/core/cmd/middleware.d.ts +15 -0
  571. package/vendor/core/cmd/timed.d.ts +15 -0
  572. package/vendor/core/creds/credential-proxy.d.ts +55 -0
  573. package/vendor/core/creds/credential-source.d.ts +19 -0
  574. package/vendor/core/creds/credentials.d.ts +28 -0
  575. package/vendor/core/creds/dotenv-file.d.ts +22 -0
  576. package/vendor/core/creds/environment.d.ts +18 -0
  577. package/vendor/core/creds/index.d.ts +8 -0
  578. package/vendor/core/creds/index.js +337 -0
  579. package/vendor/core/creds/memory-secret-store.d.ts +33 -0
  580. package/vendor/core/creds/secret-store.d.ts +14 -0
  581. package/vendor/core/creds/system-secret-store.d.ts +49 -0
  582. package/vendor/core/dictate/buffered-sink.d.ts +9 -0
  583. package/vendor/core/dictate/cue.d.ts +10 -0
  584. package/vendor/core/dictate/dictation-failure.d.ts +5 -0
  585. package/vendor/core/dictate/dictation-link.d.ts +18 -0
  586. package/vendor/core/dictate/dictation-message.d.ts +24 -0
  587. package/vendor/core/dictate/dictation-relay.d.ts +28 -0
  588. package/vendor/core/dictate/index.d.ts +10 -0
  589. package/vendor/core/dictate/index.js +132 -0
  590. package/vendor/core/dictate/microphone.d.ts +42 -0
  591. package/vendor/core/dictate/openai-transcriber.d.ts +22 -0
  592. package/vendor/core/dictate/openai-transcription.d.ts +27 -0
  593. package/vendor/core/dictate/pcm.d.ts +5 -0
  594. package/vendor/core/dictate/pcm16-encoder.d.ts +20 -0
  595. package/vendor/core/dictate/server.d.ts +1 -0
  596. package/vendor/core/dictate/server.js +153 -0
  597. package/vendor/core/dictate/transcriber.d.ts +23 -0
  598. package/vendor/core/disposable/async-disposer.d.ts +15 -0
  599. package/vendor/core/disposable/async-resource.d.ts +4 -0
  600. package/vendor/core/disposable/disposables.d.ts +8 -0
  601. package/vendor/core/disposable/disposer.d.ts +13 -0
  602. package/vendor/core/disposable/index.d.ts +5 -0
  603. package/vendor/core/disposable/index.js +96 -0
  604. package/vendor/core/disposable/resource.d.ts +4 -0
  605. package/vendor/core/events/dispatcher.d.ts +18 -0
  606. package/vendor/core/events/eventful.d.ts +7 -0
  607. package/vendor/core/events/events.d.ts +14 -0
  608. package/vendor/core/events/index.d.ts +4 -0
  609. package/vendor/core/events/index.js +75 -0
  610. package/vendor/core/events/noop-events.d.ts +6 -0
  611. package/vendor/core/id/counter-id-provider.d.ts +6 -0
  612. package/vendor/core/id/id-provider.d.ts +7 -0
  613. package/vendor/core/id/index.d.ts +3 -0
  614. package/vendor/core/id/index.js +17 -0
  615. package/vendor/core/id/uuid-provider.d.ts +11 -0
  616. package/vendor/core/index-qk5dj664.js +4 -0
  617. package/vendor/core/log/color.d.ts +22 -0
  618. package/vendor/core/log/composite-logger.d.ts +7 -0
  619. package/vendor/core/log/console-logger.d.ts +6 -0
  620. package/vendor/core/log/index.d.ts +8 -0
  621. package/vendor/core/log/index.js +154 -0
  622. package/vendor/core/log/level-prefix-logger.d.ts +12 -0
  623. package/vendor/core/log/logger.d.ts +12 -0
  624. package/vendor/core/log/mdc-logger.d.ts +14 -0
  625. package/vendor/core/log/memory-logger.d.ts +8 -0
  626. package/vendor/core/log/prefix-logger.d.ts +12 -0
  627. package/vendor/core/md/index.d.ts +2 -0
  628. package/vendor/core/md/index.js +182 -0
  629. package/vendor/core/md/markdown.d.ts +56 -0
  630. package/vendor/core/md/writer.d.ts +22 -0
  631. package/vendor/core/push/base64url.d.ts +2 -0
  632. package/vendor/core/push/encrypt.d.ts +12 -0
  633. package/vendor/core/push/index.d.ts +4 -0
  634. package/vendor/core/push/index.js +137 -0
  635. package/vendor/core/push/push-failure.d.ts +7 -0
  636. package/vendor/core/push/pusher.d.ts +24 -0
  637. package/vendor/core/push/vapid.d.ts +18 -0
  638. package/vendor/core/push/web-pusher.d.ts +20 -0
  639. package/vendor/core/ship/artifact/artifact.d.ts +52 -0
  640. package/vendor/core/ship/bundle/bun-bundle.d.ts +71 -0
  641. package/vendor/core/ship/bundle/bundle-artifact.d.ts +21 -0
  642. package/vendor/core/ship/bundle/bundle.d.ts +13 -0
  643. package/vendor/core/ship/bundle/published.d.ts +45 -0
  644. package/vendor/core/ship/bundle/reach.d.ts +43 -0
  645. package/vendor/core/ship/bundle/vendor-bundle.d.ts +47 -0
  646. package/vendor/core/ship/cut.d.ts +64 -0
  647. package/vendor/core/ship/dry-run.d.ts +63 -0
  648. package/vendor/core/ship/git/cli-git.d.ts +25 -0
  649. package/vendor/core/ship/git/git-artifact.d.ts +23 -0
  650. package/vendor/core/ship/git/git.d.ts +19 -0
  651. package/vendor/core/ship/github/cli-github.d.ts +31 -0
  652. package/vendor/core/ship/github/cli-workflows.d.ts +25 -0
  653. package/vendor/core/ship/github/github-artifact.d.ts +18 -0
  654. package/vendor/core/ship/github/github.d.ts +10 -0
  655. package/vendor/core/ship/github/login.d.ts +3 -0
  656. package/vendor/core/ship/github/workflows.d.ts +27 -0
  657. package/vendor/core/ship/index.d.ts +26 -0
  658. package/vendor/core/ship/index.js +3203 -0
  659. package/vendor/core/ship/mirror/agent-files.d.ts +6 -0
  660. package/vendor/core/ship/mirror/mirror-build.d.ts +63 -0
  661. package/vendor/core/ship/mirror/mirror-guard.d.ts +10 -0
  662. package/vendor/core/ship/mirror/mirror-options.d.ts +75 -0
  663. package/vendor/core/ship/mirror/mirror-step.d.ts +109 -0
  664. package/vendor/core/ship/mirror/mirror-tooling.d.ts +59 -0
  665. package/vendor/core/ship/mirror/source-manifest.d.ts +27 -0
  666. package/vendor/core/ship/order.d.ts +15 -0
  667. package/vendor/core/ship/publish-workflow.d.ts +32 -0
  668. package/vendor/core/ship/registry/github-actions.d.ts +76 -0
  669. package/vendor/core/ship/registry/npm-registry.d.ts +70 -0
  670. package/vendor/core/ship/registry/registry-artifact.d.ts +31 -0
  671. package/vendor/core/ship/registry/registry.d.ts +85 -0
  672. package/vendor/core/ship/release-file.d.ts +22 -0
  673. package/vendor/core/ship/release-options.d.ts +122 -0
  674. package/vendor/core/ship/release.d.ts +61 -0
  675. package/vendor/core/ship/releases.d.ts +119 -0
  676. package/vendor/core/ship/shipped.d.ts +54 -0
  677. package/vendor/core/ship/skill-artifact.d.ts +27 -0
  678. package/vendor/core/ship/step-events.d.ts +91 -0
  679. package/vendor/core/ship/step-runner.d.ts +16 -0
  680. package/vendor/core/ship/step.d.ts +49 -0
  681. package/vendor/core/ship/trust.d.ts +11 -0
  682. package/vendor/core/ship/version.d.ts +9 -0
  683. package/vendor/core/ship/workspace/manifest-workspace.d.ts +61 -0
  684. package/vendor/core/ship/workspace/workspace.d.ts +29 -0
  685. package/vendor/core/skills/index.d.ts +1 -0
  686. package/vendor/core/skills/index.js +77 -0
  687. package/vendor/core/skills/project-skills.d.ts +53 -0
  688. package/vendor/core/system/fs/fs.d.ts +58 -0
  689. package/vendor/core/system/fs/node-fs.d.ts +18 -0
  690. package/vendor/core/system/glob/glob.d.ts +11 -0
  691. package/vendor/core/system/glob/node-glob.d.ts +12 -0
  692. package/vendor/core/system/heavy/heavy-jobs.d.ts +84 -0
  693. package/vendor/core/system/host-mapper/file-host-mapper.d.ts +20 -0
  694. package/vendor/core/system/host-mapper/host-mapper.d.ts +11 -0
  695. package/vendor/core/system/host-mapper/noop-host-mapper.d.ts +4 -0
  696. package/vendor/core/system/index.d.ts +25 -0
  697. package/vendor/core/system/index.js +1385 -0
  698. package/vendor/core/system/ip-provider/darwin-ip-provider.d.ts +6 -0
  699. package/vendor/core/system/ip-provider/ip-provider.d.ts +8 -0
  700. package/vendor/core/system/ip-provider/linux-ip-provider.d.ts +6 -0
  701. package/vendor/core/system/ip-provider/platform-ip-provider.d.ts +6 -0
  702. package/vendor/core/system/ip-provider/sequential-ip-provider.d.ts +6 -0
  703. package/vendor/core/system/ip-provider/static-ip-provider.d.ts +8 -0
  704. package/vendor/core/system/ip-provider/win32-ip-provider.d.ts +6 -0
  705. package/vendor/core/system/lock/file-lock.d.ts +50 -0
  706. package/vendor/core/system/lock/lock.d.ts +11 -0
  707. package/vendor/core/system/lock/memory-lock.d.ts +13 -0
  708. package/vendor/core/system/port-provider/open-port-provider.d.ts +38 -0
  709. package/vendor/core/system/port-provider/port-provider.d.ts +14 -0
  710. package/vendor/core/system/process-like/process-like.d.ts +22 -0
  711. package/vendor/core/system/ps/file-process.d.ts +40 -0
  712. package/vendor/core/system/ps/listening.d.ts +20 -0
  713. package/vendor/core/system/ps/node-ps.d.ts +39 -0
  714. package/vendor/core/system/ps/ps.d.ts +161 -0
  715. package/vendor/core/system/ps/reap.d.ts +22 -0
  716. package/vendor/core/system/undumpable.d.ts +32 -0
  717. package/vendor/core/system/walk.d.ts +10 -0
  718. package/vendor/core/time/clock/clock.d.ts +5 -0
  719. package/vendor/core/time/clock/system-clock.d.ts +5 -0
  720. package/vendor/core/time/debouncer.d.ts +25 -0
  721. package/vendor/core/time/duration.d.ts +38 -0
  722. package/vendor/core/time/index.d.ts +13 -0
  723. package/vendor/core/time/index.js +271 -0
  724. package/vendor/core/time/sleep.d.ts +2 -0
  725. package/vendor/core/time/stopwatch.d.ts +34 -0
  726. package/vendor/core/time/throttler.d.ts +26 -0
  727. package/vendor/core/time/time-ago.d.ts +14 -0
  728. package/vendor/core/time/timeouts.d.ts +12 -0
  729. package/vendor/core/time/timer/system-timer.d.ts +7 -0
  730. package/vendor/core/time/timer/timer.d.ts +11 -0
  731. package/vendor/core/time/wall-clock/system-wall-clock.d.ts +4 -0
  732. package/vendor/core/time/wall-clock/wall-clock.d.ts +14 -0
  733. package/waiting.d.ts +2 -2
  734. package/worker.d.ts +2 -2
@@ -0,0 +1,1385 @@
1
+ // system/fs/node-fs.ts
2
+ import { watch } from "node:fs";
3
+ import fs from "node:fs/promises";
4
+ import { join, normalize } from "node:path";
5
+
6
+ class NodeFs {
7
+ async exists(path) {
8
+ return fs.access(normalize(path)).then(() => true, () => false);
9
+ }
10
+ async mkdir(path, opts) {
11
+ await fs.mkdir(normalize(path), {
12
+ recursive: opts?.recursive ?? true
13
+ });
14
+ }
15
+ read(path) {
16
+ return fs.readFile(normalize(path), "utf-8");
17
+ }
18
+ write(path, data) {
19
+ return fs.writeFile(normalize(path), data);
20
+ }
21
+ append(path, data) {
22
+ return fs.appendFile(normalize(path), data);
23
+ }
24
+ async readBytes(path) {
25
+ const buffer = await fs.readFile(normalize(path));
26
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
27
+ }
28
+ writeBytes(path, data) {
29
+ return fs.writeFile(normalize(path), data);
30
+ }
31
+ rename(from, to) {
32
+ return fs.rename(normalize(from), normalize(to));
33
+ }
34
+ readdir(path) {
35
+ return fs.readdir(normalize(path));
36
+ }
37
+ chmod(path, mode) {
38
+ return fs.chmod(normalize(path), mode);
39
+ }
40
+ stat(path) {
41
+ return fs.stat(normalize(path));
42
+ }
43
+ rm(path, opts) {
44
+ return fs.rm(normalize(path), opts);
45
+ }
46
+ isSymlink(path) {
47
+ return fs.lstat(normalize(path)).then((stat) => stat.isSymbolicLink(), () => false);
48
+ }
49
+ watch(path, onChange, opts) {
50
+ const root = normalize(path);
51
+ const watcher = watch(root, { recursive: opts?.recursive ?? false }, (_event, name) => onChange(name ? join(root, String(name)) : root));
52
+ watcher.on("error", () => watcher.close());
53
+ return { dispose: () => watcher.close() };
54
+ }
55
+ }
56
+ // system/glob/node-glob.ts
57
+ import { matchesGlob } from "node:path";
58
+
59
+ class NodeGlob {
60
+ matches(pattern, path) {
61
+ return matchesGlob(path, pattern);
62
+ }
63
+ }
64
+ // system/heavy/heavy-jobs.ts
65
+ import { Duration as Duration2, sleep as sleep2 } from "../time/index.js";
66
+
67
+ // system/lock/file-lock.ts
68
+ import { rmSync as rmSync2 } from "node:fs";
69
+ import { Disposer } from "../disposable/index.js";
70
+ import { ConsoleLogger, color } from "../log/index.js";
71
+ import { Duration, sleep } from "../time/index.js";
72
+
73
+ // system/ps/node-ps.ts
74
+ import { spawn } from "node:child_process";
75
+ import { readlink } from "node:fs/promises";
76
+ import { hostname } from "node:os";
77
+ import { Readable, Writable } from "node:stream";
78
+ import { disposables } from "../disposable/index.js";
79
+
80
+ // system/ps/file-process.ts
81
+ import {
82
+ closeSync,
83
+ constants as constants2,
84
+ mkdtempSync,
85
+ openSync,
86
+ readSync,
87
+ rmSync
88
+ } from "node:fs";
89
+ import { tmpdir } from "node:os";
90
+ import { join as join2 } from "node:path";
91
+
92
+ // system/ps/reap.ts
93
+ import { constants } from "node:os";
94
+ var reap = process.versions.bun && process.platform === "darwin" ? await load() : null;
95
+ var WNOHANG = 1;
96
+ async function load() {
97
+ const { dlopen, FFIType, ptr } = await import("bun:ffi");
98
+ const { symbols } = dlopen("libc.dylib", {
99
+ waitpid: {
100
+ args: [FFIType.i32, FFIType.ptr, FFIType.i32],
101
+ returns: FFIType.i32
102
+ }
103
+ });
104
+ const status = new Int32Array(1);
105
+ return (pid) => symbols.waitpid(pid, ptr(status), WNOHANG) === pid ? status[0] ?? 0 : null;
106
+ }
107
+ function decode(status) {
108
+ const signal = status & 127;
109
+ return signal === 0 ? status >> 8 & 255 : 128 + signal;
110
+ }
111
+ async function exitOf(child, kernel) {
112
+ let timer;
113
+ const polled = new Promise((resolve) => {
114
+ timer = setInterval(() => {
115
+ if (child.exitCode !== null || child.signalCode !== null) {
116
+ resolve(shellCode(child.exitCode, child.signalCode));
117
+ return;
118
+ }
119
+ const status = kernel.reap(child.pid);
120
+ if (status !== null) {
121
+ resolve(decode(status));
122
+ }
123
+ }, 250);
124
+ });
125
+ try {
126
+ return await Promise.race([
127
+ child.exited.then((code) => shellCode(code, child.signalCode)),
128
+ polled
129
+ ]);
130
+ } finally {
131
+ clearInterval(timer);
132
+ }
133
+ }
134
+ function shellCode(code, signal) {
135
+ if (!signal) {
136
+ return code ?? 0;
137
+ }
138
+ const number = typeof signal === "number" ? signal : constants.signals[signal] ?? 0;
139
+ return 128 + number;
140
+ }
141
+
142
+ // system/ps/file-process.ts
143
+ var mkfifo = reap === null ? null : await load2();
144
+ async function load2() {
145
+ const { dlopen, FFIType } = await import("bun:ffi");
146
+ const { symbols } = dlopen("libc.dylib", {
147
+ mkfifo: { args: [FFIType.cstring, FFIType.u16], returns: FFIType.i32 }
148
+ });
149
+ return (path) => {
150
+ if (symbols.mkfifo(Buffer.from(`${path}\x00`), 384) !== 0) {
151
+ throw new Error(`cannot make a FIFO at ${path}`);
152
+ }
153
+ };
154
+ }
155
+ var runtime = {
156
+ spawn: (argv, opts) => Bun.spawn(argv, opts),
157
+ reap: (pid) => reap?.(pid) ?? null
158
+ };
159
+ function fileStart(argv, opts) {
160
+ const { stdin = "pipe", runtime: rt = runtime, ...spawnOptions } = opts;
161
+ opts.signal?.throwIfAborted();
162
+ const dir = mkdtempSync(join2(tmpdir(), "webappwiz-ps-"));
163
+ let out;
164
+ let err;
165
+ const writers = [];
166
+ let child;
167
+ try {
168
+ out = new FifoOutput(join2(dir, "stdout"));
169
+ err = new FifoOutput(join2(dir, "stderr"));
170
+ const stdout = openSync(out.path, constants2.O_WRONLY);
171
+ writers.push(stdout);
172
+ const stderr = openSync(err.path, constants2.O_WRONLY);
173
+ writers.push(stderr);
174
+ child = rt.spawn(argv, { ...spawnOptions, stdin, stdout, stderr });
175
+ } catch (error) {
176
+ out?.[Symbol.dispose]();
177
+ err?.[Symbol.dispose]();
178
+ return unstarted(error);
179
+ } finally {
180
+ for (const fd of writers) {
181
+ closeSync(fd);
182
+ }
183
+ rmSync(dir, { recursive: true, force: true });
184
+ }
185
+ return follow(child, out, err, opts.signal, rt);
186
+ }
187
+ function unstarted(error) {
188
+ const failed = () => new ReadableStream({ start: (controller) => controller.error(error) });
189
+ return {
190
+ pid: null,
191
+ stdin: new WritableStream,
192
+ stdout: failed(),
193
+ stderr: failed(),
194
+ exited: Promise.reject(error),
195
+ kill: () => {}
196
+ };
197
+ }
198
+ function follow(child, out, err, signal, rt) {
199
+ let gone = false;
200
+ let readError;
201
+ let poll;
202
+ const read = () => {
203
+ try {
204
+ const flowing = [out.drain(false), err.drain(false)].includes(true);
205
+ poll = flowing ? setTimeout(read, 0) : setTimeout(read, 20);
206
+ } catch (error) {
207
+ readError = error;
208
+ child.kill();
209
+ }
210
+ };
211
+ read();
212
+ const exited = (async () => {
213
+ try {
214
+ const code = await exitOf(child, rt);
215
+ gone = true;
216
+ clearTimeout(poll);
217
+ if (readError !== undefined) {
218
+ throw readError;
219
+ }
220
+ out.finish();
221
+ err.finish();
222
+ signal?.throwIfAborted();
223
+ return code;
224
+ } catch (error) {
225
+ out.fail(error);
226
+ err.fail(error);
227
+ throw error;
228
+ } finally {
229
+ gone = true;
230
+ clearTimeout(poll);
231
+ child.unref();
232
+ out[Symbol.dispose]();
233
+ err[Symbol.dispose]();
234
+ }
235
+ })();
236
+ const input = child.stdin;
237
+ const stopped = exited.then(() => {
238
+ return;
239
+ });
240
+ const closeInput = async () => {
241
+ if (typeof input === "object") {
242
+ try {
243
+ await Promise.race([input.end(), stopped]);
244
+ } catch (error) {
245
+ ignoreClosedInput(error);
246
+ }
247
+ }
248
+ };
249
+ stopped.catch(() => {});
250
+ return {
251
+ pid: child.pid,
252
+ stdin: new WritableStream({
253
+ async write(bytes) {
254
+ if (gone || typeof input !== "object") {
255
+ return;
256
+ }
257
+ try {
258
+ input.write(bytes);
259
+ await Promise.race([input.flush(), stopped]);
260
+ } catch (error) {
261
+ ignoreClosedInput(error);
262
+ }
263
+ },
264
+ close: closeInput,
265
+ abort: closeInput
266
+ }),
267
+ stdout: out.stream,
268
+ stderr: err.stream,
269
+ exited,
270
+ kill: (signal = "SIGTERM") => {
271
+ if (!gone && child.exitCode === null && child.signalCode === null) {
272
+ child.kill(signal);
273
+ }
274
+ }
275
+ };
276
+ }
277
+ async function fileCapture(argv, opts) {
278
+ const { input, watcher, ...startOptions } = opts;
279
+ const child = fileStart(argv, {
280
+ ...startOptions,
281
+ stdin: input === undefined ? "inherit" : "pipe"
282
+ });
283
+ const feed = async () => {
284
+ if (input !== undefined) {
285
+ const writer = child.stdin.getWriter();
286
+ try {
287
+ await writer.write(new TextEncoder().encode(input));
288
+ await writer.close();
289
+ } finally {
290
+ writer.releaseLock();
291
+ }
292
+ }
293
+ };
294
+ const [exitCode, stdout, stderr] = await Promise.all([
295
+ child.exited,
296
+ text(child.stdout, { watcher, channel: "stdout" }),
297
+ text(child.stderr, { watcher, channel: "stderr" }),
298
+ feed()
299
+ ]);
300
+ return { exitCode, stdout, stderr };
301
+ }
302
+ async function text(stream, opts) {
303
+ const decoder = new TextDecoder;
304
+ let result = "";
305
+ for await (const bytes of stream) {
306
+ const chunk = decoder.decode(bytes, { stream: true });
307
+ result += chunk;
308
+ opts.watcher?.[opts.channel](chunk);
309
+ }
310
+ const tail = decoder.decode();
311
+ if (tail !== "") {
312
+ result += tail;
313
+ opts.watcher?.[opts.channel](tail);
314
+ }
315
+ return result;
316
+ }
317
+ function ignoreClosedInput(error) {
318
+ const code = error.code;
319
+ if (code !== "EPIPE" && code !== "ERR_STREAM_DESTROYED" && code !== "ERR_STREAM_PREMATURE_CLOSE") {
320
+ throw error;
321
+ }
322
+ }
323
+ var LEFT_OVER = 1048576;
324
+
325
+ class FifoOutput {
326
+ path;
327
+ stream;
328
+ fd;
329
+ buffer = Buffer.allocUnsafe(65536);
330
+ controller;
331
+ closed = false;
332
+ disposed = false;
333
+ constructor(path) {
334
+ this.path = path;
335
+ if (mkfifo === null) {
336
+ throw new Error("FIFO-backed processes need Bun on macOS");
337
+ }
338
+ mkfifo(path);
339
+ this.fd = openSync(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
340
+ this.stream = new ReadableStream({
341
+ start: (controller) => {
342
+ this.controller = controller;
343
+ },
344
+ cancel: () => {
345
+ this.closed = true;
346
+ this[Symbol.dispose]();
347
+ }
348
+ });
349
+ }
350
+ drain(final) {
351
+ let read = false;
352
+ let taken = 0;
353
+ while (!this.closed && (final ? taken < LEFT_OVER : (this.controller.desiredSize ?? 0) > 0)) {
354
+ const count = this.next();
355
+ if (count === null) {
356
+ break;
357
+ }
358
+ if (count === 0) {
359
+ this.end();
360
+ this[Symbol.dispose]();
361
+ break;
362
+ }
363
+ read = true;
364
+ taken += count;
365
+ this.controller.enqueue(Uint8Array.from(this.buffer.subarray(0, count)));
366
+ }
367
+ return read;
368
+ }
369
+ finish() {
370
+ this.drain(true);
371
+ this.end();
372
+ }
373
+ fail(error) {
374
+ if (!this.closed) {
375
+ this.closed = true;
376
+ this.controller.error(error);
377
+ }
378
+ }
379
+ [Symbol.dispose]() {
380
+ if (!this.disposed) {
381
+ this.disposed = true;
382
+ closeSync(this.fd);
383
+ }
384
+ }
385
+ end() {
386
+ if (!this.closed) {
387
+ this.closed = true;
388
+ this.controller.close();
389
+ }
390
+ }
391
+ next() {
392
+ try {
393
+ return readSync(this.fd, this.buffer, 0, this.buffer.length, null);
394
+ } catch (error) {
395
+ if (error.code === "EAGAIN") {
396
+ return null;
397
+ }
398
+ throw error;
399
+ }
400
+ }
401
+ }
402
+
403
+ // system/ps/listening.ts
404
+ function parseLsof(stdout) {
405
+ const found = [];
406
+ let pid = null;
407
+ for (const line of stdout.split(`
408
+ `)) {
409
+ if (line.startsWith("p")) {
410
+ pid = Number(line.slice(1));
411
+ continue;
412
+ }
413
+ if (!line.startsWith("n") || pid === null) {
414
+ continue;
415
+ }
416
+ const address = hostPort(line.slice(1));
417
+ if (address !== null) {
418
+ found.push({ pid, ...address });
419
+ }
420
+ }
421
+ return unique(found);
422
+ }
423
+ function parseSs(stdout) {
424
+ const found = [];
425
+ for (const line of stdout.split(`
426
+ `)) {
427
+ const columns = line.trim().split(/\s+/);
428
+ const address = hostPort(columns[3] ?? "");
429
+ if (address === null) {
430
+ continue;
431
+ }
432
+ for (const match of line.matchAll(/pid=(\d+)/g)) {
433
+ found.push({ pid: Number(match[1]), ...address });
434
+ }
435
+ }
436
+ return unique(found);
437
+ }
438
+ function parseLsofCwds(stdout) {
439
+ const cwds = new Map;
440
+ let pid = null;
441
+ for (const line of stdout.split(`
442
+ `)) {
443
+ if (line.startsWith("p")) {
444
+ pid = Number(line.slice(1));
445
+ } else if (line.startsWith("n") && pid !== null) {
446
+ cwds.set(pid, line.slice(1));
447
+ }
448
+ }
449
+ return cwds;
450
+ }
451
+ function hostPort(text) {
452
+ const at = text.lastIndexOf(":");
453
+ const port = Number(text.slice(at + 1));
454
+ if (at <= 0 || !Number.isInteger(port) || port <= 0) {
455
+ return null;
456
+ }
457
+ const host = text.slice(0, at).replace(/%.*?(\]?)$/, "$1");
458
+ return { host: ["0.0.0.0", "[::]", "*"].includes(host) ? "*" : host, port };
459
+ }
460
+ function unique(found) {
461
+ const seen = new Set;
462
+ return found.filter((each) => {
463
+ const key = `${each.pid} ${each.host} ${each.port}`;
464
+ if (seen.has(key)) {
465
+ return false;
466
+ }
467
+ seen.add(key);
468
+ return true;
469
+ });
470
+ }
471
+
472
+ // system/ps/node-ps.ts
473
+ class NodePs {
474
+ platform;
475
+ pid;
476
+ hostname = hostname();
477
+ args;
478
+ self;
479
+ proc;
480
+ constructor(opts = {}) {
481
+ this.proc = opts.proc ?? process;
482
+ this.platform = this.proc.platform;
483
+ this.pid = this.proc.pid;
484
+ this.args = this.proc.argv.slice(2);
485
+ this.self = this.proc.argv.slice(0, 2);
486
+ }
487
+ alive(pid) {
488
+ try {
489
+ this.proc.kill(pid, 0);
490
+ return true;
491
+ } catch (e) {
492
+ return e.code === "EPERM";
493
+ }
494
+ }
495
+ async spawn(argv, opts) {
496
+ const [cmd, args] = parse(argv);
497
+ if (reap !== null) {
498
+ opts?.signal?.throwIfAborted();
499
+ const child = Bun.spawn(argv, {
500
+ ...this.options(opts),
501
+ stdio: ["inherit", "inherit", "inherit"]
502
+ });
503
+ try {
504
+ const code = await exitOf(child, { reap });
505
+ opts?.signal?.throwIfAborted();
506
+ return { exitCode: code };
507
+ } finally {
508
+ child.unref();
509
+ }
510
+ }
511
+ const child = spawn(cmd, args, {
512
+ ...this.options(opts),
513
+ stdio: "inherit"
514
+ });
515
+ return { exitCode: await exitCode(child) };
516
+ }
517
+ async spawnCapture(argv, opts) {
518
+ const [cmd, args] = parse(argv);
519
+ if (reap !== null) {
520
+ return fileCapture(argv, {
521
+ ...this.options(opts),
522
+ input: opts?.stdin,
523
+ watcher: opts?.watcher
524
+ });
525
+ }
526
+ const child = spawn(cmd, args, {
527
+ ...this.options(opts),
528
+ stdio: [opts?.stdin === undefined ? "inherit" : "pipe", "pipe", "pipe"]
529
+ });
530
+ child.stdin?.on("error", () => {});
531
+ child.stdin?.end(opts?.stdin);
532
+ if (child.stdout === null || child.stderr === null) {
533
+ throw new Error("spawnCapture lost its output pipes");
534
+ }
535
+ let stdout = "";
536
+ let stderr = "";
537
+ child.stdout.setEncoding("utf8").on("data", (chunk) => {
538
+ stdout += chunk;
539
+ opts?.watcher?.stdout(chunk);
540
+ });
541
+ child.stderr.setEncoding("utf8").on("data", (chunk) => {
542
+ stderr += chunk;
543
+ opts?.watcher?.stderr(chunk);
544
+ });
545
+ return { exitCode: await exitCode(child), stdout, stderr };
546
+ }
547
+ start(argv, opts) {
548
+ const [cmd, args] = parse(argv);
549
+ if (reap !== null) {
550
+ return fileStart(argv, this.options(opts));
551
+ }
552
+ const child = spawn(cmd, args, {
553
+ ...this.options(opts),
554
+ stdio: "pipe"
555
+ });
556
+ child.stdin.on("error", () => {});
557
+ const exited = exitCode(child);
558
+ return {
559
+ pid: child.pid ?? null,
560
+ stdin: forgivingInput(child.stdin),
561
+ stdout: web(child.stdout),
562
+ stderr: web(child.stderr),
563
+ exited,
564
+ kill: (signal = "SIGTERM") => {
565
+ if (child.exitCode === null && child.signalCode === null) {
566
+ child.kill(signal);
567
+ }
568
+ }
569
+ };
570
+ }
571
+ startOnTerminal(argv, opts) {
572
+ parse(argv);
573
+ if (!process.versions.bun || this.platform === "win32") {
574
+ throw new Error("startOnTerminal needs Bun on a POSIX system");
575
+ }
576
+ let closed = false;
577
+ let reader;
578
+ const output = new ReadableStream({
579
+ start: (controller) => {
580
+ reader = controller;
581
+ }
582
+ });
583
+ const end = () => {
584
+ if (!closed) {
585
+ closed = true;
586
+ reader?.close();
587
+ }
588
+ };
589
+ const terminal = new Bun.Terminal({
590
+ cols: opts.cols,
591
+ rows: opts.rows,
592
+ data: (_, bytes) => {
593
+ if (!closed) {
594
+ reader?.enqueue(bytes.slice());
595
+ }
596
+ },
597
+ exit: end
598
+ });
599
+ const { cwd, env, timeout, signal } = this.options(opts);
600
+ const child = Bun.spawn([process.execPath, "-e", CLAIM, "--", ...argv], {
601
+ terminal,
602
+ cwd,
603
+ env,
604
+ timeout,
605
+ signal,
606
+ detached: true
607
+ });
608
+ const running = () => child.exitCode === null && child.signalCode === null;
609
+ return {
610
+ pid: child.pid,
611
+ output,
612
+ write: (data) => {
613
+ if (!terminal.closed) {
614
+ terminal.write(data);
615
+ }
616
+ },
617
+ resize: (cols, rows) => {
618
+ if (!terminal.closed) {
619
+ terminal.resize(cols, rows);
620
+ }
621
+ },
622
+ exited: child.exited.then(() => shellCode(child.exitCode, child.signalCode)),
623
+ kill: (signal = "SIGTERM") => {
624
+ if (running()) {
625
+ child.kill(signal);
626
+ }
627
+ },
628
+ close: () => {
629
+ terminal.close();
630
+ end();
631
+ }
632
+ };
633
+ }
634
+ async processes() {
635
+ if (this.platform === "win32") {
636
+ return [];
637
+ }
638
+ const { stdout } = await this.spawnCapture(["ps", "-A", "-o", "pid=,ppid=,pgid=,tpgid=,command="], { stdin: "" });
639
+ return stdout.split(`
640
+ `).flatMap((line) => {
641
+ const match = /^\s*(\d+)\s+(\d+)\s+(\d+)\s+(-?\d+)\s+(.*)$/.exec(line);
642
+ return match === null ? [] : [
643
+ {
644
+ pid: Number(match[1]),
645
+ ppid: Number(match[2]),
646
+ pgid: Number(match[3]),
647
+ tpgid: Number(match[4]),
648
+ command: match[5] ?? ""
649
+ }
650
+ ];
651
+ });
652
+ }
653
+ async listening() {
654
+ if (this.platform === "win32") {
655
+ return [];
656
+ }
657
+ const lsof = await this.spawnCapture(["lsof", "-nP", "-iTCP", "-sTCP:LISTEN", "-Fpn"], { stdin: "" }).catch(() => null);
658
+ if (lsof !== null && lsof.exitCode <= 1) {
659
+ const listeners = parseLsof(lsof.stdout);
660
+ const pids = [...new Set(listeners.map((each) => each.pid))];
661
+ const cwds = pids.length === 0 ? new Map : parseLsofCwds((await this.spawnCapture([
662
+ "lsof",
663
+ "-nP",
664
+ "-a",
665
+ "-d",
666
+ "cwd",
667
+ "-p",
668
+ pids.join(","),
669
+ "-Fpn"
670
+ ], { stdin: "" })).stdout);
671
+ return withCwds(listeners, (pid) => cwds.get(pid) ?? null);
672
+ }
673
+ if (this.platform === "linux") {
674
+ const ss = await this.spawnCapture(["ss", "-Hltnp"], {
675
+ stdin: ""
676
+ }).catch(() => null);
677
+ if (ss?.exitCode === 0) {
678
+ const listeners = parseSs(ss.stdout);
679
+ const cwds = new Map;
680
+ for (const { pid } of listeners) {
681
+ cwds.set(pid, await readlink(`/proc/${pid}/cwd`).catch(() => null));
682
+ }
683
+ return withCwds(listeners, (pid) => cwds.get(pid) ?? null);
684
+ }
685
+ }
686
+ return [];
687
+ }
688
+ options(opts) {
689
+ const env = { ...this.proc.env };
690
+ for (const name of opts?.unset ?? []) {
691
+ delete env[name];
692
+ }
693
+ return {
694
+ cwd: opts?.cwd,
695
+ env: { ...env, ...opts?.env },
696
+ timeout: opts?.timeoutMs,
697
+ signal: opts?.signal
698
+ };
699
+ }
700
+ cwd() {
701
+ return this.proc.cwd();
702
+ }
703
+ env(name) {
704
+ return this.proc.env[name];
705
+ }
706
+ columns() {
707
+ return this.proc.stdout?.columns;
708
+ }
709
+ cd(path) {
710
+ this.proc.chdir(path);
711
+ }
712
+ exit(code) {
713
+ this.proc.exit(code);
714
+ }
715
+ on(signal, handler) {
716
+ this.proc.on(signal, handler);
717
+ return disposables.callback(() => this.proc.off(signal, handler));
718
+ }
719
+ once(event, handler) {
720
+ this.proc.once(event, handler);
721
+ return disposables.callback(() => this.proc.off(event, handler));
722
+ }
723
+ }
724
+ function parse(argv) {
725
+ const [cmd, ...args] = argv;
726
+ if (!cmd) {
727
+ throw new Error("spawn requires a command");
728
+ }
729
+ return [cmd, args];
730
+ }
731
+ function web(readable) {
732
+ return Readable.toWeb(readable);
733
+ }
734
+ function forgivingInput(input) {
735
+ const writer = Writable.toWeb(input).getWriter();
736
+ return new WritableStream({
737
+ write: (bytes) => writer.write(bytes).catch(ignoreClosedInput),
738
+ close: () => writer.close().catch(ignoreClosedInput),
739
+ abort: (reason) => writer.abort(reason).catch(ignoreClosedInput)
740
+ });
741
+ }
742
+ function exitCode(child) {
743
+ return new Promise((resolve, reject) => {
744
+ child.on("close", (code, signal) => resolve(shellCode(code, signal)));
745
+ child.on("error", reject);
746
+ });
747
+ }
748
+ var CLAIM = `
749
+ import { dlopen, FFIType, ptr } from "bun:ffi";
750
+ const darwin = process.platform === "darwin";
751
+ const libc = dlopen(darwin ? "libc.dylib" : "libc.so.6", {
752
+ ioctl: { args: [FFIType.i32, FFIType.u64, FFIType.i32], returns: FFIType.i32 },
753
+ execvp: { args: [FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
754
+ });
755
+ const TIOCSCTTY = darwin ? 0x20007461 : 0x540e;
756
+ if (libc.symbols.ioctl(0, TIOCSCTTY, 0) !== 0) {
757
+ console.error("^C and resizes will not reach programs in this terminal");
758
+ }
759
+ const argv = process.argv.slice(1);
760
+ const strings = argv.map((arg) => Buffer.from(arg + "\\0"));
761
+ const pointers = new BigUint64Array(argv.length + 1);
762
+ strings.forEach((each, i) => { pointers[i] = BigInt(ptr(each)); });
763
+ libc.symbols.execvp(ptr(strings[0]), ptr(pointers));
764
+ console.error("could not run " + argv[0]);
765
+ process.exit(127);
766
+ `;
767
+ function withCwds(listeners, cwd) {
768
+ return listeners.map((each) => ({ ...each, cwd: cwd(each.pid) }));
769
+ }
770
+
771
+ // system/lock/file-lock.ts
772
+ class FileLock {
773
+ path;
774
+ held = false;
775
+ listeners = null;
776
+ stalenessMs;
777
+ pollMs;
778
+ pidOnly;
779
+ fs;
780
+ ps;
781
+ log;
782
+ constructor(path, opts = {}) {
783
+ this.path = path;
784
+ this.fs = opts.fs ?? new NodeFs;
785
+ this.ps = opts.ps ?? new NodePs;
786
+ this.log = opts.log ?? new ConsoleLogger;
787
+ this.stalenessMs = opts.stalenessMs ?? 60000;
788
+ this.pollMs = opts.pollMs ?? 2000;
789
+ this.pidOnly = opts.pidOnly ?? false;
790
+ }
791
+ async acquire() {
792
+ let unreadableSince = null;
793
+ let sleepMs = 5;
794
+ for (let waited = false;; waited = true) {
795
+ try {
796
+ await this.fs.mkdir(this.path, { recursive: false });
797
+ } catch {
798
+ const holder = await this.holder();
799
+ if (holder === null) {
800
+ unreadableSince ??= Date.now();
801
+ if (Date.now() - unreadableSince > this.stalenessMs) {
802
+ unreadableSince = null;
803
+ this.steal("it has no holder metadata");
804
+ continue;
805
+ }
806
+ } else if (this.isStale(holder)) {
807
+ this.steal(`holder pid ${holder.pid} is gone or stale`);
808
+ continue;
809
+ }
810
+ await sleep(Duration.ms(sleepMs));
811
+ sleepMs = Math.min(sleepMs * 2, this.pollMs);
812
+ continue;
813
+ }
814
+ if (waited) {
815
+ this.log.error(`acquired ${this.path} after waiting`);
816
+ }
817
+ break;
818
+ }
819
+ this.held = true;
820
+ await this.fs.write(this.holderPath, JSON.stringify({
821
+ pid: this.ps.pid,
822
+ hostname: this.ps.hostname,
823
+ at: new Date().toISOString()
824
+ }));
825
+ this.registerCleanup();
826
+ }
827
+ async release() {
828
+ this.listeners?.dispose();
829
+ this.listeners = null;
830
+ if (this.held) {
831
+ this.held = false;
832
+ await this.fs.rm(this.path, { recursive: true, force: true });
833
+ }
834
+ }
835
+ async releaseIfOurs() {
836
+ const holder = await this.holder();
837
+ if (holder?.pid === this.ps.pid && this.sameHost(holder)) {
838
+ this.held = true;
839
+ await this.release();
840
+ }
841
+ }
842
+ get holderPath() {
843
+ return `${this.path}/holder.json`;
844
+ }
845
+ async holder() {
846
+ const raw = await this.fs.read(this.holderPath).catch(() => null);
847
+ try {
848
+ return raw === null ? null : JSON.parse(raw);
849
+ } catch {
850
+ return null;
851
+ }
852
+ }
853
+ isStale(holder) {
854
+ if (this.sameHost(holder)) {
855
+ return !this.ps.alive(holder.pid);
856
+ }
857
+ return Date.now() - Date.parse(holder.at) > this.stalenessMs;
858
+ }
859
+ sameHost(holder) {
860
+ return this.pidOnly || holder.hostname === this.ps.hostname;
861
+ }
862
+ steal(why) {
863
+ this.log.error(color.yellow(`stealing stale lock ${this.path} (${why})`));
864
+ rmSync2(this.path, { recursive: true, force: true });
865
+ }
866
+ registerCleanup() {
867
+ if (this.listeners !== null) {
868
+ return;
869
+ }
870
+ const listeners = new Disposer;
871
+ this.listeners = listeners;
872
+ const drop = () => {
873
+ if (this.held) {
874
+ this.held = false;
875
+ rmSync2(this.path, { recursive: true, force: true });
876
+ }
877
+ };
878
+ listeners.use(this.ps.once("exit", drop));
879
+ for (const signal of ["SIGINT", "SIGTERM"]) {
880
+ listeners.use(this.ps.on(signal, () => {
881
+ drop();
882
+ this.ps.exit(130);
883
+ }));
884
+ }
885
+ listeners.use(this.ps.on("uncaughtException", (error) => {
886
+ drop();
887
+ this.log.error(error);
888
+ this.ps.exit(1);
889
+ }));
890
+ }
891
+ }
892
+
893
+ // system/heavy/heavy-jobs.ts
894
+ class HeavyJobs {
895
+ #path;
896
+ #opts;
897
+ #ids = 0;
898
+ static under(dir, {
899
+ fs,
900
+ ps,
901
+ log,
902
+ cap,
903
+ held
904
+ }) {
905
+ return new HeavyJobs(`${dir}/heavy.json`, {
906
+ fs,
907
+ ps,
908
+ log,
909
+ lock: new FileLock(`${dir}/heavy.lock`, { fs, ps, log }),
910
+ cap,
911
+ held
912
+ });
913
+ }
914
+ constructor(path, opts) {
915
+ this.#path = path;
916
+ this.#opts = opts;
917
+ }
918
+ async take({
919
+ what,
920
+ task = null
921
+ }) {
922
+ const { ps, log, held, now = () => new Date } = this.#opts;
923
+ if (ps.env(held) !== undefined) {
924
+ return { env: {}, [Symbol.asyncDispose]: async () => {} };
925
+ }
926
+ const entry = {
927
+ id: `${ps.pid}-${this.#ids++}`,
928
+ what,
929
+ task,
930
+ pid: ps.pid,
931
+ since: now().toISOString()
932
+ };
933
+ let told = false;
934
+ let wait = Duration2.ms(50);
935
+ for (;; ) {
936
+ const holders = await this.#change((file) => {
937
+ const waiting = file.waiting.some((each) => each.id === entry.id) ? file.waiting : [...file.waiting, entry];
938
+ const ahead = waiting.findIndex((each) => each.id === entry.id);
939
+ if (file.running.length + ahead < this.#opts.cap) {
940
+ return {
941
+ file: {
942
+ running: [
943
+ ...file.running,
944
+ { ...entry, since: now().toISOString() }
945
+ ],
946
+ waiting: waiting.filter((each) => each.id !== entry.id)
947
+ },
948
+ holders: null
949
+ };
950
+ }
951
+ return { file: { ...file, waiting }, holders: file.running };
952
+ });
953
+ if (holders === null) {
954
+ break;
955
+ }
956
+ if (!told) {
957
+ told = true;
958
+ log.info([
959
+ `waiting for ${this.#opts.cap === 1 ? "the heavy-job slot" : `one of ${this.#opts.cap} heavy-job slots`} for ${what}, held by:`,
960
+ ...holders.map((each) => ` ${describe(each)}`)
961
+ ].join(`
962
+ `));
963
+ }
964
+ await sleep2(wait);
965
+ wait = Duration2.ms(Math.min(wait.ms * 2, POLL.ms));
966
+ }
967
+ if (told) {
968
+ log.info(`took a heavy-job slot for ${what}`);
969
+ }
970
+ return {
971
+ env: { [held]: entry.id },
972
+ [Symbol.asyncDispose]: () => this.#give(entry.id)
973
+ };
974
+ }
975
+ async read() {
976
+ const file = this.#living(await this.#read());
977
+ return { cap: this.#opts.cap, ...file };
978
+ }
979
+ async#give(id) {
980
+ await this.#change((file) => ({
981
+ file: {
982
+ running: file.running.filter((each) => each.id !== id),
983
+ waiting: file.waiting.filter((each) => each.id !== id)
984
+ },
985
+ holders: null
986
+ }));
987
+ }
988
+ async#change(change) {
989
+ const { fs, lock } = this.#opts;
990
+ await fs.mkdir(this.#path.slice(0, this.#path.lastIndexOf("/")));
991
+ await lock.acquire();
992
+ try {
993
+ const { file, holders } = change(this.#living(await this.#read()));
994
+ await fs.write(this.#path, JSON.stringify(file));
995
+ return holders;
996
+ } finally {
997
+ await lock.release();
998
+ }
999
+ }
1000
+ #living(file) {
1001
+ const alive = (each) => this.#opts.ps.alive(each.pid);
1002
+ return {
1003
+ running: file.running.filter(alive),
1004
+ waiting: file.waiting.filter(alive)
1005
+ };
1006
+ }
1007
+ async#read() {
1008
+ const raw = await this.#opts.fs.read(this.#path).catch(() => null);
1009
+ try {
1010
+ return raw === null ? empty() : slotsFile(JSON.parse(raw));
1011
+ } catch {
1012
+ return empty();
1013
+ }
1014
+ }
1015
+ }
1016
+ var POLL = Duration2.secs(1);
1017
+ var empty = () => ({ running: [], waiting: [] });
1018
+ function slotsFile(value) {
1019
+ const { running, waiting } = value ?? {};
1020
+ if (!isEntries(running) || !isEntries(waiting)) {
1021
+ throw new Error("not a heavy-job slots file");
1022
+ }
1023
+ return { running, waiting };
1024
+ }
1025
+ function isEntries(value) {
1026
+ return Array.isArray(value) && value.every(isEntry);
1027
+ }
1028
+ function isEntry(value) {
1029
+ if (typeof value !== "object" || value === null) {
1030
+ return false;
1031
+ }
1032
+ const each = value;
1033
+ return typeof each.id === "string" && typeof each.what === "string" && (typeof each.task === "string" || each.task === null) && typeof each.pid === "number" && typeof each.since === "string";
1034
+ }
1035
+ function describe(job) {
1036
+ return `${job.what}${job.task === null ? "" : ` in ${job.task}`} (pid ${job.pid}, since ${job.since})`;
1037
+ }
1038
+ // system/host-mapper/file-host-mapper.ts
1039
+ import { ConsoleLogger as ConsoleLogger2 } from "../log/index.js";
1040
+ var HOSTS_PATH_UNIX = "/etc/hosts";
1041
+ var HOSTS_PATH_WINDOWS = "C:\\Windows\\System32\\drivers\\etc\\hosts";
1042
+
1043
+ class FileHostMapper {
1044
+ path;
1045
+ fs;
1046
+ ps;
1047
+ log;
1048
+ constructor(path, opts = {}) {
1049
+ this.path = path;
1050
+ this.fs = opts.fs ?? new NodeFs;
1051
+ this.ps = opts.ps ?? new NodePs;
1052
+ this.log = opts.log ?? new ConsoleLogger2;
1053
+ }
1054
+ static default(opts = {}) {
1055
+ const ps = opts.ps ?? new NodePs;
1056
+ switch (ps.platform) {
1057
+ case "darwin":
1058
+ case "linux":
1059
+ return new FileHostMapper(HOSTS_PATH_UNIX, { ...opts, ps });
1060
+ case "win32":
1061
+ return new FileHostMapper(HOSTS_PATH_WINDOWS, { ...opts, ps });
1062
+ default:
1063
+ throw new Error(`Unsupported platform: ${ps.platform}`);
1064
+ }
1065
+ }
1066
+ async map(hostname, ip) {
1067
+ const hosts = await this.fs.read(this.path);
1068
+ const lines = hosts.split(`
1069
+ `);
1070
+ const pattern = new RegExp(`^(\\d+\\.\\d+\\.\\d+\\.\\d+)\\s+${hostname}$`);
1071
+ let found = false;
1072
+ let changed = false;
1073
+ const updatedLines = lines.map((line) => {
1074
+ const match = line.match(pattern);
1075
+ if (match) {
1076
+ found = true;
1077
+ if (match[1] !== ip) {
1078
+ changed = true;
1079
+ return `${ip} ${hostname}`;
1080
+ }
1081
+ }
1082
+ return line;
1083
+ });
1084
+ if (!found) {
1085
+ updatedLines.push(`${ip} ${hostname}`);
1086
+ changed = true;
1087
+ }
1088
+ if (!changed) {
1089
+ return;
1090
+ }
1091
+ const updatedHosts = updatedLines.join(`
1092
+ `);
1093
+ if (this.ps.platform === "win32") {
1094
+ await this.fs.write(this.path, updatedHosts);
1095
+ } else {
1096
+ await this.writeHostFileUnix(updatedHosts);
1097
+ }
1098
+ }
1099
+ async writeHostFileUnix(contents) {
1100
+ const tempFile = `/tmp/hosts-${Date.now()}`;
1101
+ await this.fs.write(tempFile, contents);
1102
+ this.log.info(`requesting sudo to update ${this.path}`);
1103
+ const copyResult = await this.ps.spawn(["sudo", "cp", tempFile, this.path]);
1104
+ if (copyResult.exitCode !== 0) {
1105
+ throw new Error(`failed to update ${this.path}`);
1106
+ }
1107
+ await this.fs.rm(tempFile);
1108
+ }
1109
+ }
1110
+ // system/host-mapper/noop-host-mapper.ts
1111
+ class NoopHostMapper {
1112
+ map() {
1113
+ return Promise.resolve();
1114
+ }
1115
+ }
1116
+ // system/ip-provider/darwin-ip-provider.ts
1117
+ class DarwinIpProvider {
1118
+ ps;
1119
+ constructor(opts = {}) {
1120
+ this.ps = opts.ps ?? new NodePs;
1121
+ if (this.ps.platform !== "darwin") {
1122
+ throw new Error("DarwinIpProvider is only supported on macOS");
1123
+ }
1124
+ }
1125
+ async get() {
1126
+ const result = await this.ps.spawnCapture(["ipconfig", "getifaddr", "en0"]);
1127
+ if (result.exitCode !== 0) {
1128
+ throw new Error("failed to get IP address from en0");
1129
+ }
1130
+ const ip = result.stdout.trim();
1131
+ if (!ip) {
1132
+ throw new Error("no IP address found on en0");
1133
+ }
1134
+ return ip;
1135
+ }
1136
+ }
1137
+ // system/ip-provider/linux-ip-provider.ts
1138
+ class LinuxIpProvider {
1139
+ ps;
1140
+ constructor(opts = {}) {
1141
+ this.ps = opts.ps ?? new NodePs;
1142
+ if (this.ps.platform !== "linux") {
1143
+ throw new Error("LinuxIpProvider is only supported on Linux");
1144
+ }
1145
+ }
1146
+ async get() {
1147
+ const result = await this.ps.spawnCapture(["hostname", "-I"]);
1148
+ if (result.exitCode !== 0) {
1149
+ throw new Error("failed to get IP address");
1150
+ }
1151
+ const ip = result.stdout.trim().split(/\s+/)[0];
1152
+ if (!ip) {
1153
+ throw new Error("no IP address found");
1154
+ }
1155
+ return ip;
1156
+ }
1157
+ }
1158
+ // system/ip-provider/win32-ip-provider.ts
1159
+ class Win32IpProvider {
1160
+ ps;
1161
+ constructor(opts = {}) {
1162
+ this.ps = opts.ps ?? new NodePs;
1163
+ if (this.ps.platform !== "win32") {
1164
+ throw new Error("Win32IpProvider is only supported on Windows");
1165
+ }
1166
+ }
1167
+ async get() {
1168
+ const result = await this.ps.spawnCapture([
1169
+ "powershell",
1170
+ "-Command",
1171
+ "(Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notmatch 'Loopback' -and $_.PrefixOrigin -ne 'WellKnown' } | Select-Object -First 1).IPAddress"
1172
+ ]);
1173
+ if (result.exitCode !== 0) {
1174
+ throw new Error("failed to get IP address");
1175
+ }
1176
+ const ip = result.stdout.trim();
1177
+ if (!ip) {
1178
+ throw new Error("no IP address found");
1179
+ }
1180
+ return ip;
1181
+ }
1182
+ }
1183
+
1184
+ // system/ip-provider/platform-ip-provider.ts
1185
+ class PlatformIpProvider {
1186
+ provider;
1187
+ constructor(opts = {}) {
1188
+ const ps = opts.ps ?? new NodePs;
1189
+ switch (ps.platform) {
1190
+ case "darwin":
1191
+ this.provider = new DarwinIpProvider({ ps });
1192
+ break;
1193
+ case "linux":
1194
+ this.provider = new LinuxIpProvider({ ps });
1195
+ break;
1196
+ case "win32":
1197
+ this.provider = new Win32IpProvider({ ps });
1198
+ break;
1199
+ default:
1200
+ throw new Error(`Unsupported platform: ${ps.platform}`);
1201
+ }
1202
+ }
1203
+ get() {
1204
+ return this.provider.get();
1205
+ }
1206
+ }
1207
+ // system/ip-provider/sequential-ip-provider.ts
1208
+ class SequentialIpProvider {
1209
+ ipProviders;
1210
+ constructor(ipProviders) {
1211
+ this.ipProviders = ipProviders;
1212
+ }
1213
+ async get() {
1214
+ for (const provider of this.ipProviders) {
1215
+ try {
1216
+ const ip = await provider.get();
1217
+ if (ip) {
1218
+ return ip;
1219
+ }
1220
+ } catch {}
1221
+ }
1222
+ return "";
1223
+ }
1224
+ }
1225
+ // system/ip-provider/static-ip-provider.ts
1226
+ class StaticIpProvider {
1227
+ ip;
1228
+ constructor(ip) {
1229
+ this.ip = ip;
1230
+ }
1231
+ static localhost() {
1232
+ return new StaticIpProvider("0.0.0.0");
1233
+ }
1234
+ static empty() {
1235
+ return new StaticIpProvider("");
1236
+ }
1237
+ async get() {
1238
+ return this.ip;
1239
+ }
1240
+ }
1241
+ // system/lock/memory-lock.ts
1242
+ class MemoryLock {
1243
+ tail = Promise.resolve();
1244
+ handOff = null;
1245
+ async acquire() {
1246
+ const { promise, resolve } = Promise.withResolvers();
1247
+ const ahead = this.tail;
1248
+ this.tail = promise;
1249
+ await ahead;
1250
+ this.handOff = resolve;
1251
+ }
1252
+ release() {
1253
+ this.handOff?.();
1254
+ this.handOff = null;
1255
+ return Promise.resolve();
1256
+ }
1257
+ releaseIfOurs() {
1258
+ return this.release();
1259
+ }
1260
+ }
1261
+ // system/port-provider/open-port-provider.ts
1262
+ import { createServer } from "node:net";
1263
+ import { assert } from "../assert/index.js";
1264
+ var MAX_PORT = 65535;
1265
+
1266
+ class OpenPortProvider {
1267
+ from;
1268
+ to;
1269
+ host;
1270
+ constructor({ from, to = from, host }) {
1271
+ assert.integer(from, `port ${from} is not a whole number`);
1272
+ assert.integer(to, `port ${to} is not a whole number`);
1273
+ assert.inRange(from, 0, MAX_PORT, `port ${from} is outside 0 to ${MAX_PORT}`);
1274
+ assert.inRange(to, from, MAX_PORT, `no ports between ${from} and ${to}`);
1275
+ this.from = from;
1276
+ this.to = to;
1277
+ this.host = host;
1278
+ }
1279
+ static span({ from, span, host }) {
1280
+ assert.integer(span, `a span of ${span} is not a whole number`);
1281
+ assert.inRange(span, 1, MAX_PORT + 1, `a span of ${span} covers no ports`);
1282
+ return new OpenPortProvider({
1283
+ from,
1284
+ to: Math.min(from + span - 1, MAX_PORT),
1285
+ host
1286
+ });
1287
+ }
1288
+ static any() {
1289
+ return new OpenPortProvider({ from: 0 });
1290
+ }
1291
+ async get() {
1292
+ for (let port = this.from;port <= this.to; port++) {
1293
+ if (await this.open(port) && (this.host === undefined || await this.open(port, this.host))) {
1294
+ return port;
1295
+ }
1296
+ }
1297
+ throw new Error(`no open port between ${this.from} and ${this.to}`);
1298
+ }
1299
+ open(port, host) {
1300
+ return new Promise((resolve) => {
1301
+ const socket = createServer();
1302
+ socket.once("error", () => resolve(false));
1303
+ socket.listen(port, host, () => socket.close(() => resolve(true)));
1304
+ });
1305
+ }
1306
+ }
1307
+ // system/undumpable.ts
1308
+ var PR_GET_DUMPABLE = 3;
1309
+ var PR_SET_DUMPABLE = 4;
1310
+ var PT_DENY_ATTACH = 31;
1311
+ async function makeUndumpable(opts = {}) {
1312
+ const platform = opts.platform ?? process.platform;
1313
+ if (platform === "linux") {
1314
+ const { dlopen, FFIType } = await import("bun:ffi");
1315
+ const { symbols } = openLibc(dlopen, {
1316
+ prctl: {
1317
+ args: [FFIType.i32, FFIType.u64, FFIType.u64, FFIType.u64, FFIType.u64],
1318
+ returns: FFIType.i32
1319
+ }
1320
+ });
1321
+ if (symbols.prctl(PR_SET_DUMPABLE, 0, 0, 0, 0) !== 0 || symbols.prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) !== 0) {
1322
+ throw new Error("prctl(PR_SET_DUMPABLE, 0) did not take");
1323
+ }
1324
+ return { undumpable: true, how: "prctl(PR_SET_DUMPABLE, 0)" };
1325
+ }
1326
+ if (platform === "darwin") {
1327
+ const { dlopen, FFIType } = await import("bun:ffi");
1328
+ const { symbols } = dlopen("libc.dylib", {
1329
+ ptrace: {
1330
+ args: [FFIType.i32, FFIType.i32, FFIType.ptr, FFIType.i32],
1331
+ returns: FFIType.i32
1332
+ }
1333
+ });
1334
+ if (symbols.ptrace(PT_DENY_ATTACH, 0, null, 0) !== 0) {
1335
+ throw new Error("ptrace(PT_DENY_ATTACH) failed");
1336
+ }
1337
+ return { undumpable: true, how: "ptrace(PT_DENY_ATTACH)" };
1338
+ }
1339
+ return {
1340
+ undumpable: false,
1341
+ why: `${platform} has no call that keeps a user's own processes out of each other's memory`
1342
+ };
1343
+ }
1344
+ function openLibc(dlopen, symbols) {
1345
+ try {
1346
+ return dlopen("libc.so.6", symbols);
1347
+ } catch {
1348
+ return dlopen("libc.so", symbols);
1349
+ }
1350
+ }
1351
+ // system/walk.ts
1352
+ async function* walk(dir, opts = {}) {
1353
+ const files = opts.fs ?? new NodeFs;
1354
+ for (const entry of await files.readdir(dir)) {
1355
+ if (entry.startsWith(".") || entry === "node_modules") {
1356
+ continue;
1357
+ }
1358
+ const path = `${dir}/${entry}`;
1359
+ if ((await files.stat(path)).isDirectory()) {
1360
+ yield* walk(path, { fs: files });
1361
+ } else {
1362
+ yield path;
1363
+ }
1364
+ }
1365
+ }
1366
+ export {
1367
+ DarwinIpProvider,
1368
+ FileHostMapper,
1369
+ FileLock,
1370
+ HeavyJobs,
1371
+ LinuxIpProvider,
1372
+ MAX_PORT,
1373
+ MemoryLock,
1374
+ NodeFs,
1375
+ NodeGlob,
1376
+ NodePs,
1377
+ NoopHostMapper,
1378
+ OpenPortProvider,
1379
+ PlatformIpProvider,
1380
+ SequentialIpProvider,
1381
+ StaticIpProvider,
1382
+ Win32IpProvider,
1383
+ makeUndumpable,
1384
+ walk
1385
+ };