@namzu/sdk 68.0.1 → 69.1.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 (492) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/agents/QueryAgent.d.ts.map +1 -1
  3. package/dist/agents/QueryAgent.js +2 -0
  4. package/dist/agents/QueryAgent.js.map +1 -1
  5. package/dist/authorization/skill-grant.d.ts.map +1 -1
  6. package/dist/authorization/skill-grant.js +1 -0
  7. package/dist/authorization/skill-grant.js.map +1 -1
  8. package/dist/bridge/acp/permission.d.ts +10 -0
  9. package/dist/bridge/acp/permission.d.ts.map +1 -1
  10. package/dist/bridge/acp/permission.js.map +1 -1
  11. package/dist/bridge/acp/server.d.ts +12 -0
  12. package/dist/bridge/acp/server.d.ts.map +1 -1
  13. package/dist/bridge/acp/server.js +21 -0
  14. package/dist/bridge/acp/server.js.map +1 -1
  15. package/dist/compaction/context-window.d.ts +8 -0
  16. package/dist/compaction/context-window.d.ts.map +1 -1
  17. package/dist/compaction/context-window.js +14 -0
  18. package/dist/compaction/context-window.js.map +1 -1
  19. package/dist/compaction/loaded-skills.d.ts +10 -0
  20. package/dist/compaction/loaded-skills.d.ts.map +1 -1
  21. package/dist/compaction/loaded-skills.js +45 -1
  22. package/dist/compaction/loaded-skills.js.map +1 -1
  23. package/dist/compaction/manager.d.ts +8 -0
  24. package/dist/compaction/manager.d.ts.map +1 -1
  25. package/dist/compaction/manager.js +31 -0
  26. package/dist/compaction/manager.js.map +1 -1
  27. package/dist/compaction/manual.d.ts.map +1 -1
  28. package/dist/compaction/manual.js +7 -1
  29. package/dist/compaction/manual.js.map +1 -1
  30. package/dist/compaction/model-summary.js +2 -2
  31. package/dist/compaction/model-summary.js.map +1 -1
  32. package/dist/compaction/restore.d.ts +8 -0
  33. package/dist/compaction/restore.d.ts.map +1 -1
  34. package/dist/compaction/restore.js +65 -0
  35. package/dist/compaction/restore.js.map +1 -1
  36. package/dist/compaction/salience/working-set.d.ts.map +1 -1
  37. package/dist/compaction/salience/working-set.js +2 -2
  38. package/dist/compaction/salience/working-set.js.map +1 -1
  39. package/dist/compaction/tool-result-editing.d.ts +6 -0
  40. package/dist/compaction/tool-result-editing.d.ts.map +1 -1
  41. package/dist/compaction/tool-result-editing.js +7 -1
  42. package/dist/compaction/tool-result-editing.js.map +1 -1
  43. package/dist/compaction/types.d.ts +2 -0
  44. package/dist/compaction/types.d.ts.map +1 -1
  45. package/dist/compaction/wire.d.ts.map +1 -1
  46. package/dist/compaction/wire.js +4 -0
  47. package/dist/compaction/wire.js.map +1 -1
  48. package/dist/connector/index.d.ts +2 -2
  49. package/dist/connector/index.d.ts.map +1 -1
  50. package/dist/connector/index.js +1 -1
  51. package/dist/connector/index.js.map +1 -1
  52. package/dist/connector/mcp/client.d.ts +29 -0
  53. package/dist/connector/mcp/client.d.ts.map +1 -1
  54. package/dist/connector/mcp/client.js +59 -2
  55. package/dist/connector/mcp/client.js.map +1 -1
  56. package/dist/connector/mcp/errors.d.ts +7 -0
  57. package/dist/connector/mcp/errors.d.ts.map +1 -1
  58. package/dist/connector/mcp/errors.js +14 -0
  59. package/dist/connector/mcp/errors.js.map +1 -1
  60. package/dist/connector/mcp/index.d.ts +5 -1
  61. package/dist/connector/mcp/index.d.ts.map +1 -1
  62. package/dist/connector/mcp/index.js +3 -1
  63. package/dist/connector/mcp/index.js.map +1 -1
  64. package/dist/connector/mcp/skill-source.d.ts +144 -0
  65. package/dist/connector/mcp/skill-source.d.ts.map +1 -0
  66. package/dist/connector/mcp/skill-source.js +375 -0
  67. package/dist/connector/mcp/skill-source.js.map +1 -0
  68. package/dist/connector/mcp/skills.d.ts +137 -0
  69. package/dist/connector/mcp/skills.d.ts.map +1 -0
  70. package/dist/connector/mcp/skills.js +303 -0
  71. package/dist/connector/mcp/skills.js.map +1 -0
  72. package/dist/manager/session/turn-recorder.d.ts.map +1 -1
  73. package/dist/manager/session/turn-recorder.js +23 -1
  74. package/dist/manager/session/turn-recorder.js.map +1 -1
  75. package/dist/network/audit.d.ts +1 -1
  76. package/dist/network/audit.d.ts.map +1 -1
  77. package/dist/network/audit.js +2 -0
  78. package/dist/network/audit.js.map +1 -1
  79. package/dist/network/computer.d.ts +107 -0
  80. package/dist/network/computer.d.ts.map +1 -0
  81. package/dist/network/computer.js +250 -0
  82. package/dist/network/computer.js.map +1 -0
  83. package/dist/network/index.d.ts +2 -0
  84. package/dist/network/index.d.ts.map +1 -1
  85. package/dist/network/index.js +1 -0
  86. package/dist/network/index.js.map +1 -1
  87. package/dist/network/join.d.ts +13 -1
  88. package/dist/network/join.d.ts.map +1 -1
  89. package/dist/network/join.js +21 -3
  90. package/dist/network/join.js.map +1 -1
  91. package/dist/network/roster.d.ts +5 -0
  92. package/dist/network/roster.d.ts.map +1 -1
  93. package/dist/network/roster.js.map +1 -1
  94. package/dist/network/service.d.ts +12 -2
  95. package/dist/network/service.d.ts.map +1 -1
  96. package/dist/network/service.js +539 -60
  97. package/dist/network/service.js.map +1 -1
  98. package/dist/network/store.d.ts +33 -1
  99. package/dist/network/store.d.ts.map +1 -1
  100. package/dist/network/store.js +48 -4
  101. package/dist/network/store.js.map +1 -1
  102. package/dist/network/transport.d.ts +1 -1
  103. package/dist/network/transport.js +1 -1
  104. package/dist/network/wire.d.ts +14 -0
  105. package/dist/network/wire.d.ts.map +1 -1
  106. package/dist/network/wire.js +17 -1
  107. package/dist/network/wire.js.map +1 -1
  108. package/dist/plugin/shell-hook-tool-names.d.ts.map +1 -1
  109. package/dist/plugin/shell-hook-tool-names.js +1 -0
  110. package/dist/plugin/shell-hook-tool-names.js.map +1 -1
  111. package/dist/plugin/shell-hook.d.ts +8 -3
  112. package/dist/plugin/shell-hook.d.ts.map +1 -1
  113. package/dist/plugin/shell-hook.js +132 -7
  114. package/dist/plugin/shell-hook.js.map +1 -1
  115. package/dist/prompt/coding-agent-doctrine.d.ts +4 -4
  116. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  117. package/dist/prompt/coding-agent-doctrine.js +7 -2
  118. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  119. package/dist/provider/fallback.d.ts.map +1 -1
  120. package/dist/provider/fallback.js +9 -0
  121. package/dist/provider/fallback.js.map +1 -1
  122. package/dist/provider/idle-timeout.d.ts.map +1 -1
  123. package/dist/provider/idle-timeout.js +8 -0
  124. package/dist/provider/idle-timeout.js.map +1 -1
  125. package/dist/provider/instrumentation.d.ts.map +1 -1
  126. package/dist/provider/instrumentation.js +10 -0
  127. package/dist/provider/instrumentation.js.map +1 -1
  128. package/dist/provider/model-window-suffix.d.ts.map +1 -1
  129. package/dist/provider/model-window-suffix.js +2 -0
  130. package/dist/provider/model-window-suffix.js.map +1 -1
  131. package/dist/provider/retry.d.ts.map +1 -1
  132. package/dist/provider/retry.js +8 -0
  133. package/dist/provider/retry.js.map +1 -1
  134. package/dist/public-runtime.d.ts +10 -7
  135. package/dist/public-runtime.d.ts.map +1 -1
  136. package/dist/public-runtime.js +12 -5
  137. package/dist/public-runtime.js.map +1 -1
  138. package/dist/public-tools.d.ts +7 -4
  139. package/dist/public-tools.d.ts.map +1 -1
  140. package/dist/public-tools.js +9 -3
  141. package/dist/public-tools.js.map +1 -1
  142. package/dist/public-types.d.ts +4 -1
  143. package/dist/public-types.d.ts.map +1 -1
  144. package/dist/registry/tool/presentation.d.ts +8 -1
  145. package/dist/registry/tool/presentation.d.ts.map +1 -1
  146. package/dist/registry/tool/presentation.js +14 -5
  147. package/dist/registry/tool/presentation.js.map +1 -1
  148. package/dist/runtime/jobs/registry.d.ts.map +1 -1
  149. package/dist/runtime/jobs/registry.js +2 -1
  150. package/dist/runtime/jobs/registry.js.map +1 -1
  151. package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
  152. package/dist/runtime/query/auto-review/classifier.js +19 -3
  153. package/dist/runtime/query/auto-review/classifier.js.map +1 -1
  154. package/dist/runtime/query/auto-review/failure.d.ts +12 -0
  155. package/dist/runtime/query/auto-review/failure.d.ts.map +1 -0
  156. package/dist/runtime/query/auto-review/failure.js +46 -0
  157. package/dist/runtime/query/auto-review/failure.js.map +1 -0
  158. package/dist/runtime/query/auto-review/index.d.ts +1 -0
  159. package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
  160. package/dist/runtime/query/auto-review/index.js +1 -0
  161. package/dist/runtime/query/auto-review/index.js.map +1 -1
  162. package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
  163. package/dist/runtime/query/executor/tool-call-admission.js +10 -1
  164. package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
  165. package/dist/runtime/query/executor.d.ts +12 -0
  166. package/dist/runtime/query/executor.d.ts.map +1 -1
  167. package/dist/runtime/query/executor.js +43 -9
  168. package/dist/runtime/query/executor.js.map +1 -1
  169. package/dist/runtime/query/file-evidence-replay.d.ts.map +1 -1
  170. package/dist/runtime/query/file-evidence-replay.js +6 -6
  171. package/dist/runtime/query/file-evidence-replay.js.map +1 -1
  172. package/dist/runtime/query/index.d.ts +4 -0
  173. package/dist/runtime/query/index.d.ts.map +1 -1
  174. package/dist/runtime/query/index.js +40 -1
  175. package/dist/runtime/query/index.js.map +1 -1
  176. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  177. package/dist/runtime/query/iteration/index.js +2 -0
  178. package/dist/runtime/query/iteration/index.js.map +1 -1
  179. package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
  180. package/dist/runtime/query/iteration/phases/compaction.js +21 -3
  181. package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
  182. package/dist/runtime/query/iteration/phases/context.d.ts +4 -0
  183. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  184. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  185. package/dist/runtime/query/iteration/phases/per-call-review.d.ts +6 -2
  186. package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -1
  187. package/dist/runtime/query/iteration/phases/per-call-review.js +24 -9
  188. package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
  189. package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
  190. package/dist/runtime/query/iteration/step-shaping.js +4 -0
  191. package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
  192. package/dist/runtime/query/prepare-turn.d.ts +5 -1
  193. package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
  194. package/dist/runtime/query/prepare-turn.js +13 -3
  195. package/dist/runtime/query/prepare-turn.js.map +1 -1
  196. package/dist/runtime/query/review-policy.d.ts +15 -4
  197. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  198. package/dist/runtime/query/review-policy.js +15 -4
  199. package/dist/runtime/query/review-policy.js.map +1 -1
  200. package/dist/runtime/query/shell-line-escalation.d.ts +24 -0
  201. package/dist/runtime/query/shell-line-escalation.d.ts.map +1 -0
  202. package/dist/runtime/query/shell-line-escalation.js +38 -0
  203. package/dist/runtime/query/shell-line-escalation.js.map +1 -0
  204. package/dist/runtime/query/tooling.d.ts +7 -0
  205. package/dist/runtime/query/tooling.d.ts.map +1 -1
  206. package/dist/runtime/query/tooling.js +2 -0
  207. package/dist/runtime/query/tooling.js.map +1 -1
  208. package/dist/runtime/query/turn/outcome-ledger.d.ts +4 -0
  209. package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
  210. package/dist/runtime/query/turn/outcome-ledger.js +47 -1
  211. package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
  212. package/dist/sandbox/provider/local.d.ts.map +1 -1
  213. package/dist/sandbox/provider/local.js +3 -1
  214. package/dist/sandbox/provider/local.js.map +1 -1
  215. package/dist/scheduler/local.d.ts.map +1 -1
  216. package/dist/scheduler/local.js +3 -1
  217. package/dist/scheduler/local.js.map +1 -1
  218. package/dist/skills/index.d.ts +4 -0
  219. package/dist/skills/index.d.ts.map +1 -1
  220. package/dist/skills/index.js +2 -0
  221. package/dist/skills/index.js.map +1 -1
  222. package/dist/skills/inline-shell-host.d.ts +103 -0
  223. package/dist/skills/inline-shell-host.d.ts.map +1 -0
  224. package/dist/skills/inline-shell-host.js +238 -0
  225. package/dist/skills/inline-shell-host.js.map +1 -0
  226. package/dist/skills/inline-shell.d.ts +176 -0
  227. package/dist/skills/inline-shell.d.ts.map +1 -0
  228. package/dist/skills/inline-shell.js +646 -0
  229. package/dist/skills/inline-shell.js.map +1 -0
  230. package/dist/store/index.d.ts +2 -0
  231. package/dist/store/index.d.ts.map +1 -1
  232. package/dist/store/index.js +1 -0
  233. package/dist/store/index.js.map +1 -1
  234. package/dist/store/task/file.d.ts +124 -0
  235. package/dist/store/task/file.d.ts.map +1 -0
  236. package/dist/store/task/file.js +498 -0
  237. package/dist/store/task/file.js.map +1 -0
  238. package/dist/teams/backend.d.ts +28 -0
  239. package/dist/teams/backend.d.ts.map +1 -0
  240. package/dist/teams/backend.js +2 -0
  241. package/dist/teams/backend.js.map +1 -0
  242. package/dist/teams/fs-sync.d.ts +19 -0
  243. package/dist/teams/fs-sync.d.ts.map +1 -0
  244. package/dist/teams/fs-sync.js +81 -0
  245. package/dist/teams/fs-sync.js.map +1 -0
  246. package/dist/teams/index.d.ts +14 -0
  247. package/dist/teams/index.d.ts.map +1 -0
  248. package/dist/teams/index.js +11 -0
  249. package/dist/teams/index.js.map +1 -0
  250. package/dist/teams/names.d.ts +15 -0
  251. package/dist/teams/names.d.ts.map +1 -0
  252. package/dist/teams/names.js +43 -0
  253. package/dist/teams/names.js.map +1 -0
  254. package/dist/teams/store.d.ts +133 -0
  255. package/dist/teams/store.d.ts.map +1 -0
  256. package/dist/teams/store.js +536 -0
  257. package/dist/teams/store.js.map +1 -0
  258. package/dist/teams/types.d.ts +97 -0
  259. package/dist/teams/types.d.ts.map +1 -0
  260. package/dist/teams/types.js +70 -0
  261. package/dist/teams/types.js.map +1 -0
  262. package/dist/tools/admit-facts.d.ts.map +1 -1
  263. package/dist/tools/admit-facts.js +28 -0
  264. package/dist/tools/admit-facts.js.map +1 -1
  265. package/dist/tools/builtins/bash.d.ts.map +1 -1
  266. package/dist/tools/builtins/bash.js +5 -2
  267. package/dist/tools/builtins/bash.js.map +1 -1
  268. package/dist/tools/builtins/browser.js +1 -1
  269. package/dist/tools/builtins/browser.js.map +1 -1
  270. package/dist/tools/builtins/computer-use.d.ts +60 -2
  271. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  272. package/dist/tools/builtins/computer-use.js +695 -80
  273. package/dist/tools/builtins/computer-use.js.map +1 -1
  274. package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
  275. package/dist/tools/builtins/content-fingerprint.js +2 -1
  276. package/dist/tools/builtins/content-fingerprint.js.map +1 -1
  277. package/dist/tools/builtins/edit-apply.d.ts +1 -0
  278. package/dist/tools/builtins/edit-apply.d.ts.map +1 -1
  279. package/dist/tools/builtins/edit-apply.js +108 -21
  280. package/dist/tools/builtins/edit-apply.js.map +1 -1
  281. package/dist/tools/builtins/edit-match.d.ts +37 -0
  282. package/dist/tools/builtins/edit-match.d.ts.map +1 -1
  283. package/dist/tools/builtins/edit-match.js +193 -0
  284. package/dist/tools/builtins/edit-match.js.map +1 -1
  285. package/dist/tools/builtins/edit.d.ts.map +1 -1
  286. package/dist/tools/builtins/edit.js +14 -7
  287. package/dist/tools/builtins/edit.js.map +1 -1
  288. package/dist/tools/builtins/exit-semantics.d.ts +8 -0
  289. package/dist/tools/builtins/exit-semantics.d.ts.map +1 -1
  290. package/dist/tools/builtins/exit-semantics.js +19 -0
  291. package/dist/tools/builtins/exit-semantics.js.map +1 -1
  292. package/dist/tools/builtins/index.d.ts +3 -1
  293. package/dist/tools/builtins/index.d.ts.map +1 -1
  294. package/dist/tools/builtins/index.js +1 -0
  295. package/dist/tools/builtins/index.js.map +1 -1
  296. package/dist/tools/builtins/present-file.d.ts +24 -0
  297. package/dist/tools/builtins/present-file.d.ts.map +1 -0
  298. package/dist/tools/builtins/present-file.js +116 -0
  299. package/dist/tools/builtins/present-file.js.map +1 -0
  300. package/dist/tools/builtins/read-file.js +1 -1
  301. package/dist/tools/builtins/read-file.js.map +1 -1
  302. package/dist/tools/builtins/read-render.d.ts +12 -1
  303. package/dist/tools/builtins/read-render.d.ts.map +1 -1
  304. package/dist/tools/builtins/read-render.js +16 -3
  305. package/dist/tools/builtins/read-render.js.map +1 -1
  306. package/dist/tools/builtins/search-tools.d.ts +10 -0
  307. package/dist/tools/builtins/search-tools.d.ts.map +1 -1
  308. package/dist/tools/builtins/search-tools.js +36 -2
  309. package/dist/tools/builtins/search-tools.js.map +1 -1
  310. package/dist/tools/builtins/skill.d.ts +31 -0
  311. package/dist/tools/builtins/skill.d.ts.map +1 -1
  312. package/dist/tools/builtins/skill.js +232 -88
  313. package/dist/tools/builtins/skill.js.map +1 -1
  314. package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
  315. package/dist/tools/builtins/wait-for-job.js +5 -0
  316. package/dist/tools/builtins/wait-for-job.js.map +1 -1
  317. package/dist/tools/builtins/web.d.ts.map +1 -1
  318. package/dist/tools/builtins/web.js +13 -2
  319. package/dist/tools/builtins/web.js.map +1 -1
  320. package/dist/tools/task/create.d.ts.map +1 -1
  321. package/dist/tools/task/create.js +13 -4
  322. package/dist/tools/task/create.js.map +1 -1
  323. package/dist/tools/task/get.d.ts +8 -0
  324. package/dist/tools/task/get.d.ts.map +1 -0
  325. package/dist/tools/task/get.js +51 -0
  326. package/dist/tools/task/get.js.map +1 -0
  327. package/dist/tools/task/index.d.ts +7 -0
  328. package/dist/tools/task/index.d.ts.map +1 -1
  329. package/dist/tools/task/index.js +10 -2
  330. package/dist/tools/task/index.js.map +1 -1
  331. package/dist/tools/task/list.d.ts.map +1 -1
  332. package/dist/tools/task/list.js +10 -2
  333. package/dist/tools/task/list.js.map +1 -1
  334. package/dist/tools/task/number.d.ts +13 -0
  335. package/dist/tools/task/number.d.ts.map +1 -0
  336. package/dist/tools/task/number.js +30 -0
  337. package/dist/tools/task/number.js.map +1 -0
  338. package/dist/tools/task/present.d.ts.map +1 -1
  339. package/dist/tools/task/present.js +17 -3
  340. package/dist/tools/task/present.js.map +1 -1
  341. package/dist/tools/task/update.d.ts +2 -1
  342. package/dist/tools/task/update.d.ts.map +1 -1
  343. package/dist/tools/task/update.js +87 -20
  344. package/dist/tools/task/update.js.map +1 -1
  345. package/dist/types/acp/index.d.ts +10 -0
  346. package/dist/types/acp/index.d.ts.map +1 -1
  347. package/dist/types/agent/base.d.ts +4 -0
  348. package/dist/types/agent/base.d.ts.map +1 -1
  349. package/dist/types/agent/scheduler.d.ts +9 -0
  350. package/dist/types/agent/scheduler.d.ts.map +1 -1
  351. package/dist/types/computer-use/index.d.ts +7 -0
  352. package/dist/types/computer-use/index.d.ts.map +1 -1
  353. package/dist/types/computer-use/index.js.map +1 -1
  354. package/dist/types/connector/mcp.d.ts +10 -0
  355. package/dist/types/connector/mcp.d.ts.map +1 -1
  356. package/dist/types/permission/index.d.ts +20 -0
  357. package/dist/types/permission/index.d.ts.map +1 -1
  358. package/dist/types/permission/index.js +25 -0
  359. package/dist/types/permission/index.js.map +1 -1
  360. package/dist/types/plugin/index.d.ts +47 -3
  361. package/dist/types/plugin/index.d.ts.map +1 -1
  362. package/dist/types/plugin/index.js +4 -0
  363. package/dist/types/plugin/index.js.map +1 -1
  364. package/dist/types/provider/chat.d.ts +8 -0
  365. package/dist/types/provider/chat.d.ts.map +1 -1
  366. package/dist/types/provider/interface.d.ts +16 -0
  367. package/dist/types/provider/interface.d.ts.map +1 -1
  368. package/dist/types/provider/model.d.ts +6 -0
  369. package/dist/types/provider/model.d.ts.map +1 -1
  370. package/dist/types/provider/stream.d.ts +2 -0
  371. package/dist/types/provider/stream.d.ts.map +1 -1
  372. package/dist/types/tool/index.d.ts +28 -2
  373. package/dist/types/tool/index.d.ts.map +1 -1
  374. package/dist/types/tool/index.js.map +1 -1
  375. package/dist/types/tool/presentation.d.ts +15 -0
  376. package/dist/types/tool/presentation.d.ts.map +1 -1
  377. package/dist/utils/node-on-path.d.ts +27 -0
  378. package/dist/utils/node-on-path.d.ts.map +1 -0
  379. package/dist/utils/node-on-path.js +70 -0
  380. package/dist/utils/node-on-path.js.map +1 -0
  381. package/package.json +1 -1
  382. package/src/agents/QueryAgent.ts +2 -0
  383. package/src/authorization/skill-grant.ts +1 -0
  384. package/src/bridge/acp/permission.ts +11 -1
  385. package/src/bridge/acp/server.ts +26 -0
  386. package/src/compaction/context-window.ts +18 -0
  387. package/src/compaction/loaded-skills.ts +42 -1
  388. package/src/compaction/manager.ts +28 -0
  389. package/src/compaction/manual.ts +9 -1
  390. package/src/compaction/model-summary.ts +2 -2
  391. package/src/compaction/restore.ts +69 -0
  392. package/src/compaction/salience/working-set.ts +6 -2
  393. package/src/compaction/tool-result-editing.ts +8 -1
  394. package/src/compaction/types.ts +2 -0
  395. package/src/compaction/wire.ts +4 -0
  396. package/src/connector/index.ts +27 -0
  397. package/src/connector/mcp/client.ts +71 -2
  398. package/src/connector/mcp/errors.ts +14 -0
  399. package/src/connector/mcp/index.ts +36 -0
  400. package/src/connector/mcp/skill-source.ts +499 -0
  401. package/src/connector/mcp/skills.ts +367 -0
  402. package/src/manager/session/turn-recorder.ts +24 -1
  403. package/src/network/audit.ts +2 -0
  404. package/src/network/computer.ts +347 -0
  405. package/src/network/index.ts +20 -0
  406. package/src/network/join.ts +21 -2
  407. package/src/network/roster.ts +5 -0
  408. package/src/network/service.ts +674 -84
  409. package/src/network/store.ts +57 -4
  410. package/src/network/transport.ts +1 -1
  411. package/src/network/wire.ts +18 -1
  412. package/src/plugin/shell-hook-tool-names.ts +1 -0
  413. package/src/plugin/shell-hook.ts +144 -7
  414. package/src/prompt/coding-agent-doctrine.ts +7 -2
  415. package/src/provider/fallback.ts +10 -0
  416. package/src/provider/idle-timeout.ts +9 -0
  417. package/src/provider/instrumentation.ts +12 -0
  418. package/src/provider/model-window-suffix.ts +2 -0
  419. package/src/provider/retry.ts +9 -0
  420. package/src/public-runtime.ts +100 -0
  421. package/src/public-tools.ts +18 -0
  422. package/src/public-types.ts +29 -0
  423. package/src/registry/tool/presentation.ts +14 -4
  424. package/src/runtime/jobs/registry.ts +2 -1
  425. package/src/runtime/query/auto-review/classifier.ts +19 -3
  426. package/src/runtime/query/auto-review/failure.ts +50 -0
  427. package/src/runtime/query/auto-review/index.ts +1 -0
  428. package/src/runtime/query/executor/tool-call-admission.ts +10 -1
  429. package/src/runtime/query/executor.ts +57 -8
  430. package/src/runtime/query/file-evidence-replay.ts +6 -5
  431. package/src/runtime/query/index.ts +62 -0
  432. package/src/runtime/query/iteration/index.ts +2 -0
  433. package/src/runtime/query/iteration/phases/compaction.ts +25 -2
  434. package/src/runtime/query/iteration/phases/context.ts +4 -0
  435. package/src/runtime/query/iteration/phases/per-call-review.ts +24 -7
  436. package/src/runtime/query/iteration/step-shaping.ts +4 -0
  437. package/src/runtime/query/prepare-turn.ts +20 -2
  438. package/src/runtime/query/review-policy.ts +31 -5
  439. package/src/runtime/query/shell-line-escalation.ts +49 -0
  440. package/src/runtime/query/tooling.ts +6 -0
  441. package/src/runtime/query/turn/outcome-ledger.ts +56 -1
  442. package/src/sandbox/provider/local.ts +3 -1
  443. package/src/scheduler/local.ts +3 -1
  444. package/src/skills/index.ts +43 -0
  445. package/src/skills/inline-shell-host.ts +303 -0
  446. package/src/skills/inline-shell.ts +765 -0
  447. package/src/store/index.ts +8 -0
  448. package/src/store/task/file.ts +641 -0
  449. package/src/teams/backend.ts +29 -0
  450. package/src/teams/fs-sync.ts +91 -0
  451. package/src/teams/index.ts +47 -0
  452. package/src/teams/names.ts +49 -0
  453. package/src/teams/store.ts +607 -0
  454. package/src/teams/types.ts +102 -0
  455. package/src/tools/admit-facts.ts +26 -0
  456. package/src/tools/builtins/bash.ts +5 -2
  457. package/src/tools/builtins/browser.ts +1 -1
  458. package/src/tools/builtins/computer-use.ts +799 -86
  459. package/src/tools/builtins/content-fingerprint.ts +2 -1
  460. package/src/tools/builtins/edit-apply.ts +124 -24
  461. package/src/tools/builtins/edit-match.ts +200 -0
  462. package/src/tools/builtins/edit.ts +16 -7
  463. package/src/tools/builtins/exit-semantics.ts +23 -0
  464. package/src/tools/builtins/index.ts +3 -0
  465. package/src/tools/builtins/present-file.ts +127 -0
  466. package/src/tools/builtins/read-file.ts +1 -1
  467. package/src/tools/builtins/read-render.ts +18 -3
  468. package/src/tools/builtins/search-tools.ts +36 -2
  469. package/src/tools/builtins/skill.ts +291 -95
  470. package/src/tools/builtins/wait-for-job.ts +5 -0
  471. package/src/tools/builtins/web.ts +15 -2
  472. package/src/tools/task/create.ts +13 -4
  473. package/src/tools/task/get.ts +53 -0
  474. package/src/tools/task/index.ts +14 -2
  475. package/src/tools/task/list.ts +10 -2
  476. package/src/tools/task/number.ts +32 -0
  477. package/src/tools/task/present.ts +18 -3
  478. package/src/tools/task/update.ts +94 -20
  479. package/src/types/acp/index.ts +11 -1
  480. package/src/types/agent/base.ts +6 -0
  481. package/src/types/agent/scheduler.ts +9 -0
  482. package/src/types/computer-use/index.ts +7 -0
  483. package/src/types/connector/mcp.ts +10 -0
  484. package/src/types/permission/index.ts +29 -0
  485. package/src/types/plugin/index.ts +95 -39
  486. package/src/types/provider/chat.ts +9 -0
  487. package/src/types/provider/interface.ts +18 -0
  488. package/src/types/provider/model.ts +6 -0
  489. package/src/types/provider/stream.ts +2 -0
  490. package/src/types/tool/index.ts +23 -2
  491. package/src/types/tool/presentation.ts +14 -0
  492. package/src/utils/node-on-path.ts +81 -0
@@ -226,6 +226,15 @@ export type PluginHookEvent =
226
226
  * command expanded to. `skip` stops it, and `annotate` adds context.
227
227
  */
228
228
  | 'user_prompt_expansion'
229
+ /**
230
+ * A shell command written inside a skill or a custom command is about to run
231
+ * while that text loads (`!`cmd`` or a fenced block opened with three backticks
232
+ * and a bang), after the permission check allowed it and before it starts.
233
+ * Carries `toolName`, `toolInput` (`command`), `toolCallId` (new for each
234
+ * command) and `skillShell`. `skip` refuses that one command, which stays
235
+ * out of the text; `continue` with `halt` stops the whole load.
236
+ */
237
+ | 'pre_skill_shell_command'
229
238
  /**
230
239
  * A task is being created (`task_create`), before it is. Carries `task`.
231
240
  * `skip` refuses it, and the reason reaches the model.
@@ -237,6 +246,16 @@ export type PluginHookEvent =
237
246
  * reason reaches the model.
238
247
  */
239
248
  | 'task_completed'
249
+ /**
250
+ * A teammate has finished its turn and is about to go idle. Carries
251
+ * `teammateName` and `teamName`. `skip` keeps it working: the reason is sent
252
+ * to it as feedback (shell exit code 2).
253
+ */
254
+ | 'teammate_idle'
255
+ /** A teammate was started. Carries `teammateName` and `teamName`. Observational. */
256
+ | 'teammate_start'
257
+ /** A teammate left the team (shut down, stopped or ended). Carries `teammateName` and `teamName`. Observational. */
258
+ | 'teammate_stop'
240
259
  | 'pre_llm_call'
241
260
  | 'post_llm_call'
242
261
  | 'iteration_start'
@@ -287,8 +306,12 @@ export function assertPluginHookEvent(event: PluginHookEvent): void {
287
306
  case 'directory_added':
288
307
  case 'instructions_loaded':
289
308
  case 'user_prompt_expansion':
309
+ case 'pre_skill_shell_command':
290
310
  case 'task_created':
291
311
  case 'task_completed':
312
+ case 'teammate_idle':
313
+ case 'teammate_start':
314
+ case 'teammate_stop':
292
315
  case 'pre_llm_call':
293
316
  case 'post_llm_call':
294
317
  case 'iteration_start':
@@ -483,6 +506,22 @@ export interface PluginPromptExpansionInfo {
483
506
  readonly commandSource?: string
484
507
  }
485
508
 
509
+ /** Who asked for a skill or command to load, on `pre_skill_shell_command`. */
510
+ export type PluginSkillShellInvoker = 'user' | 'model' | 'other'
511
+
512
+ /** What a `pre_skill_shell_command` hook is shown beside the command itself. */
513
+ export interface PluginSkillShellInfo {
514
+ /** The skill or command whose text holds the shell command, without the slash. */
515
+ readonly commandName: string
516
+ /** Where it came from (`user`, `project`, `plugin`, `skill`, `system`), when known. */
517
+ readonly commandSource?: string
518
+ /**
519
+ * `user` for a command the person typed, `model` for the skill tool, `other`
520
+ * for a preload into a sub-agent or anything not known.
521
+ */
522
+ readonly invokedBy: PluginSkillShellInvoker
523
+ }
524
+
486
525
  /** What a task hook is shown. */
487
526
  export interface PluginTaskInfo {
488
527
  /** Absent on `task_created`: the task has no id yet. */
@@ -538,8 +577,17 @@ export interface PluginHookContext {
538
577
  readonly instructions?: PluginInstructionsInfo
539
578
  /** The command that expanded, on `user_prompt_expansion`. */
540
579
  readonly expansion?: PluginPromptExpansionInfo
580
+ /** The skill or command that holds the shell command, on `pre_skill_shell_command`. */
581
+ readonly skillShell?: PluginSkillShellInfo
541
582
  /** The task, on `task_created` and `task_completed`. */
542
583
  readonly task?: PluginTaskInfo
584
+ /**
585
+ * The teammate's name, on `teammate_idle`, `teammate_start` and `teammate_stop`, and on
586
+ * `task_created` and `task_completed` when a teammate makes or completes the task.
587
+ */
588
+ readonly teammateName?: string
589
+ /** The team that teammate belongs to; present wherever `teammateName` is. */
590
+ readonly teamName?: string
543
591
  /** The pass, on `pre_compact` and `post_compact`. */
544
592
  readonly compaction?: PluginCompactionInfo
545
593
  readonly toolName?: string
@@ -761,46 +809,54 @@ export type PluginHookResultFor<E extends PluginHookEvent> = E extends 'user_pro
761
809
  ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'skip' | 'error' }>
762
810
  : E extends 'user_prompt_expansion'
763
811
  ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'skip' | 'error' }>
764
- : E extends
765
- | 'pre_model_switch'
766
- | 'elicitation'
767
- | 'elicitation_result'
768
- | 'task_created'
769
- | 'task_completed'
812
+ : E extends 'pre_skill_shell_command'
770
813
  ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
771
- : E extends 'post_model_switch'
772
- ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
773
- : E extends 'directory_added' | 'instructions_loaded'
774
- ? Extract<PluginHookResult, { action: 'continue' }>
775
- : E extends 'subagent_start'
776
- ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
777
- : E extends 'pre_tool_use'
778
- ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'modify' | 'error' }>
779
- : E extends 'post_tool_use'
780
- ? Extract<PluginHookResult, { action: 'continue' | 'replace' | 'retry' | 'error' }>
781
- : E extends 'post_tool_use_failure'
782
- ? Extract<PluginHookResult, { action: 'continue' | 'error' }>
783
- : E extends 'permission_request'
784
- ? Extract<PluginHookResult, { action: 'continue' | 'skip' }>
785
- : E extends 'pre_compact'
786
- ? Extract<
787
- PluginHookResult,
788
- { action: 'continue' | 'annotate' | 'skip' | 'error' }
789
- >
790
- : E extends 'turn_end' | 'subagent_stop'
791
- ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
792
- : E extends 'session_start'
793
- ? Extract<PluginHookResult, { action: 'continue' | 'annotate' }>
794
- : E extends
795
- | 'turn_interrupt'
796
- | 'session_end'
797
- | 'notification'
798
- | 'turn_failure'
799
- | 'permission_denied'
800
- | 'file_changed'
801
- | 'cwd_changed'
802
- ? Extract<PluginHookResult, { action: 'continue' }>
803
- : Extract<PluginHookResult, { action: 'continue' | 'error' }>
814
+ : E extends
815
+ | 'pre_model_switch'
816
+ | 'elicitation'
817
+ | 'elicitation_result'
818
+ | 'task_created'
819
+ | 'task_completed'
820
+ | 'teammate_idle'
821
+ ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
822
+ : E extends 'post_model_switch'
823
+ ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
824
+ : E extends 'directory_added' | 'instructions_loaded'
825
+ ? Extract<PluginHookResult, { action: 'continue' }>
826
+ : E extends 'subagent_start'
827
+ ? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
828
+ : E extends 'pre_tool_use'
829
+ ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'modify' | 'error' }>
830
+ : E extends 'post_tool_use'
831
+ ? Extract<
832
+ PluginHookResult,
833
+ { action: 'continue' | 'replace' | 'retry' | 'error' }
834
+ >
835
+ : E extends 'post_tool_use_failure'
836
+ ? Extract<PluginHookResult, { action: 'continue' | 'error' }>
837
+ : E extends 'permission_request'
838
+ ? Extract<PluginHookResult, { action: 'continue' | 'skip' }>
839
+ : E extends 'pre_compact'
840
+ ? Extract<
841
+ PluginHookResult,
842
+ { action: 'continue' | 'annotate' | 'skip' | 'error' }
843
+ >
844
+ : E extends 'turn_end' | 'subagent_stop'
845
+ ? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
846
+ : E extends 'session_start'
847
+ ? Extract<PluginHookResult, { action: 'continue' | 'annotate' }>
848
+ : E extends
849
+ | 'turn_interrupt'
850
+ | 'session_end'
851
+ | 'notification'
852
+ | 'turn_failure'
853
+ | 'permission_denied'
854
+ | 'file_changed'
855
+ | 'cwd_changed'
856
+ | 'teammate_start'
857
+ | 'teammate_stop'
858
+ ? Extract<PluginHookResult, { action: 'continue' }>
859
+ : Extract<PluginHookResult, { action: 'continue' | 'error' }>
804
860
 
805
861
  /** The event and its handler verdict stay correlated, including in hook arrays. */
806
862
  export type PluginHookDefinition<E extends PluginHookEvent = PluginHookEvent> =
@@ -74,6 +74,15 @@ export interface ChatCompletionParams {
74
74
 
75
75
  cacheControl?: CacheControl
76
76
 
77
+ /**
78
+ * A stable name for the conversation this request belongs to. A driver
79
+ * whose wire has a cache-routing field (a prompt cache key, a session
80
+ * header) sends it so every request of one conversation lands on the same
81
+ * cache; a driver without one ignores it. Never a secret and never
82
+ * derived from the content of the request.
83
+ */
84
+ cacheKey?: string
85
+
77
86
  topP?: number
78
87
  topK?: number
79
88
  frequencyPenalty?: number
@@ -36,6 +36,13 @@ export interface LLMProvider {
36
36
  */
37
37
  supportsImageInputFor?(model: string): boolean
38
38
 
39
+ /**
40
+ * A model of this driver that reads images, offered to a person whose own
41
+ * attachment `model` cannot read ("Select 'x'"). Absent, or `undefined`, when
42
+ * the driver has none to name; the refusal then names no model.
43
+ */
44
+ imageModelFor?(model: string): string | undefined
45
+
39
46
  /**
40
47
  * Retry behaviour this DRIVER wants, when the generic default is wrong
41
48
  * for the vendor behind it.
@@ -280,6 +287,17 @@ export interface LLMProvider {
280
287
  */
281
288
  resolveContextWindow?(model: string, signal?: AbortSignal): Promise<number | undefined>
282
289
 
290
+ /**
291
+ * The token count at which the provider's own service says a conversation on `model`
292
+ * should be compacted, when it states one (the same listing that states the window).
293
+ *
294
+ * The compaction trigger uses it as `min(limit, 90% of the window)` when the host set no
295
+ * threshold of its own; without it Namzu's derived trigger applies. Same contract as
296
+ * `resolveContextWindow`: asked once per turn, bounded, and a rejection or `undefined`
297
+ * means "no answer", never a failed turn.
298
+ */
299
+ resolveAutoCompactLimit?(model: string, signal?: AbortSignal): Promise<number | undefined>
300
+
283
301
  /**
284
302
  * The model to re-run a refused request on, when this provider has one.
285
303
  *
@@ -37,6 +37,12 @@ export interface ModelInfo {
37
37
  * back to its own table instead of trusting a zero.
38
38
  */
39
39
  contextWindow?: number
40
+ /**
41
+ * Tokens at which the provider's service says a conversation should be compacted, already
42
+ * held to 90% of `contextWindow` when both are known. Absent means the service stated none
43
+ * and Namzu's own trigger rule applies.
44
+ */
45
+ autoCompactTokenLimit?: number
40
46
  /** Same, and absent for the same reason. */
41
47
  maxOutputTokens?: number
42
48
  /**
@@ -26,6 +26,8 @@ export interface StreamChunk {
26
26
  url?: string
27
27
  /** How many sources the provider reported for this call. Absent means unknown, not zero. */
28
28
  results?: number
29
+ /** How many queries one hosted call ran, when it ran several. Absent means one or unknown. */
30
+ searches?: number
29
31
  }
30
32
 
31
33
  content?: string
@@ -189,8 +189,12 @@ export interface SkillHooksPlan {
189
189
  * belong to one run; a skill whose hooks are switched off).
190
190
  */
191
191
  readonly resumable?: boolean
192
- /** Make the hooks live. Idempotent for a skill already attached to the conversation. */
193
- attach(): SkillHooksHandle
192
+ /**
193
+ * Make the hooks live. Idempotent for a skill already attached to the
194
+ * conversation. A forked skill's host may be told the delegated prompt here,
195
+ * when it was not known to {@link SkillRegistryRef.prepareHooks}.
196
+ */
197
+ attach(late?: { readonly prompt?: string }): SkillHooksHandle
194
198
  }
195
199
 
196
200
  /** What {@link SkillHooksPlan.attach} gives back. */
@@ -626,6 +630,23 @@ export type ToolCallSource =
626
630
  export interface ToolDispatchOptions {
627
631
  readonly signal?: AbortSignal
628
632
  readonly runtimeToolCallId?: string
633
+ /**
634
+ * A pre-approval that holds for this one dispatch only. It answers a call no
635
+ * rule decided (the gate said "review" with no rule matched); it never
636
+ * reopens a call a rule denied or sent to review, or the dangerous-command
637
+ * floor stopped, and never covers a call the tool declares needs approval.
638
+ */
639
+ readonly allow?: (call: { readonly name: string; readonly input: unknown }) => boolean
640
+ /**
641
+ * Asked after the call is allowed and before it starts. Returns `undefined`
642
+ * to let it run, or the reason it is not to run, which comes back as the
643
+ * dispatch's failure with nothing started and no tool event written.
644
+ */
645
+ readonly beforeRun?: (call: {
646
+ readonly name: string
647
+ readonly input: unknown
648
+ readonly toolUseId: string
649
+ }) => Promise<string | undefined>
629
650
  }
630
651
 
631
652
  export interface ToolContext {
@@ -219,6 +219,20 @@ export type ToolFacts =
219
219
  readonly hunks?: readonly ToolDiffHunk[]
220
220
  readonly hunksTruncated?: true
221
221
  }
222
+ | {
223
+ readonly kind: 'shared'
224
+ /** Files handed to the person, as absolute paths. */
225
+ readonly files: readonly {
226
+ readonly path: string
227
+ /** Where the path led when the call checked it, links followed; a host compares it again at use. */
228
+ readonly real?: string
229
+ readonly bytes?: number
230
+ }[]
231
+ /** One line saying what they are. */
232
+ readonly caption?: string
233
+ /** The one file is an image the agent made: the prompt it was made from. A host draws the picture itself. */
234
+ readonly generatedImage?: { readonly prompt: string }
235
+ }
222
236
  | {
223
237
  readonly kind: 'failure'
224
238
  readonly reason: ToolFailureReason
@@ -0,0 +1,81 @@
1
+ import { constants, accessSync, realpathSync, statSync } from 'node:fs'
2
+ import { posix, win32 } from 'node:path'
3
+ import { readEnvironmentEntry, setEnvironmentEntry } from './process-environment.js'
4
+
5
+ export interface NodeOnPathOptions {
6
+ /** The running binary. Defaults to `process.execPath`. */
7
+ readonly execPath?: string
8
+ readonly platform?: NodeJS.Platform
9
+ /** Whether a file is an executable `node`. Defaults to a filesystem check. */
10
+ readonly isExecutable?: (file: string) => boolean
11
+ /** Resolve links. Defaults to `fs.realpathSync`. */
12
+ readonly realpath?: (file: string) => string
13
+ }
14
+
15
+ function defaultIsExecutable(file: string, platform: NodeJS.Platform): boolean {
16
+ try {
17
+ if (!statSync(file).isFile()) return false
18
+ if (platform !== 'win32') accessSync(file, constants.X_OK)
19
+ return true
20
+ } catch {
21
+ return false
22
+ }
23
+ }
24
+
25
+ /**
26
+ * The directory that would be appended to PATH so `node` resolves, or
27
+ * undefined when `node` already resolves (or cannot be offered).
28
+ */
29
+ export function nodeDirectoryToAppend(
30
+ pathValue: string,
31
+ options: NodeOnPathOptions = {},
32
+ ): string | undefined {
33
+ const platform = options.platform ?? process.platform
34
+ const path = platform === 'win32' ? win32 : posix
35
+ const execPath = options.execPath ?? process.execPath
36
+ const binary = path.basename(execPath).toLowerCase()
37
+ const wanted = platform === 'win32' ? ['node.exe', 'node.cmd'] : ['node']
38
+ if (!wanted.includes(binary)) return undefined
39
+
40
+ const entries = pathValue.split(path.delimiter)
41
+ const isExecutable =
42
+ options.isExecutable ?? ((file: string) => defaultIsExecutable(file, platform))
43
+ for (const dir of entries) {
44
+ if (dir === '') continue
45
+ for (const file of wanted) if (isExecutable(path.join(dir, file))) return undefined
46
+ }
47
+
48
+ let target: string
49
+ try {
50
+ target = path.dirname((options.realpath ?? realpathSync)(execPath))
51
+ } catch {
52
+ target = path.dirname(execPath)
53
+ }
54
+ return entries.includes(target) ? undefined : target
55
+ }
56
+
57
+ /**
58
+ * Make `node` resolvable in a shell command's environment.
59
+ *
60
+ * The runtime is often started by an absolute path whose directory is not on
61
+ * the user's PATH, so a command like `node --test` then fails with exit 127
62
+ * while the runtime itself is running on that very binary. When no `node`
63
+ * resolves on PATH, the directory of the running binary is appended to the END
64
+ * of PATH: a `node` the user has installed always wins. The environment is
65
+ * returned unchanged when `node` already resolves, when PATH is absent, or when
66
+ * the running binary is not a plain node binary (an embedded runtime).
67
+ */
68
+ export function withNodeOnPath(
69
+ env: Record<string, string>,
70
+ options: NodeOnPathOptions = {},
71
+ ): Record<string, string> {
72
+ const platform = options.platform ?? process.platform
73
+ const entry = readEnvironmentEntry(env, 'PATH', platform)
74
+ if (!entry) return env
75
+ const [name, value] = entry
76
+ const target = nodeDirectoryToAppend(value, options)
77
+ if (target === undefined) return env
78
+ const separator = platform === 'win32' ? ';' : ':'
79
+ setEnvironmentEntry(env, name, value === '' ? target : `${value}${separator}${target}`, platform)
80
+ return env
81
+ }