@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,40 @@
1
+ /**
2
+ * Wire contract for the frames that read and write a project's checkout on
3
+ * the runner (`fs:*`), for the code app, and what they reply with. The rest
4
+ * of the Studio -> Agent frames, and the union of all of them, are `wire.ts`.
5
+ *
6
+ * Part of the agent contract (see `version.ts`), copied verbatim into the
7
+ * runner. No runtime validation here, as in `wire.ts`.
8
+ */
9
+ /** The most bytes one `fs:bytes` reply carries. */
10
+ export const FS_BYTES_CHUNK = 1024 * 1024;
11
+ /** The largest file a person drops into the code app's tree. */
12
+ export const FS_UPLOAD_MAX_BYTES = 50 * 1024 * 1024;
13
+ /** The most paths an `fs:paths` reply carries. */
14
+ export const FS_PATHS_LIMIT = 20_000;
15
+ /** The `error` of an `fs:sonar` reply when the checkout has no index (nobody built it yet). */
16
+ export const FS_SONAR_NOT_BUILT = 'Sonar is not built for this checkout';
17
+ /** The most characters an `fs:sonar` overview carries. */
18
+ export const FS_SONAR_OVERVIEW_CHARS = 6000;
19
+ /** The most nodes an `fs:sonar` graph carries; the smallest are cut first. */
20
+ export const FS_SONAR_GRAPH_NODES = 800;
21
+ /** The most edges an `fs:sonar` graph carries; the lightest are cut first. */
22
+ export const FS_SONAR_GRAPH_EDGES = 4000;
23
+ /** The deepest folder level an `fs:sonar` folder graph goes to. */
24
+ export const FS_SONAR_MAX_DEPTH = 6;
25
+ /** How deep below the checkout `fs:repos` looks for a repository. */
26
+ export const FS_REPOS_DEPTH = 3;
27
+ /** The most repositories an `fs:repos` reply carries. */
28
+ export const FS_REPOS_LIMIT = 50;
29
+ /** The runner version that knows the full git client of the code app: the
30
+ * index (`fs:diff` `side`, `stage`, `unstage`, `apply-patch`), paging and
31
+ * search in `fs:log`, `fs:show` `against`, tags and stash ids in
32
+ * `fs:branches`, and the actions that rewrite history (`reset`, `checkout`,
33
+ * `reword`, `rebase`) or settle a conflict (`resolve`, `mark-resolved`). */
34
+ export const GIT_CLIENT_MIN_RUNNER_VERSION = '0.6.0';
35
+ /** The most commits an `fs:log` reply carries. */
36
+ export const FS_LOG_LIMIT = 200;
37
+ /** The most bytes of one file's patch an `fs:show` reply carries. */
38
+ export const FS_PATCH_FILE_BYTES = 256 * 1024;
39
+ /** The most bytes of patches one `fs:show` reply carries. */
40
+ export const FS_PATCH_TOTAL_BYTES = 2 * 1024 * 1024;
@@ -0,0 +1,362 @@
1
+ /**
2
+ * The agent loop's shared rules: why a run stops, the guards that stop it,
3
+ * the texts it feeds back to the model, and how the context stays bounded
4
+ * (a tool result cut as it arrives, one fold into a summary at a ceiling).
5
+ *
6
+ * Part of the agent contract (see `version.ts`), copied verbatim into the
7
+ * runner. The two loops themselves (`server/utils/internal-runtime/loop.ts`
8
+ * and the runner's `packages/runtime/src/runtime/loop.ts`) are NOT one file:
9
+ * they speak different message shapes and host different tools. What has to
10
+ * behave the same in both lives here, so it cannot drift.
11
+ */
12
+ /** Why the agentic loop stopped. Lets callers tell a deliberate close
13
+ * (`reply` / `hook-stop` / `awaiting-user`) from an early exit that must NOT
14
+ * be recorded as a successful completion. */
15
+ export type LoopStopReason = 'reply' | 'empty' | 'hook-stop' | 'max-rounds' | 'aborted' | 'max-loop-ms' | 'max-cost' | 'stopped' | 'budget' | 'loop' | 'awaiting-user';
16
+ /** Marks a tool result that means the studio ended the run (a 410 or 402 from
17
+ * an MCP route). Both loops read it and stop with reason `stopped`. */
18
+ export declare const RUN_STOPPED_PREFIX = "Error: [run stopped by the studio] ";
19
+ /** HTTP statuses an MCP route answers to end the run rather than the call:
20
+ * 410 (the task or mission was stopped) and 402 (the task's budget is spent). */
21
+ export declare const RUN_STOPPED_STATUSES: ReadonlySet<number>;
22
+ export declare function isRunStoppedResult(result: string): boolean;
23
+ /** Why the studio refused a MODEL call with 402 (the task's budget), off the
24
+ * error the transport threw; null for any other error. Both loops end the
25
+ * run on it with stop reason `budget` and still write the handoff. */
26
+ export declare function budgetStopOf(err: unknown): string | null;
27
+ /** What the handoff call says it is (`purpose` on the inference request): the
28
+ * studio lets ONE through for a run whose budget refused its next call. */
29
+ export declare const HANDOFF_CALL_PURPOSE = "handoff";
30
+ /** The tool that puts a plan to the person in a code session and ends the
31
+ * turn the same way: the plan waits in the chat for their approval. */
32
+ export declare const PROPOSE_PLAN_TOOL = "studio_propose_plan";
33
+ /** The tool that decides a waiting plan on the person's word in the chat
34
+ * ("go ahead", "drop it"). A decision that went through ends the turn and
35
+ * says so with this prefix: the session's tools change with it (an approved
36
+ * plan runs on Auto), so the work goes on in a new turn the studio starts. */
37
+ export declare const APPROVE_PLAN_TOOL = "studio_approve_plan";
38
+ export declare const PLAN_DECIDED_PREFIX = "Plan decided; your turn ends here. ";
39
+ /** The one tool an agent asks a person with. In a task or mission run it opens
40
+ * a decision, and only a BLOCKING one ends the run, its result saying so with
41
+ * this prefix. In a chat the question goes on the person's screen and the
42
+ * turn always ends (`ASKED_IN_CHAT_PREFIX`). */
43
+ export declare const ASK_TOOL = "studio_ask";
44
+ export declare const BLOCKING_DECISION_PREFIX = "Asked; your run ends here. ";
45
+ /** The result of a `studio_ask` in a chat: the question card is on the
46
+ * person's screen and already is the agent's message there, so the turn ends
47
+ * with no reply. It starts with `BLOCKING_DECISION_PREFIX` so a runner on the
48
+ * older contract still stops on it. */
49
+ export declare const ASKED_IN_CHAT_PREFIX: string;
50
+ export declare function isAskedInChat(result: string): boolean;
51
+ /** The tools whose result can open a blocking decision. */
52
+ export declare const BLOCKING_DECISION_TOOLS: ReadonlySet<string>;
53
+ /** A `studio_ask` in a chat that put its question on screen, a plan put to
54
+ * the person (`studio_propose_plan`), a plan decided on their word
55
+ * (`studio_approve_plan`), or a call that opened a blocking decision. A
56
+ * refusal comes back as an error or an `Error:` text, so the text decides,
57
+ * not only the flag. */
58
+ export declare function isQuestionAsked(toolName: string, outcome: {
59
+ result: string;
60
+ isError: boolean;
61
+ }): boolean;
62
+ /** What a run that stopped on a question leaves as its reply. A chat's
63
+ * question (`studio_ask` answered with `ASKED_IN_CHAT_PREFIX`) already is the
64
+ * agent's message there: nothing. A plan card likewise: nothing.
65
+ * A task's blocking `studio_ask` has no card where its work is followed (the
66
+ * task's timeline, the chat or channel it came from), so the agent speaks
67
+ * there in its own words: what it wrote beside the call, else the question
68
+ * itself. Never a canned line: that is English, the people reading it may not
69
+ * be, and in a channel it reads as a robot talking. */
70
+ export declare function askedRunReply(toolName: string, args: unknown, narration: string | null | undefined, result?: string): string;
71
+ /** The statuses an agent may set on its OWN running task (`studio_update_task`)
72
+ * that end the run. `in_review` and `waiting` end it like `done`: the work is
73
+ * delivered, and what is left (a sign-off, an answer from outside) is not
74
+ * another round of the loop. */
75
+ export declare const RUN_ENDING_TASK_STATUSES: readonly ["done", "in_review", "waiting", "cancelled", "failed"];
76
+ export type RunEndingTaskStatus = typeof RUN_ENDING_TASK_STATUSES[number];
77
+ export declare function isRunEndingTaskStatus(status: unknown): status is RunEndingTaskStatus;
78
+ /** The run-ending statuses that DELIVER work, so a structured result that fails
79
+ * its schema refuses them the same way. */
80
+ export declare function deliversTaskWork(status: unknown): boolean;
81
+ /** The run's closing line when the agent ended it with `status` and wrote no
82
+ * reply of its own. */
83
+ export declare function runEndingReply(status: RunEndingTaskStatus): string;
84
+ /** Repeat-call guard: an agent that re-runs the same (toolName, args) call
85
+ * over and over is almost always stuck in a re-fetch loop. After this many
86
+ * identical executions the tool is not run again and a directive goes back
87
+ * instead. Byte-identical args make legit repeats (status polling) virtually
88
+ * never reach it. */
89
+ export declare const MAX_IDENTICAL_TOOL_CALLS = 3;
90
+ /** A run whose repeat guard had to step in this often, or whose tool calls
91
+ * failed this many times in a row, is going in circles: it ends with stop
92
+ * reason `loop` instead of spending until a cap trips (a cover run once looped
93
+ * to 2.2M tokens). */
94
+ export declare const MAX_REPEAT_GUARD_HITS = 3;
95
+ export declare const MAX_TOOL_FAILURES_IN_A_ROW = 8;
96
+ export declare function repeatGuardKey(toolName: string, args: unknown): string;
97
+ /**
98
+ * A task run that goes in circles gets ONE closing round before it stops:
99
+ * finish now, or open a blocker for a person. Only these tools run in it;
100
+ * any other call is answered with a refusal. Without a blocker of its own the
101
+ * studio opens one when the run ends (stop reason `loop`).
102
+ */
103
+ export declare const LOOP_CLOSING_TOOLS: ReadonlySet<string>;
104
+ export declare function loopClosingMessage(reason: string): string;
105
+ export declare const LOOP_CLOSING_REFUSAL = "Not run: in your closing round only studio_ask and studio_update_task work.";
106
+ /**
107
+ * A steer (a message the person sends while the run is busy) cuts the round
108
+ * short at the next tool call: the calls left in it are not run but answered
109
+ * with this, and the steer goes in at the start of the next round. Without it
110
+ * a steer waits for every tool of a batched round, which can be minutes.
111
+ */
112
+ export declare const STEER_SKIPPED_RESULT = "Not run: the person sent you a new message while this round was running, so the rest of the round was left out. Read their message first, then call this again only if it still fits.";
113
+ export type RoundCutKind = 'repeat-guard' | 'failures' | 'stopped';
114
+ /**
115
+ * The result for every tool call left in a round that a loop breaker or a
116
+ * studio stop cut short. The provider needs a result for each call of an
117
+ * assistant message; without it the next inference (the closing round, the
118
+ * handoff) throws a missing-tool-result error.
119
+ */
120
+ export declare function roundCutResult(kind: RoundCutKind): string;
121
+ export declare function repeatGuardMessage(toolName: string, count: number): string;
122
+ /** Corrective user message for the forced-synthesis retry: when a round ends
123
+ * with no text and no tool call, this is replayed and one more inference runs
124
+ * with `toolChoice: 'none'`, so the model has no option but to write text. */
125
+ export declare const FORCE_SYNTHESIS_MESSAGE = "Your previous turn produced no message and no tool call. Write your reply to the user now, in plain text: answer their question or summarise what you did. Do not call any tools.";
126
+ /** How many times to re-roll the forced-synthesis inference before giving up
127
+ * and salvaging the last narration/reasoning. Thinking models can close a
128
+ * single re-roll inside their reasoning with no text; a couple of retries
129
+ * almost always lands a plain-text reply. */
130
+ export declare const FORCE_SYNTHESIS_MAX_ATTEMPTS = 3;
131
+ /**
132
+ * Two caps on one tool result, depending on whether the run can point back to
133
+ * the whole output. A longer result is cut to its start and end the moment it
134
+ * is appended, and never touched again: the transcript is append-only (see
135
+ * "Keeping the context bounded" below), so every later round reads it from the
136
+ * prompt cache.
137
+ *
138
+ * The cost reasoning (Opus 5.5): what is appended is written to the cache once
139
+ * (1.25x input) and read on every later round (0.05x), so a few thousand more
140
+ * characters kept in the history cost little per round. Running a call again
141
+ * to see what was cut costs a whole extra inference call, which reads the full
142
+ * context (easily 100k tokens). So:
143
+ * - a result the runtime SPILLED (kept whole in a file the agent can read in
144
+ * ranges) is cut hard, `SPILLED_TOOL_RESULT_MAX_CHARS`: the way back is a
145
+ * cheap ranged read of the copy;
146
+ * - a result with no copy (the studio's internal runtime, a browser or editor
147
+ * frontend, a host tool that is not spilled) keeps `TOOL_RESULT_MAX_CHARS`:
148
+ * its only way back is the re-run we want to avoid.
149
+ * An agent's `toolResultTruncateChars` replaces the second and can only lower
150
+ * the first (`toolResultCaps`). A host tool that pages on its own (a file read)
151
+ * keeps its output under `TOOL_RESULT_MAX_CHARS`, so it is never cut in the
152
+ * middle here.
153
+ */
154
+ export declare const TOOL_RESULT_MAX_CHARS = 20000;
155
+ export declare const SPILLED_TOOL_RESULT_MAX_CHARS = 8000;
156
+ /** The two caps for an agent: `kept` for a result with no copy, `spilled` for
157
+ * one the runtime saved in full. */
158
+ export declare function toolResultCaps(override?: number | null): {
159
+ kept: number;
160
+ spilled: number;
161
+ };
162
+ /**
163
+ * Fit a tool result into `maxChars`: unchanged when it fits, else its start
164
+ * and its end around a note that says how much was cut and where the rest is.
165
+ * `fullOutputAt` is where the runtime kept the whole output (a file the agent
166
+ * can read in ranges), or null when it kept none: the note then asks for a
167
+ * narrower call. Pure, so both loops cut the same way.
168
+ */
169
+ export declare function truncateToolResult(text: string, maxChars?: number, fullOutputAt?: string | null): string;
170
+ /** Fallback context-window size (tokens) when the caller does not pass one. */
171
+ export declare const DEFAULT_CONTEXT_WINDOW_TOKENS = 200000;
172
+ /** The context (input tokens of the last call) at which a run is folded into a
173
+ * summary, however large the model's window. A 1M window would otherwise let
174
+ * a run grow to 800k before anything happened, and every round pays for what
175
+ * it resends: past this size a fresh chain plus one summary call is cheaper
176
+ * than carrying the history on. */
177
+ export declare const COMPACTION_CEILING_TOKENS = 150000;
178
+ /** For a model with a small window, the share of it at which the run folds
179
+ * (the lower of the two thresholds wins). */
180
+ export declare const COMPACTION_WINDOW_RATIO = 0.75;
181
+ /** Rounds a chain needs before it may be folded: a fresh chain whose request
182
+ * alone is over the threshold must not be folded round after round. */
183
+ export declare const COMPACTION_MIN_ROUNDS = 2;
184
+ /** Rounds to wait after a fold that failed before trying again. */
185
+ export declare const COMPACTION_RETRY_ROUNDS = 3;
186
+ /** The context size at which a run is folded, for a model with this window. */
187
+ export declare function compactionThresholdTokens(windowTokens?: number): number;
188
+ /** Marker opening the summary on a fresh chain, so the model reads it as its
189
+ * own work so far rather than as something the person said. */
190
+ export declare const SUMMARY_MARKER_PREFIX = "[Your work on this request so far, folded into a summary to stay within the context window. The earlier turns are gone: trust this summary, your Task context and the working set below, and continue from the next step.]";
191
+ /** Asked at the end of the run's own transcript when the run folds on the
192
+ * agent's own model: the same system prompt, tools and history as the last
193
+ * round, so the call is a cache read and every thinking block stays valid. */
194
+ export declare const COMPACTION_REQUEST_MESSAGE = "Your context is about to be folded: everything above is replaced by the request you are working on and the summary you write now, so write that summary for yourself. Keep, in priority order: the goal and every constraint on it; the concrete facts you found (ids, slugs, paths, urls, names, numbers, data shapes); decisions and why; what is done (files changed, commits made, messages sent, records written); what failed or turned out to be a dead end; and the exact next step. Terse bullet points under short headings. No tool calls. Output only the summary.";
195
+ /** System prompt for the fold on a separate compaction model, which reads the
196
+ * transcript without the agent's reasoning (another model cannot read it). */
197
+ export declare const SUMMARIZE_SYSTEM_PROMPT = "You are compacting an agent's working conversation because it no longer fits in its context window. Everything below is about to be replaced by your summary, so write a dense, faithful summary of what the agent needs to keep working. Preserve, in priority order: the original task and every constraint on it; concrete facts discovered (ids, slugs, paths, URLs, names, numbers, data shapes); decisions made and why; actions already completed and their outcomes; errors and dead ends already hit (so they are not repeated); and the exact next step. Drop chit-chat and reasoning that led nowhere. Use terse bullet points under short headings. Output ONLY the summary, no preamble.";
198
+ /** The turn that closes the transcript for the separate compaction model.
199
+ * Without it the transcript ends on a tool result: with tools off the model
200
+ * reads that as its own turn to continue, finds nothing to say and stops
201
+ * without text (an empty fold, the run goes on at full context). */
202
+ export declare const SUMMARIZE_REQUEST_MESSAGE = "The conversation above is the transcript to compact. Do not continue it and do not call tools: write the summary now, as instructed.";
203
+ /** The message shape both loops speak (the AI SDK's ModelMessage), reduced to
204
+ * what the context rules read. Structural, so the contract imports nothing. */
205
+ export interface LoopMessage {
206
+ role: string;
207
+ content: unknown;
208
+ }
209
+ /** Assistant rounds in a chain: how much work a fold would cover. */
210
+ export declare function roundsInChain(messages: readonly LoopMessage[]): number;
211
+ /** True while the last assistant turn has a tool call without its result: a
212
+ * fold must never cut there (the call's thinking would go back without it). */
213
+ export declare function hasOpenToolCall(messages: readonly LoopMessage[]): boolean;
214
+ /** The transcript without its reasoning parts, for a model that did not write
215
+ * them. An assistant turn left with nothing is dropped. */
216
+ export declare function withoutReasoning(messages: readonly LoopMessage[]): LoopMessage[];
217
+ /**
218
+ * What the run has worked with, read off its transcript: the files it read
219
+ * (with the ranges), searched and changed. A summary written by a model drops
220
+ * exactly these, and then the agent reads the same files again from the top.
221
+ * Empty when there is nothing to list.
222
+ */
223
+ export declare function workingSetLedger(messages: readonly LoopMessage[]): string;
224
+ /** One summary call: `forceNoTools` asks with tool use off. Returns the text,
225
+ * or nothing when the model wrote none. Each loop makes the call its own way. */
226
+ export type SummarizeCall = (request: LoopMessage[], forceNoTools: boolean) => Promise<string | null | undefined>;
227
+ /**
228
+ * Fold a chain into the one message a fresh chain starts with after its system
229
+ * prompt: the request the run is working on (`ask`, verbatim), then the
230
+ * summary and the working set. Null when the fold failed (the run goes on as
231
+ * it was) or would cut a tool round.
232
+ *
233
+ * On the agent's own model the summary is asked at the end of the run's own
234
+ * transcript, with the round's own tools and tool choice: a cache read, and
235
+ * every thinking block in it stays valid. Only when that comes back without
236
+ * text (the model reached for a tool) is it asked once more with tools off.
237
+ * On a separate compaction model (`separateModel`) the transcript goes without
238
+ * the agent's reasoning under the summarizer's own system prompt: that model
239
+ * has no cache of this run to read anyway. It ends on an explicit request
240
+ * (`SUMMARIZE_REQUEST_MESSAGE`) and is asked once more when it comes back empty.
241
+ *
242
+ * `earlier` is what earlier folds already replaced, so the working set still
243
+ * names the files of the whole run.
244
+ */
245
+ export declare function foldTranscript(opts: {
246
+ messages: readonly LoopMessage[];
247
+ ask: LoopMessage | null;
248
+ earlier?: readonly LoopMessage[];
249
+ separateModel: boolean;
250
+ summarize: SummarizeCall;
251
+ }): Promise<LoopMessage | null>;
252
+ /** Handle an in-loop `studio_compact` call for a task run. A task has no
253
+ * persisted conversation to archive (its working context is the loop's
254
+ * in-memory transcript), so the call schedules a fold of that transcript
255
+ * before the next round; folding right here would cut the tool round the call
256
+ * itself is part of. */
257
+ export declare function scheduleInMemoryCompaction(messages: readonly LoopMessage[]): {
258
+ scheduled: boolean;
259
+ reply: string;
260
+ };
261
+ /** Ends after which the task is not done and the next run would start over
262
+ * from the brief. Not `aborted` (a person stopped it: nobody asked for more
263
+ * spending), not `stopped` (the task was cancelled), and not an end the agent
264
+ * chose itself (`hook-stop`, `reply`; a run handed for review writes the
265
+ * short review variant instead, `HANDOFF_REVIEW_MESSAGE`). */
266
+ export declare const HANDOFF_STOP_REASONS: ReadonlySet<LoopStopReason>;
267
+ /** Most the handoff notes may take on the next run's prompt. */
268
+ export declare const HANDOFF_MAX_CHARS = 6000;
269
+ /** Most the notes of a run handed for review may take. */
270
+ export declare const HANDOFF_REVIEW_MAX_CHARS = 2000;
271
+ /** For a run that handed its work for review: what the reviewer, and the run
272
+ * after their feedback, need so neither reads the whole run again. */
273
+ export declare const HANDOFF_REVIEW_MESSAGE = "Your work goes to review now. Whoever reviews it, and the run that picks up their feedback, will NOT see this conversation, so write short notes for them: what you built or changed, the commits, the files and functions where the core of it is (path:line), how you checked it, and anything the reviewer should look at closely. At most 15 terse bullet points. No tool calls.";
274
+ /** The reply of a budget stop when the run wrote none of its own. */
275
+ export declare const BUDGET_STOP_REPLY = "Stopped at the task's budget; the handoff notes say where the work is.";
276
+ /** The same request for a run that stopped on a blocking question: the next
277
+ * run starts once it is answered, with the question and the answer. */
278
+ export declare const HANDOFF_AWAITING_MESSAGE = "This run ends now: you asked a question and the task waits for the answer. Whoever picks it up after the answer starts from the brief, the question and the answer, and will NOT see this conversation, so write handoff notes for them: what is done (files changed, commits made), what you established (facts, paths, ids, commands that work), what is still left and how the answer changes it. Terse bullet points under short headings. No tool calls.";
279
+ export declare const HANDOFF_REQUEST_MESSAGE = "This run is ending now, before the task is done. Whoever picks the task up next starts from the brief and will NOT see this conversation, so write handoff notes for them: what is done (files changed, commits made), what you established (facts, paths, ids, commands that work), what is still left, and what failed or turned out to be a dead end. Terse bullet points under short headings. No tool calls.";
280
+ /**
281
+ * Handoff notes for a task run that ends without delivering: one more round
282
+ * on the same transcript (so it is mostly a cache read) asking the agent what
283
+ * the next run needs, plus the working set read off the transcript. A failed
284
+ * run used to hand the next one nothing but its last 30 activity lines, and the
285
+ * next run re-read every file from the top. `ask` makes the call, first with
286
+ * the chain's own tools and tool choice: anything else is another prefix (with
287
+ * tool use off the request carries no tools at all), and the whole run is
288
+ * written to the cache again for one closing call. Only when that comes back
289
+ * without text (the model reached for a tool anyway) is it asked once more
290
+ * with tool use off, like `foldTranscript`. A call that fails still leaves the
291
+ * working set. `earlier` is what a
292
+ * fold into a summary already replaced, so the working set covers the whole
293
+ * run. Null when the end is not one that needs a handoff, or there is nothing
294
+ * to say.
295
+ */
296
+ export declare function writeRunHandoff(messages: readonly LoopMessage[], stopReason: LoopStopReason, ask: SummarizeCall, earlier?: readonly LoopMessage[], variant?: 'handoff' | 'review'): Promise<string | null>;
297
+ /** What a loop's `writeHandoff` option answers per stop: notes, the short
298
+ * review variant (a run that handed its work for review), or none. */
299
+ export type HandoffChoice = boolean | 'review';
300
+ /** Runner tools that only read the checkout. */
301
+ export declare const READ_ONLY_RUNNER_TOOLS: readonly string[];
302
+ /** Studio tools that only read although their route is not a GET. */
303
+ export declare const READ_ONLY_STUDIO_TOOLS: readonly string[];
304
+ /**
305
+ * True when a tool only reads, so the loop may run it beside the other reads
306
+ * of the same round: a model that asks for six files at once gets them at
307
+ * once, like a person opening six tabs. A studio tool behind a GET route
308
+ * reads by definition. Never `studio_load_toolset` (it changes the tool list)
309
+ * nor the tools the loop handles itself (`studio_pin`, `studio_compact`).
310
+ */
311
+ export declare function isReadOnlyTool(tool: {
312
+ name: string;
313
+ mcpMethod?: string | null;
314
+ }): boolean;
315
+ /**
316
+ * Which calls of a round start at once, side by side: the read-only calls
317
+ * before the first call that changes something (a read after an edit must
318
+ * see the edit), that the repeat guard would let through, and only when there
319
+ * are two or more. Calls the loop handles itself are stepped over. Indexes
320
+ * into `calls`; the loop still appends every result in order.
321
+ */
322
+ export declare function earlyReadIndexes(calls: readonly {
323
+ name: string;
324
+ arguments: unknown;
325
+ }[], lookup: (name: string) => {
326
+ name: string;
327
+ mcpMethod?: string | null;
328
+ } | undefined, priorCounts: ReadonlyMap<string, number>, stopAt?: number): number[];
329
+ /** Reads in a task run without one pin, after which the run is reminded once. */
330
+ export declare const PIN_NUDGE_AFTER_READS = 8;
331
+ /** A step that reads the checkout or a page: what the nudge counts. */
332
+ export declare function isReadStep(name: string): boolean;
333
+ /** Appended once to a read's result in a task run that read a lot and pinned nothing. */
334
+ export declare const PIN_NUDGE_NOTE = "\n\n[Studio] You have read a lot without pinning anything. Pin what you established so far with studio_pin (path, function, what you found): pins survive a fold into a summary and carry over to the next run of this task, so nothing has to be read twice.";
335
+ /** Tool calls since the last `studio_manage_todos` after which a run with open todos is reminded. */
336
+ export declare const TODO_NUDGE_AFTER_CALLS = 6;
337
+ /** Reminders per run at most: a run that ignores them is not kept busy with them. */
338
+ export declare const MAX_TODO_NUDGES = 3;
339
+ /** Calls that do not count as work towards the todo reminder. */
340
+ export declare function countsForTodoNudge(name: string): boolean;
341
+ interface TodoLike {
342
+ title?: unknown;
343
+ status?: unknown;
344
+ }
345
+ /** The todos passed to a `studio_manage_todos` call, or null when the arguments hold none. */
346
+ export declare function todosFromArgs(args: unknown): TodoLike[] | null;
347
+ /**
348
+ * The note appended to a tool result when the run's todo list still has open
349
+ * items and has not changed for `TODO_NUDGE_AFTER_CALLS` calls; null when
350
+ * every item is completed (nothing to remind of).
351
+ */
352
+ export declare function todoNudgeNote(todos: readonly TodoLike[]): string | null;
353
+ /**
354
+ * The note that holds back a run closing (a final reply, or a task set to
355
+ * `done` / `in_review`) while its todo list still has open items: review the
356
+ * list, then either do what is left or tick it off. Null when every item is
357
+ * completed (or there is no list).
358
+ */
359
+ export declare function openTodosAtEndNote(todos: readonly TodoLike[] | null | undefined): string | null;
360
+ export declare function pendingActionInReply(reply: string): string | null;
361
+ export declare function pendingActionNudge(action: string): string;
362
+ export {};