@nordhavnhq/runner 0.0.0-stage → 0.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/bin/cliclick +0 -0
  2. package/dist/brand.d.ts +5 -0
  3. package/dist/brand.js +18 -0
  4. package/dist/cli/agent.d.ts +9 -0
  5. package/dist/cli/agent.js +80 -0
  6. package/dist/cli/folder.d.ts +2 -0
  7. package/dist/cli/folder.js +103 -0
  8. package/dist/cli/init.d.ts +2 -0
  9. package/dist/cli/init.js +67 -0
  10. package/dist/cli/lifecycle.d.ts +3 -0
  11. package/dist/cli/lifecycle.js +149 -0
  12. package/dist/cli/link.d.ts +42 -0
  13. package/dist/cli/link.js +314 -0
  14. package/dist/cli/logs.d.ts +2 -0
  15. package/dist/cli/logs.js +147 -0
  16. package/dist/cli/prompts.d.ts +7 -0
  17. package/dist/cli/prompts.js +13 -0
  18. package/dist/cli/ps.d.ts +2 -0
  19. package/dist/cli/ps.js +81 -0
  20. package/dist/cli/relay.d.ts +4 -0
  21. package/dist/cli/relay.js +29 -0
  22. package/dist/cli/update.d.ts +6 -0
  23. package/dist/cli/update.js +131 -0
  24. package/dist/config.d.ts +166 -0
  25. package/dist/config.js +383 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +145 -0
  28. package/dist/legacy-env.d.ts +4 -0
  29. package/dist/legacy-env.js +32 -0
  30. package/dist/paths.d.ts +37 -0
  31. package/dist/paths.js +92 -0
  32. package/dist/runtime/daemon.d.ts +57 -0
  33. package/dist/runtime/daemon.js +159 -0
  34. package/dist/runtime/dev-start.d.ts +31 -0
  35. package/dist/runtime/dev-start.js +110 -0
  36. package/dist/runtime/file-claims.d.ts +58 -0
  37. package/dist/runtime/file-claims.js +174 -0
  38. package/dist/runtime/fs-browse.d.ts +18 -0
  39. package/dist/runtime/fs-browse.js +104 -0
  40. package/dist/runtime/fs-checkout.d.ts +154 -0
  41. package/dist/runtime/fs-checkout.js +1049 -0
  42. package/dist/runtime/fs-git-index.d.ts +22 -0
  43. package/dist/runtime/fs-git-index.js +133 -0
  44. package/dist/runtime/fs-git.d.ts +16 -0
  45. package/dist/runtime/fs-git.js +424 -0
  46. package/dist/runtime/git-relay.d.ts +46 -0
  47. package/dist/runtime/git-relay.js +259 -0
  48. package/dist/runtime/git-unpushed.d.ts +36 -0
  49. package/dist/runtime/git-unpushed.js +93 -0
  50. package/dist/runtime/node-version.d.ts +12 -0
  51. package/dist/runtime/node-version.js +39 -0
  52. package/dist/runtime/preview-tunnel.d.ts +16 -0
  53. package/dist/runtime/preview-tunnel.js +135 -0
  54. package/dist/runtime/processes.d.ts +61 -0
  55. package/dist/runtime/processes.js +408 -0
  56. package/dist/runtime/project-node-download.d.ts +17 -0
  57. package/dist/runtime/project-node-download.js +137 -0
  58. package/dist/runtime/project-node.d.ts +65 -0
  59. package/dist/runtime/project-node.js +223 -0
  60. package/dist/runtime/reap-scratch.d.ts +22 -0
  61. package/dist/runtime/reap-scratch.js +112 -0
  62. package/dist/runtime/spill-tool-output.d.ts +14 -0
  63. package/dist/runtime/spill-tool-output.js +84 -0
  64. package/dist/runtime/up.d.ts +6 -0
  65. package/dist/runtime/up.js +1325 -0
  66. package/dist/tools/_coerce.d.ts +2 -0
  67. package/dist/tools/_coerce.js +26 -0
  68. package/dist/tools/_commit-scope.d.ts +14 -0
  69. package/dist/tools/_commit-scope.js +70 -0
  70. package/dist/tools/_jail.d.ts +68 -0
  71. package/dist/tools/_jail.js +209 -0
  72. package/dist/tools/_output.d.ts +24 -0
  73. package/dist/tools/_output.js +48 -0
  74. package/dist/tools/_ripgrep.d.ts +46 -0
  75. package/dist/tools/_ripgrep.js +148 -0
  76. package/dist/tools/_run-worktree.d.ts +10 -0
  77. package/dist/tools/_run-worktree.js +27 -0
  78. package/dist/tools/_shell-words.d.ts +15 -0
  79. package/dist/tools/_shell-words.js +43 -0
  80. package/dist/tools/_sonar/astro.d.ts +6 -0
  81. package/dist/tools/_sonar/astro.js +45 -0
  82. package/dist/tools/_sonar/blade.d.ts +3 -0
  83. package/dist/tools/_sonar/blade.js +53 -0
  84. package/dist/tools/_sonar/build.d.ts +44 -0
  85. package/dist/tools/_sonar/build.js +147 -0
  86. package/dist/tools/_sonar/changed.d.ts +21 -0
  87. package/dist/tools/_sonar/changed.js +230 -0
  88. package/dist/tools/_sonar/diagnose/delta.d.ts +27 -0
  89. package/dist/tools/_sonar/diagnose/delta.js +64 -0
  90. package/dist/tools/_sonar/diagnose/detect.d.ts +39 -0
  91. package/dist/tools/_sonar/diagnose/detect.js +117 -0
  92. package/dist/tools/_sonar/diagnose/index.d.ts +13 -0
  93. package/dist/tools/_sonar/diagnose/index.js +217 -0
  94. package/dist/tools/_sonar/diagnose/lint-worker.d.ts +1 -0
  95. package/dist/tools/_sonar/diagnose/lint-worker.js +48 -0
  96. package/dist/tools/_sonar/diagnose/pool.d.ts +22 -0
  97. package/dist/tools/_sonar/diagnose/pool.js +149 -0
  98. package/dist/tools/_sonar/diagnose/rules.d.ts +23 -0
  99. package/dist/tools/_sonar/diagnose/rules.js +131 -0
  100. package/dist/tools/_sonar/diagnose/types-worker.d.ts +1 -0
  101. package/dist/tools/_sonar/diagnose/types-worker.js +183 -0
  102. package/dist/tools/_sonar/files.d.ts +14 -0
  103. package/dist/tools/_sonar/files.js +121 -0
  104. package/dist/tools/_sonar/graph.d.ts +34 -0
  105. package/dist/tools/_sonar/graph.js +164 -0
  106. package/dist/tools/_sonar/hints.d.ts +116 -0
  107. package/dist/tools/_sonar/hints.js +545 -0
  108. package/dist/tools/_sonar/imports.d.ts +38 -0
  109. package/dist/tools/_sonar/imports.js +275 -0
  110. package/dist/tools/_sonar/index.d.ts +79 -0
  111. package/dist/tools/_sonar/index.js +462 -0
  112. package/dist/tools/_sonar/keys.d.ts +5 -0
  113. package/dist/tools/_sonar/keys.js +248 -0
  114. package/dist/tools/_sonar/laravel-routes.d.ts +15 -0
  115. package/dist/tools/_sonar/laravel-routes.js +263 -0
  116. package/dist/tools/_sonar/laravel.d.ts +64 -0
  117. package/dist/tools/_sonar/laravel.js +326 -0
  118. package/dist/tools/_sonar/location.d.ts +33 -0
  119. package/dist/tools/_sonar/location.js +137 -0
  120. package/dist/tools/_sonar/map.d.ts +43 -0
  121. package/dist/tools/_sonar/map.js +212 -0
  122. package/dist/tools/_sonar/parse.d.ts +3 -0
  123. package/dist/tools/_sonar/parse.js +76 -0
  124. package/dist/tools/_sonar/prewarm.d.ts +9 -0
  125. package/dist/tools/_sonar/prewarm.js +96 -0
  126. package/dist/tools/_sonar/prisma.d.ts +9 -0
  127. package/dist/tools/_sonar/prisma.js +51 -0
  128. package/dist/tools/_sonar/refs.d.ts +7 -0
  129. package/dist/tools/_sonar/refs.js +273 -0
  130. package/dist/tools/_sonar/render.d.ts +66 -0
  131. package/dist/tools/_sonar/render.js +498 -0
  132. package/dist/tools/_sonar/resolve.d.ts +63 -0
  133. package/dist/tools/_sonar/resolve.js +402 -0
  134. package/dist/tools/_sonar/roots.d.ts +4 -0
  135. package/dist/tools/_sonar/roots.js +42 -0
  136. package/dist/tools/_sonar/routes.d.ts +5 -0
  137. package/dist/tools/_sonar/routes.js +247 -0
  138. package/dist/tools/_sonar/serve.d.ts +12 -0
  139. package/dist/tools/_sonar/serve.js +104 -0
  140. package/dist/tools/_sonar/suggest.d.ts +23 -0
  141. package/dist/tools/_sonar/suggest.js +114 -0
  142. package/dist/tools/_sonar/tests.d.ts +21 -0
  143. package/dist/tools/_sonar/tests.js +134 -0
  144. package/dist/tools/_sonar/tsconfig.d.ts +34 -0
  145. package/dist/tools/_sonar/tsconfig.js +188 -0
  146. package/dist/tools/_sonar/types.d.ts +81 -0
  147. package/dist/tools/_sonar/types.js +6 -0
  148. package/dist/tools/_symbols.d.ts +27 -0
  149. package/dist/tools/_symbols.js +461 -0
  150. package/dist/tools/_test-report.d.ts +47 -0
  151. package/dist/tools/_test-report.js +203 -0
  152. package/dist/tools/_touched.d.ts +44 -0
  153. package/dist/tools/_touched.js +195 -0
  154. package/dist/tools/_upload.d.ts +26 -0
  155. package/dist/tools/_upload.js +132 -0
  156. package/dist/tools/_worktree-setup.d.ts +29 -0
  157. package/dist/tools/_worktree-setup.js +204 -0
  158. package/dist/tools/browser.d.ts +2 -0
  159. package/dist/tools/browser.js +8 -0
  160. package/dist/tools/commit-guard.d.ts +44 -0
  161. package/dist/tools/commit-guard.js +165 -0
  162. package/dist/tools/computer.d.ts +13 -0
  163. package/dist/tools/computer.js +952 -0
  164. package/dist/tools/console.d.ts +44 -0
  165. package/dist/tools/console.js +739 -0
  166. package/dist/tools/database.d.ts +28 -0
  167. package/dist/tools/database.js +152 -0
  168. package/dist/tools/filesystem.d.ts +36 -0
  169. package/dist/tools/filesystem.js +506 -0
  170. package/dist/tools/git-tag.d.ts +10 -0
  171. package/dist/tools/git-tag.js +164 -0
  172. package/dist/tools/git.d.ts +52 -0
  173. package/dist/tools/git.js +1272 -0
  174. package/dist/tools/http.d.ts +12 -0
  175. package/dist/tools/http.js +119 -0
  176. package/dist/tools/image.d.ts +8 -0
  177. package/dist/tools/image.js +551 -0
  178. package/dist/tools/index.d.ts +13 -0
  179. package/dist/tools/index.js +58 -0
  180. package/dist/tools/outline.d.ts +20 -0
  181. package/dist/tools/outline.js +98 -0
  182. package/dist/tools/search.d.ts +17 -0
  183. package/dist/tools/search.js +391 -0
  184. package/dist/tools/sonar.d.ts +17 -0
  185. package/dist/tools/sonar.js +231 -0
  186. package/dist/tools/testing.d.ts +36 -0
  187. package/dist/tools/testing.js +273 -0
  188. package/dist/tools/upload.d.ts +8 -0
  189. package/dist/tools/upload.js +106 -0
  190. package/dist/tools/webcam.d.ts +28 -0
  191. package/dist/tools/webcam.js +967 -0
  192. package/dist/update/install-kind.d.ts +35 -0
  193. package/dist/update/install-kind.js +109 -0
  194. package/dist/update/install.d.ts +32 -0
  195. package/dist/update/install.js +187 -0
  196. package/dist/update/manifest.d.ts +18 -0
  197. package/dist/update/manifest.js +73 -0
  198. package/dist/update/peers.d.ts +18 -0
  199. package/dist/update/peers.js +43 -0
  200. package/dist/update/policy.d.ts +20 -0
  201. package/dist/update/policy.js +49 -0
  202. package/dist/update/supervisor.d.ts +25 -0
  203. package/dist/update/supervisor.js +83 -0
  204. package/dist/update/updater.d.ts +44 -0
  205. package/dist/update/updater.js +116 -0
  206. package/dist/utils/format.d.ts +50 -0
  207. package/dist/utils/format.js +190 -0
  208. package/dist/version.d.ts +17 -0
  209. package/dist/version.js +63 -0
  210. package/dist/version.json +5 -0
  211. package/node_modules/@nordhavnhq/runner-browser/dist/act-tools.d.ts +15 -0
  212. package/node_modules/@nordhavnhq/runner-browser/dist/act-tools.js +541 -0
  213. package/node_modules/@nordhavnhq/runner-browser/dist/cast-hub.d.ts +25 -0
  214. package/node_modules/@nordhavnhq/runner-browser/dist/cast-hub.js +137 -0
  215. package/node_modules/@nordhavnhq/runner-browser/dist/guard.d.ts +21 -0
  216. package/node_modules/@nordhavnhq/runner-browser/dist/guard.js +104 -0
  217. package/node_modules/@nordhavnhq/runner-browser/dist/host-protocol.d.ts +47 -0
  218. package/node_modules/@nordhavnhq/runner-browser/dist/host-protocol.js +41 -0
  219. package/node_modules/@nordhavnhq/runner-browser/dist/host.d.ts +18 -0
  220. package/node_modules/@nordhavnhq/runner-browser/dist/host.js +15 -0
  221. package/node_modules/@nordhavnhq/runner-browser/dist/index.d.ts +13 -0
  222. package/node_modules/@nordhavnhq/runner-browser/dist/index.js +28 -0
  223. package/node_modules/@nordhavnhq/runner-browser/dist/live-input.d.ts +74 -0
  224. package/node_modules/@nordhavnhq/runner-browser/dist/live-input.js +93 -0
  225. package/node_modules/@nordhavnhq/runner-browser/dist/live-open.d.ts +4 -0
  226. package/node_modules/@nordhavnhq/runner-browser/dist/live-open.js +57 -0
  227. package/node_modules/@nordhavnhq/runner-browser/dist/live.d.ts +148 -0
  228. package/node_modules/@nordhavnhq/runner-browser/dist/live.js +179 -0
  229. package/node_modules/@nordhavnhq/runner-browser/dist/local-live.d.ts +31 -0
  230. package/node_modules/@nordhavnhq/runner-browser/dist/local-live.js +262 -0
  231. package/node_modules/@nordhavnhq/runner-browser/dist/marks.d.ts +36 -0
  232. package/node_modules/@nordhavnhq/runner-browser/dist/marks.js +173 -0
  233. package/node_modules/@nordhavnhq/runner-browser/dist/page-events.d.ts +27 -0
  234. package/node_modules/@nordhavnhq/runner-browser/dist/page-events.js +82 -0
  235. package/node_modules/@nordhavnhq/runner-browser/dist/page-tools.d.ts +13 -0
  236. package/node_modules/@nordhavnhq/runner-browser/dist/page-tools.js +526 -0
  237. package/node_modules/@nordhavnhq/runner-browser/dist/params.d.ts +12 -0
  238. package/node_modules/@nordhavnhq/runner-browser/dist/params.js +32 -0
  239. package/node_modules/@nordhavnhq/runner-browser/dist/pick.d.ts +24 -0
  240. package/node_modules/@nordhavnhq/runner-browser/dist/pick.js +76 -0
  241. package/node_modules/@nordhavnhq/runner-browser/dist/session.d.ts +225 -0
  242. package/node_modules/@nordhavnhq/runner-browser/dist/session.js +507 -0
  243. package/node_modules/@nordhavnhq/runner-browser/dist/shots.d.ts +11 -0
  244. package/node_modules/@nordhavnhq/runner-browser/dist/shots.js +103 -0
  245. package/node_modules/@nordhavnhq/runner-browser/dist/show.d.ts +10 -0
  246. package/node_modules/@nordhavnhq/runner-browser/dist/show.js +190 -0
  247. package/node_modules/@nordhavnhq/runner-browser/dist/target.d.ts +37 -0
  248. package/node_modules/@nordhavnhq/runner-browser/dist/target.js +82 -0
  249. package/node_modules/@nordhavnhq/runner-browser/dist/tour.d.ts +19 -0
  250. package/node_modules/@nordhavnhq/runner-browser/dist/tour.js +178 -0
  251. package/node_modules/@nordhavnhq/runner-browser/package.json +18 -0
  252. package/node_modules/@nordhavnhq/runner-runtime/dist/config.d.ts +96 -0
  253. package/node_modules/@nordhavnhq/runner-runtime/dist/config.js +25 -0
  254. package/node_modules/@nordhavnhq/runner-runtime/dist/connection.d.ts +276 -0
  255. package/node_modules/@nordhavnhq/runner-runtime/dist/connection.js +507 -0
  256. package/node_modules/@nordhavnhq/runner-runtime/dist/constants.d.ts +48 -0
  257. package/node_modules/@nordhavnhq/runner-runtime/dist/constants.js +95 -0
  258. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/batch.d.ts +94 -0
  259. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/batch.js +219 -0
  260. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/calls.d.ts +136 -0
  261. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/calls.js +214 -0
  262. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/fs.d.ts +735 -0
  263. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/fs.js +40 -0
  264. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/loop.d.ts +362 -0
  265. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/loop.js +703 -0
  266. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/own-files.d.ts +105 -0
  267. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/own-files.js +202 -0
  268. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/phases.d.ts +204 -0
  269. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/phases.js +497 -0
  270. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/pins.d.ts +45 -0
  271. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/pins.js +176 -0
  272. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/processes.d.ts +74 -0
  273. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/processes.js +72 -0
  274. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/release-tag.d.ts +59 -0
  275. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/release-tag.js +117 -0
  276. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/replay.d.ts +62 -0
  277. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/replay.js +84 -0
  278. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/tool-names.d.ts +27 -0
  279. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/tool-names.js +80 -0
  280. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/version.d.ts +22 -0
  281. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/version.js +22 -0
  282. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/wire.d.ts +595 -0
  283. package/node_modules/@nordhavnhq/runner-runtime/dist/contract/wire.js +85 -0
  284. package/node_modules/@nordhavnhq/runner-runtime/dist/index.d.ts +43 -0
  285. package/node_modules/@nordhavnhq/runner-runtime/dist/index.js +50 -0
  286. package/node_modules/@nordhavnhq/runner-runtime/dist/inference.d.ts +135 -0
  287. package/node_modules/@nordhavnhq/runner-runtime/dist/inference.js +945 -0
  288. package/node_modules/@nordhavnhq/runner-runtime/dist/mcp.d.ts +67 -0
  289. package/node_modules/@nordhavnhq/runner-runtime/dist/mcp.js +47 -0
  290. package/node_modules/@nordhavnhq/runner-runtime/dist/platform.d.ts +21 -0
  291. package/node_modules/@nordhavnhq/runner-runtime/dist/platform.js +25 -0
  292. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/auto-load.d.ts +39 -0
  293. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/auto-load.js +67 -0
  294. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/background-commands.d.ts +61 -0
  295. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/background-commands.js +58 -0
  296. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/chat-run-ends.d.ts +23 -0
  297. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/chat-run-ends.js +42 -0
  298. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/duration.d.ts +6 -0
  299. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/duration.js +12 -0
  300. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/events.d.ts +150 -0
  301. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/events.js +36 -0
  302. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/extract-json.d.ts +14 -0
  303. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/extract-json.js +49 -0
  304. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-chat.d.ts +109 -0
  305. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-chat.js +894 -0
  306. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-task.d.ts +73 -0
  307. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/handle-task.js +765 -0
  308. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/loop.d.ts +246 -0
  309. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/loop.js +621 -0
  310. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/messages.d.ts +88 -0
  311. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/messages.js +188 -0
  312. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/pending-steers.d.ts +15 -0
  313. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/pending-steers.js +10 -0
  314. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/phased-loop.d.ts +16 -0
  315. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/phased-loop.js +97 -0
  316. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/project-instructions.d.ts +22 -0
  317. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/project-instructions.js +47 -0
  318. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/run-tools.d.ts +26 -0
  319. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/run-tools.js +48 -0
  320. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/scratch-prompt.d.ts +8 -0
  321. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/scratch-prompt.js +19 -0
  322. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/side-question.d.ts +76 -0
  323. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/side-question.js +155 -0
  324. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/task-validation.d.ts +43 -0
  325. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/task-validation.js +37 -0
  326. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/unload-toolset.d.ts +49 -0
  327. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/unload-toolset.js +104 -0
  328. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/write-scope.d.ts +16 -0
  329. package/node_modules/@nordhavnhq/runner-runtime/dist/runtime/write-scope.js +6 -0
  330. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/delegate.d.ts +86 -0
  331. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/delegate.js +141 -0
  332. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/index.d.ts +179 -0
  333. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/index.js +35 -0
  334. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/mcp.d.ts +21 -0
  335. package/node_modules/@nordhavnhq/runner-runtime/dist/tools/mcp.js +179 -0
  336. package/node_modules/@nordhavnhq/runner-runtime/package.json +18 -0
  337. package/package.json +33 -4
  338. package/README.md +0 -3
@@ -0,0 +1,204 @@
1
+ import { execFile, spawn } from 'node:child_process';
2
+ import { copyFileSync, existsSync, lstatSync, readdirSync, readFileSync, statSync, symlinkSync } from 'node:fs';
3
+ import { basename, dirname, join } from 'node:path';
4
+ import { promisify } from 'node:util';
5
+ import { clipHeadTail } from './_output.js';
6
+ import { commandEnv } from './console.js';
7
+ import { projectNodeNote, resolveProjectNode } from '../runtime/project-node.js';
8
+ // ─── Worktree setup ─────────────────────────
9
+ //
10
+ // A fresh git worktree is a checkout of what git tracks: no node_modules, no
11
+ // vendor, no .env, nothing generated. An agent that starts work in one would
12
+ // spend its first rounds discovering that. So right after creating a worktree
13
+ // (runner_git_worktree, a task run's own worktree) the runner makes it ready
14
+ // itself, without anything runner-specific in the project:
15
+ // 1. links the dependency folders of the main checkout: node_modules at the
16
+ // root and in every npm workspace (package.json `workspaces`), vendor next
17
+ // to every composer.json. Never installs.
18
+ // 2. copies the git-ignored env files (`.env`, `.env.*`) of the main checkout
19
+ // that the worktree lacks.
20
+ // 3. runs the project's own hook when its manifest has one: the npm script
21
+ // `worktree:setup`, else the composer script `worktree-setup`, in the
22
+ // worktree with `$NORDHAVN_MAIN_REPO` and `$NORDHAVN_WORKTREE` set and on
23
+ // the Node the project pins. That is where codegen goes (prisma generate,
24
+ // nuxt prepare, ...): the project knows what it generates, the runner does
25
+ // not guess it.
26
+ // A linked node_modules points at the MAIN checkout's workspaces, so an import
27
+ // of another workspace reads the main checkout's copy. A failing step never
28
+ // undoes the worktree: the answer says what went wrong.
29
+ const run = promisify(execFile);
30
+ const HOOK_TIMEOUT_MS = 300_000;
31
+ const HOOK_OUTPUT_MAX_CHARS = 2_000;
32
+ const ENV_FILE = /^\.env(\..+)?$/;
33
+ /** Dependency folders linked from the main checkout, with the manifest that makes them. */
34
+ const DEP_DIRS = [{ dir: 'node_modules', manifest: 'package.json' }, { dir: 'vendor', manifest: 'composer.json' }];
35
+ /**
36
+ * Make a new worktree of `repo` ready to work in (see above). Resolves null
37
+ * when there was nothing to do: no dependency folder, no env file, no hook.
38
+ */
39
+ export async function runWorktreeSetup(repo, worktree, context) {
40
+ const linked = linkDependencies(repo, worktree);
41
+ const copied = await copyEnvFiles(repo, worktree);
42
+ const command = setupHookCommand(worktree);
43
+ if (!command && linked.length === 0 && copied.length === 0)
44
+ return null;
45
+ const result = { ok: true, linked, copied };
46
+ if (!command)
47
+ return result;
48
+ const node = await resolveProjectNode(worktree, worktree);
49
+ const env = { ...commandEnv(context, worktree, process.env, node?.binDir), NORDHAVN_MAIN_REPO: repo, NORDHAVN_WORKTREE: worktree };
50
+ const nodeWarning = await projectNodeNote(node);
51
+ const hook = await runHook(command, worktree, env);
52
+ return { ...result, ok: hook.ok, hook, ...(nodeWarning ? { nodeWarning } : {}) };
53
+ }
54
+ function readManifest(path) {
55
+ try {
56
+ const parsed = JSON.parse(readFileSync(path, 'utf-8'));
57
+ return parsed && typeof parsed === 'object' ? parsed : null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ /** The project's own setup hook, from the worktree's (the branch's) manifests. */
64
+ export function setupHookCommand(worktree) {
65
+ const scripts = (file) => {
66
+ const s = readManifest(join(worktree, file))?.scripts;
67
+ return s && typeof s === 'object' ? s : {};
68
+ };
69
+ if (typeof scripts('package.json')['worktree:setup'] === 'string')
70
+ return 'npm run --silent worktree:setup';
71
+ const composer = scripts('composer.json')['worktree-setup'];
72
+ if (typeof composer === 'string' || Array.isArray(composer))
73
+ return 'composer run-script worktree-setup';
74
+ return null;
75
+ }
76
+ /** The npm workspace folders of a checkout (`workspaces` as a list or `{ packages }`), `*` segments expanded. */
77
+ export function workspaceDirs(root) {
78
+ const ws = readManifest(join(root, 'package.json'))?.workspaces;
79
+ const patterns = Array.isArray(ws) ? ws : (ws && typeof ws === 'object' && Array.isArray(ws.packages) ? ws.packages : []);
80
+ const dirs = new Set();
81
+ for (const pattern of patterns) {
82
+ if (typeof pattern !== 'string' || pattern.startsWith('!'))
83
+ continue;
84
+ for (const dir of expandPattern(root, pattern.replace(/^\.\//, '').replace(/\/+$/, '').split('/')))
85
+ dirs.add(dir);
86
+ }
87
+ return [...dirs].sort();
88
+ }
89
+ function expandPattern(root, segments) {
90
+ let found = [''];
91
+ for (const segment of segments) {
92
+ if (!segment.includes('*')) {
93
+ found = found.map(dir => (dir ? `${dir}/${segment}` : segment));
94
+ continue;
95
+ }
96
+ const match = new RegExp(`^${segment.split('*').map(p => p.replace(/[.+?^${}()|[\]\\]/g, '\\$&')).join('.*')}$`);
97
+ found = found.flatMap((dir) => {
98
+ try {
99
+ return readdirSync(join(root, dir), { withFileTypes: true })
100
+ .filter(e => e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules' && match.test(e.name))
101
+ .map(e => (dir ? `${dir}/${e.name}` : e.name));
102
+ }
103
+ catch {
104
+ return [];
105
+ }
106
+ });
107
+ }
108
+ return found.filter(dir => isDir(join(root, dir)));
109
+ }
110
+ function isDir(path) {
111
+ try {
112
+ return statSync(path).isDirectory();
113
+ }
114
+ catch {
115
+ return false;
116
+ }
117
+ }
118
+ function exists(path) {
119
+ try {
120
+ lstatSync(path);
121
+ return true;
122
+ }
123
+ catch {
124
+ return false;
125
+ }
126
+ }
127
+ /** Link node_modules and vendor from the main checkout into the worktree, where it has the manifest and lacks the folder. */
128
+ function linkDependencies(repo, worktree) {
129
+ const linked = [];
130
+ for (const dir of ['', ...workspaceDirs(worktree)]) {
131
+ for (const { dir: deps, manifest } of DEP_DIRS) {
132
+ const rel = dir ? `${dir}/${deps}` : deps;
133
+ if (!existsSync(join(worktree, dir, manifest)) || exists(join(worktree, rel)) || !isDir(join(repo, rel)))
134
+ continue;
135
+ try {
136
+ symlinkSync(join(repo, rel), join(worktree, rel), 'dir');
137
+ linked.push(rel);
138
+ }
139
+ catch { /* a folder we cannot link is one the hook or the agent installs */ }
140
+ }
141
+ }
142
+ return linked;
143
+ }
144
+ /** Copy the git-ignored env files of the main checkout that the worktree lacks. */
145
+ async function copyEnvFiles(repo, worktree) {
146
+ let listing;
147
+ try {
148
+ // --directory folds an ignored folder (node_modules, .worktrees) into one entry, so this stays fast.
149
+ listing = (await run('git', ['ls-files', '--others', '--ignored', '--exclude-standard', '--directory', '-z'], { cwd: repo, maxBuffer: 16 * 1024 * 1024 })).stdout;
150
+ }
151
+ catch {
152
+ return [];
153
+ }
154
+ const copied = [];
155
+ for (const rel of listing.split('\0')) {
156
+ if (!rel || rel.endsWith('/') || !ENV_FILE.test(basename(rel)))
157
+ continue;
158
+ const target = join(worktree, rel);
159
+ if (exists(target) || !isDir(dirname(target)))
160
+ continue;
161
+ try {
162
+ copyFileSync(join(repo, rel), target);
163
+ copied.push(rel);
164
+ }
165
+ catch { /* unreadable: left out */ }
166
+ }
167
+ return copied.sort();
168
+ }
169
+ function runHook(command, worktree, env) {
170
+ return new Promise((resolve) => {
171
+ const started = Date.now();
172
+ const child = spawn('sh', ['-c', command], { cwd: worktree, env, stdio: ['ignore', 'pipe', 'pipe'], detached: true });
173
+ let output = '';
174
+ const keep = (chunk) => { output = (output + chunk.toString()).slice(-50_000); };
175
+ child.stdout?.on('data', keep);
176
+ child.stderr?.on('data', keep);
177
+ let timedOut = false;
178
+ const timer = setTimeout(() => {
179
+ timedOut = true;
180
+ try {
181
+ if (child.pid)
182
+ process.kill(-child.pid, 'SIGKILL');
183
+ }
184
+ catch { }
185
+ }, HOOK_TIMEOUT_MS);
186
+ let done = false;
187
+ const finish = (exitCode, extra = '') => {
188
+ if (done)
189
+ return;
190
+ done = true;
191
+ clearTimeout(timer);
192
+ const text = `${output}${extra}${timedOut ? `\n[stopped after ${HOOK_TIMEOUT_MS / 1000}s]` : ''}`.replace(/\x1b\[[0-9;]*m/g, '').trim();
193
+ resolve({
194
+ command,
195
+ ok: exitCode === 0 && !timedOut,
196
+ exitCode,
197
+ seconds: Math.round((Date.now() - started) / 100) / 10,
198
+ output: clipHeadTail(text, HOOK_OUTPUT_MAX_CHARS),
199
+ });
200
+ };
201
+ child.on('error', err => finish(null, `\n${err.message}`));
202
+ child.on('close', code => finish(code));
203
+ });
204
+ }
@@ -0,0 +1,2 @@
1
+ import { browserTools } from '@nordhavnhq/runner-browser';
2
+ export { browserTools };
@@ -0,0 +1,8 @@
1
+ import { browserTools, setBrowserHost } from '@nordhavnhq/runner-browser';
2
+ import { resolveForRead } from './_jail.js';
3
+ import { uploadImage } from './_upload.js';
4
+ // The agent browser lives in @nordhavnhq/runner-browser (packages/browser), shared with
5
+ // the browser host. On a runner, a path an agent names goes through this
6
+ // runner's jail and an image is uploaded with the agent's own token.
7
+ setBrowserHost({ resolveForRead, uploadImage });
8
+ export { browserTools };
@@ -0,0 +1,44 @@
1
+ /** One import a commit would leave behind: `file` imports `imports`, both
2
+ * relative to the repository's top level. */
3
+ export interface MissingImport {
4
+ file: string;
5
+ imports: string;
6
+ }
7
+ /** A commit refused because of the imports it would leave behind. */
8
+ export declare class MissingImportsError extends Error {
9
+ readonly missing: MissingImport[];
10
+ constructor(missing: MissingImport[]);
11
+ }
12
+ /** The relative specifiers a source file imports, without a query or hash. */
13
+ export declare function relativeSpecifiers(source: string): string[];
14
+ /**
15
+ * The imports the files of a commit (`committed`, relative to `top`) would
16
+ * leave behind: a relative import whose target git does not track and the
17
+ * commit does not take.
18
+ */
19
+ export declare function findMissingImports(top: string, committed: string[]): Promise<MissingImport[]>;
20
+ /** Why a commit was refused, for a person and for an agent. */
21
+ export declare function missingImportsMessage(missing: MissingImport[]): string;
22
+ /** The repository's top level, from any folder in it. */
23
+ export declare function repoTop(cwd: string): Promise<string>;
24
+ /** `missing` with its paths relative to `cwd`, a folder of the repository,
25
+ * rather than to its top level. */
26
+ export declare function missingFrom(cwd: string, missing: MissingImport[]): Promise<MissingImport[]>;
27
+ /**
28
+ * The files a plain `git commit` of the index takes (added, copied, modified,
29
+ * renamed), relative to `top`. With `amend` against the commit's parent, as the
30
+ * amended commit replaces HEAD; the whole index when there is nothing below.
31
+ * With `paths` (literal pathspecs relative to `cwd`, a folder of the
32
+ * repository) only what a `git commit -- <paths>` takes.
33
+ */
34
+ export declare function stagedFiles(top: string, opts?: {
35
+ amend?: boolean;
36
+ paths?: string[];
37
+ cwd?: string;
38
+ }): Promise<string[]>;
39
+ /** The index as a tree, so a refused commit can put back what it staged;
40
+ * null when the index holds a conflict (git refuses that commit anyway). */
41
+ export declare function snapshotIndex(top: string): Promise<string | null>;
42
+ /** Put the index back as `tree` held it, only for the paths that differ: what
43
+ * was staged before stays staged. */
44
+ export declare function restoreIndex(top: string, tree: string | null): Promise<void>;
@@ -0,0 +1,165 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { readFileSync, statSync } from 'node:fs';
3
+ import { join, posix } from 'node:path';
4
+ import { promisify } from 'node:util';
5
+ // ─── A commit never leaves an import behind ─
6
+ //
7
+ // A commit that takes `a.ts` while the `./b` it imports stays untracked builds
8
+ // fine on the machine that made it and breaks every build of what was pushed.
9
+ // Before `runner_git_commit` and the code app's commit (`fs:git`) commit, the
10
+ // files the commit takes are read for relative imports (`./`, `../`; aliases
11
+ // such as `#shared/` or `~/` are too fuzzy to resolve here), and a target git
12
+ // does not track that is not in the commit either refuses it. Cheap by design:
13
+ // only the committed files are read, at most MAX_SCANNED of them, none past
14
+ // MAX_BYTES.
15
+ const execFileAsync = promisify(execFile);
16
+ /** A commit refused because of the imports it would leave behind. */
17
+ export class MissingImportsError extends Error {
18
+ missing;
19
+ constructor(missing) {
20
+ super(missingImportsMessage(missing));
21
+ this.name = 'MissingImportsError';
22
+ this.missing = missing;
23
+ }
24
+ }
25
+ const SCANNED_FILE = /\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|vue|astro)$/;
26
+ const MAX_SCANNED = 300;
27
+ const MAX_BYTES = 512 * 1024;
28
+ const EXTENSIONS = ['.ts', '.tsx', '.js', '.mjs', '.vue', '.astro', '.json'];
29
+ const INDEX_FILES = ['/index.ts', '/index.js'];
30
+ /** A `.js` specifier names the file TypeScript compiles to: try the source too. */
31
+ const JS_TO_TS = { '.js': ['.ts', '.tsx'], '.jsx': ['.tsx'], '.mjs': ['.mts'], '.cjs': ['.cts'] };
32
+ /** `from './x'`, `import './x'`, `import('./x')`, `require('./x')`. */
33
+ const RELATIVE_SPECIFIER = /\b(?:from|import|require)\s*\(?\s*['"](\.\.?\/[^'"\n]+)['"]/g;
34
+ async function git(cwd, args) {
35
+ const { stdout } = await execFileAsync('git', args, { cwd, maxBuffer: 20 * 1024 * 1024, timeout: 60_000 });
36
+ return stdout;
37
+ }
38
+ const nulList = (out) => out.split('\0').filter(Boolean);
39
+ /** The relative specifiers a source file imports, without a query or hash. */
40
+ export function relativeSpecifiers(source) {
41
+ const found = new Set();
42
+ for (const match of source.matchAll(RELATIVE_SPECIFIER))
43
+ found.add(match[1].replace(/[?#].*$/, ''));
44
+ return [...found];
45
+ }
46
+ /** Where a specifier may point, in the order a bundler tries them. */
47
+ function candidatesOf(target) {
48
+ const ext = posix.extname(target);
49
+ const swapped = (JS_TO_TS[ext] ?? []).map(to => target.slice(0, -ext.length) + to);
50
+ return [...swapped, target, ...EXTENSIONS.map(e => target + e), ...INDEX_FILES.map(i => target + i)];
51
+ }
52
+ function isFile(path) {
53
+ try {
54
+ return statSync(path).isFile();
55
+ }
56
+ catch {
57
+ return false;
58
+ }
59
+ }
60
+ /** The file `spec` of `file` resolves to, relative to `top`; null when it
61
+ * leaves the repository or names nothing on disk. */
62
+ function resolveImport(top, file, spec) {
63
+ const target = posix.normalize(posix.join(posix.dirname(file), spec));
64
+ if (target.startsWith('../') || target === '..')
65
+ return null;
66
+ return candidatesOf(target).find(c => isFile(join(top, c))) ?? null;
67
+ }
68
+ function readSource(path) {
69
+ try {
70
+ if (statSync(path).size > MAX_BYTES)
71
+ return null;
72
+ return readFileSync(path, 'utf8');
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ /**
79
+ * The imports the files of a commit (`committed`, relative to `top`) would
80
+ * leave behind: a relative import whose target git does not track and the
81
+ * commit does not take.
82
+ */
83
+ export async function findMissingImports(top, committed) {
84
+ const scanned = committed.filter(f => SCANNED_FILE.test(f)).slice(0, MAX_SCANNED);
85
+ if (!scanned.length)
86
+ return [];
87
+ const inCommit = new Set(committed);
88
+ let untracked = null;
89
+ const missing = [];
90
+ for (const file of scanned) {
91
+ const source = readSource(join(top, file));
92
+ if (!source)
93
+ continue;
94
+ for (const spec of relativeSpecifiers(source)) {
95
+ const target = resolveImport(top, file, spec);
96
+ if (!target || inCommit.has(target))
97
+ continue;
98
+ untracked ??= new Set(nulList(await git(top, ['ls-files', '-z', '--others', '--exclude-standard'])));
99
+ if (untracked.has(target) && !missing.some(m => m.file === file && m.imports === target))
100
+ missing.push({ file, imports: target });
101
+ }
102
+ }
103
+ return missing;
104
+ }
105
+ /** Why a commit was refused, for a person and for an agent. */
106
+ export function missingImportsMessage(missing) {
107
+ const list = missing.map(m => `${m.file} imports ${m.imports}`).join(', ');
108
+ return `Commit would leave untracked imports: ${list}; add them to paths or commit them too`;
109
+ }
110
+ /** The repository's top level, from any folder in it. */
111
+ export async function repoTop(cwd) {
112
+ return (await git(cwd, ['rev-parse', '--show-toplevel'])).trim();
113
+ }
114
+ /** `missing` with its paths relative to `cwd`, a folder of the repository,
115
+ * rather than to its top level. */
116
+ export async function missingFrom(cwd, missing) {
117
+ const prefix = (await git(cwd, ['rev-parse', '--show-prefix'])).trim().replace(/\/$/, '');
118
+ if (!prefix)
119
+ return missing;
120
+ return missing.map(m => ({ file: posix.relative(prefix, m.file), imports: posix.relative(prefix, m.imports) }));
121
+ }
122
+ async function hasRef(top, ref) {
123
+ try {
124
+ await git(top, ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`]);
125
+ return true;
126
+ }
127
+ catch {
128
+ return false;
129
+ }
130
+ }
131
+ /**
132
+ * The files a plain `git commit` of the index takes (added, copied, modified,
133
+ * renamed), relative to `top`. With `amend` against the commit's parent, as the
134
+ * amended commit replaces HEAD; the whole index when there is nothing below.
135
+ * With `paths` (literal pathspecs relative to `cwd`, a folder of the
136
+ * repository) only what a `git commit -- <paths>` takes.
137
+ */
138
+ export async function stagedFiles(top, opts = {}) {
139
+ const base = opts.amend ? 'HEAD~1' : 'HEAD';
140
+ const cwd = opts.cwd ?? top;
141
+ const pathspec = opts.paths ? ['--', ...opts.paths] : [];
142
+ const literal = opts.paths ? ['--literal-pathspecs'] : [];
143
+ if (!(await hasRef(top, base)))
144
+ return nulList(await git(cwd, [...literal, 'ls-files', '-z', '--full-name', ...pathspec]));
145
+ return nulList(await git(cwd, [...literal, 'diff', '--cached', '--name-only', '-z', '--no-renames', '--diff-filter=ACM', base, ...pathspec]));
146
+ }
147
+ /** The index as a tree, so a refused commit can put back what it staged;
148
+ * null when the index holds a conflict (git refuses that commit anyway). */
149
+ export async function snapshotIndex(top) {
150
+ try {
151
+ return (await git(top, ['write-tree'])).trim() || null;
152
+ }
153
+ catch {
154
+ return null;
155
+ }
156
+ }
157
+ /** Put the index back as `tree` held it, only for the paths that differ: what
158
+ * was staged before stays staged. */
159
+ export async function restoreIndex(top, tree) {
160
+ if (!tree)
161
+ return;
162
+ const changed = nulList(await git(top, ['diff', '--cached', '--name-only', '-z', '--no-renames', tree]));
163
+ if (changed.length)
164
+ await git(top, ['--literal-pathspecs', 'reset', '-q', tree, '--', ...changed]);
165
+ }
@@ -0,0 +1,13 @@
1
+ import type { ToolDefinition } from '@nordhavnhq/runner-runtime';
2
+ import type { ToolContext } from './index.js';
3
+ declare function executeMouseControl(params: Record<string, unknown>, context?: ToolContext): Promise<string>;
4
+ export declare function appMatches(front: string, wanted: string): boolean;
5
+ export declare function darwinKeyScript(modifiers: string[], key: string): {
6
+ script: string;
7
+ args: string[];
8
+ } | null;
9
+ export declare const computerTools: {
10
+ definition: ToolDefinition;
11
+ execute: typeof executeMouseControl;
12
+ }[];
13
+ export {};